quara.protocol.qtomography.standard.standard_qst module

class StandardQst(povms, is_physicality_required=False, is_estimation_object=False, on_para_eq_constraint=False, eps_proj_physical=None, eps_truncate_imaginary_part=None, seed_data=None, schedules='all')[source]

Bases: quara.protocol.qtomography.standard.standard_qtomography.StandardQTomography

Constructor

Parameters
  • povms (List[Povm]) – testers of QST.

  • is_physicality_required (bool, optional) – whether the QOperation is physically required, by default False

  • is_estimation_object (bool, optional) – whether the QOperation is estimation object, by default False

  • on_para_eq_constraint (bool, optional) – whether the parameters of QOperation are on equal constraint, by default False

  • eps_proj_physical (float, optional) – threshold epsilon where the algorithm repeats the projection in order to make estimate object is physical, by default get_atol() / 10.0

  • eps_truncate_imaginary_part (float, optional) – threshold to truncate imaginary part, by default get_atol()

  • seed (int, optional) – a seed used to generate random data, by default None.

  • seed_data (int) –

  • schedules (Union[str, List[List[Tuple]]]) –

Raises

ValueError – the experiment is not valid.

convert_var_to_qoperation(var)[source]

converts variable to QOperation.

see convert_var_to_qoperation()

Parameters

var (numpy.ndarray) –

Return type

quara.objects.state.State

estimation_object_type()[source]
Return type

type

generate_dataset(data_nums)[source]

calculates a probability distribution.

see generate_dataset()

Parameters

data_nums (List[int]) –

Return type

List[List[numpy.ndarray]]

generate_empi_dist(schedule_index, state, num_sum, seed_or_generator=None)[source]

Generate empirical distribution using the data generated from probability distribution of specified schedules.

Parameters
  • schedule_index (int) – schedule index.

  • state (State) – true object.

  • num_sum (int) – the number of data to use to generate the experience distributions for each schedule.

  • seed_or_generator (Union[int, np.random.Generator], optional) – If the type is int, it is assumed to be a seed used to generate random data. If the type is Generator, it is used to generate random data. If argument is None, np.random is used to generate random data. Default value is None.

Returns

Generated empirical distribution.

Return type

Tuple[int, np.ndarray]

generate_empi_dists(state, num_sum, seed_or_generator=None)[source]

Generate empirical distributions using the data generated from probability distributions of all schedules.

see generate_empi_dists()

Parameters
  • state (quara.objects.state.State) –

  • num_sum (int) –

  • seed_or_generator (Optional[Union[int, numpy.random._generator.Generator]]) –

Return type

List[Tuple[int, numpy.ndarray]]

generate_empi_dists_sequence(state, num_sums, seed_or_generator=None)[source]

Generate sequence of empirical distributions using the data generated from probability distributions of all schedules.

Parameters
  • state (State) – true object.

  • num_sums (List[int]) – list of the number of data to use to generate the experience distributions for each schedule.

  • seed_or_generator (Union[int, np.random.Generator], optional) – If the type is int, it is assumed to be a seed used to generate random data. If the type is Generator, it is used to generate random data. If argument is None, np.random is used to generate random data. Default value is None.

Returns

sequence of list of tuples for the number of data and experience distributions for each schedules.

Return type

List[List[Tuple[int, np.ndarray]]]

generate_empty_estimation_obj_with_setting_info()[source]

generates the empty estimation object with setting information.

Returns

the empty estimation object(State) with setting information.

Return type

QOperation

is_valid_experiment()[source]

returns whether the experiment is valid.

all of the following conditions are True, the state is physically correct:

  • all povms have same CompositeSystem.

Returns

whether the experiment is valid.

Return type

bool

num_outcomes(schedule_index)[source]

returns the number of outcomes of probability distribution of a schedule index.

Parameters

schedule_index (int) –

Returns

the number of outcomes

Return type

int

property on_para_eq_constraint