FAILURE MAP
← Case archive

FA-90971 / Quantum circuit simulation / Open access

Pauli product keeps the letter when multiplying equal Paulis · case 01

Y*Y is reported as Y instead of the identity.

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

ROOT CAUSE

The equal-letter branch appends the letter itself, assuming idempotence rather than P*P = I.

THE FAILURE

The equal-letter branch appends the letter itself, assuming idempotence rather than P*P = I.

Unsuccessful approach: The attempted repair appends I but adds a phase of -1, treating P*P as -I.

Case contract

Input [[k1, s1], [k2, s2]] representing i**k1 * s1 and i**k2 * s2 (Pauli strings over IXYZ, equal length). Return [k mod 4, s] with i**k * s = (i**k1 s1)(i**k2 s2), using XY=iZ, YZ=iX, ZX=iY and the reversed products with -i. Error "length-mismatch".

Why this case matters

Pauli-frame and stabilizer bookkeeping multiply Pauli strings constantly; one phase slip flips measurement signs.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    (k1, s1), (k2, s2) = x
    if len(s1) != len(s2):
        return 'length-mismatch'
    table = {('X', 'Y'): (1, 'Z'), ('Y', 'Z'): (1, 'X'), ('Z', 'X'): (1, 'Y'),
             ('Y', 'X'): (3, 'Z'), ('Z', 'Y'): (3, 'X'), ('X', 'Z'): (3, 'Y')}
    k = k1 + k2
    out = []
    for a, b in zip(s1, s2):
        if a == 'I':
            out.append(b)
        elif b == 'I':
            out.append(a)
        elif a == b:
            out.append(a)
        else:
            dk, c = table[(a, b)]
            k += dk
            out.append(c)
    return [k % 4, ''.join(out)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression: square of Y', [[0, 'Y'], [0, 'Y']], [0, 'I']], ['regression: random product 0', [[0, 'YY'], [2, 'ZY']], [3, 'XI']], ['regression: random product 1', [[-2, 'ZZI'], [2, 'ZXI']], [1, 'IYI']], ['control: X times Y', [[0, 'X'], [0, 'Y']], [1, 'Z']], ['control: Y times X', [[0, 'Y'], [0, 'X']], [3, 'Z']], ['control: X times Z', [[0, 'X'], [0, 'Z']], [3, 'Y']], ['control: Z times X', [[0, 'Z'], [0, 'X']], [1, 'Y']]], [['regression: random product 6', [[0, 'Z'], [0, 'Z']], [0, 'I']], ['regression: random product 8', [[-1, 'XZIY'], [3, 'IXYY']], [3, 'XYYI']], ['regression: random product 1', [[-2, 'ZZI'], [2, 'ZXI']], [1, 'IYI']], ['control: identity factors', [[1, 'II'], [2, 'IZ']], [3, 'IZ']], ['control: anticommuting pair twice', [[0, 'XY'], [0, 'YX']], [0, 'ZZ']], ['control: negative phase input', [[-1, 'Z'], [0, 'X']], [0, 'Y']], ['control: length mismatch', [[0, 'X'], [0, 'XY']], 'length-mismatch']], [['regression: random product 15', [[0, 'YYZI'], [0, 'XYXZ']], [0, 'ZIYZ']], ['regression: random product 17', [[3, 'X'], [0, 'X']], [3, 'I']], ['regression: random product 8', [[-1, 'XZIY'], [3, 'IXYY']], [3, 'XYYI']], ['control: phases wrap', [[3, 'XX'], [3, 'ZZ']], [0, 'YY']], ['control: random product 2', [[0, 'Y'], [1, 'X']], [0, 'Z']], ['control: random product 3', [[1, 'Y'], [0, 'Z']], [2, 'X']], ['control: random product 4', [[0, 'YXY'], [1, 'IZZ']], [1, 'YYX']]], [['regression: random product 25', [[-2, 'ZX'], [3, 'YX']], [0, 'XI']], ['regression: random product 27', [[-1, 'YY'], [3, 'IY']], [2, 'YI']], ['regression: random product 17', [[3, 'X'], [0, 'X']], [3, 'I']], ['control: random product 5', [[0, 'YIXX'], [2, 'ZIYY']], [1, 'XIZZ']], ['control: random product 7', [[3, 'Z'], [2, 'Y']], [0, 'X']], ['control: random product 9', [[0, 'I'], [3, 'I']], [3, 'I']], ['control: random product 10', [[1, 'XIZX'], [0, 'IYIZ']], [0, 'XYZY']]], [['regression: random product 33', [[2, 'IZYY'], [3, 'ZYXY']], [3, 'ZXZI']], ['regression: random product 34', [[-2, 'XXZ'], [2, 'IYZ']], [1, 'XZI']], ['regression: random product 27', [[-1, 'YY'], [3, 'IY']], [2, 'YI']], ['control: random product 11', [[-2, 'ZXI'], [3, 'IZX']], [0, 'ZYX']], ['control: random product 13', [[-1, 'Z'], [3, 'X']], [3, 'Y']], ['control: random product 14', [[-2, 'Z'], [0, 'X']], [3, 'Y']], ['control: random product 16', [[-1, 'YZI'], [2, 'ZIX']], [2, 'XZX']]]]
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: square of Y[0, 'Y'][0, 'I']Failed
regression: random product 0[3, 'XY'][3, 'XI']Failed
regression: random product 1[1, 'ZYI'][1, 'IYI']Failed
control: X times Y[1, 'Z'][1, 'Z']Passed
control: Y times X[3, 'Z'][3, 'Z']Passed
control: X times Z[3, 'Y'][3, 'Y']Passed
control: Z times X[1, 'Y'][1, 'Y']Passed

SHA-256 / 4b3ffe9f2ec6afd2cb2865ab4784d5ab9c9b236a89524880dcdc47eeb65532be

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    (k1, s1), (k2, s2) = x
    if len(s1) != len(s2):
        return 'length-mismatch'
    table = {('X', 'Y'): (1, 'Z'), ('Y', 'Z'): (1, 'X'), ('Z', 'X'): (1, 'Y'),
             ('Y', 'X'): (3, 'Z'), ('Z', 'Y'): (3, 'X'), ('X', 'Z'): (3, 'Y')}
    k = k1 + k2
    out = []
    for a, b in zip(s1, s2):
        if a == 'I':
            out.append(b)
        elif b == 'I':
            out.append(a)
        elif a == b:
            k += 2
            out.append('I')
        else:
            dk, c = table[(a, b)]
            k += dk
            out.append(c)
    return [k % 4, ''.join(out)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression: square of Y', [[0, 'Y'], [0, 'Y']], [0, 'I']], ['regression: random product 0', [[0, 'YY'], [2, 'ZY']], [3, 'XI']], ['regression: random product 1', [[-2, 'ZZI'], [2, 'ZXI']], [1, 'IYI']], ['control: X times Y', [[0, 'X'], [0, 'Y']], [1, 'Z']], ['control: Y times X', [[0, 'Y'], [0, 'X']], [3, 'Z']], ['control: X times Z', [[0, 'X'], [0, 'Z']], [3, 'Y']], ['control: Z times X', [[0, 'Z'], [0, 'X']], [1, 'Y']]], [['regression: random product 6', [[0, 'Z'], [0, 'Z']], [0, 'I']], ['regression: random product 8', [[-1, 'XZIY'], [3, 'IXYY']], [3, 'XYYI']], ['regression: random product 1', [[-2, 'ZZI'], [2, 'ZXI']], [1, 'IYI']], ['control: identity factors', [[1, 'II'], [2, 'IZ']], [3, 'IZ']], ['control: anticommuting pair twice', [[0, 'XY'], [0, 'YX']], [0, 'ZZ']], ['control: negative phase input', [[-1, 'Z'], [0, 'X']], [0, 'Y']], ['control: length mismatch', [[0, 'X'], [0, 'XY']], 'length-mismatch']], [['regression: random product 15', [[0, 'YYZI'], [0, 'XYXZ']], [0, 'ZIYZ']], ['regression: random product 17', [[3, 'X'], [0, 'X']], [3, 'I']], ['regression: random product 8', [[-1, 'XZIY'], [3, 'IXYY']], [3, 'XYYI']], ['control: phases wrap', [[3, 'XX'], [3, 'ZZ']], [0, 'YY']], ['control: random product 2', [[0, 'Y'], [1, 'X']], [0, 'Z']], ['control: random product 3', [[1, 'Y'], [0, 'Z']], [2, 'X']], ['control: random product 4', [[0, 'YXY'], [1, 'IZZ']], [1, 'YYX']]], [['regression: random product 25', [[-2, 'ZX'], [3, 'YX']], [0, 'XI']], ['regression: random product 27', [[-1, 'YY'], [3, 'IY']], [2, 'YI']], ['regression: random product 17', [[3, 'X'], [0, 'X']], [3, 'I']], ['control: random product 5', [[0, 'YIXX'], [2, 'ZIYY']], [1, 'XIZZ']], ['control: random product 7', [[3, 'Z'], [2, 'Y']], [0, 'X']], ['control: random product 9', [[0, 'I'], [3, 'I']], [3, 'I']], ['control: random product 10', [[1, 'XIZX'], [0, 'IYIZ']], [0, 'XYZY']]], [['regression: random product 33', [[2, 'IZYY'], [3, 'ZYXY']], [3, 'ZXZI']], ['regression: random product 34', [[-2, 'XXZ'], [2, 'IYZ']], [1, 'XZI']], ['regression: random product 27', [[-1, 'YY'], [3, 'IY']], [2, 'YI']], ['control: random product 11', [[-2, 'ZXI'], [3, 'IZX']], [0, 'ZYX']], ['control: random product 13', [[-1, 'Z'], [3, 'X']], [3, 'Y']], ['control: random product 14', [[-2, 'Z'], [0, 'X']], [3, 'Y']], ['control: random product 16', [[-1, 'YZI'], [2, 'ZIX']], [2, 'XZX']]]]
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: square of Y[2, 'I'][0, 'I']Failed
regression: random product 0[1, 'XI'][3, 'XI']Failed
regression: random product 1[3, 'IYI'][1, 'IYI']Failed
control: X times Y[1, 'Z'][1, 'Z']Passed
control: Y times X[3, 'Z'][3, 'Z']Passed
control: X times Z[3, 'Y'][3, 'Y']Passed
control: Z times X[1, 'Y'][1, 'Y']Passed

SHA-256 / 3e2fdeedc15c3a61a54b76f7f5202505a4c7066a5fb789f743a18b80216c255f

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

Case digest / 2cc4a038e941266af662e5f0cc50217b6024fa2febdd76a889577dff8108de0b