{"abstract":"A Toffoli costs (1-e2) instead of its six-CNOT, nine-single-qubit decomposition.","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.","evaluation_group":"w2-quantum_circuit_simulation-gate-error-budget","failed_approach":"The attempted repair charges only the six CNOTs and forgets the nine single-qubit gates.","family":"w2-quantum_circuit_simulation-gate-error-budget-three-qubit-decomposition-charge","id":"FA-91236","implementations":{"attempt":{"sha256":"6be6d228e8b1e5ed05fedf5975df2dcee3af362371ba51cf3a8d769e9d613768","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\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: toffoli', [[['ccx', [0, 1, 2]]], '0.001', '0.01', '0.02'], 0.933040642], ['regression: 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], ['regression: random budget 4', [[['cx', [2, 1]], ['ccx', [1, 0, 2]], ['h', [0]], ['x', [2]]], '0.001', '0.02', '0.02'], 0.858623756], ['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: measure two qubits', [[['measure', [0, 1]]], '0.001', '0.01', '0.02'], 0.9604], ['control: sx pulse', [[['sx', [0]]], '0.001', '0.01', '0.02'], 0.999]], [['regression: 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], ['regression: 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 4', [[['cx', [2, 1]], ['ccx', [1, 0, 2]], ['h', [0]], ['x', [2]]], '0.001', '0.02', '0.02'], 0.858623756], ['control: barrier and id', [[['barrier', [0, 1]], ['id', [0]]], '0.1', '0.1', '0.1'], 1.0], ['control: 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], ['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 9', [[['ccx', [1, 0, 2]], ['id', [0]], ['cx', [0, 2]], ['rz', [0]], ['ccx', [0, 2, 1]]], '0.001', '0.01', '0.03'], 0.861859192], ['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 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], ['control: random budget 5', [[['cx', [1, 0]]], '0.001', '0.01', '0.03'], 0.99], ['control: random budget 10', [[['measure', [1, 2]], ['rz', [2]], ['cx', [2, 0]], ['h', [0]], ['x', [2]]], '0.0005', '0.05', '0.03'], 0.892961368], ['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]], [['regression: 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 25', [[['barrier', [0]], ['ccx', [2, 1, 0]], ['x', [1]], ['measure', [1]], ['cx', [2, 1]]], '0.0005', '0.05', '0.02'], 0.680956386], ['regression: 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 14', [[['cx', [1, 0]], ['measure', [1, 2]], ['cx', [1, 0]], ['id', [0]], ['cx', [1, 0]], ['h', [0]]], '0.0005', '0.01', '0.03'], 0.912497852], ['control: 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 16', [[['cx', [0, 2]], ['rz', [0]], ['h', [0]], ['measure', [0, 1, 2]], ['rz', [0]], ['rz', [1]]], '0.0005', '0.02', '0.03'], 0.89397233], ['control: 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 28', [[['cx', [1, 0]], ['rz', [0]], ['sx', [0]], ['ccx', [0, 1, 2]], ['barrier', [0]]], '0.001', '0.05', '0.03'], 0.691385265], ['regression: 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], ['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 19', [[['measure', [0, 2]]], '0.01', '0.02', '0.02'], 0.9604], ['control: random budget 20', [[['cx', [2, 1]], ['rz', [0]], ['cx', [0, 2]], ['measure', [0, 1]], ['rz', [1]]], '0.01', '0.05', '0.02'], 0.866761], ['control: random budget 21', [[['measure', [0, 1, 2]], ['rz', [1]], ['x', [1]], ['measure', [0]]], '0.0005', '0.02', '0.03'], 0.884850164], ['control: random budget 22', [[['measure', [0, 1, 2]], ['rz', [0]], ['cx', [2, 1]]], '0.001', '0.02', '0.03'], 0.89441954]]]\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":"b6730fdd3498f51756f93bd659bb1c44e0475056df06ca955787163eec6156a6","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\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: toffoli', [[['ccx', [0, 1, 2]]], '0.001', '0.01', '0.02'], 0.933040642], ['regression: 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], ['regression: random budget 4', [[['cx', [2, 1]], ['ccx', [1, 0, 2]], ['h', [0]], ['x', [2]]], '0.001', '0.02', '0.02'], 0.858623756], ['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: measure two qubits', [[['measure', [0, 1]]], '0.001', '0.01', '0.02'], 0.9604], ['control: sx pulse', [[['sx', [0]]], '0.001', '0.01', '0.02'], 0.999]], [['regression: 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], ['regression: 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 4', [[['cx', [2, 1]], ['ccx', [1, 0, 2]], ['h', [0]], ['x', [2]]], '0.001', '0.02', '0.02'], 0.858623756], ['control: barrier and id', [[['barrier', [0, 1]], ['id', [0]]], '0.1', '0.1', '0.1'], 1.0], ['control: 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], ['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 9', [[['ccx', [1, 0, 2]], ['id', [0]], ['cx', [0, 2]], ['rz', [0]], ['ccx', [0, 2, 1]]], '0.001', '0.01', '0.03'], 0.861859192], ['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 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], ['control: random budget 5', [[['cx', [1, 0]]], '0.001', '0.01', '0.03'], 0.99], ['control: random budget 10', [[['measure', [1, 2]], ['rz', [2]], ['cx', [2, 0]], ['h', [0]], ['x', [2]]], '0.0005', '0.05', '0.03'], 0.892961368], ['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]], [['regression: 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 25', [[['barrier', [0]], ['ccx', [2, 1, 0]], ['x', [1]], ['measure', [1]], ['cx', [2, 1]]], '0.0005', '0.05', '0.02'], 0.680956386], ['regression: 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 14', [[['cx', [1, 0]], ['measure', [1, 2]], ['cx', [1, 0]], ['id', [0]], ['cx', [1, 0]], ['h', [0]]], '0.0005', '0.01', '0.03'], 0.912497852], ['control: 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 16', [[['cx', [0, 2]], ['rz', [0]], ['h', [0]], ['measure', [0, 1, 2]], ['rz', [0]], ['rz', [1]]], '0.0005', '0.02', '0.03'], 0.89397233], ['control: 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 28', [[['cx', [1, 0]], ['rz', [0]], ['sx', [0]], ['ccx', [0, 1, 2]], ['barrier', [0]]], '0.001', '0.05', '0.03'], 0.691385265], ['regression: 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], ['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 19', [[['measure', [0, 2]]], '0.01', '0.02', '0.02'], 0.9604], ['control: random budget 20', [[['cx', [2, 1]], ['rz', [0]], ['cx', [0, 2]], ['measure', [0, 1]], ['rz', [1]]], '0.01', '0.05', '0.02'], 0.866761], ['control: random budget 21', [[['measure', [0, 1, 2]], ['rz', [1]], ['x', [1]], ['measure', [0]]], '0.0005', '0.02', '0.03'], 0.884850164], ['control: random budget 22', [[['measure', [0, 1, 2]], ['rz', [0]], ['cx', [2, 1]]], '0.001', '0.02', '0.03'], 0.89441954]]]\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"},"fixed":{"sha256":"842b7345c20117c1498fe0542b03bb8179def3d5a8cf6774c4d77d64e04681d4","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: toffoli', [[['ccx', [0, 1, 2]]], '0.001', '0.01', '0.02'], 0.933040642], ['regression: 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], ['regression: random budget 4', [[['cx', [2, 1]], ['ccx', [1, 0, 2]], ['h', [0]], ['x', [2]]], '0.001', '0.02', '0.02'], 0.858623756], ['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: measure two qubits', [[['measure', [0, 1]]], '0.001', '0.01', '0.02'], 0.9604], ['control: sx pulse', [[['sx', [0]]], '0.001', '0.01', '0.02'], 0.999]], [['regression: 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], ['regression: 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 4', [[['cx', [2, 1]], ['ccx', [1, 0, 2]], ['h', [0]], ['x', [2]]], '0.001', '0.02', '0.02'], 0.858623756], ['control: barrier and id', [[['barrier', [0, 1]], ['id', [0]]], '0.1', '0.1', '0.1'], 1.0], ['control: 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], ['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 9', [[['ccx', [1, 0, 2]], ['id', [0]], ['cx', [0, 2]], ['rz', [0]], ['ccx', [0, 2, 1]]], '0.001', '0.01', '0.03'], 0.861859192], ['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 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], ['control: random budget 5', [[['cx', [1, 0]]], '0.001', '0.01', '0.03'], 0.99], ['control: random budget 10', [[['measure', [1, 2]], ['rz', [2]], ['cx', [2, 0]], ['h', [0]], ['x', [2]]], '0.0005', '0.05', '0.03'], 0.892961368], ['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]], [['regression: 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 25', [[['barrier', [0]], ['ccx', [2, 1, 0]], ['x', [1]], ['measure', [1]], ['cx', [2, 1]]], '0.0005', '0.05', '0.02'], 0.680956386], ['regression: 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 14', [[['cx', [1, 0]], ['measure', [1, 2]], ['cx', [1, 0]], ['id', [0]], ['cx', [1, 0]], ['h', [0]]], '0.0005', '0.01', '0.03'], 0.912497852], ['control: 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 16', [[['cx', [0, 2]], ['rz', [0]], ['h', [0]], ['measure', [0, 1, 2]], ['rz', [0]], ['rz', [1]]], '0.0005', '0.02', '0.03'], 0.89397233], ['control: 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 28', [[['cx', [1, 0]], ['rz', [0]], ['sx', [0]], ['ccx', [0, 1, 2]], ['barrier', [0]]], '0.001', '0.05', '0.03'], 0.691385265], ['regression: 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], ['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 19', [[['measure', [0, 2]]], '0.01', '0.02', '0.02'], 0.9604], ['control: random budget 20', [[['cx', [2, 1]], ['rz', [0]], ['cx', [0, 2]], ['measure', [0, 1]], ['rz', [1]]], '0.01', '0.05', '0.02'], 0.866761], ['control: random budget 21', [[['measure', [0, 1, 2]], ['rz', [1]], ['x', [1]], ['measure', [0]]], '0.0005', '0.02', '0.03'], 0.884850164], ['control: random budget 22', [[['measure', [0, 1, 2]], ['rz', [0]], ['cx', [2, 1]]], '0.001', '0.02', '0.03'], 0.89441954]]]\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-three-qubit-decomposition-charge","generated_at":"2026-09-29T14:51:34.155083+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.","repair":"Charge (1-e2)^6 (1-e1)^9 for three-qubit gates.","root_cause":"The fallback branch for three-qubit gates reuses the two-qubit charge.","sha256":"e166de810f70f6451059384c8818fb8f7da3bd7c5aee92a0927e010aac4139bb","title":"Error budget prices a Toffoli like one CNOT · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":44.814,"exit_code":1,"observations":[{"actual":0.941480149,"check":"regression: toffoli","expected":0.933040642,"passed":false},{"actual":0.904103387,"check":"regression: random budget 1","expected":0.895998929,"passed":false},{"actual":0.86639015,"check":"regression: random budget 4","expected":0.858623756,"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.9604,"check":"control: measure two qubits","expected":0.9604,"passed":true},{"actual":0.999,"check":"control: sx pulse","expected":0.999,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: toffoli\", \"actual\": 0.941480149, \"expected\": 0.933040642, \"passed\": false}, {\"check\": \"regression: random budget 1\", \"actual\": 0.904103387, \"expected\": 0.895998929, \"passed\": false}, {\"check\": \"regression: random budget 4\", \"actual\": 0.86639015, \"expected\": 0.858623756, \"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: measure two qubits\", \"actual\": 0.9604, \"expected\": 0.9604, \"passed\": true}, {\"check\": \"control: sx pulse\", \"actual\": 0.999, \"expected\": 0.999, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":44.713,"exit_code":1,"observations":[{"actual":0.99,"check":"regression: toffoli","expected":0.933040642,"passed":false},{"actual":0.950697,"check":"regression: random budget 1","expected":0.895998929,"passed":false},{"actual":0.95848016,"check":"regression: random budget 4","expected":0.858623756,"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.9604,"check":"control: measure two qubits","expected":0.9604,"passed":true},{"actual":0.999,"check":"control: sx pulse","expected":0.999,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: toffoli\", \"actual\": 0.99, \"expected\": 0.933040642, \"passed\": false}, {\"check\": \"regression: random budget 1\", \"actual\": 0.950697, \"expected\": 0.895998929, \"passed\": false}, {\"check\": \"regression: random budget 4\", \"actual\": 0.95848016, \"expected\": 0.858623756, \"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: measure two qubits\", \"actual\": 0.9604, \"expected\": 0.9604, \"passed\": true}, {\"check\": \"control: sx pulse\", \"actual\": 0.999, \"expected\": 0.999, \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":44.413,"exit_code":0,"observations":[{"actual":0.933040642,"check":"regression: toffoli","expected":0.933040642,"passed":true},{"actual":0.895998929,"check":"regression: random budget 1","expected":0.895998929,"passed":true},{"actual":0.858623756,"check":"regression: random budget 4","expected":0.858623756,"passed":true},{"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.9604,"check":"control: measure two qubits","expected":0.9604,"passed":true},{"actual":0.999,"check":"control: sx pulse","expected":0.999,"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: toffoli\", \"actual\": 0.933040642, \"expected\": 0.933040642, \"passed\": true}, {\"check\": \"regression: random budget 1\", \"actual\": 0.895998929, \"expected\": 0.895998929, \"passed\": true}, {\"check\": \"regression: random budget 4\", \"actual\": 0.858623756, \"expected\": 0.858623756, \"passed\": true}, {\"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: measure two qubits\", \"actual\": 0.9604, \"expected\": 0.9604, \"passed\": true}, {\"check\": \"control: sx pulse\", \"actual\": 0.999, \"expected\": 0.999, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}