Download

Download this file as Jupyter notebook: keys.ipynb.

Keys: Storing and Filtering Metadata

True-Q™ uses objects called Keys to store metadata. Each Circuit and Estimate owns a key which can store multiple name/value pairs in a dictionary-like format. Keys are used by all built-in circuit generation methods, such as SRB, to disambiguate the circuits that they generate from independent circuits that might happen to be in the same circuit collection. These metadata are what allow the main fitter, fit(), to keep track of all protocol types, cycles of interest, twirling groups, measurement bases, and so on, to provide separate estimates in each relevant context.

Keys can be constructed manually by providing the constructor keyname/value pairs.

[2]:
import trueq as tq
import matplotlib.pyplot as plt
import numpy as np

tq.Key(name="my_name", phi=27.7, shapes=("circle", "square"))
[2]:
Key(name='my_name', phi=27.7, shapes=('circle', 'square'))

In the following example, we combine some basic diagnostic protocols, SRB and IRB, in the same circuit collection, and display all resulting circuit keys in the fancy table format provided by KeySet.

[3]:
# create a single circuit collection with simultaneous RB, and simultaneous interleaved
# randomized benchmarking on two different cycles. for demonstration purposes, we have
# lowered the number of randomizations per sequence length below what a typical
# experiment would use
circuits = tq.make_srb(range(5), [4, 12], n_circuits=4)

cycle_h = tq.Cycle({range(5): tq.Gate.h})
circuits += tq.make_irb(cycle_h, [4, 10], n_circuits=3)

cycle_x = tq.Cycle({range(5): tq.Gate.x})
circuits += tq.make_irb(cycle_x, [2, 10], n_circuits=3)

circuits.keys()
[3]:
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".
KeySet
List of all the keys in the KeySet
protocol
The characterization protocol used to generate a circuit.
cycles twirl
The twirling group used to generate a circuit.
n_random_cycles
The number of independent random cycles in the circuit.
compiled_pauli
The n-qubit Pauli operator that was compiled into the circuit immediately before measurement.
measurement_basis
An n-qubit Pauli operator describing the change-of-basis gates added prior to measurement.
Key
Key:
  • compiled_pauli: YYZYX
  • cycles: (Cycle((0,): Gate.h, (1,): Gate.h, (2,): Gate.h, (3,): Gate.h, (4,): Gate.h),)
  • measurement_basis: ZZZZZ
  • n_random_cycles: 4
  • protocol: IRB
  • twirl: Cliffords on [0, 1, 2, 3, 4]
IRB (Cycle((0,): Gate.h, (1,): Gate.h, (2,): Gate.h, (3,): Gate.h, (4,): Gate.h),) Cliffords on [0, 1, 2, 3, 4] 4 YYZYX ZZZZZ
Key
Key:
  • compiled_pauli: YZYIY
  • cycles: (Cycle((0,): Gate.h, (1,): Gate.h, (2,): Gate.h, (3,): Gate.h, (4,): Gate.h),)
  • measurement_basis: ZZZZZ
  • n_random_cycles: 4
  • protocol: IRB
  • twirl: Cliffords on [0, 1, 2, 3, 4]
IRB (Cycle((0,): Gate.h, (1,): Gate.h, (2,): Gate.h, (3,): Gate.h, (4,): Gate.h),) Cliffords on [0, 1, 2, 3, 4] 4 YZYIY ZZZZZ
Key
Key:
  • compiled_pauli: XXYIZ
  • cycles: (Cycle((0,): Gate.h, (1,): Gate.h, (2,): Gate.h, (3,): Gate.h, (4,): Gate.h),)
  • measurement_basis: ZZZZZ
  • n_random_cycles: 4
  • protocol: IRB
  • twirl: Cliffords on [0, 1, 2, 3, 4]
IRB (Cycle((0,): Gate.h, (1,): Gate.h, (2,): Gate.h, (3,): Gate.h, (4,): Gate.h),) Cliffords on [0, 1, 2, 3, 4] 4 XXYIZ ZZZZZ
Key
Key:
  • compiled_pauli: ZIXII
  • cycles: (Cycle((0,): Gate.h, (1,): Gate.h, (2,): Gate.h, (3,): Gate.h, (4,): Gate.h),)
  • measurement_basis: ZZZZZ
  • n_random_cycles: 10
  • protocol: IRB
  • twirl: Cliffords on [0, 1, 2, 3, 4]
