quara.protocol.qtomography.standard.loss_minimization_estimator module

class LossMinimizationEstimationResult(estimated_var_sequence, computation_times, template_qoperation, detailed_results=None)[source]

Bases: quara.protocol.qtomography.standard.standard_qtomography_estimator.StandardQTomographyEstimationResult

Constructor

Parameters
property detailed_results: List[quara.minimization_algorithm.minimization_algorithm.MinimizationResult]

returns result details. the type of result details is List[MinimizationResult].

Returns

detailed results.

Return type

List[MinimizationResult]

class LossMinimizationEstimator[source]

Bases: quara.protocol.qtomography.standard.standard_qtomography_estimator.StandardQTomographyEstimator

calc_estimate(qtomography, empi_dists, loss, loss_option, algo, algo_option, is_computation_time_required=False, is_detailed_results_required=False)[source]

calculates estimate variables.

Notice: this function updates loss and algo properties.

Parameters
  • qtomography (StandardQTomography) – StandardQTomography to calculates estimate variables.

  • empi_dists (List[Tuple[int, np.ndarray]]) – empirical distributions to calculates estimate variables.

  • loss (ProbabilityBasedLossFunction) – ProbabilityBasedLossFunction to calculates estimate variables.

  • loss_option (ProbabilityBasedLossFunctionOption) – ProbabilityBasedLossFunctionOption to calculates estimate variables.

  • algo (MinimizationAlgorithm) – MinimizationAlgorithm to calculates estimate variables.

  • algo_option (MinimizationAlgorithmOption) – MinimizationAlgorithmOption to calculates estimate variables.

  • is_computation_time_required (bool, optional) – whether to include computation time in the return value or not, by default False.

  • is_detailed_results_required (bool, optional) – whether to include detailed results in the return value or not, by default False.

Returns

estimation result.

Return type

StandardQTomographyEstimationResult

Raises
  • ValueError – loss.is_option_sufficient() returns False.

  • ValueError – algo.is_loss_sufficient() returns False.

  • ValueError – algo.is_option_sufficient() returns False.

  • ValueError – algo.is_loss_and_option_sufficient() returns False.

calc_estimate_sequence(qtomography, empi_dists_sequence, loss, loss_option, algo, algo_option, is_computation_time_required=False, is_detailed_results_required=False)[source]

calculates sequence of estimate variables.

Notice: this function updates loss and algo properties.

Parameters
  • qtomography (StandardQTomography) – StandardQTomography to calculates estimate variables.

  • empi_dists_sequence (List[List[Tuple[int, np.ndarray]]]) – sequence of empirical distributions to calculates estimate variables.

  • loss (ProbabilityBasedLossFunction) – ProbabilityBasedLossFunction to calculates estimate variables.

  • loss_option (ProbabilityBasedLossFunctionOption) – ProbabilityBasedLossFunctionOption to calculates estimate variables.

  • algo (MinimizationAlgorithm) – MinimizationAlgorithm to calculates estimate variables.

  • algo_option (MinimizationAlgorithmOption) – MinimizationAlgorithmOption to calculates estimate variables.

  • is_computation_time_required (bool, optional) – whether to include computation time in the return value or not, by default False.

  • is_detailed_results_required (bool, optional) – whether to include detailed results in the return value or not, by default False.

Returns

estimation result.

Return type

StandardQTomographyEstimationResult

Raises
  • ValueError – loss.is_option_sufficient() returns False.

  • ValueError – algo.is_loss_sufficient() returns False.

  • ValueError – algo.is_option_sufficient() returns False.

  • ValueError – algo.is_loss_and_option_sufficient() returns False.