quara.loss_function.standard_qtomography_based_weighted_probability_based_squared_error module

class StandardQTomographyBasedWeightedProbabilityBasedSquaredError(num_var=None, prob_dists_q=None, weight_matrices=None)[source]

Bases: quara.loss_function.weighted_probability_based_squared_error.WeightedProbabilityBasedSquaredError

Constructor of StandardQTomography based WeightedProbabilityBasedSquaredError.

Parameters
  • num_var (int, optional) – number of variables, by default None

  • prob_dists_q (List[np.ndarray], optional) – vectors of q, by default None.

  • weight_matrices (List[np.ndarray], optional) – weight matrices, by default None

gradient(var, validate=False)[source]

returns the gradient of Weighted Relative Entropy.

see gradient()

Parameters
  • var (numpy.ndarray) –

  • validate (bool) –

Return type

numpy.ndarray

hessian(var, validate=False)[source]

returns the Hessian of Weighted Probability Based Squared Error.

see hessian()

Parameters
  • var (numpy.ndarray) –

  • validate (bool) –

Return type

numpy.ndarray

set_func_gradient_prob_dists_from_standard_qt(qt)[source]

sets the gradient of probability distributions from StandardQTomography.

Parameters

qt (StandardQTomography) – StandardQTomography to set the gradient of probability distributions.

Return type

None

set_func_prob_dists_from_standard_qt(qt)[source]

sets the function of probability distributions from StandardQTomography.

Parameters

qt (StandardQTomography) – StandardQTomography to set the function of probability distributions.

Return type

None

set_prob_dists_q(prob_dists_q)[source]

sets vectors of q, by default None.

Parameters

prob_dists_q (List[np.ndarray]) – vectors of q, by default None.

Return type

None

value(var, validate=False)[source]

returns the value of Weighted Relative Entropy.

see value()

Parameters
  • var (numpy.ndarray) –

  • validate (bool) –

Return type

numpy.float64

class StandardQTomographyBasedWeightedProbabilityBasedSquaredErrorOption(mode_weight=None, weights=None, weight_name=None)[source]

Bases: quara.loss_function.weighted_probability_based_squared_error.WeightedProbabilityBasedSquaredErrorOption

Constructor

mode_weight should be the following value:

  • “identity” then uses identity matrices for weights.

  • “custom” then uses user custom matrices for weights.

Parameters
  • mode_weight (str, optional) – mode weight, by default None

  • weights (List, optional) – list of weight, by default None

  • weight_name (str, optional) – weight name for reporting, by default None