Targeted noise reconstruction (TNR)

import trueq as tq

# Define the cycle we wish to do noise reconstruction on.
cycle = {(label,): tq.Gate.id for label in range(4)}

# Generate a circuit collection to measure noise.
circuits = tq.make_tnr(cycle, [4, 32, 64], 30, targeted_errors={"XXXX", "XYXY", "YYZZ"})

# Initialize a simulator with stochastic pauli noise.
sim = tq.Simulator().add_stochastic_pauli(px=0.005, py=0.005)

# Run the circuits on the simulator to populate the results.
sim.run(circuits)
# Print summary of the results.
circuits.fit()
Key(cycle=Cycle((0,): Gate.id, (1,): Gate.id, (2,): Gate.id, (3,): Gate.id, immutable=True), protocol='TNR', twirl=(('P', 0), ('P', 1), ('P', 2), ('P', 3)), labels=(0,), order=10)
Name
Estimate
95% CI
 
Description
p_Y
1.978
[1.851,2.105]
e-02
Probability of Pauli error Y
p_X
2.057
[1.930,2.185]
e-02
Probability of Pauli error X
Key(cycle=Cycle((0,): Gate.id, (1,): Gate.id, (2,): Gate.id, (3,): Gate.id, immutable=True), protocol='TNR', twirl=(('P', 0), ('P', 1), ('P', 2), ('P', 3)), labels=(1,), order=10)
Name
Estimate
95% CI
 
Description
p_Y
2.004
[1.855,2.153]
e-02
Probability of Pauli error Y
p_X
2.088
[1.939,2.237]
e-02
Probability of Pauli error X
Key(cycle=Cycle((0,): Gate.id, (1,): Gate.id, (2,): Gate.id, (3,): Gate.id, immutable=True), protocol='TNR', twirl=(('P', 0), ('P', 1), ('P', 2), ('P', 3)), labels=(2,), order=10)
Name
Estimate
95% CI
 
Description
p_X
2.037
[1.917,2.156]
e-02
Probability of Pauli error X
p_Z
-3.224
[-122.5,116.0]
e-05
Probability of Pauli error Z
Key(cycle=Cycle((0,): Gate.id, (1,): Gate.id, (2,): Gate.id, (3,): Gate.id, immutable=True), protocol='TNR', twirl=(('P', 0), ('P', 1), ('P', 2), ('P', 3)), labels=(3,), order=10)
Name
Estimate
95% CI
 
Description
p_Z
-5.643
[-134.9,123.6]
e-05
Probability of Pauli error Z
p_X
1.986
[1.857,2.116]
e-02
Probability of Pauli error X
p_Y
2.038
[1.909,2.167]
e-02
Probability of Pauli error Y


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

Gallery generated by Sphinx-Gallery