Skip to content

Decomp ​

Rotation and damping decompositions

8/8 passed in 247ms

TestWhat it doesResult
test_branches_match_channelOn every axis and angle the branches reproduce exp(-i theta P / 2) as a superoperator, identity branch first and empty. At a multiple of pi/2 they are one deterministic Clifford at gamma = 1; elsewhere 1 < gamma <= sqrt(2).✅ pass
test_clifford_gatesclifford_gates(axis, k * pi/2) multiplies out to exp(-i theta P / 2) up to a global phase on all three axes, through negative and past-2pi turns, and is None away from a multiple of pi/2.✅ pass
test_clifford_toleranceA Clifford angle is within CLIFFORD_TOL = 1e-9 rad of k*(pi/2): math.pi and 100 * math.pi fold, a hand-typed 3.14159265 (3.6e-9 rad off) does not.✅ pass
test_positive_regimeWith T2 <= T1 (mu >= lam) the decomposition is positive, gamma = 1; pure amplitude damping has q_Z < 0 and gamma > 1.✅ pass
test_reproduces_channelGeneralizedDamping reproduces the exact amplitude + phase damping channel over {I, Z, reset|0>, reset|1>} across relaxation and dephasing strengths.✅ pass
test_kraus_setIn both regimes the Kraus set is trace preserving (sum K^dag K = I), holds only Pauli terms, and reproduces the branch superoperator.✅ pass
test_twirlpauli_twirl is the chi diagonal read off the dense Kraus matrices, a genuine probability vector, and keeps the channel's decay: PTM diagonal (lam, lam, mu).✅ pass
test_twirl_named_casesAnchors: T1 = 100, T2 = 50 over t = 1 twirls to ((1-mu)/4, (1-mu)/4, (1+mu-2 lam)/4), and GeneralizedDamping(0.9, 0.95, 0.05) to (0.0125, 0.0125, 0.0375).✅ pass