FAILURE MAP
← Case archive

FA-91231 / Quantum circuit simulation / Open access

Error budget charges a register measurement once · case 01

Measuring three qubits in one op costs (1-er) instead of (1-er)^3.

Verified by executionVariant 1 · 7 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

The measurement branch ignores how many qubits the op reads.

VERIFIED REPAIR

Charge (1-er) per measured qubit.

Unsuccessful approach: The attempted repair uses the linearized 1 - er*k, which overstates success for several qubits.

Case contract

Input [ops, e1, e2, er] with decimal error rates. Success probability is the product of (1-e1) per single-qubit physical gate, (1-e2) per two-qubit gate, (1-e2)^6 (1-e1)^9 per three-qubit gate (Toffoli decomposition), and (1-er) per measured qubit; rz is virtual and barrier/id are free. Return the probability rounded to 9 decimals.

Why this case matters

Error budgets guide which circuit variant to run on hardware; miscounting gate classes skews every comparison.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(x):
    ops, e1, e2, er = x[0], Fraction(x[1]), Fraction(x[2]), Fraction(x[3])
    p = Fraction(1)
    for op in ops:
        name, qs = op[0], op[1]
        if name in ('barrier', 'id', 'rz'):
            continue
        if name == 'measure':
            p *= 1 - er
        elif len(qs) == 1:
            p *= 1 - e1
        elif len(qs) == 2:
            p *= 1 - e2
        else:
            p *= (1 - e2) ** 6 * (1 - e1) ** 9
    return round(float(p), 9) + 0.0
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression: measure two qubits', [[['measure', [0, 1]]], '0.001', '0.01', '0.02'], 0.9604], ['regression: random budget 0', [[['rz', [2]], ['id', [0]], ['barrier', [0]], ['measure', [0, 1, 2]], ['x', [1]], ['barrier', [0]]], '0.0005', '0.02', '0.02'], 0.940721404], ['regression: random budget 8', [[['measure', [1]], ['rz', [2]], ['ccx', [1, 0, 2]], ['id', [0]], ['measure', [1, 2]], ['barrier', [0]]], '0.0005', '0.01', '0.03'], 0.855404551], ['control: virtual rz only', [[['rz', [0]], ['rz', [1]]], '0.001', '0.01', '0.02'], 1.0], ['control: one cx', [[['cx', [0, 1]]], '0.001', '0.01', '0.02'], 0.99], ['control: toffoli', [[['ccx', [0, 1, 2]]], '0.001', '0.01', '0.02'], 0.933040642], ['control: sx pulse', [[['sx', [0]]], '0.001', '0.01', '0.02'], 0.999]], [['regression: random budget 10', [[['measure', [1, 2]], ['rz', [2]], ['cx', [2, 0]], ['h', [0]], ['x', [2]]], '0.0005', '0.05', '0.03'], 0.892961368], ['regression: random budget 11', [[['ccx', [1, 2, 0]], ['measure', [0, 1, 2]], ['x', [2]], ['cx', [1, 2]], ['ccx', [1, 2, 0]], ['rz', [2]], ['rz', [1]], ['id', [0]]], '0.001', '0.02', '0.02'], 0.710168635], ['regression: random budget 8', [[['measure', [1]], ['rz', [2]], ['ccx', [1, 0, 2]], ['id', [0]], ['measure', [1, 2]], ['barrier', [0]]], '0.0005', '0.01', '0.03'], 0.855404551], ['control: barrier and id', [[['barrier', [0, 1]], ['id', [0]]], '0.1', '0.1', '0.1'], 1.0], ['control: random budget 1', [[['rz', [1]], ['ccx', [2, 0, 1]], ['measure', [2]], ['rz', [1]], ['rz', [1]], ['cx', [1, 2]]], '0.001', '0.01', '0.03'], 0.895998929], ['control: random budget 2', [[['cx', [0, 2]]], '0.001', '0.01', '0.02'], 0.99], ['control: random budget 3', [[['rz', [1]]], '0.01', '0.02', '0.02'], 1.0]], [['regression: random budget 15', [[['measure', [1, 2]], ['h', [2]], ['cx', [1, 2]], ['x', [0]], ['cx', [2, 0]], ['cx', [0, 2]], ['measure', [2]], ['rz', [2]]], '0.0005', '0.01', '0.03'], 0.884680355], ['regression: random budget 16', [[['cx', [0, 2]], ['rz', [0]], ['h', [0]], ['measure', [0, 1, 2]], ['rz', [0]], ['rz', [1]]], '0.0005', '0.02', '0.03'], 0.89397233], ['regression: random budget 11', [[['ccx', [1, 2, 0]], ['measure', [0, 1, 2]], ['x', [2]], ['cx', [1, 2]], ['ccx', [1, 2, 0]], ['rz', [2]], ['rz', [1]], ['id', [0]]], '0.001', '0.02', '0.02'], 0.710168635], ['control: random budget 4', [[['cx', [2, 1]], ['ccx', [1, 0, 2]], ['h', [0]], ['x', [2]]], '0.001', '0.02', '0.02'], 0.858623756], ['control: random budget 5', [[['cx', [1, 0]]], '0.001', '0.01', '0.03'], 0.99], ['control: random budget 6', [[['rz', [2]], ['ccx', [1, 0, 2]], ['ccx', [1, 0, 2]], ['rz', [0]], ['h', [2]], ['cx', [0, 2]]], '0.001', '0.05', '0.02'], 0.50367587], ['control: random budget 7', [[['ccx', [0, 1, 2]], ['barrier', [0]], ['ccx', [0, 1, 2]], ['id', [0]], ['barrier', [0]], ['measure', [1]], ['rz', [2]]], '0.001', '0.02', '0.02'], 0.755297022]], [['regression: random budget 18', [[['measure', [0, 1]], ['sx', [1]], ['id', [0]], ['rz', [2]], ['sx', [1]], ['rz', [0]]], '0.001', '0.05', '0.03'], 0.939019141], ['regression: random budget 19', [[['measure', [0, 2]]], '0.01', '0.02', '0.02'], 0.9604], ['regression: random budget 15', [[['measure', [1, 2]], ['h', [2]], ['cx', [1, 2]], ['x', [0]], ['cx', [2, 0]], ['cx', [0, 2]], ['measure', [2]], ['rz', [2]]], '0.0005', '0.01', '0.03'], 0.884680355], ['control: random budget 9', [[['ccx', [1, 0, 2]], ['id', [0]], ['cx', [0, 2]], ['rz', [0]], ['ccx', [0, 2, 1]]], '0.001', '0.01', '0.03'], 0.861859192], ['control: random budget 12', [[['barrier', [0]], ['rz', [1]], ['cx', [0, 2]], ['rz', [2]], ['rz', [1]], ['cx', [2, 1]]], '0.0005', '0.02', '0.02'], 0.9604], ['control: random budget 13', [[['cx', [0, 2]]], '0.001', '0.02', '0.03'], 0.98], ['control: random budget 23', [[['barrier', [0]], ['ccx', [2, 1, 0]], ['barrier', [0]], ['sx', [1]], ['barrier', [0]], ['id', [0]], ['rz', [2]]], '0.01', '0.01', '0.02'], 0.851457771]], [['regression: random budget 21', [[['measure', [0, 1, 2]], ['rz', [1]], ['x', [1]], ['measure', [0]]], '0.0005', '0.02', '0.03'], 0.884850164], ['regression: random budget 22', [[['measure', [0, 1, 2]], ['rz', [0]], ['cx', [2, 1]]], '0.001', '0.02', '0.03'], 0.89441954], ['regression: random budget 17', [[['ccx', [2, 1, 0]], ['id', [0]], ['cx', [1, 2]], ['cx', [1, 0]], ['measure', [1, 2]], ['ccx', [0, 2, 1]], ['x', [0]], ['barrier', [0]]], '0.0005', '0.02', '0.03'], 0.702395465], ['control: random budget 25', [[['barrier', [0]], ['ccx', [2, 1, 0]], ['x', [1]], ['measure', [1]], ['cx', [2, 1]]], '0.0005', '0.05', '0.02'], 0.680956386], ['control: random budget 27', [[['ccx', [2, 0, 1]], ['ccx', [0, 2, 1]], ['barrier', [0]], ['barrier', [0]], ['cx', [0, 1]], ['cx', [1, 0]], ['h', [0]], ['sx', [0]]], '0.0005', '0.01', '0.02'], 0.860099497], ['control: random budget 28', [[['cx', [1, 0]], ['rz', [0]], ['sx', [0]], ['ccx', [0, 1, 2]], ['barrier', [0]]], '0.001', '0.05', '0.03'], 0.691385265], ['control: random budget 29', [[['ccx', [0, 1, 2]], ['rz', [1]], ['ccx', [1, 0, 2]], ['cx', [0, 1]], ['barrier', [0]]], '0.0005', '0.01', '0.03'], 0.86965681]]]
for label, args, expected in fixtures[N-1]:
    check(label, solve(args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
regression: measure two qubits0.980.9604Failed
regression: random budget 00.979510.940721404Failed
regression: random budget 80.8818603620.855404551Failed
control: virtual rz only1.01.0Passed
control: one cx0.990.99Passed
control: toffoli0.9330406420.933040642Passed
control: sx pulse0.9990.999Passed

SHA-256 / 4a7ae0806bc5d54a9d476d64e0338a2a8d34b50c985d79638609eb96883f37e6

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(x):
    ops, e1, e2, er = x[0], Fraction(x[1]), Fraction(x[2]), Fraction(x[3])
    p = Fraction(1)
    for op in ops:
        name, qs = op[0], op[1]
        if name in ('barrier', 'id', 'rz'):
            continue
        if name == 'measure':
            p *= 1 - er * len(qs)
        elif len(qs) == 1:
            p *= 1 - e1
        elif len(qs) == 2:
            p *= 1 - e2
        else:
            p *= (1 - e2) ** 6 * (1 - e1) ** 9
    return round(float(p), 9) + 0.0
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression: measure two qubits', [[['measure', [0, 1]]], '0.001', '0.01', '0.02'], 0.9604], ['regression: random budget 0', [[['rz', [2]], ['id', [0]], ['barrier', [0]], ['measure', [0, 1, 2]], ['x', [1]], ['barrier', [0]]], '0.0005', '0.02', '0.02'], 0.940721404], ['regression: random budget 8', [[['measure', [1]], ['rz', [2]], ['ccx', [1, 0, 2]], ['id', [0]], ['measure', [1, 2]], ['barrier', [0]]], '0.0005', '0.01', '0.03'], 0.855404551], ['control: virtual rz only', [[['rz', [0]], ['rz', [1]]], '0.001', '0.01', '0.02'], 1.0], ['control: one cx', [[['cx', [0, 1]]], '0.001', '0.01', '0.02'], 0.99], ['control: toffoli', [[['ccx', [0, 1, 2]]], '0.001', '0.01', '0.02'], 0.933040642], ['control: sx pulse', [[['sx', [0]]], '0.001', '0.01', '0.02'], 0.999]], [['regression: random budget 10', [[['measure', [1, 2]], ['rz', [2]], ['cx', [2, 0]], ['h', [0]], ['x', [2]]], '0.0005', '0.05', '0.03'], 0.892961368], ['regression: random budget 11', [[['ccx', [1, 2, 0]], ['measure', [0, 1, 2]], ['x', [2]], ['cx', [1, 2]], ['ccx', [1, 2, 0]], ['rz', [2]], ['rz', [1]], ['id', [0]]], '0.001', '0.02', '0.02'], 0.710168635], ['regression: random budget 8', [[['measure', [1]], ['rz', [2]], ['ccx', [1, 0, 2]], ['id', [0]], ['measure', [1, 2]], ['barrier', [0]]], '0.0005', '0.01', '0.03'], 0.855404551], ['control: barrier and id', [[['barrier', [0, 1]], ['id', [0]]], '0.1', '0.1', '0.1'], 1.0], ['control: random budget 1', [[['rz', [1]], ['ccx', [2, 0, 1]], ['measure', [2]], ['rz', [1]], ['rz', [1]], ['cx', [1, 2]]], '0.001', '0.01', '0.03'], 0.895998929], ['control: random budget 2', [[['cx', [0, 2]]], '0.001', '0.01', '0.02'], 0.99], ['control: random budget 3', [[['rz', [1]]], '0.01', '0.02', '0.02'], 1.0]], [['regression: random budget 15', [[['measure', [1, 2]], ['h', [2]], ['cx', [1, 2]], ['x', [0]], ['cx', [2, 0]], ['cx', [0, 2]], ['measure', [2]], ['rz', [2]]], '0.0005', '0.01', '0.03'], 0.884680355], ['regression: random budget 16', [[['cx', [0, 2]], ['rz', [0]], ['h', [0]], ['measure', [0, 1, 2]], ['rz', [0]], ['rz', [1]]], '0.0005', '0.02', '0.03'], 0.89397233], ['regression: random budget 11', [[['ccx', [1, 2, 0]], ['measure', [0, 1, 2]], ['x', [2]], ['cx', [1, 2]], ['ccx', [1, 2, 0]], ['rz', [2]], ['rz', [1]], ['id', [0]]], '0.001', '0.02', '0.02'], 0.710168635], ['control: random budget 4', [[['cx', [2, 1]], ['ccx', [1, 0, 2]], ['h', [0]], ['x', [2]]], '0.001', '0.02', '0.02'], 0.858623756], ['control: random budget 5', [[['cx', [1, 0]]], '0.001', '0.01', '0.03'], 0.99], ['control: random budget 6', [[['rz', [2]], ['ccx', [1, 0, 2]], ['ccx', [1, 0, 2]], ['rz', [0]], ['h', [2]], ['cx', [0, 2]]], '0.001', '0.05', '0.02'], 0.50367587], ['control: random budget 7', [[['ccx', [0, 1, 2]], ['barrier', [0]], ['ccx', [0, 1, 2]], ['id', [0]], ['barrier', [0]], ['measure', [1]], ['rz', [2]]], '0.001', '0.02', '0.02'], 0.755297022]], [['regression: random budget 18', [[['measure', [0, 1]], ['sx', [1]], ['id', [0]], ['rz', [2]], ['sx', [1]], ['rz', [0]]], '0.001', '0.05', '0.03'], 0.939019141], ['regression: random budget 19', [[['measure', [0, 2]]], '0.01', '0.02', '0.02'], 0.9604], ['regression: random budget 15', [[['measure', [1, 2]], ['h', [2]], ['cx', [1, 2]], ['x', [0]], ['cx', [2, 0]], ['cx', [0, 2]], ['measure', [2]], ['rz', [2]]], '0.0005', '0.01', '0.03'], 0.884680355], ['control: random budget 9', [[['ccx', [1, 0, 2]], ['id', [0]], ['cx', [0, 2]], ['rz', [0]], ['ccx', [0, 2, 1]]], '0.001', '0.01', '0.03'], 0.861859192], ['control: random budget 12', [[['barrier', [0]], ['rz', [1]], ['cx', [0, 2]], ['rz', [2]], ['rz', [1]], ['cx', [2, 1]]], '0.0005', '0.02', '0.02'], 0.9604], ['control: random budget 13', [[['cx', [0, 2]]], '0.001', '0.02', '0.03'], 0.98], ['control: random budget 23', [[['barrier', [0]], ['ccx', [2, 1, 0]], ['barrier', [0]], ['sx', [1]], ['barrier', [0]], ['id', [0]], ['rz', [2]]], '0.01', '0.01', '0.02'], 0.851457771]], [['regression: random budget 21', [[['measure', [0, 1, 2]], ['rz', [1]], ['x', [1]], ['measure', [0]]], '0.0005', '0.02', '0.03'], 0.884850164], ['regression: random budget 22', [[['measure', [0, 1, 2]], ['rz', [0]], ['cx', [2, 1]]], '0.001', '0.02', '0.03'], 0.89441954], ['regression: random budget 17', [[['ccx', [2, 1, 0]], ['id', [0]], ['cx', [1, 2]], ['cx', [1, 0]], ['measure', [1, 2]], ['ccx', [0, 2, 1]], ['x', [0]], ['barrier', [0]]], '0.0005', '0.02', '0.03'], 0.702395465], ['control: random budget 25', [[['barrier', [0]], ['ccx', [2, 1, 0]], ['x', [1]], ['measure', [1]], ['cx', [2, 1]]], '0.0005', '0.05', '0.02'], 0.680956386], ['control: random budget 27', [[['ccx', [2, 0, 1]], ['ccx', [0, 2, 1]], ['barrier', [0]], ['barrier', [0]], ['cx', [0, 1]], ['cx', [1, 0]], ['h', [0]], ['sx', [0]]], '0.0005', '0.01', '0.02'], 0.860099497], ['control: random budget 28', [[['cx', [1, 0]], ['rz', [0]], ['sx', [0]], ['ccx', [0, 1, 2]], ['barrier', [0]]], '0.001', '0.05', '0.03'], 0.691385265], ['control: random budget 29', [[['ccx', [0, 1, 2]], ['rz', [1]], ['ccx', [1, 0, 2]], ['cx', [0, 1]], ['barrier', [0]]], '0.0005', '0.01', '0.03'], 0.86965681]]]
for label, args, expected in fixtures[N-1]:
    check(label, solve(args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
regression: measure two qubits0.960.9604Failed
regression: random budget 00.939530.940721404Failed
regression: random budget 80.854586330.855404551Failed
control: virtual rz only1.01.0Passed
control: one cx0.990.99Passed
control: toffoli0.9330406420.933040642Passed
control: sx pulse0.9990.999Passed

SHA-256 / 9b1d0e51c4c39a2461faf60115e201db6065cc6f5f5b95889c03dc7f88f03fae

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(x):
    ops, e1, e2, er = x[0], Fraction(x[1]), Fraction(x[2]), Fraction(x[3])
    p = Fraction(1)
    for op in ops:
        name, qs = op[0], op[1]
        if name in ('barrier', 'id', 'rz'):
            continue
        if name == 'measure':
            p *= (1 - er) ** len(qs)
        elif len(qs) == 1:
            p *= 1 - e1
        elif len(qs) == 2:
            p *= 1 - e2
        else:
            p *= (1 - e2) ** 6 * (1 - e1) ** 9
    return round(float(p), 9) + 0.0
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression: measure two qubits', [[['measure', [0, 1]]], '0.001', '0.01', '0.02'], 0.9604], ['regression: random budget 0', [[['rz', [2]], ['id', [0]], ['barrier', [0]], ['measure', [0, 1, 2]], ['x', [1]], ['barrier', [0]]], '0.0005', '0.02', '0.02'], 0.940721404], ['regression: random budget 8', [[['measure', [1]], ['rz', [2]], ['ccx', [1, 0, 2]], ['id', [0]], ['measure', [1, 2]], ['barrier', [0]]], '0.0005', '0.01', '0.03'], 0.855404551], ['control: virtual rz only', [[['rz', [0]], ['rz', [1]]], '0.001', '0.01', '0.02'], 1.0], ['control: one cx', [[['cx', [0, 1]]], '0.001', '0.01', '0.02'], 0.99], ['control: toffoli', [[['ccx', [0, 1, 2]]], '0.001', '0.01', '0.02'], 0.933040642], ['control: sx pulse', [[['sx', [0]]], '0.001', '0.01', '0.02'], 0.999]], [['regression: random budget 10', [[['measure', [1, 2]], ['rz', [2]], ['cx', [2, 0]], ['h', [0]], ['x', [2]]], '0.0005', '0.05', '0.03'], 0.892961368], ['regression: random budget 11', [[['ccx', [1, 2, 0]], ['measure', [0, 1, 2]], ['x', [2]], ['cx', [1, 2]], ['ccx', [1, 2, 0]], ['rz', [2]], ['rz', [1]], ['id', [0]]], '0.001', '0.02', '0.02'], 0.710168635], ['regression: random budget 8', [[['measure', [1]], ['rz', [2]], ['ccx', [1, 0, 2]], ['id', [0]], ['measure', [1, 2]], ['barrier', [0]]], '0.0005', '0.01', '0.03'], 0.855404551], ['control: barrier and id', [[['barrier', [0, 1]], ['id', [0]]], '0.1', '0.1', '0.1'], 1.0], ['control: random budget 1', [[['rz', [1]], ['ccx', [2, 0, 1]], ['measure', [2]], ['rz', [1]], ['rz', [1]], ['cx', [1, 2]]], '0.001', '0.01', '0.03'], 0.895998929], ['control: random budget 2', [[['cx', [0, 2]]], '0.001', '0.01', '0.02'], 0.99], ['control: random budget 3', [[['rz', [1]]], '0.01', '0.02', '0.02'], 1.0]], [['regression: random budget 15', [[['measure', [1, 2]], ['h', [2]], ['cx', [1, 2]], ['x', [0]], ['cx', [2, 0]], ['cx', [0, 2]], ['measure', [2]], ['rz', [2]]], '0.0005', '0.01', '0.03'], 0.884680355], ['regression: random budget 16', [[['cx', [0, 2]], ['rz', [0]], ['h', [0]], ['measure', [0, 1, 2]], ['rz', [0]], ['rz', [1]]], '0.0005', '0.02', '0.03'], 0.89397233], ['regression: random budget 11', [[['ccx', [1, 2, 0]], ['measure', [0, 1, 2]], ['x', [2]], ['cx', [1, 2]], ['ccx', [1, 2, 0]], ['rz', [2]], ['rz', [1]], ['id', [0]]], '0.001', '0.02', '0.02'], 0.710168635], ['control: random budget 4', [[['cx', [2, 1]], ['ccx', [1, 0, 2]], ['h', [0]], ['x', [2]]], '0.001', '0.02', '0.02'], 0.858623756], ['control: random budget 5', [[['cx', [1, 0]]], '0.001', '0.01', '0.03'], 0.99], ['control: random budget 6', [[['rz', [2]], ['ccx', [1, 0, 2]], ['ccx', [1, 0, 2]], ['rz', [0]], ['h', [2]], ['cx', [0, 2]]], '0.001', '0.05', '0.02'], 0.50367587], ['control: random budget 7', [[['ccx', [0, 1, 2]], ['barrier', [0]], ['ccx', [0, 1, 2]], ['id', [0]], ['barrier', [0]], ['measure', [1]], ['rz', [2]]], '0.001', '0.02', '0.02'], 0.755297022]], [['regression: random budget 18', [[['measure', [0, 1]], ['sx', [1]], ['id', [0]], ['rz', [2]], ['sx', [1]], ['rz', [0]]], '0.001', '0.05', '0.03'], 0.939019141], ['regression: random budget 19', [[['measure', [0, 2]]], '0.01', '0.02', '0.02'], 0.9604], ['regression: random budget 15', [[['measure', [1, 2]], ['h', [2]], ['cx', [1, 2]], ['x', [0]], ['cx', [2, 0]], ['cx', [0, 2]], ['measure', [2]], ['rz', [2]]], '0.0005', '0.01', '0.03'], 0.884680355], ['control: random budget 9', [[['ccx', [1, 0, 2]], ['id', [0]], ['cx', [0, 2]], ['rz', [0]], ['ccx', [0, 2, 1]]], '0.001', '0.01', '0.03'], 0.861859192], ['control: random budget 12', [[['barrier', [0]], ['rz', [1]], ['cx', [0, 2]], ['rz', [2]], ['rz', [1]], ['cx', [2, 1]]], '0.0005', '0.02', '0.02'], 0.9604], ['control: random budget 13', [[['cx', [0, 2]]], '0.001', '0.02', '0.03'], 0.98], ['control: random budget 23', [[['barrier', [0]], ['ccx', [2, 1, 0]], ['barrier', [0]], ['sx', [1]], ['barrier', [0]], ['id', [0]], ['rz', [2]]], '0.01', '0.01', '0.02'], 0.851457771]], [['regression: random budget 21', [[['measure', [0, 1, 2]], ['rz', [1]], ['x', [1]], ['measure', [0]]], '0.0005', '0.02', '0.03'], 0.884850164], ['regression: random budget 22', [[['measure', [0, 1, 2]], ['rz', [0]], ['cx', [2, 1]]], '0.001', '0.02', '0.03'], 0.89441954], ['regression: random budget 17', [[['ccx', [2, 1, 0]], ['id', [0]], ['cx', [1, 2]], ['cx', [1, 0]], ['measure', [1, 2]], ['ccx', [0, 2, 1]], ['x', [0]], ['barrier', [0]]], '0.0005', '0.02', '0.03'], 0.702395465], ['control: random budget 25', [[['barrier', [0]], ['ccx', [2, 1, 0]], ['x', [1]], ['measure', [1]], ['cx', [2, 1]]], '0.0005', '0.05', '0.02'], 0.680956386], ['control: random budget 27', [[['ccx', [2, 0, 1]], ['ccx', [0, 2, 1]], ['barrier', [0]], ['barrier', [0]], ['cx', [0, 1]], ['cx', [1, 0]], ['h', [0]], ['sx', [0]]], '0.0005', '0.01', '0.02'], 0.860099497], ['control: random budget 28', [[['cx', [1, 0]], ['rz', [0]], ['sx', [0]], ['ccx', [0, 1, 2]], ['barrier', [0]]], '0.001', '0.05', '0.03'], 0.691385265], ['control: random budget 29', [[['ccx', [0, 1, 2]], ['rz', [1]], ['ccx', [1, 0, 2]], ['cx', [0, 1]], ['barrier', [0]]], '0.0005', '0.01', '0.03'], 0.86965681]]]
for label, args, expected in fixtures[N-1]:
    check(label, solve(args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
regression: measure two qubits0.96040.9604Passed
regression: random budget 00.9407214040.940721404Passed
regression: random budget 80.8554045510.855404551Passed
control: virtual rz only1.01.0Passed
control: one cx0.990.99Passed
control: toffoli0.9330406420.933040642Passed
control: sx pulse0.9990.999Passed

SHA-256 / ab2222f427280e3d1a1cad89a02c78ac3639fc30f628e879f1acdc3bb0288d51

Verification & scope

A deterministic bounded teaching model with a stipulated toy contract; amplitudes are rounded to fixed decimals for strict JSON output. It is not a production quantum SDK and claims no standards conformance. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.

Observations recorded using Python 3.12.14 at 2026-09-29T14:51:34.143224+00:00.

Case digest / 5c602489deed921b71ab957e9a5337db810096d7f280159e7446ed63b3879f3d