IRB (Cycle((0,): Gate.h, (1,): Gate.h, (2,): Gate.h, (3,): Gate.h, (4,): Gate.h),) Cliffords on [0, 1, 2, 3, 4] 10 ZIXII ZZZZZ
Key
Key:
  • compiled_pauli: YIIZX
  • cycles: (Cycle((0,): Gate.h, (1,): Gate.h, (2,): Gate.h, (3,): Gate.h, (4,): Gate.h),)
  • measurement_basis: ZZZZZ
  • n_random_cycles: 10
  • protocol: IRB
  • twirl: Cliffords on [0, 1, 2, 3, 4]
IRB (Cycle((0,): Gate.h, (1,): Gate.h, (2,): Gate.h, (3,): Gate.h, (4,): Gate.h),) Cliffords on [0, 1, 2, 3, 4] 10 YIIZX ZZZZZ
Key
Key:
  • compiled_pauli: IIXZI
  • cycles: (Cycle((0,): Gate.h, (1,): Gate.h, (2,): Gate.h, (3,): Gate.h, (4,): Gate.h),)
  • measurement_basis: ZZZZZ
  • n_random_cycles: 10
  • protocol: IRB
  • twirl: Cliffords on [0, 1, 2, 3, 4]
IRB (Cycle((0,): Gate.h, (1,): Gate.h, (2,): Gate.h, (3,): Gate.h, (4,): Gate.h),) Cliffords on [0, 1, 2, 3, 4] 10 IIXZI ZZZZZ
Key
Key:
  • compiled_pauli: ZXIXX
  • cycles: (Cycle((0,): Gate.x, (1,): Gate.x, (2,): Gate.x, (3,): Gate.x, (4,): Gate.x),)
  • measurement_basis: ZZZZZ
  • n_random_cycles: 2
  • protocol: IRB
  • twirl: Cliffords on [0, 1, 2, 3, 4]
IRB (Cycle((0,): Gate.x, (1,): Gate.x, (2,): Gate.x, (3,): Gate.x, (4,): Gate.x),) Cliffords on [0, 1, 2, 3, 4] 2 ZXIXX ZZZZZ
Key
Key:
  • compiled_pauli: YZIXI
  • cycles: (Cycle((0,): Gate.x, (1,): Gate.x, (2,): Gate.x, (3,): Gate.x, (4,): Gate.x),)
  • measurement_basis: ZZZZZ
  • n_random_cycles: 2
  • protocol: IRB
  • twirl: Cliffords on [0, 1, 2, 3, 4]
IRB (Cycle((0,): Gate.x, (1,): Gate.x, (2,): Gate.x, (3,): Gate.x, (4,): Gate.x),) Cliffords on [0, 1, 2, 3, 4] 2 YZIXI ZZZZZ
Key
Key:
  • compiled_pauli: ZIYXX
  • cycles: (Cycle((0,): Gate.x, (1,): Gate.x, (2,): Gate.x, (3,): Gate.x, (4,): Gate.x),)
  • measurement_basis: ZZZZZ
  • n_random_cycles: 2
  • protocol: IRB
  • twirl: Cliffords on [0, 1, 2, 3, 4]
IRB (Cycle((0,): Gate.x, (1,): Gate.x, (2,): Gate.x, (3,): Gate.x, (4,): Gate.x),) Cliffords on [0, 1, 2, 3, 4] 2 ZIYXX ZZZZZ
Key
Key:
  • compiled_pauli: XZYYZ
  • cycles: (Cycle((0,): Gate.x, (1,): Gate.x, (2,): Gate.x, (3,): Gate.x, (4,): Gate.x),)
  • measurement_basis: ZZZZZ
  • n_random_cycles: 10
  • protocol: IRB
  • twirl: Cliffords on [0, 1, 2, 3, 4]
IRB (Cycle((0,): Gate.x, (1,): Gate.x, (2,): Gate.x, (3,): Gate.x, (4,): Gate.x),) Cliffords on [0, 1, 2, 3, 4] 10 XZYYZ ZZZZZ
Key
Key:
  • compiled_pauli: ZIXZI
  • cycles: (Cycle((0,): Gate.x, (1,): Gate.x, (2,): Gate.x, (3,): Gate.x, (4,): Gate.x),)
  • measurement_basis: ZZZZZ
  • n_random_cycles: 10
  • protocol: IRB
  • twirl: Cliffords on [0, 1, 2, 3, 4]
IRB (Cycle((0,): Gate.x, (1,): Gate.x, (2,): Gate.x, (3,): Gate.x, (4,): Gate.x),) Cliffords on [0, 1, 2, 3, 4] 10 ZIXZI ZZZZZ
Key
Key:
  • compiled_pauli: XYXIX
  • cycles: (Cycle((0,): Gate.x, (1,): Gate.x, (2,): Gate.x, (3,): Gate.x, (4,): Gate.x),)
  • measurement_basis: ZZZZZ
  • n_random_cycles: 10
  • protocol: IRB
  • twirl: Cliffords on [0, 1, 2, 3, 4]
