quri_parts.algo.mitigation.zne package#

create_folding_left()#

Returns a FoldingMethod that gives a list of indices of gates to be folded.

Folding starts from the left of the circuit.

Return type:

algo.mitigation.zne.zne.FoldingMethod

create_folding_right()#

Returns a FoldingMethod that gives a list of indices of gates to be folded.

Folding starts from the right of the circuit.

Return type:

algo.mitigation.zne.zne.FoldingMethod

create_folding_random(seed=None)#

Returns a FoldingMethod that gives a list of indices of gates to be folded.

The gates to be folded are chosen at random.

Parameters:

seed (int | None) – Seed for random number generator.

Return type:

algo.mitigation.zne.zne.FoldingMethod

create_polynomial_extrapolate(order)#

Returns a ZeroExtrapolationMethod that gives a zero-noise extrapolated value which is evaluated by using the polynomial fitting.

Parameters:

order (int) – Order of the polynomial used for fitting.

Return type:

algo.mitigation.zne.zne.ZeroExtrapolationMethod

create_exp_extrapolate(order)#

Returns a ZeroExtrapolationMethod that gives a zero-noise extrapolated value which is evaluated by using the curve fitting and exponential ansatz f(x) = a + b exp(p(x)), where p(x) is a polynomial of a given order.

Parameters:

order (int) – Order of the polynomial on the exponential used for fitting.

Return type:

algo.mitigation.zne.zne.ZeroExtrapolationMethod

create_exp_extrapolate_with_const(order, constant)#

Returns a ZeroExtrapolationMethod that gives a zero-noise extrapolated value which is evaluated by using the curve fitting and exponential ansatz f(x) = constant + b exp(p(x)), where p(x) is a polynomial of a given order and constant is a known parameter (obtained as the infinite-noise limit f(x->inf)).

Parameters:
  • order (int) – Order of the polynomial on the exponential used for fitting.

  • constant (float) – An infinite-noise limit parameter f(x->inf).

Return type:

algo.mitigation.zne.zne.ZeroExtrapolationMethod

create_exp_extrapolate_with_const_log(order, constant)#

Returns a ZeroExtrapolationMethod that gives a zero-noise extrapolated value which is evaluated by using the log fitting and exponential ansatz f(x) = constant + b exp(p(x)), where p(x) is a polynomial of a given order and constant is a known parameter (obtained as the infinite-noise limit f(x->inf)).

Parameters:
  • order (int) – Order of the polynomial on the exponential used for fitting.

  • constant (float) – An infinite-noise limit parameter f(x->inf).

Return type:

algo.mitigation.zne.zne.ZeroExtrapolationMethod

create_zne_estimator(estimator, scale_factors, extrapolate_method, folding_method)#

Wrap the given ConcurrentQuantumEstimator to create a QuantumEstimator where zero-noise mitigation is automatically applied to the result.

Parameters:
  • estimator (ConcurrentQuantumEstimator[GeneralCircuitQuantumState]) – An estimator that computes the expectation value from obs and circuit.

  • scale_factors (Iterable[float]) – Factor to scale the circuit. A real number that satisfies >= 1.

  • extrapolate_method (ZeroExtrapolationMethod) – ZeroExtrapolationMethod that determine the method of extrapolation.

  • folding_method (FoldingMethod) – FoldingMethod that determines the method of folding.

Return type:

QuantumEstimator[GeneralCircuitQuantumState]

zne(obs, circuit, estimator, scale_factors, extrapolate_method, folding_method)#

Returns an error-mitigated expectation value of an observable by using zero-noise extrapolation (zne).

Parameters:
  • obs (Estimatable) – Observable for which the expected value is calculated.

  • circuit (NonParametricQuantumCircuit) – Circuit that ZNE is applied to.

  • estimator (ConcurrentQuantumEstimator[GeneralCircuitQuantumState]) – An estimator that computes the expectation value from obs and circuit.

  • scale_factors (Iterable[float]) – Factor to scale the circuit. An real number that satisfies >= 1.

  • extrapolate_method (ZeroExtrapolationMethod) – ZeroExtrapolationMethod that determine the method of extrapolation.

  • folding_method (FoldingMethod) – FoldingMethod that determines the method of folding.

Return type:

float

richardson_extrapolation(obs, circuit, estimator, scale_factors, folding_method)#

Returns an error-mitigated expectation value of an observable by using zne.

The order of polynomial = len(list(scale_factors)) - 1.

Parameters:
  • obs (Estimatable) – Observable for which the expected value is calculated.

  • circuit (NonParametricQuantumCircuit) – Circuit that apply zne.

  • estimator (ConcurrentQuantumEstimator[GeneralCircuitQuantumState]) – An estimator that computes the expectation value from obs and circuit.

  • scale_factors (Iterable[float]) – Factor to scale the circuit. A real number that satisfies >= 1.

  • folding_method (FoldingMethod) – FoldingMethod that determines the method of folding.

Return type:

float

scaling_circuit_folding(circuit, scale_factor, folding_method)#

Returns a scaled circuit. If the scale factor is odd, all gates are folded regardless of the folding method.

Parameters:
  • circuit (NonParametricQuantumCircuit) – Circuit to be folded.

  • scale_factor (float) – Factor to scale the circuit. A real number that satisfies >= 1.

  • folding_method (algo.mitigation.zne.zne.FoldingMethod) – Folding method applied to the circuit as a FoldingMethod.

Return type:

NonParametricQuantumCircuit

Submodules#