quara.protocol.qtomography.standard.standard_qpt module¶
- class StandardQpt(states, povms, is_physicality_required=False, is_estimation_object=False, on_para_eq_constraint=False, eps_proj_physical=None, seed=None, schedules='all')[source]¶
Bases:
quara.protocol.qtomography.standard.standard_qtomography.StandardQTomographyinitialize standard quantum tomography class.
To inherit from this class, set the following instance variables in the constructor of the subclass.
_coeffs_0th: return value ofget_coeffs_0thfunction._coeffs_1st: return value ofget_coeffs_1stfunction._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]) –
povms (List[quara.objects.povm.Povm]) –
is_physicality_required (bool) –
is_estimation_object (bool) –
on_para_eq_constraint (bool) –
eps_proj_physical (float) –
seed (int) –
schedules (Union[str, List[List[Tuple]]]) –
- 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
- Raises
NotImplementedError – this function does not be implemented in the subclass.
- generate_empi_dist(schedule_index, gate, num_sum)[source]¶
Generate empirical distribution using the data generated from probability distribution of specified schedules.
- Parameters
schedule_index (int) – schedule index.
gate (Gate) – true object.
num_sum (int) – the number of data to use to generate the experience distributions for each schedule.
- Returns
Generated empirical distribution.
- Return type
Tuple[int, np.ndarray]
- generate_empi_dists(gate, num_sum)[source]¶
Generate empirical distributions using the data generated from probability distributions of all schedules.
- Parameters
gate (quara.objects.gate.Gate) –
num_sum (int) –
- Return type
List[Tuple[int, numpy.ndarray]]
- generate_empi_dists_sequence(gate, num_sums)[source]¶
- Parameters
gate (quara.objects.gate.Gate) –
num_sums (List[int]) –
- 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(QOperation) with setting information.
- Return type
- Raises
NotImplementedError – this function does not be implemented in the subclass.
- 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) – a schedule index
- Returns
the number of outcomes
- Return type
int
- property on_para_eq_constraint¶