quara.protocol.qtomography.standard.standard_povmt module

class StandardPovmt(states, num_outcomes, 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

initialize standard quantum tomography class.

To inherit from this class, set the following instance variables in the constructor of the subclass.

  • _coeffs_0th: return value of get_coeffs_0th function.

  • _coeffs_1st: return value of get_coeffs_1st function.

  • _map_experiment_to_setqoperations: a map from indices of Experiment to indices of SetQOperations.

    if you map the 0th state to the 1st state, set {("state", 0): ("state", 1)}.

  • _map_setqoperations_to_experiment: a map from indices of SetQOperations to indices of Experiment.

Parameters
  • experiment (Experiment) – Experiment class used in quantum tomography.

  • set_qoperations (SetQOperations) – SetQOperations class used in quantum tomography.

  • states (List[quara.objects.state.State]) –

  • num_outcomes (int) –

  • is_physicality_required (bool) –

  • is_estimation_object (bool) –

  • on_para_eq_constraint (bool) –

  • eps_proj_physical (float) –

  • eps_truncate_imaginary_part (float) –

  • seed_data (int) –

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

calc_cramer_rao_bound(var, N, list_N)[source]

calculates Cramer-Rao bound.

Parameters
  • var (Union[QOperation, np.ndarray]) – variables to calculate Cramer-Rao bound.

  • N (int) – representative value of the number of data.

  • list_N (List[int]) – the number of data for each schedule.

Returns

Cramer-Rao bound.

Return type

np.ndarray

convert_var_to_qoperation(var)[source]

converts variable to QOperation.

this function must be implemented in the subclass.

Parameters

var (np.ndarray) – variables.

Returns

converted QOperation.

Return type

QOperation

Raises

NotImplementedError – this function does not be implemented in the subclass.

estimation_object_type()[source]
Return type

type

generate_empi_dist(schedule_index, povm, 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.

  • povm (Povm) – 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(povm, 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
  • povm (quara.objects.povm.Povm) –

  • num_sum (int) –

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

Return type

List[Tuple[int, numpy.ndarray]]

generate_empi_dists_sequence(povm, num_sums, seed_or_genrator=None)[source]
Parameters
  • povm (quara.objects.povm.Povm) –

  • num_sums (List[int]) –

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

Return type

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

generate_empty_estimation_obj_with_setting_info()[source]

generates the empty estimation object with setting information.

Returns

the empty estimation object(Povm) with setting information.

Return type

QOperation

is_valid_experiment()[source]

returns whether the experiment is valid.

this function must be implemented in the subclass.

Returns

whether the experiment is valid.

Return type

bool

Raises

NotImplementedError – this function does not be implemented in the subclass.

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 num_outcomes_estimate
property on_para_eq_constraint