FAILURE MAP
← Case archive

FA-90911 / Quantum circuit simulation / Open access

Collapse renormalizes by probability instead of its square root · case 01

After measuring |+> the post-measurement amplitude is 1.414 instead of 1.0.

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

ROOT CAUSE

The surviving branch is scaled by 1/p rather than 1/sqrt(p).

VERIFIED REPAIR

Scale the kept amplitudes by 1/sqrt(p) where p is the kept squared mass.

Unsuccessful approach: The attempted repair uses 1/sqrt(prob) with the already-normalized probability, which is wrong whenever the input state is unnormalized.

Case contract

Input [n, amps, q, outcome]; measure qubit q (0 = LSB) of the possibly unnormalized state. Return {"probability": p, "state": post} with p normalized by the total squared norm and the post-measurement state renormalized to unit norm with the other branch zeroed; values rounded to 6 decimals. Return "impossible" when p < 1e-12.

Why this case matters

Mid-circuit measurement and collapse drive dynamic circuits; wrong renormalization breaks every later probability.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(x):
    n, amps, q, outcome = x
    psi = [complex(a, b) for a, b in amps]
    keep = [((i >> q) & 1) == outcome for i in range(len(psi))]
    p = sum(abs(v) ** 2 for i, v in enumerate(psi) if keep[i])
    norm = sum(abs(v) ** 2 for v in psi)
    prob = p / norm
    if prob < 1e-12:
        return 'impossible'
    scale = 1 / p
    post = [v * scale if keep[i] else 0j for i, v in enumerate(psi)]
    return {'probability': round(prob, 6) + 0.0, 'state': [[round(v.real, 6) + 0.0, round(v.imag, 6) + 0.0] for v in post]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression: measure 0 on |+>', [1, [[0.707107, 0], [0.707107, 0]], 0, 0], {'probability': 0.5, 'state': [[1.0, 0.0], [0.0, 0.0]]}], ['regression: measure 1 on |+>', [1, [[0.707107, 0], [0.707107, 0]], 0, 1], {'probability': 0.5, 'state': [[0.0, 0.0], [1.0, 0.0]]}], ['regression: unnormalized bell measure qubit 1', [2, [[2, 0], [0, 0], [0, 0], [2, 0]], 1, 0], {'probability': 0.5, 'state': [[1.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0]]}], ['control: impossible outcome', [1, [[1, 0], [0, 0]], 0, 1], 'impossible'], ['control: near impossible branch', [1, [[1, 0], [1e-08, 0]], 0, 1], 'impossible'], ['control: random collapse 1', [2, [[0.5, 0.0], [0.0, 0.0], [0.0, -0.0], [-0.0, -0.0]], 0, 1], 'impossible'], ['control: random collapse 2', [2, [[0.0, 0.0], [0.0, 0.0], [0.591, 0.404], [0.405, 0.306]], 1, 0], 'impossible']], [['regression: tiny norm state', [1, [[3e-07, 0], [0, 4e-07]], 0, 1], {'probability': 0.64, 'state': [[0.0, 0.0], [0.0, 1.0]]}], ['regression: random collapse 0', [1, [[-0.305, 0.494], [0.447, -0.241]], 0, 0], {'probability': 0.566536, 'state': [[-0.525346, 0.850889], [0.0, 0.0]]}], ['regression: random collapse 3', [3, [[0.755, 0.514], [0.624, 0.382], [-0.745, 0.675], [-0.295, 0.287], [0.799, -0.013], [-0.459, 0.107], [0.751, 0.682], [0.988, 0.816]], 0, 1], {'probability': 0.422407, 'state': [[0.0, 0.0], [0.38933, 0.23834], [0.0, 0.0], [-0.184058, 0.179067], [0.0, 0.0], [-0.286382, 0.06676], [0.0, 0.0], [0.616439, 0.509123]]}], ['control: random collapse 7', [2, [[0.5, 0.0], [-0.0, 0.0], [0.0, 0.0], [0.0, 0.0]], 0, 1], 'impossible'], ['control: random collapse 12', [1, [[0.5, 0.0], [0.0, 0.0]], 0, 1], 'impossible'], ['control: random collapse 16', [2, [[0.5, 0.0], [-0.0, 0.0], [0.0, -0.0], [-0.0, 0.0]], 0, 1], 'impossible'], ['control: random collapse 22', [2, [[0.5, 0.0], [-0.0, -0.0], [0.0, 0.0], [-0.0, -0.0]], 0, 1], 'impossible']], [['regression: random collapse 4', [1, [[-0.125, -0.177], [0.075, 0.432]], 0, 0], {'probability': 0.196294, 'state': [[-0.576864, -0.81684], [0.0, 0.0]]}], ['regression: random collapse 5', [3, [[0.5, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [-0.0, 0.0], [0.0, 0.0], [-0.0, -0.0]], 1, 0], {'probability': 1.0, 'state': [[1.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0]]}], ['regression: random collapse 6', [3, [[-0.436, -0.015], [-0.35, 0.017], [0.17, 0.002], [0.369, -0.461], [0.411, -0.033], [-0.475, 0.29], [0.379, -0.067], [-0.298, 0.408]], 2, 0], {'probability': 0.438863, 'state': [[-0.524618, -0.018049], [-0.421138, 0.020455], [0.204553, 0.002407], [0.444, -0.554699], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0]]}], ['control: random collapse 23', [2, [[0.5, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, -0.0]], 0, 1], 'impossible'], ['control: random collapse 34', [2, [[0.5, 0.0], [0.0, 0.0], [0.0, 0.0], [-0.0, 0.0]], 1, 1], 'impossible'], ['control: random collapse 37', [3, [[0.5, 0.0], [-0.0, -0.0], [0.0, -0.0], [0.0, 0.0], [0.0, -0.0], [-0.0, 0.0], [-0.0, -0.0], [-0.0, 0.0]], 0, 1], 'impossible'], ['control: impossible outcome', [1, [[1, 0], [0, 0]], 0, 1], 'impossible']], [['regression: random collapse 8', [2, [[-1.464, -0.995], [0.052, 0.311], [0.0, 0.0], [0.0, 0.0]], 0, 0], {'probability': 0.969244, 'state': [[-0.827063, -0.562109], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0]]}], ['regression: random collapse 9', [1, [[0.307, 0.202], [-0.161, 0.592]], 0, 0], {'probability': 0.264065, 'state': [[0.835384, 0.549666], [0.0, 0.0]]}], ['regression: random collapse 6', [3, [[-0.436, -0.015], [-0.35, 0.017], [0.17, 0.002], [0.369, -0.461], [0.411, -0.033], [-0.475, 0.29], [0.379, -0.067], [-0.298, 0.408]], 2, 0], {'probability': 0.438863, 'state': [[-0.524618, -0.018049], [-0.421138, 0.020455], [0.204553, 0.002407], [0.444, -0.554699], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0]]}], ['control: near impossible branch', [1, [[1, 0], [1e-08, 0]], 0, 1], 'impossible'], ['control: random collapse 1', [2, [[0.5, 0.0], [0.0, 0.0], [0.0, -0.0], [-0.0, -0.0]], 0, 1], 'impossible'], ['control: random collapse 2', [2, [[0.0, 0.0], [0.0, 0.0], [0.591, 0.404], [0.405, 0.306]], 1, 0], 'impossible'], ['control: random collapse 7', [2, [[0.5, 0.0], [-0.0, 0.0], [0.0, 0.0], [0.0, 0.0]], 0, 1], 'impossible']], [['regression: random collapse 11', [2, [[0.414, -0.429], [-0.452, -0.264], [0.422, -0.171], [-0.123, 0.056]], 0, 1], {'probability': 0.34182, 'state': [[0.0, 0.0], [-0.836084, -0.488332], [0.0, 0.0], [-0.227518, 0.103586]]}], ['regression: random collapse 13', [3, [[0.164, 0.188], [0.288, -0.262], [0.203, 0.372], [0.485, -0.006], [-0.386, -0.389], [-0.128, 0.167], [-0.162, 0.438], [-0.379, -0.043]], 0, 1], {'probability': 0.431321, 'state': [[0.0, 0.0], [0.379272, -0.345032], [0.0, 0.0], [0.638704, -0.007901], [0.0, 0.0], [-0.168565, 0.219925], [0.0, 0.0], [-0.499111, -0.056627]]}], ['regression: random collapse 9', [1, [[0.307, 0.202], [-0.161, 0.592]], 0, 0], {'probability': 0.264065, 'state': [[0.835384, 0.549666], [0.0, 0.0]]}], ['control: random collapse 12', [1, [[0.5, 0.0], [0.0, 0.0]], 0, 1], 'impossible'], ['control: random collapse 16', [2, [[0.5, 0.0], [-0.0, 0.0], [0.0, -0.0], [-0.0, 0.0]], 0, 1], 'impossible'], ['control: random collapse 22', [2, [[0.5, 0.0], [-0.0, -0.0], [0.0, 0.0], [-0.0, -0.0]], 0, 1], 'impossible'], ['control: random collapse 23', [2, [[0.5, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, -0.0]], 0, 1], 'impossible']]]
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 0 on |+>{'probability': 0.5, 'state': [[1.414213, 0.0], [0.0, 0.0]]}{'probability': 0.5, 'state': [[1.0, 0.0], [0.0, 0.0]]}Failed
regression: measure 1 on |+>{'probability': 0.5, 'state': [[0.0, 0.0], [1.414213, 0.0]]}{'probability': 0.5, 'state': [[0.0, 0.0], [1.0, 0.0]]}Failed
regression: unnormalized bell measure qubit 1{'probability': 0.5, 'state': [[0.5, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0]]}{'probability': 0.5, 'state': [[1.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0]]}Failed
control: impossible outcomeimpossibleimpossiblePassed
control: near impossible branchimpossibleimpossiblePassed
control: random collapse 1impossibleimpossiblePassed
control: random collapse 2impossibleimpossiblePassed

SHA-256 / 635138663478764b1f511e47c50b3616df0d8d8d888d8ee698e5783f64a4a76c

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(x):
    n, amps, q, outcome = x
    psi = [complex(a, b) for a, b in amps]
    keep = [((i >> q) & 1) == outcome for i in range(len(psi))]
    p = sum(abs(v) ** 2 for i, v in enumerate(psi) if keep[i])
    norm = sum(abs(v) ** 2 for v in psi)
    prob = p / norm
    if prob < 1e-12:
        return 'impossible'
    scale = 1 / math.sqrt(prob)
    post = [v * scale if keep[i] else 0j for i, v in enumerate(psi)]
    return {'probability': round(prob, 6) + 0.0, 'state': [[round(v.real, 6) + 0.0, round(v.imag, 6) + 0.0] for v in post]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression: measure 0 on |+>', [1, [[0.707107, 0], [0.707107, 0]], 0, 0], {'probability': 0.5, 'state': [[1.0, 0.0], [0.0, 0.0]]}], ['regression: measure 1 on |+>', [1, [[0.707107, 0], [0.707107, 0]], 0, 1], {'probability': 0.5, 'state': [[0.0, 0.0], [1.0, 0.0]]}], ['regression: unnormalized bell measure qubit 1', [2, [[2, 0], [0, 0], [0, 0], [2, 0]], 1, 0], {'probability': 0.5, 'state': [[1.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0]]}], ['control: impossible outcome', [1, [[1, 0], [0, 0]], 0, 1], 'impossible'], ['control: near impossible branch', [1, [[1, 0], [1e-08, 0]], 0, 1], 'impossible'], ['control: random collapse 1', [2, [[0.5, 0.0], [0.0, 0.0], [0.0, -0.0], [-0.0, -0.0]], 0, 1], 'impossible'], ['control: random collapse 2', [2, [[0.0, 0.0], [0.0, 0.0], [0.591, 0.404], [0.405, 0.306]], 1, 0], 'impossible']], [['regression: tiny norm state', [1, [[3e-07, 0], [0, 4e-07]], 0, 1], {'probability': 0.64, 'state': [[0.0, 0.0], [0.0, 1.0]]}], ['regression: random collapse 0', [1, [[-0.305, 0.494], [0.447, -0.241]], 0, 0], {'probability': 0.566536, 'state': [[-0.525346, 0.850889], [0.0, 0.0]]}], ['regression: random collapse 3', [3, [[0.755, 0.514], [0.624, 0.382], [-0.745, 0.675], [-0.295, 0.287], [0.799, -0.013], [-0.459, 0.107], [0.751, 0.682], [0.988, 0.816]], 0, 1], {'probability': 0.422407, 'state': [[0.0, 0.0], [0.38933, 0.23834], [0.0, 0.0], [-0.184058, 0.179067], [0.0, 0.0], [-0.286382, 0.06676], [0.0, 0.0], [0.616439, 0.509123]]}], ['control: random collapse 7', [2, [[0.5, 0.0], [-0.0, 0.0], [0.0, 0.0], [0.0, 0.0]], 0, 1], 'impossible'], ['control: random collapse 12', [1, [[0.5, 0.0], [0.0, 0.0]], 0, 1], 'impossible'], ['control: random collapse 16', [2, [[0.5, 0.0], [-0.0, 0.0], [0.0, -0.0], [-0.0, 0.0]], 0, 1], 'impossible'], ['control: random collapse 22', [2, [[0.5, 0.0], [-0.0, -0.0], [0.0, 0.0], [-0.0, -0.0]], 0, 1], 'impossible']], [['regression: random collapse 4', [1, [[-0.125, -0.177], [0.075, 0.432]], 0, 0], {'probability': 0.196294, 'state': [[-0.576864, -0.81684], [0.0, 0.0]]}], ['regression: random collapse 5', [3, [[0.5, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [-0.0, 0.0], [0.0, 0.0], [-0.0, -0.0]], 1, 0], {'probability': 1.0, 'state': [[1.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0]]}], ['regression: random collapse 6', [3, [[-0.436, -0.015], [-0.35, 0.017], [0.17, 0.002], [0.369, -0.461], [0.411, -0.033], [-0.475, 0.29], [0.379, -0.067], [-0.298, 0.408]], 2, 0], {'probability': 0.438863, 'state': [[-0.524618, -0.018049], [-0.421138, 0.020455], [0.204553, 0.002407], [0.444, -0.554699], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0]]}], ['control: random collapse 23', [2, [[0.5, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, -0.0]], 0, 1], 'impossible'], ['control: random collapse 34', [2, [[0.5, 0.0], [0.0, 0.0], [0.0, 0.0], [-0.0, 0.0]], 1, 1], 'impossible'], ['control: random collapse 37', [3, [[0.5, 0.0], [-0.0, -0.0], [0.0, -0.0], [0.0, 0.0], [0.0, -0.0], [-0.0, 0.0], [-0.0, -0.0], [-0.0, 0.0]], 0, 1], 'impossible'], ['control: impossible outcome', [1, [[1, 0], [0, 0]], 0, 1], 'impossible']], [['regression: random collapse 8', [2, [[-1.464, -0.995], [0.052, 0.311], [0.0, 0.0], [0.0, 0.0]], 0, 0], {'probability': 0.969244, 'state': [[-0.827063, -0.562109], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0]]}], ['regression: random collapse 9', [1, [[0.307, 0.202], [-0.161, 0.592]], 0, 0], {'probability': 0.264065, 'state': [[0.835384, 0.549666], [0.0, 0.0]]}], ['regression: random collapse 6', [3, [[-0.436, -0.015], [-0.35, 0.017], [0.17, 0.002], [0.369, -0.461], [0.411, -0.033], [-0.475, 0.29], [0.379, -0.067], [-0.298, 0.408]], 2, 0], {'probability': 0.438863, 'state': [[-0.524618, -0.018049], [-0.421138, 0.020455], [0.204553, 0.002407], [0.444, -0.554699], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0]]}], ['control: near impossible branch', [1, [[1, 0], [1e-08, 0]], 0, 1], 'impossible'], ['control: random collapse 1', [2, [[0.5, 0.0], [0.0, 0.0], [0.0, -0.0], [-0.0, -0.0]], 0, 1], 'impossible'], ['control: random collapse 2', [2, [[0.0, 0.0], [0.0, 0.0], [0.591, 0.404], [0.405, 0.306]], 1, 0], 'impossible'], ['control: random collapse 7', [2, [[0.5, 0.0], [-0.0, 0.0], [0.0, 0.0], [0.0, 0.0]], 0, 1], 'impossible']], [['regression: random collapse 11', [2, [[0.414, -0.429], [-0.452, -0.264], [0.422, -0.171], [-0.123, 0.056]], 0, 1], {'probability': 0.34182, 'state': [[0.0, 0.0], [-0.836084, -0.488332], [0.0, 0.0], [-0.227518, 0.103586]]}], ['regression: random collapse 13', [3, [[0.164, 0.188], [0.288, -0.262], [0.203, 0.372], [0.485, -0.006], [-0.386, -0.389], [-0.128, 0.167], [-0.162, 0.438], [-0.379, -0.043]], 0, 1], {'probability': 0.431321, 'state': [[0.0, 0.0], [0.379272, -0.345032], [0.0, 0.0], [0.638704, -0.007901], [0.0, 0.0], [-0.168565, 0.219925], [0.0, 0.0], [-0.499111, -0.056627]]}], ['regression: random collapse 9', [1, [[0.307, 0.202], [-0.161, 0.592]], 0, 0], {'probability': 0.264065, 'state': [[0.835384, 0.549666], [0.0, 0.0]]}], ['control: random collapse 12', [1, [[0.5, 0.0], [0.0, 0.0]], 0, 1], 'impossible'], ['control: random collapse 16', [2, [[0.5, 0.0], [-0.0, 0.0], [0.0, -0.0], [-0.0, 0.0]], 0, 1], 'impossible'], ['control: random collapse 22', [2, [[0.5, 0.0], [-0.0, -0.0], [0.0, 0.0], [-0.0, -0.0]], 0, 1], 'impossible'], ['control: random collapse 23', [2, [[0.5, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, -0.0]], 0, 1], 'impossible']]]
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 0 on |+>{'probability': 0.5, 'state': [[1.0, 0.0], [0.0, 0.0]]}{'probability': 0.5, 'state': [[1.0, 0.0], [0.0, 0.0]]}Passed
regression: measure 1 on |+>{'probability': 0.5, 'state': [[0.0, 0.0], [1.0, 0.0]]}{'probability': 0.5, 'state': [[0.0, 0.0], [1.0, 0.0]]}Passed
regression: unnormalized bell measure qubit 1{'probability': 0.5, 'state': [[2.828427, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0]]}{'probability': 0.5, 'state': [[1.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0]]}Failed
control: impossible outcomeimpossibleimpossiblePassed
control: near impossible branchimpossibleimpossiblePassed
control: random collapse 1impossibleimpossiblePassed
control: random collapse 2impossibleimpossiblePassed

SHA-256 / ade8209d151feb35e9fb35397b4db15671c5f4fdab76d800f3827a89a79b58b2

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(x):
    n, amps, q, outcome = x
    psi = [complex(a, b) for a, b in amps]
    keep = [((i >> q) & 1) == outcome for i in range(len(psi))]
    p = sum(abs(v) ** 2 for i, v in enumerate(psi) if keep[i])
    norm = sum(abs(v) ** 2 for v in psi)
    prob = p / norm
    if prob < 1e-12:
        return 'impossible'
    scale = 1 / math.sqrt(p)
    post = [v * scale if keep[i] else 0j for i, v in enumerate(psi)]
    return {'probability': round(prob, 6) + 0.0, 'state': [[round(v.real, 6) + 0.0, round(v.imag, 6) + 0.0] for v in post]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression: measure 0 on |+>', [1, [[0.707107, 0], [0.707107, 0]], 0, 0], {'probability': 0.5, 'state': [[1.0, 0.0], [0.0, 0.0]]}], ['regression: measure 1 on |+>', [1, [[0.707107, 0], [0.707107, 0]], 0, 1], {'probability': 0.5, 'state': [[0.0, 0.0], [1.0, 0.0]]}], ['regression: unnormalized bell measure qubit 1', [2, [[2, 0], [0, 0], [0, 0], [2, 0]], 1, 0], {'probability': 0.5, 'state': [[1.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0]]}], ['control: impossible outcome', [1, [[1, 0], [0, 0]], 0, 1], 'impossible'], ['control: near impossible branch', [1, [[1, 0], [1e-08, 0]], 0, 1], 'impossible'], ['control: random collapse 1', [2, [[0.5, 0.0], [0.0, 0.0], [0.0, -0.0], [-0.0, -0.0]], 0, 1], 'impossible'], ['control: random collapse 2', [2, [[0.0, 0.0], [0.0, 0.0], [0.591, 0.404], [0.405, 0.306]], 1, 0], 'impossible']], [['regression: tiny norm state', [1, [[3e-07, 0], [0, 4e-07]], 0, 1], {'probability': 0.64, 'state': [[0.0, 0.0], [0.0, 1.0]]}], ['regression: random collapse 0', [1, [[-0.305, 0.494], [0.447, -0.241]], 0, 0], {'probability': 0.566536, 'state': [[-0.525346, 0.850889], [0.0, 0.0]]}], ['regression: random collapse 3', [3, [[0.755, 0.514], [0.624, 0.382], [-0.745, 0.675], [-0.295, 0.287], [0.799, -0.013], [-0.459, 0.107], [0.751, 0.682], [0.988, 0.816]], 0, 1], {'probability': 0.422407, 'state': [[0.0, 0.0], [0.38933, 0.23834], [0.0, 0.0], [-0.184058, 0.179067], [0.0, 0.0], [-0.286382, 0.06676], [0.0, 0.0], [0.616439, 0.509123]]}], ['control: random collapse 7', [2, [[0.5, 0.0], [-0.0, 0.0], [0.0, 0.0], [0.0, 0.0]], 0, 1], 'impossible'], ['control: random collapse 12', [1, [[0.5, 0.0], [0.0, 0.0]], 0, 1], 'impossible'], ['control: random collapse 16', [2, [[0.5, 0.0], [-0.0, 0.0], [0.0, -0.0], [-0.0, 0.0]], 0, 1], 'impossible'], ['control: random collapse 22', [2, [[0.5, 0.0], [-0.0, -0.0], [0.0, 0.0], [-0.0, -0.0]], 0, 1], 'impossible']], [['regression: random collapse 4', [1, [[-0.125, -0.177], [0.075, 0.432]], 0, 0], {'probability': 0.196294, 'state': [[-0.576864, -0.81684], [0.0, 0.0]]}], ['regression: random collapse 5', [3, [[0.5, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [-0.0, 0.0], [0.0, 0.0], [-0.0, -0.0]], 1, 0], {'probability': 1.0, 'state': [[1.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0]]}], ['regression: random collapse 6', [3, [[-0.436, -0.015], [-0.35, 0.017], [0.17, 0.002], [0.369, -0.461], [0.411, -0.033], [-0.475, 0.29], [0.379, -0.067], [-0.298, 0.408]], 2, 0], {'probability': 0.438863, 'state': [[-0.524618, -0.018049], [-0.421138, 0.020455], [0.204553, 0.002407], [0.444, -0.554699], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0]]}], ['control: random collapse 23', [2, [[0.5, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, -0.0]], 0, 1], 'impossible'], ['control: random collapse 34', [2, [[0.5, 0.0], [0.0, 0.0], [0.0, 0.0], [-0.0, 0.0]], 1, 1], 'impossible'], ['control: random collapse 37', [3, [[0.5, 0.0], [-0.0, -0.0], [0.0, -0.0], [0.0, 0.0], [0.0, -0.0], [-0.0, 0.0], [-0.0, -0.0], [-0.0, 0.0]], 0, 1], 'impossible'], ['control: impossible outcome', [1, [[1, 0], [0, 0]], 0, 1], 'impossible']], [['regression: random collapse 8', [2, [[-1.464, -0.995], [0.052, 0.311], [0.0, 0.0], [0.0, 0.0]], 0, 0], {'probability': 0.969244, 'state': [[-0.827063, -0.562109], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0]]}], ['regression: random collapse 9', [1, [[0.307, 0.202], [-0.161, 0.592]], 0, 0], {'probability': 0.264065, 'state': [[0.835384, 0.549666], [0.0, 0.0]]}], ['regression: random collapse 6', [3, [[-0.436, -0.015], [-0.35, 0.017], [0.17, 0.002], [0.369, -0.461], [0.411, -0.033], [-0.475, 0.29], [0.379, -0.067], [-0.298, 0.408]], 2, 0], {'probability': 0.438863, 'state': [[-0.524618, -0.018049], [-0.421138, 0.020455], [0.204553, 0.002407], [0.444, -0.554699], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0]]}], ['control: near impossible branch', [1, [[1, 0], [1e-08, 0]], 0, 1], 'impossible'], ['control: random collapse 1', [2, [[0.5, 0.0], [0.0, 0.0], [0.0, -0.0], [-0.0, -0.0]], 0, 1], 'impossible'], ['control: random collapse 2', [2, [[0.0, 0.0], [0.0, 0.0], [0.591, 0.404], [0.405, 0.306]], 1, 0], 'impossible'], ['control: random collapse 7', [2, [[0.5, 0.0], [-0.0, 0.0], [0.0, 0.0], [0.0, 0.0]], 0, 1], 'impossible']], [['regression: random collapse 11', [2, [[0.414, -0.429], [-0.452, -0.264], [0.422, -0.171], [-0.123, 0.056]], 0, 1], {'probability': 0.34182, 'state': [[0.0, 0.0], [-0.836084, -0.488332], [0.0, 0.0], [-0.227518, 0.103586]]}], ['regression: random collapse 13', [3, [[0.164, 0.188], [0.288, -0.262], [0.203, 0.372], [0.485, -0.006], [-0.386, -0.389], [-0.128, 0.167], [-0.162, 0.438], [-0.379, -0.043]], 0, 1], {'probability': 0.431321, 'state': [[0.0, 0.0], [0.379272, -0.345032], [0.0, 0.0], [0.638704, -0.007901], [0.0, 0.0], [-0.168565, 0.219925], [0.0, 0.0], [-0.499111, -0.056627]]}], ['regression: random collapse 9', [1, [[0.307, 0.202], [-0.161, 0.592]], 0, 0], {'probability': 0.264065, 'state': [[0.835384, 0.549666], [0.0, 0.0]]}], ['control: random collapse 12', [1, [[0.5, 0.0], [0.0, 0.0]], 0, 1], 'impossible'], ['control: random collapse 16', [2, [[0.5, 0.0], [-0.0, 0.0], [0.0, -0.0], [-0.0, 0.0]], 0, 1], 'impossible'], ['control: random collapse 22', [2, [[0.5, 0.0], [-0.0, -0.0], [0.0, 0.0], [-0.0, -0.0]], 0, 1], 'impossible'], ['control: random collapse 23', [2, [[0.5, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, -0.0]], 0, 1], 'impossible']]]
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 0 on |+>{'probability': 0.5, 'state': [[1.0, 0.0], [0.0, 0.0]]}{'probability': 0.5, 'state': [[1.0, 0.0], [0.0, 0.0]]}Passed
regression: measure 1 on |+>{'probability': 0.5, 'state': [[0.0, 0.0], [1.0, 0.0]]}{'probability': 0.5, 'state': [[0.0, 0.0], [1.0, 0.0]]}Passed
regression: unnormalized bell measure qubit 1{'probability': 0.5, 'state': [[1.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0]]}{'probability': 0.5, 'state': [[1.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0]]}Passed
control: impossible outcomeimpossibleimpossiblePassed
control: near impossible branchimpossibleimpossiblePassed
control: random collapse 1impossibleimpossiblePassed
control: random collapse 2impossibleimpossiblePassed

SHA-256 / 654faae0c98a5b16f6a28660f8d26ce6d1d4525681893efbd7d28c719ae549aa

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:31.033797+00:00.

Case digest / 88c4edd4784274e198ac2fdad78f68d71905090d4af6cada1d15f733a45551b0