Interleaved randomized benchmarking (IRB)

This example page demonstrates how to use make_irb() method to estimate the infidelity of a specific gate. This protocol differs from Cycle Benchmarking (CB) in several ways:

  • It estimates the infidelity of a specific gate (not cycle) composed with gates from the twirling group, see Interleaved Randomized Benchmarking (IRB) for more details. Gate infidelity can then be estimated by taking into account the results of an SRB experiment.

  • IRB uses a different twirling group than CB, Cliffords instead of Paulis by default. Paulis being a reference group with no entangling operations and therefore usually higher fidelity, leading to less systematic uncertainty in estimates.

  • Typically uses fewer circuits than CB.

  • IRB only gives information about specific gates (possibly in the context of being simultaneously applied), not an entire cycles like CB.

We begin by defining some cycles that contain the gates we want to characterize using IRB. Next we generate IRB circuits for these cycles. Note that we could perform simultaneous two qubit IRB with a cycle such as:

{(1, 2): tq.Gate.cz, (3, 4): tq.Gate.cz}

See make_irb() for more details.

import trueq as tq

cycle1 = {1: tq.Gate.h}
cycle2 = {2: tq.Gate.h}
cycle12 = {(1, 2): tq.Gate.cz}

# Generate a circuit collection to run IRB on the above cycles with 30 random circuits
# for each circuit length in [4, 32, 64]:
n_random_cycles = [4, 32, 64]
circuits = tq.make_irb(cycle1, n_random_cycles)
circuits += tq.make_irb(cycle2, n_random_cycles)
circuits += tq.make_irb(cycle12, n_random_cycles)
len(circuits)

Out:

270

We are interested in the gate fidelity of the individual gates in the cycles defined above, e.g. \(CZ\) alone, so we also need a reference SRB experiment to translate from the average fidelity of cycles dressed with gates in the twirling group to fidelity of the undressed gates. Optionally, to tighten the bound on the infidelity estimate, we also do an XRB experiment. The double nesting [[1, 2]] is necessary to characterize the \(CZ\) gate because just [1, 2] refers to simultaneous single-qubit gates.

circuits += tq.make_srb([1], n_random_cycles)
circuits += tq.make_srb([2], n_random_cycles)
circuits += tq.make_srb([[1, 2]], n_random_cycles)
circuits += tq.make_xrb([1], n_random_cycles)
circuits += tq.make_xrb([2], n_random_cycles)
circuits += tq.make_xrb([[1, 2]], n_random_cycles)

Create a noisy simulator in lieu of a physical device and populate all circuits with results.

sim = tq.Simulator().add_depolarizing(0.01).add_overrotation(0.04)
sim.run(circuits)

Print a summary of the results for the CZ gate:

circuits.fit()
SRB
Streamlined Randomized Benchmarking
Cliffords
(1,)
Key:
  • labels: (1,)
  • protocol: SRB
  • twirl: (('C', 1),)
Cliffords
(1, 2)
Key:
  • labels: (1, 2)
  • protocol: SRB
  • twirl: (('C', 1, 2),)
Cliffords
(2,)
Key:
  • labels: (2,)
  • protocol: SRB
  • twirl: (('C', 2),)
${e}_{P}$
The probability of an error acting on the targeted systems during a random gate.
1.1e-02 (8.1e-04)
0.011432928185380692, 0.0008086656209214162
1.6e-02 (9.1e-04)
0.01603747360050329, 0.0009135046990417886
1.1e-02 (7.1e-04)
0.010571059573273672, 0.000714330725958152
${p}$
Decay parameter of the exponential decay $Ap^m$.
9.8e-01 (1.1e-03)
0.9847560957528257, 0.0010782208278952215
9.8e-01 (9.7e-04)
0.9828933614927965, 0.0009744050123112412
9.9e-01 (9.5e-04)
0.9859052539023018, 0.0009524409679442027
${A}$
SPAM parameter of the exponential decay $Ap^m$.
1.0e+00 (1.1e-02)
1.0101102930250165, 0.010964422564041041
9.9e-01 (1.2e-02)
0.9929306183543396, 0.012121017459706564
9.8e-01 (1.1e-02)
0.982653260122483, 0.010769567338835434
XRB
Extended Randomized Benchmarking
Cliffords
(1,)
Key:
  • labels: (1,)
  • protocol: XRB
  • twirl: (('C', 1),)