IRB (Cycle((0,): Gate.x, (1,): Gate.x, (2,): Gate.x, (3,): Gate.x, (4,): Gate.x),) Cliffords on [0, 1, 2, 3, 4] 10 XYXIX ZZZZZ
Key
Key:
  • compiled_pauli: IZXYY
  • measurement_basis: ZZZZZ
  • n_random_cycles: 4
  • protocol: SRB
  • twirl: Cliffords on [0, 1, 2, 3, 4]
SRB Cliffords on [0, 1, 2, 3, 4] 4 IZXYY ZZZZZ
Key
Key:
  • compiled_pauli: ZXZZX
  • measurement_basis: ZZZZZ
  • n_random_cycles: 4
  • protocol: SRB
  • twirl: Cliffords on [0, 1, 2, 3, 4]
SRB Cliffords on [0, 1, 2, 3, 4] 4 ZXZZX ZZZZZ
Key
Key:
  • compiled_pauli: XIXYI
  • measurement_basis: ZZZZZ
  • n_random_cycles: 4
  • protocol: SRB
  • twirl: Cliffords on [0, 1, 2, 3, 4]
SRB Cliffords on [0, 1, 2, 3, 4] 4 XIXYI ZZZZZ
Key
Key:
  • compiled_pauli: XIIII
  • measurement_basis: ZZZZZ
  • n_random_cycles: 4
  • protocol: SRB
  • twirl: Cliffords on [0, 1, 2, 3, 4]
SRB Cliffords on [0, 1, 2, 3, 4] 4 XIIII ZZZZZ
Key
Key:
  • compiled_pauli: IIZYX
  • measurement_basis: ZZZZZ
  • n_random_cycles: 12
  • protocol: SRB
  • twirl: Cliffords on [0, 1, 2, 3, 4]
SRB Cliffords on [0, 1, 2, 3, 4] 12 IIZYX ZZZZZ
Key
Key:
  • compiled_pauli: ZXXXX
  • measurement_basis: ZZZZZ
  • n_random_cycles: 12
  • protocol: SRB
  • twirl: Cliffords on [0, 1, 2, 3, 4]
SRB Cliffords on [0, 1, 2, 3, 4] 12 ZXXXX ZZZZZ
Key
Key:
  • compiled_pauli: IIXII
  • measurement_basis: ZZZZZ
  • n_random_cycles: 12
  • protocol: SRB
  • twirl: Cliffords on [0, 1, 2, 3, 4]
SRB Cliffords on [0, 1, 2, 3, 4] 12 IIXII ZZZZZ
Key
Key:
  • compiled_pauli: XYXXX
  • measurement_basis: ZZZZZ
  • n_random_cycles: 12
  • protocol: SRB
  • twirl: Cliffords on [0, 1, 2, 3, 4]
SRB Cliffords on [0, 1, 2, 3, 4] 12 XYXXX ZZZZZ

We can look at the key of a particular circuit, inspect its values either with property syntax, or subscript syntax, and perform other container-like actions.

[4]:
# get the whole key
circuits[0].key
[4]:
Key(compiled_pauli=Weyls('IZXYY'), measurement_basis=Weyls('ZZZZZ'), n_random_cycles=4, protocol='SRB', twirl=Twirl({(0,): 'C', (1,): 'C', (2,): 'C', (3,): 'C', (4,): 'C'}, dim=2))
[5]:
# get all keywords (names) present in the key
circuits[0].key.names
[5]:
('compiled_pauli', 'measurement_basis', 'n_random_cycles', 'protocol', 'twirl')
[6]:
# find out whether the key contains a particular keyword (name)
"protocol" in circuits[0].key
[6]:
True
[7]:
# inspect a particular value using property syntax
circuits[0].key.compiled_pauli
[7]:
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".
Type:
  • Weyls
Dim:
  • 2
Powers:
X0 X1 X2 X3 X4 Z0 Z1 Z2 Z3 Z4
0 0 0 1 1 1 0 1 0 1 1
[8]:
# inspect a particular value using subscript syntax
circuits[0].key["measurement_basis"]
[8]:
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".
Type:
  • Weyls
Dim:
  • 2
Powers:
X0 X1 X2 X3 X4 Z0 Z1 Z2 Z3 Z4
0 0 0 0 0 0 1 1 1 1 1

