Extended Randomized Benchmarking (XRB)

This example illustrates how to generate extended randomized benchmarking (XRB) circuits and use them to estimate the probability of a stochastic error acting on the specified system(s) during a random gate. While this example uses a simulator to execute the circuits, the same procedure can be followed for hardware applications.

Isolated XRB

This section illustrates how to generate XRB circuits to characterize a pair of qubits in isolation. Here, we are performing two-qubit XRB which learns the stochastic infidelity over the two-qubit Clifford gateset.

import trueq as tq

# generate XRB circuits to characterize a pair of qubits [0, 1]
# with 9 * 30 random circuits for each circuit depth [2, 4, 16]
circuits = tq.make_xrb([[0, 1]], [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)

# plot the exponential decay of the purities
circuits.plot.raw()
XRB on [0, 1]
# print the fit summary
circuits.fit()
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".
XRB
Extended Randomized Benchmarking
Cliffords
(0, 1)
Key:
  • labels: (0, 1)
  • protocol: XRB
  • twirl: Cliffords on [(0, 1)]
${e}_{S}$
The probability of a stochastic error acting on the specified systems during a random gate.
3.9e-02 (7.5e-04)
0.03949978898563011, 0.0007451610728501925
${u}$
The unitarity of the noise, that is, the average decrease in the purity of an initial state.
9.2e-01 (1.5e-03)
0.9173980323825591, 0.001526885051119582
${A}$
SPAM parameter of the exponential decay $Au^m$.
9.9e-01 (8.5e-03)
0.9942480227869303, 0.008462021265830136


Simultaneous XRB

This section demonstrates how to generate XRB circuits that characterize the amount of stochastic noise while gates are applied simultaneously on a device.

# generate XRB circuits to simultaneously characterize a single qubit [0],
# a pair of qubits [1, 2], and another single qubit [3] with 9 * 30 random circuits
# for each circuit depth [2, 4, 16]
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)

# plot the exponential decay of the purities
circuits.plot.raw()
XRB on [0], XRB on [1, 2], XRB on [3]
# print the fit summary
circuits.fit()
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".
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}_{S}$
The probability of a stochastic error acting on the specified systems during a random gate.
2.0e-02 (7.4e-04)
0.01968108436084104, 0.0007392582131826509
3.8e-02 (8.7e-04)
0.03795844737741105, 0.0008675201944545102
1.9e-02 (8.5e-04)
0.019338509332985532, 0.0008476815070405402
${u}$
The unitarity of the noise, that is, the average decrease in the purity of an initial state.
9.5e-01 (1.9e-03)
0.9480335684799153, 0.0019325568264654898
9.2e-01 (1.8e-03)
0.9205588789039804, 0.0017804596795828636
9.5e-01 (2.2e-03)
0.9489292790363346, 0.002216769627480633
${A}$
SPAM parameter of the exponential decay $Au^m$.
9.8e-01 (9.2e-03)
0.9762983484261595, 0.009187861386173397
9.7e-01 (7.2e-03)
0.9693295978001861, 0.007158764131328119
9.8e-01 (1.0e-02)
0.9796379040864219, 0.009983832537628159


Total running time of the script: ( 0 minutes 2.722 seconds)

Gallery generated by Sphinx-Gallery