pygsti.tools.rbtheory.predicted_rb_number

pygsti.tools.rbtheory.predicted_rb_number#

predicted_rb_number(model, target_model, weights=None, d=None, rtype='EI')#

Predicts the RB error rate from a model.

Uses the “L-matrix” theory from Proctor et al Phys. Rev. Lett. 119, 130502 (2017). Note that this gives the same predictions as the theory in Wallman Quantum 2, 47 (2018).

This theory is valid for various types of RB, including standard Clifford RB – i.e., it will accurately predict the per-Clifford error rate reported by standard Clifford RB. It is also valid for “direct RB” under broad circumstances.

For this function to be valid the model should be trace preserving and completely positive in some representation, but the particular representation of the model used is irrelevant, as the predicted RB error rate is a gauge-invariant quantity. The function is likely reliable when complete positivity is slightly violated, although the theory on which it is based assumes complete positivity.

Parameters:
  • model (Model) – The model to calculate the RB number of. This model is the model randomly sampled over, so this is not necessarily the set of physical primitives. In Clifford RB this is a set of Clifford gates; in “direct RB” this normally would be the physical primitives.

  • target_model (Model) – The target model, corresponding to model. This function is not invariant under swapping model and target_model: this Model must be the target model, and should consistent of perfect gates.

  • weights (dict, optional) – If not None, a dictionary of floats, whereby the keys are the gates in model and the values are the unnormalized probabilities to apply each gate at each stage of the RB protocol. If not None, the values in weights must all be non-negative, and they must not all be zero. Because, when divided by their sum, they must be a valid probability distribution. If None, the weighting defaults to an equal weighting on all gates, as this is used in many RB protocols (e.g., Clifford RB). But, this weighting is flexible in the “direct RB” protocol.

  • d (int, optional) – The Hilbert space dimension. If None, then sqrt(model.dim) is used.

  • rtype (str, optional) –

    The type of RB error rate, either “EI” or “AGI”, corresponding to different dimension-dependent rescalings of the RB decay constant p obtained from fitting to Pm = A + Bp^m. “EI” corresponds to an RB error rate that is associated with entanglement infidelity, which is the probability of error for a gate with stochastic errors. This is the RB error rate defined in the “direct RB” protocol, and is given by:

    r = (d^2 - 1)(1 - p)/d^2,

    The AGI-type r is given by

    r = (d - 1)(1 - p)/d,

    which is the conventional r definition in Clifford RB. This r is associated with (gate-averaged) average gate infidelity.

Returns:

r – The predicted RB number.

Return type:

float.