If we have a KeySet, as returned by keys(), we can look at all unique values associated with a particular keyword to quickly identify the contents of a collection.

[9]:
# our collection contains circuits generated by the SRB and IRB protocols
circuits.keys().protocol
[9]:
{'IRB', 'SRB'}
[10]:
# all circuits present use simultaneous single-qubit Clifford twirling
circuits.keys().twirl
[10]:
{Twirl({(0,): 'C', (1,): 'C', (2,): 'C', (3,): 'C', (4,): 'C'}, dim=2)}

Filtering Based on Keys

Keys are designed to allow fast filtering of large collections. Circuit and estimate collections contain the respective methods subset() and subset() for this purpose. We use the circuit collection created in the previous subsection, though the mechanics of filtering estimate collections are identical.

There are three ways that circuits can be filtered based on key values, (which can all be used together on different keywords in the same filtering operation):

  1. By exact value equality.

[11]:
# collect all SRB circuits into a new collection
srb_circuits = circuits.subset(protocol="SRB")
  1. By value containment in some allowed set of values.

[12]:
# collect all circuits with sequence length 2 or 4. the use of a set is necessary
short_circuits = circuits.subset(n_random_cycles={2, 4})
  1. By value exclusion from some list of disallowed values.

[13]:
# collect all circuits whose sequence length is not 2 or 4. the use of list is necessary
long_circuits = circuits.subset(n_random_cycles=[2, 4])

We can combine the three types of filtering in a single operation, as seen below.

[14]:
irb_circuits_h = circuits.subset(cycles=(cycle_h,), n_random_cycles={2, 4})
irb_circuits_h.keys()
[14]:
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".
KeySet
List of all the keys in the KeySet
protocol
The characterization protocol used to generate a circuit.
cycles twirl
The twirling group used to generate a circuit.
n_random_cycles
The number of independent random cycles in the circuit.
compiled_pauli
The n-qubit Pauli operator that was compiled into the circuit immediately before measurement.
measurement_basis
An n-qubit Pauli operator describing the change-of-basis gates added prior to measurement.
Key
Key:
  • compiled_pauli: YYZYX
  • cycles: (Cycle((0,): Gate.h, (1,): Gate.h, (2,): Gate.h, (3,): Gate.h, (4,): Gate.h),)
  • measurement_basis: ZZZZZ
  • n_random_cycles: 4
  • protocol: IRB
  • twirl: Cliffords on [0, 1, 2, 3, 4]
IRB (Cycle((0,): Gate.h, (1,): Gate.h, (2,): Gate.h, (3,): Gate.h, (4,): Gate.h),) Cliffords on [0, 1, 2, 3, 4] 4 YYZYX ZZZZZ
Key
Key:
  • compiled_pauli: XXYIZ
  • cycles: (Cycle((0,): Gate.h, (1,): Gate.h, (2,): Gate.h, (3,): Gate.h, (4,): Gate.h),)
  • measurement_basis: ZZZZZ
  • n_random_cycles: 4
  • protocol: IRB
  • twirl: Cliffords on [0, 1, 2, 3, 4]
IRB (Cycle((0,): Gate.h, (1,): Gate.h, (2,): Gate.h, (3,): Gate.h, (4,): Gate.h),) Cliffords on [0, 1, 2, 3, 4] 4 XXYIZ ZZZZZ
Key
Key:
  • compiled_pauli: YZYIY
  • cycles: (Cycle((0,): Gate.h, (1,): Gate.h, (2,): Gate.h, (3,): Gate.h, (4,): Gate.h),)
  • measurement_basis: ZZZZZ
  • n_random_cycles: 4
  • protocol: IRB
  • twirl: Cliffords on [0, 1, 2, 3, 4]
IRB (Cycle((0,): Gate.h, (1,): Gate.h, (2,): Gate.h, (3,): Gate.h, (4,): Gate.h),) Cliffords on [0, 1, 2, 3, 4] 4 YZYIY ZZZZZ

Using Keys in Custom Circuits

Users are encouraged to use keys to attach metadata to their own circuits. In the following demonstration, we create a collection of circuits which produce a 5 qubit GHZ state, rotate each qubit about Z by some angle phi, and then undo the GHZ state to measure the total phase accumulation. We use the key to keep track of which phase each circuit contains.

