FAILURE MAP
← Case archive

FA-90966 / Quantum circuit simulation / Open access

Pauli product multiplies phase exponents · case 01

The product of iX and iZ is reported with phase exponent 1 instead of 2 plus the XZ contribution.

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

ROOT CAUSE

Input phase powers are combined with k1 * k2, but powers of i add under multiplication.

VERIFIED REPAIR

Start from k = k1 + k2.

Unsuccessful approach: The attempted repair adds the powers but folds them modulo 2, discarding the imaginary unit.

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('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: identity factors', [[1, 'II'], [2, 'IZ']], [3, 'IZ']], ['regression: negative phase input', [[-1, 'Z'], [0, 'X']], [0, 'Y']], ['regression: phases wrap', [[3, 'XX'], [3, 'ZZ']], [0, 'YY']], ['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 0', [[0, 'YY'], [2, 'ZY']], [3, 'XI']], ['regression: random product 2', [[0, 'Y'], [1, 'X']], [0, 'Z']], ['regression: phases wrap', [[3, 'XX'], [3, 'ZZ']], [0, 'YY']], ['control: square of Y', [[0, 'Y'], [0, 'Y']], [0, 'I']], ['control: anticommuting pair twice', [[0, 'XY'], [0, 'YX']], [0, 'ZZ']], ['control: length mismatch', [[0, 'X'], [0, 'XY']], 'length-mismatch'], ['control: random product 1', [[-2, 'ZZI'], [2, 'ZXI']], [1, 'IYI']]], [['regression: random product 4', [[0, 'YXY'], [1, 'IZZ']], [1, 'YYX']], ['regression: random product 5', [[0, 'YIXX'], [2, 'ZIYY']], [1, 'XIZZ']], ['regression: random product 8', [[-1, 'XZIY'], [3, 'IXYY']], [3, 'XYYI']], ['control: random product 6', [[0, 'Z'], [0, 'Z']], [0, 'I']], ['control: random product 15', [[0, 'YYZI'], [0, 'XYXZ']], [0, 'ZIYZ']], ['control: random product 19', [[2, 'I'], [2, 'Y']], [0, 'Y']], ['control: random product 21', [[2, 'YY'], [2, 'II']], [0, 'YY']]], [['regression: random product 8', [[-1, 'XZIY'], [3, 'IXYY']], [3, 'XYYI']], ['regression: random product 9', [[0, 'I'], [3, 'I']], [3, 'I']], ['regression: random product 12', [[-2, 'ZXIX'], [1, 'ZYXX']], [0, 'IZXI']], ['control: random product 23', [[0, 'YYI'], [0, 'YYX']], [0, 'IIX']], ['control: random product 34', [[-2, 'XXZ'], [2, 'IYZ']], [1, 'XZI']], ['control: random product 35', [[-2, 'IY'], [2, 'IX']], [3, 'IZ']], ['control: random product 37', [[-2, 'IIZ'], [2, 'XZX']], [1, 'XZY']]], [['regression: random product 11', [[-2, 'ZXI'], [3, 'IZX']], [0, 'ZYX']], ['regression: random product 12', [[-2, 'ZXIX'], [1, 'ZYXX']], [0, 'IZXI']], ['regression: random product 13', [[-1, 'Z'], [3, 'X']], [3, 'Y']], ['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']]]]
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: identity factors[2, 'IZ'][3, 'IZ']Failed
regression: negative phase input[1, 'Y'][0, 'Y']Failed
regression: phases wrap[3, 'YY'][0, 'YY']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 / 3274e3215e1ea8d4cd26df8bfda970ea460607c7331ab6ec58a4d42e4f5bf0f9

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) % 2
    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('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: identity factors', [[1, 'II'], [2, 'IZ']], [3, 'IZ']], ['regression: negative phase input', [[-1, 'Z'], [0, 'X']], [0, 'Y']], ['regression: phases wrap', [[3, 'XX'], [3, 'ZZ']], [0, 'YY']], ['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 0', [[0, 'YY'], [2, 'ZY']], [3, 'XI']], ['regression: random product 2', [[0, 'Y'], [1, 'X']], [0, 'Z']], ['regression: phases wrap', [[3, 'XX'], [3, 'ZZ']], [0, 'YY']], ['control: square of Y', [[0, 'Y'], [0, 'Y']], [0, 'I']], ['control: anticommuting pair twice', [[0, 'XY'], [0, 'YX']], [0, 'ZZ']], ['control: length mismatch', [[0, 'X'], [0, 'XY']], 'length-mismatch'], ['control: random product 1', [[-2, 'ZZI'], [2, 'ZXI']], [1, 'IYI']]], [['regression: random product 4', [[0, 'YXY'], [1, 'IZZ']], [1, 'YYX']], ['regression: random product 5', [[0, 'YIXX'], [2, 'ZIYY']], [1, 'XIZZ']], ['regression: random product 8', [[-1, 'XZIY'], [3, 'IXYY']], [3, 'XYYI']], ['control: random product 6', [[0, 'Z'], [0, 'Z']], [0, 'I']], ['control: random product 15', [[0, 'YYZI'], [0, 'XYXZ']], [0, 'ZIYZ']], ['control: random product 19', [[2, 'I'], [2, 'Y']], [0, 'Y']], ['control: random product 21', [[2, 'YY'], [2, 'II']], [0, 'YY']]], [['regression: random product 8', [[-1, 'XZIY'], [3, 'IXYY']], [3, 'XYYI']], ['regression: random product 9', [[0, 'I'], [3, 'I']], [3, 'I']], ['regression: random product 12', [[-2, 'ZXIX'], [1, 'ZYXX']], [0, 'IZXI']], ['control: random product 23', [[0, 'YYI'], [0, 'YYX']], [0, 'IIX']], ['control: random product 34', [[-2, 'XXZ'], [2, 'IYZ']], [1, 'XZI']], ['control: random product 35', [[-2, 'IY'], [2, 'IX']], [3, 'IZ']], ['control: random product 37', [[-2, 'IIZ'], [2, 'XZX']], [1, 'XZY']]], [['regression: random product 11', [[-2, 'ZXI'], [3, 'IZX']], [0, 'ZYX']], ['regression: random product 12', [[-2, 'ZXIX'], [1, 'ZYXX']], [0, 'IZXI']], ['regression: random product 13', [[-1, 'Z'], [3, 'X']], [3, 'Y']], ['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']]]]
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: identity factors[1, 'IZ'][3, 'IZ']Failed
regression: negative phase input[2, 'Y'][0, 'Y']Failed
regression: phases wrap[2, 'YY'][0, 'YY']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 / 639c153837c9d59a6173397eeff1da5a7b2f3c531e2d15fa738ecbc69cca6b5f

