FA-91081 / Quantum circuit simulation / Open access
Bloch vector omits the factor 2 on coherences · case 01
|+> is reported at x = 0.5, inside the sphere, although it is a pure state.
ROOT CAUSE
The x and y components use Re and Im of conj(a) b without the factor 2.
THE FAILURE
The x and y components use Re and Im of conj(a) b without the factor 2.
Unsuccessful approach: The attempted repair restores the factor only for x, leaving y halved.
Case contract
Input [[ar, ai], [br, bi]] for a|0> + b|1> (possibly unnormalized). Return the Bloch vector [2Re(conj(a) b), 2Im(conj(a) b), |a|^2 - |b|^2] divided by |a|^2 + |b|^2, rounded to 6 decimals, or "zero-state" when the squared norm is below 1e-12.
Why this case matters
Bloch coordinates feed visualizers and single-qubit tomography checks; sign or scale slips put states on the wrong axis.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(x):
(ar, ai), (br, bi) = x
a, b = complex(ar, ai), complex(br, bi)
nrm = abs(a) ** 2 + abs(b) ** 2
if nrm < 1e-12:
return 'zero-state'
cross = a.conjugate() * b
bx = cross.real / nrm
by = cross.imag / nrm
bz = (abs(a) ** 2 - abs(b) ** 2) / nrm
return [round(v, 6) + 0.0 for v in (bx, by, bz)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression: plus', [[0.707107, 0], [0.707107, 0]], [1.0, 0.0, 0.0]], ['regression: plus i', [[0.707107, 0], [0, 0.707107]], [0.0, 1.0, 0.0]], ['regression: minus i', [[0.707107, 0], [0, -0.707107]], [0.0, -1.0, 0.0]], ['control: ket zero', [[1, 0], [0, 0]], [0.0, 0.0, 1.0]], ['control: ket one', [[0, 0], [1, 0]], [0.0, 0.0, -1.0]], ['control: zero vector', [[0, 0], [0, 0]], 'zero-state'], ['control: global phase i', [[0, 1], [0, 0]], [0.0, 0.0, 1.0]]], [['regression: unnormalized', [[3, 0], [0, 4]], [0.0, 0.96, -0.28]], ['regression: random qubit 0', [[-1.176, -0.41], [1.26, -1.053]], [-0.494424, 0.826337, -0.26965]], ['regression: random qubit 1', [[1.052, -0.843], [-0.499, 1.97]], [-0.735014, 0.555478, -0.388843]], ['control: numerical noise state', [[1e-07, 0], [0, 1e-07]], 'zero-state'], ['control: noise on one amplitude', [[3e-08, 0], [0, 0]], 'zero-state'], ['control: ket zero', [[1, 0], [0, 0]], [0.0, 0.0, 1.0]], ['control: ket one', [[0, 0], [1, 0]], [0.0, 0.0, -1.0]]], [['regression: random qubit 2', [[0.057, -1.052], [0.48, 1.205]], [-0.888347, 0.410865, -0.205012]], ['regression: random qubit 3', [[1.769, -1.743], [0.441, -0.443]], [0.47339, -0.004576, 0.880841]], ['regression: random qubit 1', [[1.052, -0.843], [-0.499, 1.97]], [-0.735014, 0.555478, -0.388843]], ['control: zero vector', [[0, 0], [0, 0]], 'zero-state'], ['control: global phase i', [[0, 1], [0, 0]], [0.0, 0.0, 1.0]], ['control: numerical noise state', [[1e-07, 0], [0, 1e-07]], 'zero-state'], ['control: noise on one amplitude', [[3e-08, 0], [0, 0]], 'zero-state']], [['regression: random qubit 5', [[1.781, 0.313], [-0.534, -1.473]], [-0.493327, -0.858114, 0.142371]], ['regression: random qubit 6', [[1.624, -0.932], [-1.233, 0.708]], [-0.963265, 0.00023, 0.268554]], ['regression: random qubit 3', [[1.769, -1.743], [0.441, -0.443]], [0.47339, -0.004576, 0.880841]], ['control: ket zero', [[1, 0], [0, 0]], [0.0, 0.0, 1.0]], ['control: ket one', [[0, 0], [1, 0]], [0.0, 0.0, -1.0]], ['control: zero vector', [[0, 0], [0, 0]], 'zero-state'], ['control: global phase i', [[0, 1], [0, 0]], [0.0, 0.0, 1.0]]], [['regression: random qubit 8', [[-1.932, 0.067], [0.651, -1.416]], [-0.438732, 0.873211, 0.212174]], ['regression: random qubit 9', [[0.467, -1.484], [-1.959, -0.631]], [0.006475, -0.962062, -0.272753]], ['regression: random qubit 5', [[1.781, 0.313], [-0.534, -1.473]], [-0.493327, -0.858114, 0.142371]], ['control: numerical noise state', [[1e-07, 0], [0, 1e-07]], 'zero-state'], ['control: noise on one amplitude', [[3e-08, 0], [0, 0]], 'zero-state'], ['control: ket zero', [[1, 0], [0, 0]], [0.0, 0.0, 1.0]], ['control: ket one', [[0, 0], [1, 0]], [0.0, 0.0, -1.0]]]]
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: plus | [0.5, 0.0, 0.0] | [1.0, 0.0, 0.0] | Failed |
| regression: plus i | [0.0, 0.5, 0.0] | [0.0, 1.0, 0.0] | Failed |
| regression: minus i | [0.0, -0.5, 0.0] | [0.0, -1.0, 0.0] | Failed |
| control: ket zero | [0.0, 0.0, 1.0] | [0.0, 0.0, 1.0] | Passed |
| control: ket one | [0.0, 0.0, -1.0] | [0.0, 0.0, -1.0] | Passed |
| control: zero vector | zero-state | zero-state | Passed |
| control: global phase i | [0.0, 0.0, 1.0] | [0.0, 0.0, 1.0] | Passed |
SHA-256 / fd30dee4e1e2b6f2d6930f176a7fefc229ba53587e82400707be42f7581d6e88
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(x):
(ar, ai), (br, bi) = x
a, b = complex(ar, ai), complex(br, bi)
nrm = abs(a) ** 2 + abs(b) ** 2
if nrm < 1e-12:
return 'zero-state'
cross = a.conjugate() * b
bx = 2 * cross.real / nrm
by = cross.imag / nrm
bz = (abs(a) ** 2 - abs(b) ** 2) / nrm
return [round(v, 6) + 0.0 for v in (bx, by, bz)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression: plus', [[0.707107, 0], [0.707107, 0]], [1.0, 0.0, 0.0]], ['regression: plus i', [[0.707107, 0], [0, 0.707107]], [0.0, 1.0, 0.0]], ['regression: minus i', [[0.707107, 0], [0, -0.707107]], [0.0, -1.0, 0.0]], ['control: ket zero', [[1, 0], [0, 0]], [0.0, 0.0, 1.0]], ['control: ket one', [[0, 0], [1, 0]], [0.0, 0.0, -1.0]], ['control: zero vector', [[0, 0], [0, 0]], 'zero-state'], ['control: global phase i', [[0, 1], [0, 0]], [0.0, 0.0, 1.0]]], [['regression: unnormalized', [[3, 0], [0, 4]], [0.0, 0.96, -0.28]], ['regression: random qubit 0', [[-1.176, -0.41], [1.26, -1.053]], [-0.494424, 0.826337, -0.26965]], ['regression: random qubit 1', [[1.052, -0.843], [-0.499, 1.97]], [-0.735014, 0.555478, -0.388843]], ['control: numerical noise state', [[1e-07, 0], [0, 1e-07]], 'zero-state'], ['control: noise on one amplitude', [[3e-08, 0], [0, 0]], 'zero-state'], ['control: ket zero', [[1, 0], [0, 0]], [0.0, 0.0, 1.0]], ['control: ket one', [[0, 0], [1, 0]], [0.0, 0.0, -1.0]]], [['regression: random qubit 2', [[0.057, -1.052], [0.48, 1.205]], [-0.888347, 0.410865, -0.205012]], ['regression: random qubit 3', [[1.769, -1.743], [0.441, -0.443]], [0.47339, -0.004576, 0.880841]], ['regression: random qubit 1', [[1.052, -0.843], [-0.499, 1.97]], [-0.735014, 0.555478, -0.388843]], ['control: zero vector', [[0, 0], [0, 0]], 'zero-state'], ['control: global phase i', [[0, 1], [0, 0]], [0.0, 0.0, 1.0]], ['control: numerical noise state', [[1e-07, 0], [0, 1e-07]], 'zero-state'], ['control: noise on one amplitude', [[3e-08, 0], [0, 0]], 'zero-state']], [['regression: random qubit 5', [[1.781, 0.313], [-0.534, -1.473]], [-0.493327, -0.858114, 0.142371]], ['regression: random qubit 6', [[1.624, -0.932], [-1.233, 0.708]], [-0.963265, 0.00023, 0.268554]], ['regression: random qubit 3', [[1.769, -1.743], [0.441, -0.443]], [0.47339, -0.004576, 0.880841]], ['control: ket zero', [[1, 0], [0, 0]], [0.0, 0.0, 1.0]], ['control: ket one', [[0, 0], [1, 0]], [0.0, 0.0, -1.0]], ['control: zero vector', [[0, 0], [0, 0]], 'zero-state'], ['control: global phase i', [[0, 1], [0, 0]], [0.0, 0.0, 1.0]]], [['regression: random qubit 8', [[-1.932, 0.067], [0.651, -1.416]], [-0.438732, 0.873211, 0.212174]], ['regression: random qubit 9', [[0.467, -1.484], [-1.959, -0.631]], [0.006475, -0.962062, -0.272753]], ['regression: random qubit 5', [[1.781, 0.313], [-0.534, -1.473]], [-0.493327, -0.858114, 0.142371]], ['control: numerical noise state', [[1e-07, 0], [0, 1e-07]], 'zero-state'], ['control: noise on one amplitude', [[3e-08, 0], [0, 0]], 'zero-state'], ['control: ket zero', [[1, 0], [0, 0]], [0.0, 0.0, 1.0]], ['control: ket one', [[0, 0], [1, 0]], [0.0, 0.0, -1.0]]]]
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: plus | [1.0, 0.0, 0.0] | [1.0, 0.0, 0.0] | Passed |
| regression: plus i | [0.0, 0.5, 0.0] | [0.0, 1.0, 0.0] | Failed |
| regression: minus i | [0.0, -0.5, 0.0] | [0.0, -1.0, 0.0] | Failed |
| control: ket zero | [0.0, 0.0, 1.0] | [0.0, 0.0, 1.0] | Passed |
| control: ket one | [0.0, 0.0, -1.0] | [0.0, 0.0, -1.0] | Passed |
| control: zero vector | zero-state | zero-state | Passed |
| control: global phase i | [0.0, 0.0, 1.0] | [0.0, 0.0, 1.0] | Passed |
SHA-256 / 104acf626949d6961830829609fb6cfbd725a328d2c2a1b73d44270abc582800
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 7 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.
Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.
Member access is invitation-based. Sign in with your invited account to inspect the repair.
Sign in to the archive ↗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:32.715268+00:00.
Case digest / ef54c6b47bd31036ceeb89b9953cebcc5cd8535ef81dd5c251a07e5e6efa06b1