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 [4, 32, 64]
circuits = tq.make_xrb([[0, 1]], [4, 32, 64], 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()
XRB
Extended Randomized Benchmarking
Cliffords
(0, 1)
Key:
  • labels: (0, 1)
  • protocol: XRB
  • twirl: (('C', 0, 1),)
${e}_{S}$
The probability of a stochastic error acting on the specified systems during a random gate.
3.7e-02 (4.0e-04)
0.037236770939636336, 0.00039557564101160724
${u}$
The unitarity of the noise, that is, the average decrease in the purity of an initial state.
9.2e-01 (8.1e-04)
0.9221391719517216, 0.0008103758595748585
${A}$
SPAM parameter of the exponential decay $Au^m$.
9.7e-01 (1.1e-02)
0.9707793955224528, 0.010956426308776685


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 [4, 32, 64]
circuits = tq.make_xrb([[0], [1, 2], [3]], [4, 32, 64], 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()
XRB
Extended Randomized Benchmarking
Cliffords
(0,)
Key:
  • labels: (0,)
  • protocol: XRB
  • twirl: (('C', 0), ('C', 3), ('C', 1, 2))
Cliffords
(1, 2)
Key:
  • labels: (1, 2)
  • protocol: XRB
  • twirl: (('C', 0), ('C', 3), ('C', 1, 2))
Cliffords
(3,)
Key:
  • labels: (3,)
  • protocol: XRB
  • twirl: (('C', 0), ('C', 3), ('C', 1, 2))
${e}_{S}$
The probability of a stochastic error acting on the specified systems during a random gate.
2.0e-02 (2.9e-04)
0.019968262333878772, 0.0002912673449135749
3.6e-02 (4.7e-04)
0.03634603033543741, 0.0004709618502467283
2.0e-02 (3.3e-04)
0.019731804787703727, 0.0003342421170458248
${u}$
The unitarity of the noise, that is, the average decrease in the purity of an initial state.
9.5e-01 (7.6e-04)
0.9474601564441181, 0.0007560334433161052
9.2e-01 (9.7e-04)
0.9239648449902357, 0.000965766578427236
9.5e-01 (8.7e-04)
0.9480740212242214, 0.0008678627113919699
${A}$
SPAM parameter of the exponential decay $Au^m$.
9.9e-01 (1.1e-02)
0.9900330374428721, 0.010748687222223148
9.7e-01 (1.3e-02)
0.9659866055048891, 0.01328854803274169
9.8e-01 (1.3e-02)
0.9775114146048323, 0.013117601625400679


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

Gallery generated by Sphinx-Gallery