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.4e-02 (8.9e-04)
0.023557695705847564, 0.0008891756327716986
4.0e-02 (1.5e-03)
0.04024317001196771, 0.001543659052714323
2.2e-02 (9.0e-04)
0.022193170875184492, 0.0009034110202023768
${p}$
Decay parameter of the exponential decay $Ap^m$.
9.7e-01 (1.2e-03)
0.9685897390588699, 0.0011855675103622648
9.6e-01 (1.6e-03)
0.9570739519872344, 0.0016465696562286112
9.7e-01 (1.2e-03)
0.970409105499754, 0.0012045480269365025
${A}$
SPAM parameter of the exponential decay $Ap^m$.
9.6e-01 (6.6e-03)
0.9601100465896258, 0.006605812161943431
9.3e-01 (9.4e-03)
0.9297567752422322, 0.009442399967168634
9.5e-01 (6.5e-03)
0.9508334626700622, 0.006467094815769272
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.
3.5e-03 (1.2e-03)
0.0035154693150276917, 0.001221621906718074
1.6e-03 (1.8e-03)
0.0016310388587270214, 0.001801647026003402
2.3e-03 (1.2e-03)
0.0023206185017853598, 0.001159827363483482
${e}_{S}$
The probability of a stochastic error acting on the specified systems during a random gate.
2.0e-02 (8.4e-04)
0.020042226390819873, 0.0008376913375811836
3.9e-02 (9.3e-04)
0.03861213115324069, 0.0009290041632199622
2.0e-02 (7.3e-04)
0.019872552373399133, 0.0007273568874094379
${u}$
The unitarity of the noise, that is, the average decrease in the purity of an initial state.
9.5e-01 (2.2e-03)
0.9470896507427481, 0.0021890723683940074
9.2e-01 (1.9e-03)
0.9192177433234279, 0.0019053511096059868
9.5e-01 (1.9e-03)
0.9475330847880471, 0.0019010731988539766
${A}$
SPAM parameter of the exponential decay $Au^m$.
9.8e-01 (1.1e-02)
0.9772463055062205, 0.011001542548098148
9.8e-01 (9.3e-03)
0.9822914310723836, 0.00931537248383271
9.7e-01 (1.0e-02)
0.9696487033446681, 0.010112343963859287

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.