[15]:
circuits = tq.CircuitCollection()
for phi in np.linspace(-180, 180, 61):
    circuit = tq.Circuit(key=tq.Key(phi=phi, measurement_basis=tq.math.Weyls("Z")))
    circuit += {0: tq.Gate.h}
    circuit += [{(i, i + 1): tq.Gate.cx} for i in range(4)]
    circuit += {range(5): tq.Gate.rz(phi)}
    circuit += [{(i, i + 1): tq.Gate.cx} for i in reversed(range(4))]
    circuit += [{0: tq.Gate.h}, {0: tq.Meas()}]

    circuits += circuit

# draw an example circuit
circuits[5].draw(False)
[15]:
0 1 2 3 4 H CX CX CX CX CX CX CX CX CX CX CX CX CX CX CX CX H M

Next, we attach results to all circuits in the collection with a noisy simulator.

[16]:
sim = tq.Simulator().add_overrotation(0.04, 0.08).add_stochastic_pauli(px=0.01)
sim.run(circuits, n_shots=128)

Finally, we can extract values from each circuit’s results and key to produce a plot.

[17]:
xs, ys = [], []
for circuit in circuits:
    xs.append(circuit.key.phi)
    ys.append(circuit.results[0] / 128)
ys = np.array(ys)
plt.errorbar(xs, ys, yerr=np.sqrt(ys * (1 - ys) / 128))
plt.xlabel("phi")
plt.ylabel("Pr(0)")
[17]:
Text(0, 0.5, 'Pr(0)')
../../_images/guides_fundamentals_keys_27_1.png

Augmenting True-Q™ Generated Circuits with User Metadata

We also encourage users to augment key metadata generated by True-Q™ protocols with their own keynames/values when convenient. In the following example, we insert SRB circuits into a circuit collection 11 times, each time augmenting the new circuits with an additional keyname eps whose value records how much single-qubit overrotation noise we have included in their simulation.

[18]:
circuits = tq.CircuitCollection()
for eps in np.linspace(0, 0.05, 11):
    srb_circuits = tq.make_srb(range(3), [4, 12, 24, 48]).update_keys(eps=eps)
    tq.Simulator().add_overrotation(eps).run(srb_circuits)
    circuits += srb_circuits

Importantly, the fitter will treat these 11 groups independently, so that in the following table we see estimates for each of the three qubits, and for each of the 11 values of eps. Hovering over a cell in the top row of the table will produce a tooltip containing the full contents of the respective estimate’s key.

[19]:
fit = circuits.fit()
fit
[19]:
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:
  • eps: 0.03
  • labels: (0,)
  • protocol: SRB
  • twirl: Cliffords on [0, 1, 2]
Cliffords
(0,)
Key:
  • eps: 0.0
  • labels: (0,)
  • protocol: SRB
  • twirl: Cliffords on [0, 1, 2]
Cliffords
(0,)
Key:
  • eps: 0.01
  • labels: (0,)
  • protocol: SRB
  • twirl: Cliffords on [0, 1, 2]
Cliffords
(0,)
Key:
  • eps: 0.005
  • labels: (0,)
  • protocol: SRB
  • twirl: Cliffords on [0, 1, 2]
Cliffords
(0,)
Key:
  • eps: 0.02
  • labels: (0,)
  • protocol: SRB
  • twirl: Cliffords on [0, 1, 2]
Cliffords
(0,)
Key:
  • eps: 0.04
  • labels: (0,)
  • protocol: SRB
  • twirl: Cliffords on [0, 1, 2]
Cliffords
(0,)
Key:
  • eps: 0.045
  • labels: (0,)
  • protocol: SRB
  • twirl: Cliffords on [0, 1, 2]
Cliffords
(0,)
Key:
  • eps: 0.015
  • labels: (0,)
  • protocol: SRB
  • twirl: Cliffords on [0, 1, 2]
Cliffords
(0,)
Key:
  • eps: 0.035
  • labels: (0,)
  • protocol: SRB
  • twirl: Cliffords on [0, 1, 2]
Cliffords
(0,)
Key:
  • eps: 0.025
  • labels: (0,)
  • protocol: SRB
  • twirl: Cliffords on [0, 1, 2]
Cliffords
(0,)
Key:
  • eps: 0.05
  • labels: (0,)
  • protocol: SRB
  • twirl: Cliffords on [0, 1, 2]
Cliffords
(1,)
Key:
  • eps: 0.05
  • labels: (1,)
  • protocol: SRB
  • twirl: Cliffords on [0, 1, 2]
Cliffords
(1,)
Key:
  • eps: 0.045
  • labels: (1,)
  • protocol: SRB
  • twirl: Cliffords on [0, 1, 2]
Cliffords
(1,)
Key:
  • eps: 0.03
  • labels: (1,)
  • protocol: SRB
  • twirl: Cliffords on [0, 1, 2]