Cliffords
(1, 2)
Key:
  • labels: (1, 2)
  • protocol: XRB
  • twirl: (('C', 1, 2),)
Cliffords
(2,)
Key:
  • labels: (2,)
  • protocol: XRB
  • twirl: (('C', 2),)
${e}_{U}$
The process infidelity of the coherent error acting on the specifed systems during a random gate.
4.6e-03 (9.3e-04)
0.004550332278421193, 0.0009291699614766378
3.6e-03 (9.5e-04)
0.0036499352641417362, 0.0009465645295392783
3.9e-03 (8.3e-04)
0.0039300801387425754, 0.000831078187133179
${e}_{S}$
The probability of a stochastic error acting on the specified systems during a random gate.
6.9e-03 (4.6e-04)
0.006882595906959499, 0.0004576207281693836
1.2e-02 (2.5e-04)
0.012387538336361553, 0.0002479789777591769
6.6e-03 (4.2e-04)
0.006640979434531097, 0.0004247617768593014
${u}$
The unitarity of the noise, that is, the average decrease in the purity of an initial state.
9.8e-01 (1.2e-03)
0.9817306244728521, 0.0012091232980494199
9.7e-01 (5.2e-04)
0.9737478448075172, 0.0005220316559487995
9.8e-01 (1.1e-03)
0.9823691261440947, 0.0011226684388258791
${A}$
SPAM parameter of the exponential decay $Au^m$.
1.1e+00 (2.4e-02)
1.0551968253557338, 0.023500544469116483
1.0e+00 (1.1e-02)
1.0468994327958983, 0.011036829536781537
1.0e+00 (1.6e-02)
1.0359802514344323, 0.016329935008950157
IRB
Interleaved Randomized Benchmarking
Cliffords

(1,) : Gate.h

Key:
  • cycle: Cycle((1,): Gate.h, immutable=True)
  • labels: (1,)
  • protocol: IRB
  • twirl: (('C', 1),)
Cliffords

(1, 2) : Gate.cz

Key:
  • cycle: Cycle((1, 2): Gate.cz, immutable=True)
  • labels: (1, 2)
  • protocol: IRB
  • twirl: (('C', 1, 2),)
Cliffords

(2,) : Gate.h

Key:
  • cycle: Cycle((2,): Gate.h, immutable=True)
  • labels: (2,)
  • protocol: IRB
  • twirl: (('C', 2),)
${e}_{P}$
The probability of an error acting on the targeted systems during a dressed gate of interest.
2.2e-02 (1.9e-03)
0.022051874334917843, 0.0019018820223200676
2.9e-02 (1.8e-03)
0.028709339901603625, 0.001834933809555256
2.0e-02 (1.3e-03)
0.02001358573813919, 0.0013406385561971028
${e}_{IU}$
An upper bound on the inferred value of $e_P$ that accounts for systematic errors in the interleaved estimate.
3.6e-02 (4.2e-03)
0.03646732527439403, 0.004209541763489182
3.6e-02 (4.1e-03)
0.03573286432042494, 0.00410026624192597
3.2e-02 (3.4e-03)
0.031929286872553836, 0.0034310798232739612
${e}_{IL}$
A lower bound on the inferred value of $e_P$ that accounts for systematic errors in the interleaved estimate.
3.1e-03 (1.1e-03)
0.0031496811209140996, 0.0011188699627721697
4.6e-03 (1.4e-03)
0.004614948133137495, 0.0014358922930404543
2.8e-03 (8.9e-04)
0.0028425785199157894, 0.0008881615320178827
${p}$
Decay parameter of the exponential decay $Ap^m$.
9.7e-01 (2.5e-03)
0.9705975008867762, 0.002535842696426757
9.7e-01 (2.0e-03)
0.9693767041049561, 0.001957262730192273
9.7e-01 (1.8e-03)
0.9733152190158144, 0.0017875180749294703
${A}$
SPAM parameter of the exponential decay $Ap^m$.
9.7e-01 (2.2e-02)
0.9664686460534758, 0.021584640935072712
9.9e-01 (2.0e-02)
0.991940877376338, 0.01987415152679186
9.7e-01 (2.2e-02)
0.9730919441247421, 0.02168515475879821


Plot a summary of information:

circuits.plot.irb_summary()
IRB Summary

For a refresher on the parameters plotted above, see Interleaved Randomized Benchmarking (IRB).

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

Gallery generated by Sphinx-Gallery