FA-91001 / Quantum circuit simulation / Open access
Tableau CNOT propagates Z forward instead of backward · case 01
A Z stabilizer on the target is not copied onto the control, so a Bell state reports +XX, +ZI instead of +XX, +ZZ.
ROOT CAUSE
The CNOT rule updates z_target ^= z_control; Z propagates from target to control.
VERIFIED REPAIR
Set z_control ^= z_target.
Unsuccessful approach: The attempted repair XORs the target x bit into the control z bit, mixing Pauli components.
Case contract
Input [n, gates] with gates h, s, x, z (["g", q]) and cx (["cx", c, t]). Track the n stabilizer generators of |0...0> (initially Z on each qubit) under the Aaronson-Gottesman update rules and return them as signed strings such as "+XX", character q describing qubit q.
Why this case matters
Stabilizer simulators verify Clifford circuits and error-correction encoders; a phase-bit rule error yields wrong syndromes.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
n, gates = x
xs = [[0] * n for _ in range(n)]
zs = [[1 if i == j else 0 for j in range(n)] for i in range(n)]
rs = [0] * n
for g in gates:
op = g[0]
for row in range(n):
X, Z = xs[row], zs[row]
if op == 'h':
a = g[1]
rs[row] ^= X[a] & Z[a]
X[a], Z[a] = Z[a], X[a]
elif op == 's':
a = g[1]
rs[row] ^= X[a] & Z[a]
Z[a] ^= X[a]
elif op == 'x':
rs[row] ^= Z[g[1]]
elif op == 'z':
rs[row] ^= X[g[1]]
elif op == 'cx':
a, b = g[1], g[2]
rs[row] ^= X[a] & Z[b] & (X[b] ^ Z[a] ^ 1)
X[b] ^= X[a]
Z[b] ^= Z[a]
letters = {(0, 0): 'I', (1, 0): 'X', (0, 1): 'Z', (1, 1): 'Y'}
return [('-' if rs[r] else '+') + ''.join(letters[(xs[r][q], zs[r][q])] for q in range(n)) for r in range(n)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression: bell preparation', [2, [['h', 0], ['cx', 0, 1]]], ['+XX', '+ZZ']], ['regression: cx on excited control', [2, [['x', 0], ['cx', 0, 1]]], ['-ZI', '+ZZ']], ['regression: ghz', [3, [['h', 0], ['cx', 0, 1], ['cx', 0, 2]]], ['+XXX', '+ZZI', '+ZIZ']], ['control: h then s', [1, [['h', 0], ['s', 0]]], ['+Y']], ['control: s twice after h', [1, [['h', 0], ['s', 0], ['s', 0]]], ['-X']], ['control: x flips z sign', [1, [['x', 0]]], ['-Z']], ['control: z on plus', [1, [['h', 0], ['z', 0]]], ['-X']]], [['regression: random clifford 0', [3, [['cx', 1, 2]]], ['+ZII', '+IZI', '+IZZ']], ['regression: random clifford 2', [3, [['cx', 0, 2], ['z', 2], ['s', 2], ['h', 0], ['cx', 2, 1], ['x', 1], ['cx', 1, 0], ['x', 1], ['x', 1], ['z', 0], ['cx', 2, 1], ['h', 1], ['h', 0]]], ['-ZII', '-IXI', '-ZIZ']], ['regression: ghz', [3, [['h', 0], ['cx', 0, 1], ['cx', 0, 2]]], ['+XXX', '+ZZI', '+ZIZ']], ['control: h on y eigenstate', [1, [['h', 0], ['s', 0], ['h', 0]]], ['-Y']], ['control: random clifford 1', [1, [['z', 0], ['s', 0], ['x', 0], ['x', 0], ['x', 0], ['z', 0], ['z', 0], ['z', 0]]], ['-Z']], ['control: random clifford 3', [1, [['s', 0], ['h', 0], ['h', 0], ['x', 0], ['h', 0], ['h', 0], ['s', 0], ['s', 0]]], ['-Z']], ['control: random clifford 5', [1, [['h', 0], ['h', 0], ['h', 0], ['h', 0], ['z', 0], ['s', 0], ['s', 0], ['s', 0], ['x', 0], ['h', 0], ['x', 0], ['h', 0]]], ['-Z']]], [['regression: random clifford 7', [3, [['cx', 0, 2], ['cx', 2, 1], ['s', 0], ['cx', 0, 2], ['cx', 2, 1], ['z', 1], ['z', 0], ['h', 1], ['x', 1]]], ['+ZII', '+ZXI', '+IIZ']], ['regression: random clifford 8', [3, [['cx', 0, 1], ['h', 2], ['h', 2], ['h', 0], ['cx', 2, 1], ['h', 2], ['z', 0], ['cx', 1, 2]]], ['-XII', '-XZX', '+IIX']], ['regression: random clifford 2', [3, [['cx', 0, 2], ['z', 2], ['s', 2], ['h', 0], ['cx', 2, 1], ['x', 1], ['cx', 1, 0], ['x', 1], ['x', 1], ['z', 0], ['cx', 2, 1], ['h', 1], ['h', 0]]], ['-ZII', '-IXI', '-ZIZ']], ['control: random clifford 6', [1, [['h', 0], ['z', 0], ['h', 0], ['z', 0], ['x', 0], ['h', 0], ['h', 0], ['h', 0], ['h', 0], ['h', 0], ['h', 0], ['s', 0], ['x', 0]]], ['-Z']], ['control: random clifford 10', [1, [['z', 0], ['z', 0], ['s', 0], ['z', 0], ['h', 0], ['h', 0], ['s', 0]]], ['+Z']], ['control: random clifford 12', [1, [['h', 0], ['s', 0], ['h', 0], ['x', 0], ['s', 0], ['x', 0], ['x', 0], ['z', 0], ['h', 0], ['s', 0], ['s', 0]]], ['+Z']], ['control: random clifford 13', [1, [['z', 0], ['x', 0], ['z', 0], ['z', 0], ['s', 0], ['x', 0], ['h', 0], ['h', 0], ['z', 0], ['h', 0]]], ['+X']]], [['regression: random clifford 11', [2, [['s', 1], ['h', 0], ['cx', 0, 1], ['s', 0], ['x', 0]]], ['-YX', '-ZZ']], ['regression: random clifford 15', [2, [['z', 1], ['cx', 0, 1], ['x', 1], ['h', 1]]], ['+ZI', '-ZX']], ['regression: random clifford 7', [3, [['cx', 0, 2], ['cx', 2, 1], ['s', 0], ['cx', 0, 2], ['cx', 2, 1], ['z', 1], ['z', 0], ['h', 1], ['x', 1]]], ['+ZII', '+ZXI', '+IIZ']], ['control: random clifford 14', [1, [['z', 0], ['s', 0], ['h', 0], ['z', 0], ['h', 0], ['x', 0], ['x', 0], ['z', 0], ['h', 0], ['h', 0], ['x', 0], ['x', 0], ['z', 0], ['h', 0]]], ['-X']], ['control: random clifford 16', [1, [['x', 0], ['h', 0], ['h', 0], ['h', 0], ['h', 0], ['z', 0], ['z', 0], ['h', 0], ['x', 0], ['h', 0]]], ['-Z']], ['control: random clifford 17', [1, [['h', 0], ['s', 0], ['h', 0], ['h', 0], ['x', 0], ['s', 0], ['s', 0]]], ['+Y']], ['control: random clifford 24', [1, [['x', 0]]], ['-Z']]], [['regression: random clifford 19', [2, [['h', 0], ['cx', 1, 0], ['cx', 1, 0], ['cx', 0, 1], ['h', 0], ['cx', 1, 0], ['cx', 1, 0], ['cx', 0, 1], ['cx', 0, 1], ['cx', 1, 0], ['cx', 0, 1]]], ['+XZ', '-YY']], ['regression: random clifford 20', [3, [['cx', 2, 0], ['h', 2], ['z', 0], ['cx', 2, 1], ['cx', 0, 2], ['cx', 2, 1]]], ['+ZIX', '+ZZI', '+IIX']], ['regression: random clifford 9', [2, [['cx', 1, 0], ['cx', 1, 0], ['x', 0], ['s', 0], ['cx', 1, 0], ['h', 1], ['x', 0], ['z', 1], ['cx', 0, 1]]], ['-ZX', '-IX']], ['control: random clifford 25', [2, [['cx', 1, 0], ['cx', 1, 0]]], ['+ZI', '+IZ']], ['control: random clifford 26', [1, [['x', 0], ['h', 0], ['x', 0], ['h', 0], ['s', 0], ['h', 0], ['s', 0], ['h', 0], ['s', 0], ['s', 0], ['x', 0]]], ['+Y']], ['control: random clifford 29', [3, [['h', 2], ['s', 0], ['z', 1], ['h', 0], ['s', 0], ['z', 2], ['x', 1], ['z', 0], ['h', 2]]], ['-YII', '-IZI', '-IIZ']], ['control: random clifford 30', [1, [['x', 0], ['z', 0], ['x', 0], ['s', 0], ['z', 0], ['z', 0], ['h', 0]]], ['+X']]]]
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression: bell preparation | ['+XX', '+IZ'] | ['+XX', '+ZZ'] | Failed |
| regression: cx on excited control | ['-ZZ', '+IZ'] | ['-ZI', '+ZZ'] | Failed |
| regression: ghz | ['+XXX', '+IZI', '+IIZ'] | ['+XXX', '+ZZI', '+ZIZ'] | Failed |
| control: h then s | ['+Y'] | ['+Y'] | Passed |
| control: s twice after h | ['-X'] | ['-X'] | Passed |
| control: x flips z sign | ['-Z'] | ['-Z'] | Passed |
| control: z on plus | ['-X'] | ['-X'] | Passed |
SHA-256 / 4b7259c62d42b2cc53fcde16b0e58eefe7f9eefefdb9fa349a827aa0410547a5
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
n, gates = x
xs = [[0] * n for _ in range(n)]
zs = [[1 if i == j else 0 for j in range(n)] for i in range(n)]
rs = [0] * n
for g in gates:
op = g[0]
for row in range(n):
X, Z = xs[row], zs[row]
if op == 'h':
a = g[1]
rs[row] ^= X[a] & Z[a]
X[a], Z[a] = Z[a], X[a]
elif op == 's':
a = g[1]
rs[row] ^= X[a] & Z[a]
Z[a] ^= X[a]
elif op == 'x':
rs[row] ^= Z[g[1]]
elif op == 'z':
rs[row] ^= X[g[1]]
elif op == 'cx':
a, b = g[1], g[2]
rs[row] ^= X[a] & Z[b] & (X[b] ^ Z[a] ^ 1)
X[b] ^= X[a]
Z[a] ^= X[b]
letters = {(0, 0): 'I', (1, 0): 'X', (0, 1): 'Z', (1, 1): 'Y'}
return [('-' if rs[r] else '+') + ''.join(letters[(xs[r][q], zs[r][q])] for q in range(n)) for r in range(n)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression: bell preparation', [2, [['h', 0], ['cx', 0, 1]]], ['+XX', '+ZZ']], ['regression: cx on excited control', [2, [['x', 0], ['cx', 0, 1]]], ['-ZI', '+ZZ']], ['regression: ghz', [3, [['h', 0], ['cx', 0, 1], ['cx', 0, 2]]], ['+XXX', '+ZZI', '+ZIZ']], ['control: h then s', [1, [['h', 0], ['s', 0]]], ['+Y']], ['control: s twice after h', [1, [['h', 0], ['s', 0], ['s', 0]]], ['-X']], ['control: x flips z sign', [1, [['x', 0]]], ['-Z']], ['control: z on plus', [1, [['h', 0], ['z', 0]]], ['-X']]], [['regression: random clifford 0', [3, [['cx', 1, 2]]], ['+ZII', '+IZI', '+IZZ']], ['regression: random clifford 2', [3, [['cx', 0, 2], ['z', 2], ['s', 2], ['h', 0], ['cx', 2, 1], ['x', 1], ['cx', 1, 0], ['x', 1], ['x', 1], ['z', 0], ['cx', 2, 1], ['h', 1], ['h', 0]]], ['-ZII', '-IXI', '-ZIZ']], ['regression: ghz', [3, [['h', 0], ['cx', 0, 1], ['cx', 0, 2]]], ['+XXX', '+ZZI', '+ZIZ']], ['control: h on y eigenstate', [1, [['h', 0], ['s', 0], ['h', 0]]], ['-Y']], ['control: random clifford 1', [1, [['z', 0], ['s', 0], ['x', 0], ['x', 0], ['x', 0], ['z', 0], ['z', 0], ['z', 0]]], ['-Z']], ['control: random clifford 3', [1, [['s', 0], ['h', 0], ['h', 0], ['x', 0], ['h', 0], ['h', 0], ['s', 0], ['s', 0]]], ['-Z']], ['control: random clifford 5', [1, [['h', 0], ['h', 0], ['h', 0], ['h', 0], ['z', 0], ['s', 0], ['s', 0], ['s', 0], ['x', 0], ['h', 0], ['x', 0], ['h', 0]]], ['-Z']]], [['regression: random clifford 7', [3, [['cx', 0, 2], ['cx', 2, 1], ['s', 0], ['cx', 0, 2], ['cx', 2, 1], ['z', 1], ['z', 0], ['h', 1], ['x', 1]]], ['+ZII', '+ZXI', '+IIZ']], ['regression: random clifford 8', [3, [['cx', 0, 1], ['h', 2], ['h', 2], ['h', 0], ['cx', 2, 1], ['h', 2], ['z', 0], ['cx', 1, 2]]], ['-XII', '-XZX', '+IIX']], ['regression: random clifford 2', [3, [['cx', 0, 2], ['z', 2], ['s', 2], ['h', 0], ['cx', 2, 1], ['x', 1], ['cx', 1, 0], ['x', 1], ['x', 1], ['z', 0], ['cx', 2, 1], ['h', 1], ['h', 0]]], ['-ZII', '-IXI', '-ZIZ']], ['control: random clifford 6', [1, [['h', 0], ['z', 0], ['h', 0], ['z', 0], ['x', 0], ['h', 0], ['h', 0], ['h', 0], ['h', 0], ['h', 0], ['h', 0], ['s', 0], ['x', 0]]], ['-Z']], ['control: random clifford 10', [1, [['z', 0], ['z', 0], ['s', 0], ['z', 0], ['h', 0], ['h', 0], ['s', 0]]], ['+Z']], ['control: random clifford 12', [1, [['h', 0], ['s', 0], ['h', 0], ['x', 0], ['s', 0], ['x', 0], ['x', 0], ['z', 0], ['h', 0], ['s', 0], ['s', 0]]], ['+Z']], ['control: random clifford 13', [1, [['z', 0], ['x', 0], ['z', 0], ['z', 0], ['s', 0], ['x', 0], ['h', 0], ['h', 0], ['z', 0], ['h', 0]]], ['+X']]], [['regression: random clifford 11', [2, [['s', 1], ['h', 0], ['cx', 0, 1], ['s', 0], ['x', 0]]], ['-YX', '-ZZ']], ['regression: random clifford 15', [2, [['z', 1], ['cx', 0, 1], ['x', 1], ['h', 1]]], ['+ZI', '-ZX']], ['regression: random clifford 7', [3, [['cx', 0, 2], ['cx', 2, 1], ['s', 0], ['cx', 0, 2], ['cx', 2, 1], ['z', 1], ['z', 0], ['h', 1], ['x', 1]]], ['+ZII', '+ZXI', '+IIZ']], ['control: random clifford 14', [1, [['z', 0], ['s', 0], ['h', 0], ['z', 0], ['h', 0], ['x', 0], ['x', 0], ['z', 0], ['h', 0], ['h', 0], ['x', 0], ['x', 0], ['z', 0], ['h', 0]]], ['-X']], ['control: random clifford 16', [1, [['x', 0], ['h', 0], ['h', 0], ['h', 0], ['h', 0], ['z', 0], ['z', 0], ['h', 0], ['x', 0], ['h', 0]]], ['-Z']], ['control: random clifford 17', [1, [['h', 0], ['s', 0], ['h', 0], ['h', 0], ['x', 0], ['s', 0], ['s', 0]]], ['+Y']], ['control: random clifford 24', [1, [['x', 0]]], ['-Z']]], [['regression: random clifford 19', [2, [['h', 0], ['cx', 1, 0], ['cx', 1, 0], ['cx', 0, 1], ['h', 0], ['cx', 1, 0], ['cx', 1, 0], ['cx', 0, 1], ['cx', 0, 1], ['cx', 1, 0], ['cx', 0, 1]]], ['+XZ', '-YY']], ['regression: random clifford 20', [3, [['cx', 2, 0], ['h', 2], ['z', 0], ['cx', 2, 1], ['cx', 0, 2], ['cx', 2, 1]]], ['+ZIX', '+ZZI', '+IIX']], ['regression: random clifford 9', [2, [['cx', 1, 0], ['cx', 1, 0], ['x', 0], ['s', 0], ['cx', 1, 0], ['h', 1], ['x', 0], ['z', 1], ['cx', 0, 1]]], ['-ZX', '-IX']], ['control: random clifford 25', [2, [['cx', 1, 0], ['cx', 1, 0]]], ['+ZI', '+IZ']], ['control: random clifford 26', [1, [['x', 0], ['h', 0], ['x', 0], ['h', 0], ['s', 0], ['h', 0], ['s', 0], ['h', 0], ['s', 0], ['s', 0], ['x', 0]]], ['+Y']], ['control: random clifford 29', [3, [['h', 2], ['s', 0], ['z', 1], ['h', 0], ['s', 0], ['z', 2], ['x', 1], ['z', 0], ['h', 2]]], ['-YII', '-IZI', '-IIZ']], ['control: random clifford 30', [1, [['x', 0], ['z', 0], ['x', 0], ['s', 0], ['z', 0], ['z', 0], ['h', 0]]], ['+X']]]]
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression: bell preparation | ['+YX', '+IZ'] | ['+XX', '+ZZ'] | Failed |
| regression: cx on excited control | ['-ZI', '+IZ'] | ['-ZI', '+ZZ'] | Failed |
| regression: ghz | ['+XXX', '+IZI', '+IIZ'] | ['+XXX', '+ZZI', '+ZIZ'] | Failed |
| control: h then s | ['+Y'] | ['+Y'] | Passed |
| control: s twice after h | ['-X'] | ['-X'] | Passed |
| control: x flips z sign | ['-Z'] | ['-Z'] | Passed |
| control: z on plus | ['-X'] | ['-X'] | Passed |
SHA-256 / 159b512cb44e3e9ff72a88fc1133e6e3ef314549d0f89a74508c8c89f8ad0938
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
n, gates = x
xs = [[0] * n for _ in range(n)]
zs = [[1 if i == j else 0 for j in range(n)] for i in range(n)]
rs = [0] * n
for g in gates:
op = g[0]
for row in range(n):
X, Z = xs[row], zs[row]
if op == 'h':
a = g[1]
rs[row] ^= X[a] & Z[a]
X[a], Z[a] = Z[a], X[a]
elif op == 's':
a = g[1]
rs[row] ^= X[a] & Z[a]
Z[a] ^= X[a]
elif op == 'x':
rs[row] ^= Z[g[1]]
elif op == 'z':
rs[row] ^= X[g[1]]
elif op == 'cx':
a, b = g[1], g[2]
rs[row] ^= X[a] & Z[b] & (X[b] ^ Z[a] ^ 1)
X[b] ^= X[a]
Z[a] ^= Z[b]
letters = {(0, 0): 'I', (1, 0): 'X', (0, 1): 'Z', (1, 1): 'Y'}
return [('-' if rs[r] else '+') + ''.join(letters[(xs[r][q], zs[r][q])] for q in range(n)) for r in range(n)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression: bell preparation', [2, [['h', 0], ['cx', 0, 1]]], ['+XX', '+ZZ']], ['regression: cx on excited control', [2, [['x', 0], ['cx', 0, 1]]], ['-ZI', '+ZZ']], ['regression: ghz', [3, [['h', 0], ['cx', 0, 1], ['cx', 0, 2]]], ['+XXX', '+ZZI', '+ZIZ']], ['control: h then s', [1, [['h', 0], ['s', 0]]], ['+Y']], ['control: s twice after h', [1, [['h', 0], ['s', 0], ['s', 0]]], ['-X']], ['control: x flips z sign', [1, [['x', 0]]], ['-Z']], ['control: z on plus', [1, [['h', 0], ['z', 0]]], ['-X']]], [['regression: random clifford 0', [3, [['cx', 1, 2]]], ['+ZII', '+IZI', '+IZZ']], ['regression: random clifford 2', [3, [['cx', 0, 2], ['z', 2], ['s', 2], ['h', 0], ['cx', 2, 1], ['x', 1], ['cx', 1, 0], ['x', 1], ['x', 1], ['z', 0], ['cx', 2, 1], ['h', 1], ['h', 0]]], ['-ZII', '-IXI', '-ZIZ']], ['regression: ghz', [3, [['h', 0], ['cx', 0, 1], ['cx', 0, 2]]], ['+XXX', '+ZZI', '+ZIZ']], ['control: h on y eigenstate', [1, [['h', 0], ['s', 0], ['h', 0]]], ['-Y']], ['control: random clifford 1', [1, [['z', 0], ['s', 0], ['x', 0], ['x', 0], ['x', 0], ['z', 0], ['z', 0], ['z', 0]]], ['-Z']], ['control: random clifford 3', [1, [['s', 0], ['h', 0], ['h', 0], ['x', 0], ['h', 0], ['h', 0], ['s', 0], ['s', 0]]], ['-Z']], ['control: random clifford 5', [1, [['h', 0], ['h', 0], ['h', 0], ['h', 0], ['z', 0], ['s', 0], ['s', 0], ['s', 0], ['x', 0], ['h', 0], ['x', 0], ['h', 0]]], ['-Z']]], [['regression: random clifford 7', [3, [['cx', 0, 2], ['cx', 2, 1], ['s', 0], ['cx', 0, 2], ['cx', 2, 1], ['z', 1], ['z', 0], ['h', 1], ['x', 1]]], ['+ZII', '+ZXI', '+IIZ']], ['regression: random clifford 8', [3, [['cx', 0, 1], ['h', 2], ['h', 2], ['h', 0], ['cx', 2, 1], ['h', 2], ['z', 0], ['cx', 1, 2]]], ['-XII', '-XZX', '+IIX']], ['regression: random clifford 2', [3, [['cx', 0, 2], ['z', 2], ['s', 2], ['h', 0], ['cx', 2, 1], ['x', 1], ['cx', 1, 0], ['x', 1], ['x', 1], ['z', 0], ['cx', 2, 1], ['h', 1], ['h', 0]]], ['-ZII', '-IXI', '-ZIZ']], ['control: random clifford 6', [1, [['h', 0], ['z', 0], ['h', 0], ['z', 0], ['x', 0], ['h', 0], ['h', 0], ['h', 0], ['h', 0], ['h', 0], ['h', 0], ['s', 0], ['x', 0]]], ['-Z']], ['control: random clifford 10', [1, [['z', 0], ['z', 0], ['s', 0], ['z', 0], ['h', 0], ['h', 0], ['s', 0]]], ['+Z']], ['control: random clifford 12', [1, [['h', 0], ['s', 0], ['h', 0], ['x', 0], ['s', 0], ['x', 0], ['x', 0], ['z', 0], ['h', 0], ['s', 0], ['s', 0]]], ['+Z']], ['control: random clifford 13', [1, [['z', 0], ['x', 0], ['z', 0], ['z', 0], ['s', 0], ['x', 0], ['h', 0], ['h', 0], ['z', 0], ['h', 0]]], ['+X']]], [['regression: random clifford 11', [2, [['s', 1], ['h', 0], ['cx', 0, 1], ['s', 0], ['x', 0]]], ['-YX', '-ZZ']], ['regression: random clifford 15', [2, [['z', 1], ['cx', 0, 1], ['x', 1], ['h', 1]]], ['+ZI', '-ZX']], ['regression: random clifford 7', [3, [['cx', 0, 2], ['cx', 2, 1], ['s', 0], ['cx', 0, 2], ['cx', 2, 1], ['z', 1], ['z', 0], ['h', 1], ['x', 1]]], ['+ZII', '+ZXI', '+IIZ']], ['control: random clifford 14', [1, [['z', 0], ['s', 0], ['h', 0], ['z', 0], ['h', 0], ['x', 0], ['x', 0], ['z', 0], ['h', 0], ['h', 0], ['x', 0], ['x', 0], ['z', 0], ['h', 0]]], ['-X']], ['control: random clifford 16', [1, [['x', 0], ['h', 0], ['h', 0], ['h', 0], ['h', 0], ['z', 0], ['z', 0], ['h', 0], ['x', 0], ['h', 0]]], ['-Z']], ['control: random clifford 17', [1, [['h', 0], ['s', 0], ['h', 0], ['h', 0], ['x', 0], ['s', 0], ['s', 0]]], ['+Y']], ['control: random clifford 24', [1, [['x', 0]]], ['-Z']]], [['regression: random clifford 19', [2, [['h', 0], ['cx', 1, 0], ['cx', 1, 0], ['cx', 0, 1], ['h', 0], ['cx', 1, 0], ['cx', 1, 0], ['cx', 0, 1], ['cx', 0, 1], ['cx', 1, 0], ['cx', 0, 1]]], ['+XZ', '-YY']], ['regression: random clifford 20', [3, [['cx', 2, 0], ['h', 2], ['z', 0], ['cx', 2, 1], ['cx', 0, 2], ['cx', 2, 1]]], ['+ZIX', '+ZZI', '+IIX']], ['regression: random clifford 9', [2, [['cx', 1, 0], ['cx', 1, 0], ['x', 0], ['s', 0], ['cx', 1, 0], ['h', 1], ['x', 0], ['z', 1], ['cx', 0, 1]]], ['-ZX', '-IX']], ['control: random clifford 25', [2, [['cx', 1, 0], ['cx', 1, 0]]], ['+ZI', '+IZ']], ['control: random clifford 26', [1, [['x', 0], ['h', 0], ['x', 0], ['h', 0], ['s', 0], ['h', 0], ['s', 0], ['h', 0], ['s', 0], ['s', 0], ['x', 0]]], ['+Y']], ['control: random clifford 29', [3, [['h', 2], ['s', 0], ['z', 1], ['h', 0], ['s', 0], ['z', 2], ['x', 1], ['z', 0], ['h', 2]]], ['-YII', '-IZI', '-IIZ']], ['control: random clifford 30', [1, [['x', 0], ['z', 0], ['x', 0], ['s', 0], ['z', 0], ['z', 0], ['h', 0]]], ['+X']]]]
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression: bell preparation | ['+XX', '+ZZ'] | ['+XX', '+ZZ'] | Passed |
| regression: cx on excited control | ['-ZI', '+ZZ'] | ['-ZI', '+ZZ'] | Passed |
| regression: ghz | ['+XXX', '+ZZI', '+ZIZ'] | ['+XXX', '+ZZI', '+ZIZ'] | Passed |
| control: h then s | ['+Y'] | ['+Y'] | Passed |
| control: s twice after h | ['-X'] | ['-X'] | Passed |
| control: x flips z sign | ['-Z'] | ['-Z'] | Passed |
| control: z on plus | ['-X'] | ['-X'] | Passed |
SHA-256 / c27c8fa19fa7532115f8ff1564725bc211a3dd98db317448242a9eef3834559a
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.810914+00:00.
Case digest / d6ff9b00fd0ff595d8fa9ac0113fe61121c51836eb7eb0f665f14810106f3699