Cliffords
(1,)
Key:
  • eps: 0.015
  • labels: (1,)
  • protocol: SRB
  • twirl: Cliffords on [0, 1, 2]
Cliffords
(1,)
Key:
  • eps: 0.0
  • labels: (1,)
  • protocol: SRB
  • twirl: Cliffords on [0, 1, 2]
Cliffords
(1,)
Key:
  • eps: 0.02
  • labels: (1,)
  • protocol: SRB
  • twirl: Cliffords on [0, 1, 2]
Cliffords
(1,)
Key:
  • eps: 0.005
  • labels: (1,)
  • protocol: SRB
  • twirl: Cliffords on [0, 1, 2]
Cliffords
(1,)
Key:
  • eps: 0.01
  • labels: (1,)
  • protocol: SRB
  • twirl: Cliffords on [0, 1, 2]
Cliffords
(1,)
Key:
  • eps: 0.04
  • labels: (1,)
  • protocol: SRB
  • twirl: Cliffords on [0, 1, 2]
Cliffords
(1,)
Key:
  • eps: 0.035
  • labels: (1,)
  • protocol: SRB
  • twirl: Cliffords on [0, 1, 2]
Cliffords
(1,)
Key:
  • eps: 0.025
  • labels: (1,)
  • protocol: SRB
  • twirl: Cliffords on [0, 1, 2]
Cliffords
(2,)
Key:
  • eps: 0.01
  • labels: (2,)
  • protocol: SRB
  • twirl: Cliffords on [0, 1, 2]
Cliffords
(2,)
Key:
  • eps: 0.02
  • labels: (2,)
  • protocol: SRB
  • twirl: Cliffords on [0, 1, 2]
Cliffords
(2,)
Key:
  • eps: 0.035
  • labels: (2,)
  • protocol: SRB
  • twirl: Cliffords on [0, 1, 2]
Cliffords
(2,)
Key:
  • eps: 0.04
  • labels: (2,)
  • protocol: SRB
  • twirl: Cliffords on [0, 1, 2]
Cliffords
(2,)
Key:
  • eps: 0.005
  • labels: (2,)
  • protocol: SRB
  • twirl: Cliffords on [0, 1, 2]
Cliffords
(2,)
Key:
  • eps: 0.015
  • labels: (2,)
  • protocol: SRB
  • twirl: Cliffords on [0, 1, 2]
Cliffords
(2,)
Key:
  • eps: 0.045
  • labels: (2,)
  • protocol: SRB
  • twirl: Cliffords on [0, 1, 2]
Cliffords
(2,)
Key:
  • eps: 0.025
  • labels: (2,)
  • protocol: SRB
  • twirl: Cliffords on [0, 1, 2]
Cliffords
(2,)
Key:
  • eps: 0.05
  • labels: (2,)
  • protocol: SRB
  • twirl: Cliffords on [0, 1, 2]
Cliffords
(2,)
Key:
  • eps: 0.0
  • labels: (2,)
  • protocol: SRB
  • twirl: Cliffords on [0, 1, 2]
Cliffords
(2,)
Key:
  • eps: 0.03
  • labels: (2,)
  • protocol: SRB
  • twirl: Cliffords on [0, 1, 2]
