{"abstract":"Measuring three qubits in one op costs (1-er) instead of (1-er)^3.","category":"Quantum circuit simulation","checks":7,"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.","contract_signature":"x","evaluation_group":"w2-quantum_circuit_simulation-gate-error-budget","failed_approach":"The attempted repair uses the linearized 1 - er*k, which overstates success for several qubits.","family":"w2-quantum_circuit_simulation-gate-error-budget-multi-qubit-readout-charge","id":"FA-91231","implementations":{"attempt":{"sha256":"9b1d0e51c4c39a2461faf60115e201db6065cc6f5f5b95889c03dc7f88f03fae","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(x):\n    ops, e1, e2, er = x[0], Fraction(x[1]), Fraction(x[2]), Fraction(x[3])\n    p = Fraction(1)\n    for op in ops:\n        name, qs = op[0], op[1]\n        if name in ('barrier', 'id', 'rz'):\n            continue\n        if name == 'measure':\n            p *= 1 - er * len(qs)\n        elif len(qs) == 1:\n            p *= 1 - e1\n        elif len(qs) == 2:\n            p *= 1 - e2\n        else:\n            p *= (1 - e2) ** 6 * (1 - e1) ** 9\n    return round(float(p), 9) + 0.0\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['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]]]\nfor label, args, expected in fixtures[N-1]:\n    check(label, solve(args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"broken":{"sha256":"4a7ae0806bc5d54a9d476d64e0338a2a8d34b50c985d79638609eb96883f37e6","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(x):\n    ops, e1, e2, er = x[0], Fraction(x[1]), Fraction(x[2]), Fraction(x[3])\n    p = Fraction(1)\n    for op in ops:\n        name, qs = op[0], op[1]\n        if name in ('barrier', 'id', 'rz'):\n            continue\n        if name == 'measure':\n            p *= 1 - er\n        elif len(qs) == 1:\n            p *= 1 - e1\n        elif len(qs) == 2:\n            p *= 1 - e2\n        else:\n            p *= (1 - e2) ** 6 * (1 - e1) ** 9\n    return round(float(p), 9) + 0.0\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['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]]]\nfor label, args, expected in fixtures[N-1]:\n    check(label, solve(args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"}},"limitations":"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.","method":"Deterministic executable model with adversarial boundary fixtures.","provenance":{"created_by":"Failure Map","dependencies":"Python standard library","family":"w2-quantum_circuit_simulation-gate-error-budget-multi-qubit-readout-charge","generated_at":"2026-09-29T14:51:34.143224+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Error budgets guide which circuit variant to run on hardware; miscounting gate classes skews every comparison.","root_cause":"The measurement branch ignores how many qubits the op reads.","sha256":"28fd830a1626115040732df2cfb9a7c3a47426a7cf96b5190a87a231cee2dcd1","title":"Error budget charges a register measurement once · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":44.535,"exit_code":1,"observations":[{"actual":0.96,"check":"regression: measure two qubits","expected":0.9604,"passed":false},{"actual":0.93953,"check":"regression: random budget 0","expected":0.940721404,"passed":false},{"actual":0.85458633,"check":"regression: random budget 8","expected":0.855404551,"passed":false},{"actual":1.0,"check":"control: virtual rz only","expected":1.0,"passed":true},{"actual":0.99,"check":"control: one cx","expected":0.99,"passed":true},{"actual":0.933040642,"check":"control: toffoli","expected":0.933040642,"passed":true},{"actual":0.999,"check":"control: sx pulse","expected":0.999,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: measure two qubits\", \"actual\": 0.96, \"expected\": 0.9604, \"passed\": false}, {\"check\": \"regression: random budget 0\", \"actual\": 0.93953, \"expected\": 0.940721404, \"passed\": false}, {\"check\": \"regression: random budget 8\", \"actual\": 0.85458633, \"expected\": 0.855404551, \"passed\": false}, {\"check\": \"control: virtual rz only\", \"actual\": 1.0, \"expected\": 1.0, \"passed\": true}, {\"check\": \"control: one cx\", \"actual\": 0.99, \"expected\": 0.99, \"passed\": true}, {\"check\": \"control: toffoli\", \"actual\": 0.933040642, \"expected\": 0.933040642, \"passed\": true}, {\"check\": \"control: sx pulse\", \"actual\": 0.999, \"expected\": 0.999, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":44.381,"exit_code":1,"observations":[{"actual":0.98,"check":"regression: measure two qubits","expected":0.9604,"passed":false},{"actual":0.97951,"check":"regression: random budget 0","expected":0.940721404,"passed":false},{"actual":0.881860362,"check":"regression: random budget 8","expected":0.855404551,"passed":false},{"actual":1.0,"check":"control: virtual rz only","expected":1.0,"passed":true},{"actual":0.99,"check":"control: one cx","expected":0.99,"passed":true},{"actual":0.933040642,"check":"control: toffoli","expected":0.933040642,"passed":true},{"actual":0.999,"check":"control: sx pulse","expected":0.999,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: measure two qubits\", \"actual\": 0.98, \"expected\": 0.9604, \"passed\": false}, {\"check\": \"regression: random budget 0\", \"actual\": 0.97951, \"expected\": 0.940721404, \"passed\": false}, {\"check\": \"regression: random budget 8\", \"actual\": 0.881860362, \"expected\": 0.855404551, \"passed\": false}, {\"check\": \"control: virtual rz only\", \"actual\": 1.0, \"expected\": 1.0, \"passed\": true}, {\"check\": \"control: one cx\", \"actual\": 0.99, \"expected\": 0.99, \"passed\": true}, {\"check\": \"control: toffoli\", \"actual\": 0.933040642, \"expected\": 0.933040642, \"passed\": true}, {\"check\": \"control: sx pulse\", \"actual\": 0.999, \"expected\": 0.999, \"passed\": true}], \"passed\": false}\n"}},"member_only":{"stages":["fixed"],"fields":["implementations.fixed","verification.fixed","harness","repair"],"note":"The verified repair, its recorded checks, the repair description, and the scoring harness are available to members."}}