# Extended Randomized Benchmarking (XRB)¶

*See* `make_xrb()`

*for API documentation.*

XRB is a protocol for estimating how the probability of error decomposed into stochastic errors vs coherent/calibration errors that can typically be corrected through improved control (see arXiv:1503.07865).

Terms that may be returned from the analysis are as follows. These descriptions are also available via mouse-overs when running True-Q™ in a Jupyter or Colab notebook.

## Estimated Parameters¶

- \({e}_{S}\) -
The probability of a stochastic error for an error channel \(\mathcal{A}\) is defined to be

\[e_S = 1 - \sqrt{\Phi(\mathcal{A}^\dagger \mathcal{A}, \mathcal{I})}\]where \(\Phi(\cdot, \cdot)\) is the process fidelity between two channels (see arXiv:1904.08897, eq. 13). By looking at the process fidelity of \(\mathcal{A}^\dagger \mathcal{A}\), we remove any coherent errors. The square root corrects for the residual stochastic errors being applied twice.

- \({e}_{U}\) -
We define this quantity to be \(e_U = e_F - e_S\), so that it will be \(O(e_S^2)\) if there are no residual unitary errors. Formally, the quantity \(e_U\) is equivalent to the process infidelity of the unitary correction required to make the noise channel decoherent up to corrections of \(O(e_F^2)\) (see arxiv 1904.08897, eq. 65).

- \({A}\) -
This parameter has an ideal value of \(A=1\) and only includes state preparation and and measurement (SPAM) errors, up to statistical noise.

This is one of two parameters in the decay curve \(y=Au^m\) where \(m\) is the sequence length, i.e. the number of random gates in a particular circuit, or the circuit depth before compiling into native gates. At least two distinct values of \(m\) must be used to distinguish \(A\) from \(u\). The value of \(y\) at a particular value of \(m\) is the average purity after \(m\) random gates, including the loss of purity due to SPAM errors. Many random circuits must be used per sequence length \(m\) to gain an accurate estimate of the average purity. If the raw decay is plotted, the average value \(y\) is shown, as well as individual estimates of final state purity for each random circuit.

As a technical aside, given a final density matrix \(\rho\) expressed in the Pauli basis as \(\rho=\sum_P r_P P/d\) where \(d\) is the Hilbert space dimension, the purity is given by \(\operatorname{Tr}\rho^2=\sum_P r_P^2/d\). However, purity values discussed above omit the component \(r_I\) which allows the decay of \(y\) to asymptote to 0 making the fit simpler. This would upper bound any \(y\) value to the value \((d-1)/d\) rather than the nominal value of \(1\). Therefore, for aesthetic reasons, \(y\) is an estimate of \(\sum_{P\neq I} r_P^2/(d-1)\) instead of \(\operatorname{Tr}\rho^2\). Note that this scaling of \(A\) does not affect the interpretation of \(u\) or derived quantities such as \(e_U\).

- \({u}\) -
The unitarity of the noise, that is, the average decrease in the purity of an initial state.

This is one of two parameters in the decay curve \(y=Au^m\) where \(m\) is the sequence length, i.e. the number of random gates in a particular circuit, or the circuit depth before compiling into native gates. At least two distinct values of \(m\) must be used to distinguish \(A\) from \(u\). The value of \(y\) at a particular value of \(m\) is the average purity after \(m\) random gates, including the loss of purity due to SPAM errors. Many random circuits must be used per sequence length \(m\) to gain an accurate estimate of the average purity. If the raw decay is plotted, the average value \(y\) is shown, as well as individual estimates of final state purity for each random circuit.

As a technical aside, given a final density matrix \(\rho\) expressed in the Pauli basis as \(\rho=\sum_P r_P P/d\) where \(d\) is the Hilbert space dimension, the purity is given by \(\operatorname{Tr}\rho^2=\sum_P r_P^2/d\). However, purity values discussed above omit the component \(r_I\) which allows the decay of \(y\) to asymptote to 0 making the fit simpler. This would upper bound any \(y\) value to the value \((d-1)/d\) rather than the nominal value of \(1\). Therefore, for aesthetic reasons, \(y\) is an estimate of \(\sum_{P\neq I} r_P^2/(d-1)\) instead of \(\operatorname{Tr}\rho^2\). Note that this scaling of \(A\) does not affect the interpretation of \(u\) or derived quantities such as \(e_U\).