${e}_{F}$
The probability of an error acting on the targeted systems during a random gate.
1.0e-03 (3.3e-04)
0.001025285888868216, 0.0003258967935588343
0.0e+00 (0.0e+00)
0.0, 0.0
3.2e-04 (1.4e-04)
0.0003204949363798948, 0.00014319733492619324
5.4e-05 (4.2e-05)
5.446454188093308e-05, 4.152046954136944e-05
7.9e-04 (2.2e-04)
0.0007875359823879824, 0.00022398574080482263
2.2e-03 (5.3e-04)
0.0022290716964799007, 0.0005276074819524253
7.1e-03 (1.9e-03)
0.007078142222100736, 0.001909901867814424
6.7e-04 (2.5e-04)
0.0006742000948259108, 0.00025167923599724685
2.0e-03 (4.3e-04)
0.002010627811651511, 0.000425421069277075
1.1e-03 (3.5e-04)
0.0010875672028423378, 0.00035380864341756006
4.0e-03 (1.1e-03)
0.004015527561796156, 0.0010671105823021527
7.0e-03 (2.0e-03)
0.00697619009609915, 0.002022053122691832
3.1e-03 (7.6e-04)
0.0031279413879654328, 0.0007623617161750943
1.4e-03 (3.6e-04)
0.0014221295723356175, 0.0003617087406769172
5.5e-04 (1.6e-04)
0.0005477610098088559, 0.00016329570433415292
0.0e+00 (0.0e+00)
0.0, 0.0
4.9e-04 (1.7e-04)
0.000493304027939373, 0.0001706612894690652
1.5e-05 (2.5e-05)
1.4502283843226271e-05, 2.5265787268123064e-05
1.5e-04 (6.4e-05)
0.00014736470580636873, 6.392640480918977e-05
2.5e-03 (6.2e-04)
0.002474918430596579, 0.000623895461148871
2.4e-03 (5.4e-04)
0.002425973792210767, 0.000536589756878277
1.5e-03 (3.1e-04)
0.0015283291968295476, 0.0003065050709968252
2.5e-04 (1.0e-04)
0.0002537066626362994, 0.00010149235235343241
6.9e-04 (2.1e-04)
0.0006874132924314658, 0.00021066914365277544
2.8e-03 (5.5e-04)
0.0028049000350552356, 0.0005512452318171625
2.8e-03 (8.5e-04)
0.0027530244485418076, 0.0008476757556582547
3.1e-05 (3.5e-05)
3.083639250103798e-05, 3.5202697324817185e-05
4.7e-04 (1.7e-04)
0.00047025509121206843, 0.00016584545541164334
4.8e-03 (1.3e-03)
0.004753256826206281, 0.0013264066060379195
8.2e-04 (2.2e-04)
0.0008237463026717073, 0.00021866904755511556
4.7e-03 (1.0e-03)
0.0047057994593837915, 0.000999197918447015
0.0e+00 (0.0e+00)
0.0, 0.0
1.8e-03 (4.6e-04)
0.0018089589648073168, 0.0004598356012547884
${p}$
Decay parameter of the exponential decay $Ap^m$.
1.0e+00 (4.3e-04)
0.9986329521481757, 0.00043452905807844577
1.0e+00 (0.0e+00)
1.0, 0.0
1.0e+00 (1.9e-04)
0.9995726734181601, 0.00019092977990159098
1.0e+00 (5.5e-05)
0.9999273806108254, 5.536062605515925e-05
1.0e+00 (3.0e-04)
0.9989499520234827, 0.00029864765440643017
1.0e+00 (7.0e-04)
0.9970279044046935, 0.0007034766426032337
9.9e-01 (2.5e-03)
0.990562477037199, 0.0025465358237525652
1.0e+00 (3.4e-04)
0.9991010665402321, 0.00033557231466299577
1.0e+00 (5.7e-04)
0.997319162917798, 0.0005672280923694333
1.0e+00 (4.7e-04)
0.9985499103962102, 0.00047174485789008006
9.9e-01 (1.4e-03)
0.9946459632509385, 0.0014228141097362035
9.9e-01 (2.7e-03)
0.9906984132052011, 0.002696070830255776
1.0e+00 (1.0e-03)
0.9958294114827128, 0.0010164822882334592
1.0e+00 (4.8e-04)
0.9981038272368858, 0.0004822783209025563
1.0e+00 (2.2e-04)
0.9992696519869215, 0.00021772760577887056
1.0e+00 (0.0e+00)
1.0, 0.0
1.0e+00 (2.3e-04)
0.9993422612960808, 0.00022754838595875362
1.0e+00 (3.4e-05)
0.9999806636215424, 3.3687716357497414e-05
1.0e+00 (8.5e-05)
0.9998035137255915, 8.523520641225302e-05
1.0e+00 (8.3e-04)
0.9967001087592046, 0.0008318606148651613
1.0e+00 (7.2e-04)
0.9967653682770523, 0.0007154530091710361
1.0e+00 (4.1e-04)
0.9979622277375606, 0.00040867342799576694
1.0e+00 (1.4e-04)
0.9996617244498183, 0.0001353231364712432
1.0e+00 (2.8e-04)
0.9990834489434247, 0.0002808921915370339
1.0e+00 (7.3e-04)
0.996260133286593, 0.0007349936424228833
1.0e+00 (1.1e-03)
0.9963293007352776, 0.0011302343408776728
1.0e+00 (4.7e-05)
0.9999588848099986, 4.6936929766422916e-05
1.0e+00 (2.2e-04)
0.9993729932117172, 0.00022112727388219112
9.9e-01 (1.8e-03)
0.993662324231725, 0.0017685421413838928
1.0e+00 (2.9e-04)
0.9989016715964377, 0.0002915587300734874
9.9e-01 (1.3e-03)
0.9937256007208216, 0.0013322638912626865
1.0e+00 (0.0e+00)
1.0, 0.0
1.0e+00 (6.1e-04)
0.9975880547135902, 0.0006131141350063845
${A}$
SPAM parameter of the exponential decay $Ap^m$.
9.9e-01 (6.8e-03)
0.9882898496523871, 0.006847661133534783
1.0e+00 (0.0e+00)
1.0, 0.0
1.0e+00 (2.6e-03)
1.0016814666296123, 0.00256689152513954
1.0e+00 (1.1e-03)
0.9995946485094674, 0.0010650204395934208
1.0e+00 (4.0e-03)
1.0048048835797603, 0.003954864422972772
9.9e-01 (1.1e-02)
0.9941821445076278, 0.010532804944808637
1.0e+00 (3.2e-02)
1.040550160577762, 0.03232955313013547
1.0e+00 (4.5e-03)
1.001832096111214, 0.004501927900362274
1.0e+00 (8.6e-03)
0.999712954182581, 0.008603022495594831
1.0e+00 (6.5e-03)
0.999104620142723, 0.006532863822732467
9.4e-01 (2.1e-02)
0.9435761778349969, 0.021142065072821768
1.0e+00 (3.5e-02)
1.012442477519184, 0.034521357870707176
9.8e-01 (1.4e-02)
0.9808938156356205, 0.014264872074600709
1.0e+00 (7.8e-03)
0.9955704345040322, 0.007793817417272915
1.0e+00 (3.1e-03)
1.0035907242620747, 0.0030674909217481183
1.0e+00 (0.0e+00)
1.0, 0.0
1.0e+00 (3.7e-03)
0.9979492096072928, 0.0036672748331207042
1.0e+00 (7.0e-04)
0.9997583221412026, 0.0006983577970194711
1.0e+00 (1.5e-03)
0.9993007778195371, 0.001501613290369572
9.9e-01 (1.2e-02)
0.9885280025709056, 0.01203657632567459
1.0e+00 (9.6e-03)
1.0044253034613233, 0.009567834945119409
1.0e+00 (5.6e-03)
1.0086728359469392, 0.005591129526634785
1.0e+00 (1.8e-03)
1.0017452180587387, 0.0018235455303356428
1.0e+00 (4.5e-03)
0.9998527045445523, 0.004459698319171567
1.0e+00 (1.1e-02)
1.0025301515289837, 0.010545361030897205
9.8e-01 (1.6e-02)
0.9826894695389368, 0.015541925933267873
1.0e+00 (1.0e-03)
0.999236174607609, 0.0010108926754555552
1.0e+00 (3.0e-03)
1.0009900075790636, 0.003014641648958739
1.0e+00 (2.3e-02)
1.0003105321422732, 0.023406898351043245
9.9e-01 (5.3e-03)
0.9935607708813627, 0.005279905517262263
9.5e-01 (2.2e-02)
0.9547137421578846, 0.022280832728065376
1.0e+00 (0.0e+00)
1.0, 0.0
1.0e+00 (8.0e-03)
1.0059360392453687, 0.007976152603399098
[20]:
fit.plot.compare("e_F", "eps")
../../_images/guides_fundamentals_keys_32_0.png