3 / The verified repair

Exit 0
"""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('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: identity factors', [[1, 'II'], [2, 'IZ']], [3, 'IZ']], ['regression: negative phase input', [[-1, 'Z'], [0, 'X']], [0, 'Y']], ['regression: phases wrap', [[3, 'XX'], [3, 'ZZ']], [0, 'YY']], ['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 0', [[0, 'YY'], [2, 'ZY']], [3, 'XI']], ['regression: random product 2', [[0, 'Y'], [1, 'X']], [0, 'Z']], ['regression: phases wrap', [[3, 'XX'], [3, 'ZZ']], [0, 'YY']], ['control: square of Y', [[0, 'Y'], [0, 'Y']], [0, 'I']], ['control: anticommuting pair twice', [[0, 'XY'], [0, 'YX']], [0, 'ZZ']], ['control: length mismatch', [[0, 'X'], [0, 'XY']], 'length-mismatch'], ['control: random product 1', [[-2, 'ZZI'], [2, 'ZXI']], [1, 'IYI']]], [['regression: random product 4', [[0, 'YXY'], [1, 'IZZ']], [1, 'YYX']], ['regression: random product 5', [[0, 'YIXX'], [2, 'ZIYY']], [1, 'XIZZ']], ['regression: random product 8', [[-1, 'XZIY'], [3, 'IXYY']], [3, 'XYYI']], ['control: random product 6', [[0, 'Z'], [0, 'Z']], [0, 'I']], ['control: random product 15', [[0, 'YYZI'], [0, 'XYXZ']], [0, 'ZIYZ']], ['control: random product 19', [[2, 'I'], [2, 'Y']], [0, 'Y']], ['control: random product 21', [[2, 'YY'], [2, 'II']], [0, 'YY']]], [['regression: random product 8', [[-1, 'XZIY'], [3, 'IXYY']], [3, 'XYYI']], ['regression: random product 9', [[0, 'I'], [3, 'I']], [3, 'I']], ['regression: random product 12', [[-2, 'ZXIX'], [1, 'ZYXX']], [0, 'IZXI']], ['control: random product 23', [[0, 'YYI'], [0, 'YYX']], [0, 'IIX']], ['control: random product 34', [[-2, 'XXZ'], [2, 'IYZ']], [1, 'XZI']], ['control: random product 35', [[-2, 'IY'], [2, 'IX']], [3, 'IZ']], ['control: random product 37', [[-2, 'IIZ'], [2, 'XZX']], [1, 'XZY']]], [['regression: random product 11', [[-2, 'ZXI'], [3, 'IZX']], [0, 'ZYX']], ['regression: random product 12', [[-2, 'ZXIX'], [1, 'ZYXX']], [0, 'IZXI']], ['regression: random product 13', [[-1, 'Z'], [3, 'X']], [3, 'Y']], ['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']]]]
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: identity factors[3, 'IZ'][3, 'IZ']Passed
regression: negative phase input[0, 'Y'][0, 'Y']Passed
regression: phases wrap[0, 'YY'][0, 'YY']Passed
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 / ac14a3990dacb7f9fb605ca9037cf4bc4b763ddf88df1a157076e32f329e2444

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

Case digest / 24a69093f72e6792a1e8e10f1afde14fe77ec014ac597b8906c981bdc10e9265