{"abstract":"Unnormalized states produce probabilities such as 0.3076923076 with many digits instead of values rounded to 6 decimals.","category":"Quantum circuit simulation","checks":7,"contract":"Input [n, amps, qubits]; amps are 2**n [re, im] pairs (qubit 0 = LSB), possibly unnormalized. Return the marginal outcome distribution over the listed qubits as {bitstring: probability} where the first listed qubit is the rightmost character, probabilities are normalized by the total squared norm, rounded to 6 decimals after summation, and zero entries are omitted. Errors: \"bad-length\", \"duplicate-qubit\", \"bad-qubit\", \"zero-state\" (total squared norm <= 1e-12).","evaluation_group":"w2-quantum_circuit_simulation-marginal-distribution","failed_approach":"The attempted repair rounds the weight, divides by the exact total and rounds again, a double rounding that drifts from single rounding.","family":"w2-quantum_circuit_simulation-marginal-distribution-rounding-stage","id":"FA-90896","implementations":{"attempt":{"sha256":"4b66dfb4e6b12e68c2a2e3bd714e923098f8ec55b3057dbff3ecc81a33aefa54","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(x):\n    n, amps, qubits = x\n    if len(amps) != 1 << n:\n        return 'bad-length'\n    if len(set(qubits)) != len(qubits):\n        return 'duplicate-qubit'\n    if any(q < 0 or q >= n for q in qubits):\n        return 'bad-qubit'\n    total = sum(re * re + im * im for re, im in amps)\n    if total <= 1e-12:\n        return 'zero-state'\n    acc = {}\n    for idx, (a, b) in enumerate(amps):\n        p = a * a + b * b\n        if p == 0:\n            continue\n        key = ''.join('1' if idx >> q & 1 else '0' for q in reversed(qubits))\n        acc[key] = acc.get(key, 0.0) + p\n    out = {}\n    for key in sorted(acc):\n        v = round(round(acc[key], 3) / total, 6)\n        if v > 0:\n            out[key] = v\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression: bell state on both qubits', [2, [[0.707107, 0], [0, 0], [0, 0], [0.707107, 0]], [0, 1]], {'00': 0.5, '11': 0.5}], ['regression: random state 0', [2, [[0.0, 0.0], [0.282, -0.043], [-0.278, 0.017], [0.0, 0.0]], [0, 1]], {'01': 0.511954, '10': 0.488046}], ['repair check: random state 1', [2, [[0.129, 0.125], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0]], [1, 0]], {'00': 1.0}], ['control: reversed qubit list', [2, [[0, 0], [1, 0], [0, 0], [0, 0]], [1, 0]], {'10': 1.0}], ['control: single qubit marginal of |01>', [2, [[0, 0], [1, 0], [0, 0], [0, 0]], [1]], {'0': 1.0}], ['control: out of range qubit equals n', [2, [[1, 0], [0, 0], [0, 0], [0, 0]], [2]], 'bad-qubit'], ['control: negative qubit index', [2, [[1, 0], [0, 0], [0, 0], [0, 0]], [-1]], 'bad-qubit']], [['regression: random state 3', [2, [[0.379, 0.308], [-0.129, -0.524], [0.79, -0.299], [-0.403, -0.327]], [0, 1]], {'00': 0.157683, '01': 0.192532, '10': 0.471717, '11': 0.178068}], ['regression: random state 4', [1, [[-0.217, 0.525], [-0.308, -0.181]], [0]], {'0': 0.716602, '1': 0.283398}], ['regression: random state 2', [1, [[0.541, -0.923], [-0.479, -0.646]], [0]], {'0': 0.638959, '1': 0.361041}], ['control: duplicate qubits', [2, [[0.6, 0], [0, 0.8], [0, 0], [0, 0]], [0, 0]], 'duplicate-qubit'], ['control: wrong amplitude count', [2, [[1, 0], [0, 0]], [0]], 'bad-length'], ['control: all-zero state', [1, [[0, 0], [0, 0]], [0]], 'zero-state'], ['control: unnormalized pair', [1, [[3, 0], [0, 4]], [0]], {'0': 0.36, '1': 0.64}]], [['regression: random state 6', [3, [[-0.119, 0.092], [0.264, -0.223], [-0.189, 0.034], [-0.22, -0.267], [-0.291, -0.092], [0.09, -0.02], [0.062, -0.284], [-0.239, 0.039]], [2]], {'0': 0.54953, '1': 0.45047}], ['regression: random state 7', [1, [[0.725, -0.825], [-0.233, -0.266]], [0]], {'0': 0.906073, '1': 0.093927}], ['regression: random state 4', [1, [[-0.217, 0.525], [-0.308, -0.181]], [0]], {'0': 0.716602, '1': 0.283398}], ['control: near zero state', [1, [[1e-08, 0], [0, 1e-08]], [0]], 'zero-state'], ['control: reversed qubit list', [2, [[0, 0], [1, 0], [0, 0], [0, 0]], [1, 0]], {'10': 1.0}], ['control: single qubit marginal of |01>', [2, [[0, 0], [1, 0], [0, 0], [0, 0]], [1]], {'0': 1.0}], ['control: out of range qubit equals n', [2, [[1, 0], [0, 0], [0, 0], [0, 0]], [2]], 'bad-qubit']], [['regression: random state 10', [3, [[-0.064, 0.212], [0.264, -0.114], [-0.15, -0.24], [0.031, 0.141], [0.037, -0.002], [0.023, -0.229], [0.193, -0.153], [0.251, 0.097]], [0, 1, 2]], {'000': 0.116738, '001': 0.196846, '010': 0.190676, '011': 0.049614, '100': 0.003268, '101': 0.126094, '110': 0.144395, '111': 0.17237}], ['regression: random state 11', [2, [[-0.211, 0.28], [0.154, -0.18], [-0.016, -0.095], [-0.157, 0.075]], [0]], {'0': 0.604789, '1': 0.395211}], ['regression: random state 6', [3, [[-0.119, 0.092], [0.264, -0.223], [-0.189, 0.034], [-0.22, -0.267], [-0.291, -0.092], [0.09, -0.02], [0.062, -0.284], [-0.239, 0.039]], [2]], {'0': 0.54953, '1': 0.45047}], ['control: negative qubit index', [2, [[1, 0], [0, 0], [0, 0], [0, 0]], [-1]], 'bad-qubit'], ['control: duplicate qubits', [2, [[0.6, 0], [0, 0.8], [0, 0], [0, 0]], [0, 0]], 'duplicate-qubit'], ['control: wrong amplitude count', [2, [[1, 0], [0, 0]], [0]], 'bad-length'], ['control: all-zero state', [1, [[0, 0], [0, 0]], [0]], 'zero-state']], [['regression: random state 13', [3, [[0.624, -0.422], [-0.596, 0.926], [-0.719, 1.0], [-0.208, -0.957], [-0.398, 0.533], [-0.189, -0.721], [-0.845, -0.901], [0.144, -0.267]], [0, 1, 2]], {'000': 0.082574, '001': 0.176465, '010': 0.220741, '011': 0.139566, '100': 0.064389, '101': 0.080843, '110': 0.222031, '111': 0.013391}], ['regression: random state 14', [3, [[-0.144, 0.15], [-0.052, 0.123], [0.0, 0.0], [0.145, -0.129], [0.077, 0.218], [0.248, 0.026], [0.0, 0.0], [0.256, 0.015]], [2, 0, 1]], {'000': 0.154343, '001': 0.190816, '010': 0.06366, '011': 0.221969, '110': 0.134459, '111': 0.234753}], ['regression: random state 8', [2, [[0.258, -0.148], [-0.044, -0.154], [0.09, 0.21], [0.28, 0.265]], [0]], {'0': 0.446643, '1': 0.553357}], ['control: unnormalized pair', [1, [[3, 0], [0, 4]], [0]], {'0': 0.36, '1': 0.64}], ['control: near zero state', [1, [[1e-08, 0], [0, 1e-08]], [0]], 'zero-state'], ['control: reversed qubit list', [2, [[0, 0], [1, 0], [0, 0], [0, 0]], [1, 0]], {'10': 1.0}], ['control: single qubit marginal of |01>', [2, [[0, 0], [1, 0], [0, 0], [0, 0]], [1]], {'0': 1.0}]]]\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":"393edbcd645d7f671a65ad31bff122bd439c024f51779c38e464b1cb7cc20c97","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(x):\n    n, amps, qubits = x\n    if len(amps) != 1 << n:\n        return 'bad-length'\n    if len(set(qubits)) != len(qubits):\n        return 'duplicate-qubit'\n    if any(q < 0 or q >= n for q in qubits):\n        return 'bad-qubit'\n    total = sum(re * re + im * im for re, im in amps)\n    if total <= 1e-12:\n        return 'zero-state'\n    acc = {}\n    for idx, (a, b) in enumerate(amps):\n        p = a * a + b * b\n        if p == 0:\n            continue\n        key = ''.join('1' if idx >> q & 1 else '0' for q in reversed(qubits))\n        acc[key] = acc.get(key, 0.0) + p\n    out = {}\n    for key in sorted(acc):\n        v = round(acc[key], 6) / round(total, 6)\n        if v > 0:\n            out[key] = v\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression: bell state on both qubits', [2, [[0.707107, 0], [0, 0], [0, 0], [0.707107, 0]], [0, 1]], {'00': 0.5, '11': 0.5}], ['regression: random state 0', [2, [[0.0, 0.0], [0.282, -0.043], [-0.278, 0.017], [0.0, 0.0]], [0, 1]], {'01': 0.511954, '10': 0.488046}], ['repair check: random state 1', [2, [[0.129, 0.125], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0]], [1, 0]], {'00': 1.0}], ['control: reversed qubit list', [2, [[0, 0], [1, 0], [0, 0], [0, 0]], [1, 0]], {'10': 1.0}], ['control: single qubit marginal of |01>', [2, [[0, 0], [1, 0], [0, 0], [0, 0]], [1]], {'0': 1.0}], ['control: out of range qubit equals n', [2, [[1, 0], [0, 0], [0, 0], [0, 0]], [2]], 'bad-qubit'], ['control: negative qubit index', [2, [[1, 0], [0, 0], [0, 0], [0, 0]], [-1]], 'bad-qubit']], [['regression: random state 3', [2, [[0.379, 0.308], [-0.129, -0.524], [0.79, -0.299], [-0.403, -0.327]], [0, 1]], {'00': 0.157683, '01': 0.192532, '10': 0.471717, '11': 0.178068}], ['regression: random state 4', [1, [[-0.217, 0.525], [-0.308, -0.181]], [0]], {'0': 0.716602, '1': 0.283398}], ['regression: random state 2', [1, [[0.541, -0.923], [-0.479, -0.646]], [0]], {'0': 0.638959, '1': 0.361041}], ['control: duplicate qubits', [2, [[0.6, 0], [0, 0.8], [0, 0], [0, 0]], [0, 0]], 'duplicate-qubit'], ['control: wrong amplitude count', [2, [[1, 0], [0, 0]], [0]], 'bad-length'], ['control: all-zero state', [1, [[0, 0], [0, 0]], [0]], 'zero-state'], ['control: unnormalized pair', [1, [[3, 0], [0, 4]], [0]], {'0': 0.36, '1': 0.64}]], [['regression: random state 6', [3, [[-0.119, 0.092], [0.264, -0.223], [-0.189, 0.034], [-0.22, -0.267], [-0.291, -0.092], [0.09, -0.02], [0.062, -0.284], [-0.239, 0.039]], [2]], {'0': 0.54953, '1': 0.45047}], ['regression: random state 7', [1, [[0.725, -0.825], [-0.233, -0.266]], [0]], {'0': 0.906073, '1': 0.093927}], ['regression: random state 4', [1, [[-0.217, 0.525], [-0.308, -0.181]], [0]], {'0': 0.716602, '1': 0.283398}], ['control: near zero state', [1, [[1e-08, 0], [0, 1e-08]], [0]], 'zero-state'], ['control: reversed qubit list', [2, [[0, 0], [1, 0], [0, 0], [0, 0]], [1, 0]], {'10': 1.0}], ['control: single qubit marginal of |01>', [2, [[0, 0], [1, 0], [0, 0], [0, 0]], [1]], {'0': 1.0}], ['control: out of range qubit equals n', [2, [[1, 0], [0, 0], [0, 0], [0, 0]], [2]], 'bad-qubit']], [['regression: random state 10', [3, [[-0.064, 0.212], [0.264, -0.114], [-0.15, -0.24], [0.031, 0.141], [0.037, -0.002], [0.023, -0.229], [0.193, -0.153], [0.251, 0.097]], [0, 1, 2]], {'000': 0.116738, '001': 0.196846, '010': 0.190676, '011': 0.049614, '100': 0.003268, '101': 0.126094, '110': 0.144395, '111': 0.17237}], ['regression: random state 11', [2, [[-0.211, 0.28], [0.154, -0.18], [-0.016, -0.095], [-0.157, 0.075]], [0]], {'0': 0.604789, '1': 0.395211}], ['regression: random state 6', [3, [[-0.119, 0.092], [0.264, -0.223], [-0.189, 0.034], [-0.22, -0.267], [-0.291, -0.092], [0.09, -0.02], [0.062, -0.284], [-0.239, 0.039]], [2]], {'0': 0.54953, '1': 0.45047}], ['control: negative qubit index', [2, [[1, 0], [0, 0], [0, 0], [0, 0]], [-1]], 'bad-qubit'], ['control: duplicate qubits', [2, [[0.6, 0], [0, 0.8], [0, 0], [0, 0]], [0, 0]], 'duplicate-qubit'], ['control: wrong amplitude count', [2, [[1, 0], [0, 0]], [0]], 'bad-length'], ['control: all-zero state', [1, [[0, 0], [0, 0]], [0]], 'zero-state']], [['regression: random state 13', [3, [[0.624, -0.422], [-0.596, 0.926], [-0.719, 1.0], [-0.208, -0.957], [-0.398, 0.533], [-0.189, -0.721], [-0.845, -0.901], [0.144, -0.267]], [0, 1, 2]], {'000': 0.082574, '001': 0.176465, '010': 0.220741, '011': 0.139566, '100': 0.064389, '101': 0.080843, '110': 0.222031, '111': 0.013391}], ['regression: random state 14', [3, [[-0.144, 0.15], [-0.052, 0.123], [0.0, 0.0], [0.145, -0.129], [0.077, 0.218], [0.248, 0.026], [0.0, 0.0], [0.256, 0.015]], [2, 0, 1]], {'000': 0.154343, '001': 0.190816, '010': 0.06366, '011': 0.221969, '110': 0.134459, '111': 0.234753}], ['regression: random state 8', [2, [[0.258, -0.148], [-0.044, -0.154], [0.09, 0.21], [0.28, 0.265]], [0]], {'0': 0.446643, '1': 0.553357}], ['control: unnormalized pair', [1, [[3, 0], [0, 4]], [0]], {'0': 0.36, '1': 0.64}], ['control: near zero state', [1, [[1e-08, 0], [0, 1e-08]], [0]], 'zero-state'], ['control: reversed qubit list', [2, [[0, 0], [1, 0], [0, 0], [0, 0]], [1, 0]], {'10': 1.0}], ['control: single qubit marginal of |01>', [2, [[0, 0], [1, 0], [0, 0], [0, 0]], [1]], {'0': 1.0}]]]\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":"82ff888aa8cce2d3499dcc4d08ed44f12300c92f3fccb0003d5925ea5856f95d","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(x):\n    n, amps, qubits = x\n    if len(amps) != 1 << n:\n        return 'bad-length'\n    if len(set(qubits)) != len(qubits):\n        return 'duplicate-qubit'\n    if any(q < 0 or q >= n for q in qubits):\n        return 'bad-qubit'\n    total = sum(re * re + im * im for re, im in amps)\n    if total <= 1e-12:\n        return 'zero-state'\n    acc = {}\n    for idx, (a, b) in enumerate(amps):\n        p = a * a + b * b\n        if p == 0:\n            continue\n        key = ''.join('1' if idx >> q & 1 else '0' for q in reversed(qubits))\n        acc[key] = acc.get(key, 0.0) + p\n    out = {}\n    for key in sorted(acc):\n        v = round(acc[key] / total, 6)\n        if v > 0:\n            out[key] = v\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression: bell state on both qubits', [2, [[0.707107, 0], [0, 0], [0, 0], [0.707107, 0]], [0, 1]], {'00': 0.5, '11': 0.5}], ['regression: random state 0', [2, [[0.0, 0.0], [0.282, -0.043], [-0.278, 0.017], [0.0, 0.0]], [0, 1]], {'01': 0.511954, '10': 0.488046}], ['repair check: random state 1', [2, [[0.129, 0.125], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0]], [1, 0]], {'00': 1.0}], ['control: reversed qubit list', [2, [[0, 0], [1, 0], [0, 0], [0, 0]], [1, 0]], {'10': 1.0}], ['control: single qubit marginal of |01>', [2, [[0, 0], [1, 0], [0, 0], [0, 0]], [1]], {'0': 1.0}], ['control: out of range qubit equals n', [2, [[1, 0], [0, 0], [0, 0], [0, 0]], [2]], 'bad-qubit'], ['control: negative qubit index', [2, [[1, 0], [0, 0], [0, 0], [0, 0]], [-1]], 'bad-qubit']], [['regression: random state 3', [2, [[0.379, 0.308], [-0.129, -0.524], [0.79, -0.299], [-0.403, -0.327]], [0, 1]], {'00': 0.157683, '01': 0.192532, '10': 0.471717, '11': 0.178068}], ['regression: random state 4', [1, [[-0.217, 0.525], [-0.308, -0.181]], [0]], {'0': 0.716602, '1': 0.283398}], ['regression: random state 2', [1, [[0.541, -0.923], [-0.479, -0.646]], [0]], {'0': 0.638959, '1': 0.361041}], ['control: duplicate qubits', [2, [[0.6, 0], [0, 0.8], [0, 0], [0, 0]], [0, 0]], 'duplicate-qubit'], ['control: wrong amplitude count', [2, [[1, 0], [0, 0]], [0]], 'bad-length'], ['control: all-zero state', [1, [[0, 0], [0, 0]], [0]], 'zero-state'], ['control: unnormalized pair', [1, [[3, 0], [0, 4]], [0]], {'0': 0.36, '1': 0.64}]], [['regression: random state 6', [3, [[-0.119, 0.092], [0.264, -0.223], [-0.189, 0.034], [-0.22, -0.267], [-0.291, -0.092], [0.09, -0.02], [0.062, -0.284], [-0.239, 0.039]], [2]], {'0': 0.54953, '1': 0.45047}], ['regression: random state 7', [1, [[0.725, -0.825], [-0.233, -0.266]], [0]], {'0': 0.906073, '1': 0.093927}], ['regression: random state 4', [1, [[-0.217, 0.525], [-0.308, -0.181]], [0]], {'0': 0.716602, '1': 0.283398}], ['control: near zero state', [1, [[1e-08, 0], [0, 1e-08]], [0]], 'zero-state'], ['control: reversed qubit list', [2, [[0, 0], [1, 0], [0, 0], [0, 0]], [1, 0]], {'10': 1.0}], ['control: single qubit marginal of |01>', [2, [[0, 0], [1, 0], [0, 0], [0, 0]], [1]], {'0': 1.0}], ['control: out of range qubit equals n', [2, [[1, 0], [0, 0], [0, 0], [0, 0]], [2]], 'bad-qubit']], [['regression: random state 10', [3, [[-0.064, 0.212], [0.264, -0.114], [-0.15, -0.24], [0.031, 0.141], [0.037, -0.002], [0.023, -0.229], [0.193, -0.153], [0.251, 0.097]], [0, 1, 2]], {'000': 0.116738, '001': 0.196846, '010': 0.190676, '011': 0.049614, '100': 0.003268, '101': 0.126094, '110': 0.144395, '111': 0.17237}], ['regression: random state 11', [2, [[-0.211, 0.28], [0.154, -0.18], [-0.016, -0.095], [-0.157, 0.075]], [0]], {'0': 0.604789, '1': 0.395211}], ['regression: random state 6', [3, [[-0.119, 0.092], [0.264, -0.223], [-0.189, 0.034], [-0.22, -0.267], [-0.291, -0.092], [0.09, -0.02], [0.062, -0.284], [-0.239, 0.039]], [2]], {'0': 0.54953, '1': 0.45047}], ['control: negative qubit index', [2, [[1, 0], [0, 0], [0, 0], [0, 0]], [-1]], 'bad-qubit'], ['control: duplicate qubits', [2, [[0.6, 0], [0, 0.8], [0, 0], [0, 0]], [0, 0]], 'duplicate-qubit'], ['control: wrong amplitude count', [2, [[1, 0], [0, 0]], [0]], 'bad-length'], ['control: all-zero state', [1, [[0, 0], [0, 0]], [0]], 'zero-state']], [['regression: random state 13', [3, [[0.624, -0.422], [-0.596, 0.926], [-0.719, 1.0], [-0.208, -0.957], [-0.398, 0.533], [-0.189, -0.721], [-0.845, -0.901], [0.144, -0.267]], [0, 1, 2]], {'000': 0.082574, '001': 0.176465, '010': 0.220741, '011': 0.139566, '100': 0.064389, '101': 0.080843, '110': 0.222031, '111': 0.013391}], ['regression: random state 14', [3, [[-0.144, 0.15], [-0.052, 0.123], [0.0, 0.0], [0.145, -0.129], [0.077, 0.218], [0.248, 0.026], [0.0, 0.0], [0.256, 0.015]], [2, 0, 1]], {'000': 0.154343, '001': 0.190816, '010': 0.06366, '011': 0.221969, '110': 0.134459, '111': 0.234753}], ['regression: random state 8', [2, [[0.258, -0.148], [-0.044, -0.154], [0.09, 0.21], [0.28, 0.265]], [0]], {'0': 0.446643, '1': 0.553357}], ['control: unnormalized pair', [1, [[3, 0], [0, 4]], [0]], {'0': 0.36, '1': 0.64}], ['control: near zero state', [1, [[1e-08, 0], [0, 1e-08]], [0]], 'zero-state'], ['control: reversed qubit list', [2, [[0, 0], [1, 0], [0, 0], [0, 0]], [1, 0]], {'10': 1.0}], ['control: single qubit marginal of |01>', [2, [[0, 0], [1, 0], [0, 0], [0, 0]], [1]], {'0': 1.0}]]]\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-marginal-distribution-rounding-stage","generated_at":"2026-09-29T14:51:30.948968+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Marginal readout distributions are what users compare against hardware counts; ordering or normalization slips mislabel every histogram.","repair":"Normalize first, then round the probability once to 6 decimals.","root_cause":"Rounding is applied to the unnormalized weight and total separately, and the division result is never rounded.","sha256":"8425cf2db17f4cafada2565a8e6994531a0d24d6c00ebc83f0d4ebec3ff452d3","title":"Marginal rounds the numerator before normalizing · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":39.926,"exit_code":1,"observations":[{"actual":{"00":0.5,"11":0.5},"check":"regression: bell state on both qubits","expected":{"00":0.5,"11":0.5},"passed":true},{"actual":{"01":0.509607,"10":0.490733},"check":"regression: random state 0","expected":{"01":0.511954,"10":0.488046},"passed":false},{"actual":{"00":0.991756},"check":"repair check: random state 1","expected":{"00":1.0},"passed":false},{"actual":{"10":1.0},"check":"control: reversed qubit list","expected":{"10":1.0},"passed":true},{"actual":{"0":1.0},"check":"control: single qubit marginal of |01>","expected":{"0":1.0},"passed":true},{"actual":"bad-qubit","check":"control: out of range qubit equals n","expected":"bad-qubit","passed":true},{"actual":"bad-qubit","check":"control: negative qubit index","expected":"bad-qubit","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: bell state on both qubits\", \"actual\": {\"00\": 0.5, \"11\": 0.5}, \"expected\": {\"00\": 0.5, \"11\": 0.5}, \"passed\": true}, {\"check\": \"regression: random state 0\", \"actual\": {\"01\": 0.509607, \"10\": 0.490733}, \"expected\": {\"01\": 0.511954, \"10\": 0.488046}, \"passed\": false}, {\"check\": \"repair check: random state 1\", \"actual\": {\"00\": 0.991756}, \"expected\": {\"00\": 1.0}, \"passed\": false}, {\"check\": \"control: reversed qubit list\", \"actual\": {\"10\": 1.0}, \"expected\": {\"10\": 1.0}, \"passed\": true}, {\"check\": \"control: single qubit marginal of |01>\", \"actual\": {\"0\": 1.0}, \"expected\": {\"0\": 1.0}, \"passed\": true}, {\"check\": \"control: out of range qubit equals n\", \"actual\": \"bad-qubit\", \"expected\": \"bad-qubit\", \"passed\": true}, {\"check\": \"control: negative qubit index\", \"actual\": \"bad-qubit\", \"expected\": \"bad-qubit\", \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":39.054,"exit_code":1,"observations":[{"actual":{"00":0.49999950000050003,"11":0.49999950000050003},"check":"regression: bell state on both qubits","expected":{"00":0.5,"11":0.5},"passed":false},{"actual":{"01":0.5119537452971449,"10":0.48804625470285506},"check":"regression: random state 0","expected":{"01":0.511954,"10":0.488046},"passed":false},{"actual":{"00":1.0},"check":"repair check: random state 1","expected":{"00":1.0},"passed":true},{"actual":{"10":1.0},"check":"control: reversed qubit list","expected":{"10":1.0},"passed":true},{"actual":{"0":1.0},"check":"control: single qubit marginal of |01>","expected":{"0":1.0},"passed":true},{"actual":"bad-qubit","check":"control: out of range qubit equals n","expected":"bad-qubit","passed":true},{"actual":"bad-qubit","check":"control: negative qubit index","expected":"bad-qubit","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: bell state on both qubits\", \"actual\": {\"00\": 0.49999950000050003, \"11\": 0.49999950000050003}, \"expected\": {\"00\": 0.5, \"11\": 0.5}, \"passed\": false}, {\"check\": \"regression: random state 0\", \"actual\": {\"01\": 0.5119537452971449, \"10\": 0.48804625470285506}, \"expected\": {\"01\": 0.511954, \"10\": 0.488046}, \"passed\": false}, {\"check\": \"repair check: random state 1\", \"actual\": {\"00\": 1.0}, \"expected\": {\"00\": 1.0}, \"passed\": true}, {\"check\": \"control: reversed qubit list\", \"actual\": {\"10\": 1.0}, \"expected\": {\"10\": 1.0}, \"passed\": true}, {\"check\": \"control: single qubit marginal of |01>\", \"actual\": {\"0\": 1.0}, \"expected\": {\"0\": 1.0}, \"passed\": true}, {\"check\": \"control: out of range qubit equals n\", \"actual\": \"bad-qubit\", \"expected\": \"bad-qubit\", \"passed\": true}, {\"check\": \"control: negative qubit index\", \"actual\": \"bad-qubit\", \"expected\": \"bad-qubit\", \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":37.254,"exit_code":0,"observations":[{"actual":{"00":0.5,"11":0.5},"check":"regression: bell state on both qubits","expected":{"00":0.5,"11":0.5},"passed":true},{"actual":{"01":0.511954,"10":0.488046},"check":"regression: random state 0","expected":{"01":0.511954,"10":0.488046},"passed":true},{"actual":{"00":1.0},"check":"repair check: random state 1","expected":{"00":1.0},"passed":true},{"actual":{"10":1.0},"check":"control: reversed qubit list","expected":{"10":1.0},"passed":true},{"actual":{"0":1.0},"check":"control: single qubit marginal of |01>","expected":{"0":1.0},"passed":true},{"actual":"bad-qubit","check":"control: out of range qubit equals n","expected":"bad-qubit","passed":true},{"actual":"bad-qubit","check":"control: negative qubit index","expected":"bad-qubit","passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: bell state on both qubits\", \"actual\": {\"00\": 0.5, \"11\": 0.5}, \"expected\": {\"00\": 0.5, \"11\": 0.5}, \"passed\": true}, {\"check\": \"regression: random state 0\", \"actual\": {\"01\": 0.511954, \"10\": 0.488046}, \"expected\": {\"01\": 0.511954, \"10\": 0.488046}, \"passed\": true}, {\"check\": \"repair check: random state 1\", \"actual\": {\"00\": 1.0}, \"expected\": {\"00\": 1.0}, \"passed\": true}, {\"check\": \"control: reversed qubit list\", \"actual\": {\"10\": 1.0}, \"expected\": {\"10\": 1.0}, \"passed\": true}, {\"check\": \"control: single qubit marginal of |01>\", \"actual\": {\"0\": 1.0}, \"expected\": {\"0\": 1.0}, \"passed\": true}, {\"check\": \"control: out of range qubit equals n\", \"actual\": \"bad-qubit\", \"expected\": \"bad-qubit\", \"passed\": true}, {\"check\": \"control: negative qubit index\", \"actual\": \"bad-qubit\", \"expected\": \"bad-qubit\", \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}