Special Keywords

True-Q™ uses the following keywords for Keys internally. There are no restrictions on using these keywords for your own purposes, or manually overriding them, but doing so may cause fitting and other features to break.

Keyword

Description

amplification

Used by NOX to specify noise amplification.

analyze_decays

Stores CB decays to measure.

batch

Used by RCAL to index experiment batches.

compiled_pauli

Which Paulis were compiled prior to measurements.

cycles

The cycles of interest, see e.g. CB.

labels

A tuple of qubit labels.

measurement_basis

Which basis change was compiled into the circuit.

mitigation

The name of a mitigation protocol, e.g. NOX.

n_random_cycles

The number of independent random cycles in a circuit.

order

Sometimes used to order by key.

protocol

The name of a protocol, e.g. CB.

relabeling

Stores how a circuit was relabeled by a compiler.

seq_label

Used to index small variations of a common random circuit.

subsystems

Used by KNR to specify the gate-bodies to probe.

targeted_errors

Non-identity errors targeted by CB.

twirl

Stores the twirling group.

Usually, fit() produces a separate set of estimates for every unique combination of custom keywords (i.e. not in the list above). The exceptions to this rule are the following custom keywords, which will be ignored and deleted in the returned fit object:

Keyword

Description

job_id

E.g. store a job execution identifier.

n_shots

E.g. store a recommended number of shots for a circuit.


Download

Download this file as Jupyter notebook: keys.ipynb.