Download

Download this file as Jupyter notebook: srb_xrb_example.ipynb.

Example: Comparing Infidelities with SRB and XRB

This example demonstrates how to estimate the process infidelities of specified systems using SRB, and how this quantity can be divided into coherent and stochastic infidelity by the addition of XRB circuits. While this example uses the built-in Simulator to execute the circuits, the same procedure can be followed for hardware applications.

[2]:
import trueq as tq

# generate SRB circuits to simultaneously characterize a single qubit [0],
# a pair of qubits [1, 2], and another single qubit [3]
circuits = tq.make_srb([[0], [1, 2], [3]], [2, 4, 16], 30)

# generate XRB circuits using the same arguments as SRB and combine them
circuits += tq.make_xrb([[0], [1, 2], [3]], [2, 4, 16], 30)

# initialize a noisy simulator with stochastic Pauli and overrotation
sim = tq.Simulator().add_stochastic_pauli(px=0.02).add_overrotation(0.04)

# run the circuits on the simulator to populate their results
sim.run(circuits, n_shots=1000)

# print the fit summary
circuits.fit()
[2]:
True-Q formatting will not be loaded without trusting this notebook or rerunning the affected cells. Notebooks can be marked as trusted by clicking "File -> Trust Notebook".
SRB
Streamlined Randomized Benchmarking
Cliffords
(0,)
Key:
  • labels: (0,)
  • protocol: SRB
  • twirl: Cliffords on [0, (1, 2), 3]
Cliffords
(1, 2)
Key:
  • labels: (1, 2)
  • protocol: SRB
  • twirl: Cliffords on [0, (1, 2), 3]
Cliffords
(3,)
Key:
  • labels: (3,)
  • protocol: SRB
  • twirl: Cliffords on [0, (1, 2), 3]
${e}_{F}$
The probability of an error acting on the targeted systems during a random gate.
2.2e-02 (1.5e-03)
0.021978009298614792, 0.0014848851502525754
4.2e-02 (1.6e-03)
0.042255543513489424, 0.0015961564547726302
2.2e-02 (1.3e-03)
0.021505929447021593, 0.001278015188553699
${p}$
Decay parameter of the exponential decay $Ap^m$.
9.7e-01 (2.0e-03)
0.9706959876018469, 0.001979846867003434
9.5e-01 (1.7e-03)
0.954927420252278, 0.0017025668850908055
9.7e-01 (1.7e-03)
0.9713254274039712, 0.0017040202514049323
${A}$
SPAM parameter of the exponential decay $Ap^m$.
9.5e-01 (8.0e-03)
0.9512191444486504, 0.00801870519097862
9.3e-01 (8.7e-03)
0.926085902007721, 0.008706239441858879
9.4e-01 (6.9e-03)
0.9404053569891049, 0.006861259239076515
XRB
Extended Randomized Benchmarking
Cliffords
(0,)
Key:
  • labels: (0,)
  • protocol: XRB
  • twirl: Cliffords on [0, (1, 2), 3]
Cliffords
(1, 2)
Key:
  • labels: (1, 2)
  • protocol: XRB
  • twirl: Cliffords on [0, (1, 2), 3]
Cliffords
(3,)
Key:
  • labels: (3,)
  • protocol: XRB
  • twirl: Cliffords on [0, (1, 2), 3]
${e}_{U}$
The process infidelity of the coherent error acting on the specifed systems during a random gate.
2.8e-03 (1.7e-03)
0.002778013117705286, 0.0016681889650162992
4.0e-03 (1.8e-03)
0.003956456131076813, 0.0018302551717038987
1.5e-03 (1.6e-03)
0.0014926194145339633, 0.0015549174725900709
${e}_{S}$
The probability of a stochastic error acting on the specified systems during a random gate.
1.9e-02 (7.6e-04)
0.019199996180909507, 0.0007602437198435368
3.8e-02 (9.0e-04)
0.03829908738241261, 0.0008956107220419686
2.0e-02 (8.9e-04)
0.02001331003248763, 0.000885689293370958
${u}$
The unitarity of the noise, that is, the average decrease in the purity of an initial state.
9.5e-01 (2.0e-03)
0.9492915299887038, 0.0019883921155359483
9.2e-01 (1.8e-03)
0.9198598883514673, 0.0018374605839740963
9.5e-01 (2.3e-03)
0.9471652166846417, 0.00231456991720072
${A}$
SPAM parameter of the exponential decay $Au^m$.
9.6e-01 (1.1e-02)
0.9619950779785189, 0.010748162448066116
9.7e-01 (1.0e-02)
0.9706144788511325, 0.010003788293335545
9.9e-01 (1.2e-02)
0.9872490190929083, 0.012314202758162151

Notice that the fit() output contains an estimate of process infidelity for the specified systems from SRB, the stochastic infidelity from XRB, and the unitary infidelity which would be absent if the circuit collection did not contain both SRB and XRB circuits. We can visualize the different process infidelities as follows.

[3]:
# plot a comparison of process infidelities
circuits.plot.compare_rb()
../../_images/guides_error_diagnostics_srb_xrb_example_4_0.png

Download

Download this file as Jupyter notebook: srb_xrb_example.ipynb.