betaFeedback

WorksPhysics and Astronomy

Accelerating Quantum Error Correction Simulations under Coherent Noise with Compiled Clifford-Augmented Matrix Product States

Abstract

Reliable assessment of quantum error correction requires understanding how coherent errors affect logical performance. Although tensor networks naturally capture coherent interference, entanglement growth and large qubit counts make repeated sampling costly. Here we develop a compiled Clifford-Augmented Matrix Product State (CAMPS) framework that reuses Clifford transformations across shots, recycles qubits released by measurements, evolves a compressed residual state, and accelerates sampling through rotation fusion and compilation tailored to the MPS layout. Surface-code benchmarks under fixed-sign coherent noise yield accurate logical error estimates at small bond dimensions, while random-sign simulations up to distance d=9d=9 and on the [[72,12,6]][[72,12,6]] bivariate bicycle code match the Pauli-twirling approximation results. Compared with uncompiled CAMPS, compiled CAMPS converges at smaller bond dimensions and achieves order-of-magnitude sampling speedups at equal bond dimension, opening a scalable route to studying coherent error propagation in larger fault-tolerant circuits.

Introduction.—Predicting how physical noise translates into logical failure under quantum error correction (QEC) is essential to building fault-tolerant quantum computers. Coherent errors complicate this task because amplitudes for distinct error paths can interfere, an effect discarded by stochastic Pauli models [1, 2]. Tensor-network methods [3, 4], particularly matrix product states (MPS), provide a natural framework for calculating these amplitudes and their interference [5, 6, 7, 8]. As entanglement accumulates, however, the bond dimension required for an accurate description can make repeated trajectory sampling prohibitively expensive.

In earlier work, we introduced Clifford-Augmented Matrix Product States (CAMPS) for simulating quantum many-body systems [9], representing a state as an MPS augmented by a Clifford circuit. Optimizing this Clifford representation reduces the residual MPS entanglement while preserving the physical state. In Hamiltonian simulations of ground states [10–16], finite-temperature properties [17], and real-time dynamics [18–21], disentanglers are updated iteratively across MPS bonds while optimizing or evolving a single state.

Quantum circuit simulation differs from Hamiltonian evolution in both structure and sampling cost. Instead of acting through coupled Hamiltonian terms, fault-tolerant circuits interleave explicit Clifford gates with sparse non-Clifford gates or coherent errors, leaving the residual state weakly entangled even at non-Clifford gate counts comparable to system size [22–25]. Estimating logical error rates also requires sampling many noisy trajectories of the same circuit rather than evolving a single state, motivating recent hybrid simulators [26] and MPS/CAMPS studies of coherent surface-code noise [27], QEC circuits, and magic-state cultivation [28, 29].

In such circuits, mid-circuit QEC measurements leave subsets of qubits isolated from the rest of the state. Using these free qubits, suitable Clifford transformations can turn subsequent multi-qubit Pauli rotations or projections into local single-qubit updates without increasing the MPS bond dimension [23, 30]. Recent compilers build on this property, with Clifford compiling, qubit recycling and Clifford evolution from circuit structure [31] and SymFT encoding fault and feedback dependence symbolically across trajectories [32].

Although Clifford compilation and CAMPS exploit the same representation freedom, existing compilers fix a Clifford sequence without tailoring the residual basis for MPS compression, whereas dynamic CAMPS updates the basis separately in each shot without recycling qubits. Capturing both advantages requires coordinating qubit recycling and residual-basis selection entirely at compile time from circuit structure alone.

In this Letter, we develop compiled CAMPS, combining cross-shot Clifford compilation and free-qubit recycling with block-MPS evolution, rotation fusion, and operator-span minimization. On rotated surface codes up to d=9d = 9 [33, 34] and the [[72,12,6]][[72, 12, 6]] bivariate bicycle (BB) code [35] under coherent noise, compiled CAMPS converges at smaller bond dimensions χ\chi and samples over an order of magnitude faster than uncompiled CAMPS at equal χ\chi.

Compiled CAMPS.—CAMPS represents a quantum state as ∣Ψ⟩=C∣ψ[A]⟩|\Psi\rangle=C|\psi[A]\rangle, with a Clifford operator CC augmenting an MPS specified by tensors AA [9]. Stochastic Pauli errors and measurement corrections are collected into an operator called the Pauli frame. Before sampling, the compiler constructs a shared Clifford sequence {C(t)}\{C(t)\} and a symbolic frame E(t;b)E(t;b), where bb records noise realizations and measurement outcomes [31, 32]. At circuit step tt, shot ν\nu evaluates the frame on its sampled record bνb_\nu,

∣Ψν(t)⟩=C(t)Eν(t)∣ψ[Aν(t)]⟩,E(t;b)⟶b=bνshot νEν(t).(1)|\Psi_\nu(t)\rangle=C(t)E_\nu(t)|\psi[A_\nu(t)]\rangle, \qquad E(t;b)\mathrel{\mathop{\longrightarrow}^{\text{shot }\nu}_{b=b_\nu}}E_\nu(t). \tag*{(1)}

The residual state ∣ψ[Aν(t)]⟩|\psi[A_\nu(t)]\rangle contains k(t)k(t) active qubits and free qubits in known ∣0⟩|0\rangle state. The compiler tracks their activation and release, reserving K=max⁡tk(t)K=\max_t k(t)

MPS positions. For nn physical qubits, pairing neighboring positions into L=⌈K/2⌉L=\lceil K/2\rceil blocks and omitting the step label tt hereafter gives

∣ψ[Aν]⟩=∣ϕν⟩⊗∣0⟩⊗(n−K),|\psi[A_\nu]\rangle=|\phi_\nu\rangle\otimes|0\rangle^{\otimes(n-K)},
∣ϕν⟩=∑{sa}Aν[1]s1⋯Aν[L]sL∣s1⋯sL⟩.(2)|\phi_\nu\rangle=\sum_{\{s_a\}} A_\nu^{[1]s_1}\cdots A_\nu^{[L]s_L}|s_1\cdots s_L\rangle. \tag*{(2)}

Each block index sas_a has dimension four (or two for an unpaired final qubit), inter-block bonds have dimensions χa≤χ\chi_a\le\chi, and the K−k(t)K-k(t) vacant positions remain in ∣0⟩|0\rangle. The effect of block size is analyzed in the End Matter (Figure 6). In each shot, the residual tensors AνA_\nu evolve under compiled non-Clifford rotations and measurements, as illustrated in Figure 1(a,Figure 1b).

Figure 1. Compiled CAMPS workflow and surface-code benchmarks. (a,b) Orange blocks show physical noise N\mathcal{N} and its compiled residual action N~\widetilde{\mathcal{N}}. The compiled C(t)C(t) is shared by all shots; Eν(t)E_{\nu}(t) and the block-2 MPS tensors AνA_{\nu} vary between shots. The MPS uses K=max⁡tk(t)K=\max_t k(t) positions. (c) Physical-qubit count nn and peak active-qubit count KK versus code distance dd for surface-code XX memory under coherent ZZZZ noise, with r=dr=d rounds. (d,e) Fixed-sign ZZZZ benchmark at d=r=5d=r=5, θ=0.02\theta=0.02, and p=0.005p=0.005. (d) Logical error rate pLp_L versus bond dimension χ\chi. Gray and purple dashed lines mark the untruncated K=17K=17 reference and PTA prediction. Compiled and uncompiled CAMPS and the state-vector reference each use 5×1055\times10^5 shots. Bars and shading show 95% confidence intervals. Inset: zoom near the untruncated reference. (e) Median sampling time per shot versus χ\chi. Compiled CAMPS is more than an order of magnitude faster than uncompiled CAMPS and physical MPS at equal χ\chi.

Figure 6. Mean number of SVDs per shot versus block size bb at χ=8\chi=8 in the surface-code circuit of Figure 1(d). Left inset: grouping qubits turns a two-qubit residual rotation into a local tensor update. Right inset: median sampling speedup t1/tbt_1/t_b versus bond dimension χ\chi, where tbt_b is the sampling time with bb qubits per block. Error bars show 95% confidence intervals.

We now construct the shared Clifford sequence and symbolic frame E(b)≡E(t;b)E(b)\equiv E(t;b), with “compile” arrows denoting updates made before sampling. A physical Clifford gate UU gives C→compileUCC \xrightarrow{\mathrm{compile}} UC, whereas a Pauli error FeF^{e} (e=0e=0 for II and e=1e=1 for FF) satisfies FeC=C(C†FC)eF^{e}C=C(C^\dagger F C)^{e} and updates E(b)→compile(C†FC)eE(b)E(\mathbf{b}) \xrightarrow{\mathrm{compile}} (C^\dagger F C)^{e}E(\mathbf{b}), keeping ee symbolic until sampled in each shot. A non-Clifford noise rotation Nj=eiθjPj\mathcal{N}_{j}=e^{i\theta_{j}P_{j}} then acts on the residual state as

N~j,ν=Eν†C†NjCEν=eiϑj,νQj,ϑj,ν=(−1)ℓj(bν)θj.(3)\widetilde{\mathcal{N}}_{j,\nu}=E_{\nu}^{\dagger}C^{\dagger}\mathcal{N}_{j}CE_{\nu} =e^{i\vartheta_{j,\nu}Q_{j}},\qquad\vartheta_{j,\nu}=(-1)^{\ell_{j}(\mathbf{b}_{\nu})}\theta_{j}. \tag*{(3)}

Here QjQ_{j} is the unsigned Pauli string in C†PjC=±QjC^{\dagger}P_{j}C=\pm Q_{j}, while the binary function ℓj(b)\ell_{j}(\mathbf{b}) tracks this sign together with sign flips from anticommuting Pauli errors and measurement corrections. Both QjQ_{j} and ℓj\ell_{j} are fixed during compilation, and each shot evaluates ℓj(bν)\ell_{j}(\mathbf{b}_{\nu}) to determine its effective rotation angle [32].

Rotations sharing the same Pauli string QjQ_{j} can be fused when all intervening operations commute with QjQ_{j},

∏μ∈Fjeiϑμ,νQj=exp⁡(iQj∑μ∈Fjϑμ,ν),\prod_{\mu\in\mathcal{F}_{j}}e^{i\vartheta_{\mu,\nu}Q_{j}}=\exp\left(iQ_{j}\sum_{\mu\in\mathcal{F}_{j}}\vartheta_{\mu,\nu}\right),

where Fj\mathcal{F}_{j} is a group of rotations applied in a single MPS update per shot. We repeat this fusion after simplifying operators on free ∣0⟩\lvert0\rangle qubits, since removing trivial ZZ factors via Z∣0⟩=∣0⟩Z\lvert0\rangle=\lvert0\rangle can make additional Pauli strings identical.

When a rotation instead acts as XX or YY on a free qubit, its multi-qubit coupling can be absorbed into CC, leaving a local MPS update [23, 30, 31]. For Q=σf⊗PfQ=\sigma_{f}\otimes P_{f} with σf∈{X,Y}\sigma_{f}\in\{X,Y\} on a free qubit ff and PfP_{f} on the remaining qubits, the controlled-PfP_{f} Clifford gate DfD_{f} (with control ff) obeys

eiϑQ(∣0⟩f⊗∣η⟩)=Df[eiϑσf∣0⟩f⊗∣η⟩],e^{i\vartheta Q}(\lvert0\rangle_{f}\otimes\lvert\eta\rangle) =D_{f}[e^{i\vartheta\sigma_{f}}\lvert0\rangle_{f}\otimes\lvert\eta\rangle],
C→compileCDf,C\xrightarrow{\mathrm{compile}}CD_{f},
E(b)→compileDf†E(b)Df.(4)E(\mathbf{b})\xrightarrow{\mathrm{compile}}D_{f}^{\dagger}E(\mathbf{b})D_{f}. \tag*{(4)}

Because this identity holds for any state ∣η⟩\lvert\eta\rangle of the other qubits, compilation fixes DfD_{f} from QQ and ff, while each shot activates ff through a single-qubit rotation without increasing the MPS bond dimensions.

Subsequent measurements can release active qubits for reuse [30, 31]. For an active Pauli measurement, where the reduced Q≠IQ\ne I acts only on active qubits (deterministic and free-qubit cases update CC and EE analytically), the compiler chooses a pivot qubit rr in its support and constructs a Clifford GrG_{r} satisfying GrQGr†=ZrG_{r}QG_{r}^{\dagger}=Z_{r}. The conditional release map Mm,r=(∣0⟩⟨m∣r⊗Irˉ)GrM_{m,r}=(\lvert0\rangle\langle m\rvert_{r}\otimes I_{\bar r})G_{r} projects onto the (−1)m(-1)^{m} eigenspace of QQ and resets rr to ∣0⟩\lvert0\rangle in the transformed basis,

C→compileCGr†,C\xrightarrow{\mathrm{compile}}CG_{r}^{\dagger},
E(b)→compileGrE(b)Gr†Xrm,E(\mathbf{b})\xrightarrow{\mathrm{compile}}G_{r}E(\mathbf{b})G_{r}^{\dagger}X_{r}^{m},
∣ψ[Aν]⟩→shot νMmν,r∣ψ[Aν]⟩pmν.(5)\lvert\psi[A_{\nu}]\rangle\xrightarrow{\mathrm{shot}\ \nu} \frac{M_{m_{\nu},r}\lvert\psi[A_{\nu}]\rangle}{\sqrt{p_{m_{\nu}}}.} \tag*{(5)}

Each shot evaluates ⟨Q⟩\langle Q\rangle from its current MPS, samples mν∈{0,1}m_{\nu}\in\{0,1\} with probability pm=[1+(−1)m⟨Q⟩]/2p_{m}=[1+(-1)^{m}\langle Q\rangle]/2, and substitutes m=mνm=m_{\nu} into E(b)E(\mathbf{b}), with position rr now free for later rotations. Applying the compiled sign correction to the residual eigenvalue (−1)mν(-1)^{m_{\nu}} recovers the physical measurement outcome.

CAMPs reduces MPS entanglement by changing the Clifford representation [9] [23]. A Clifford gate GG on the stored positions maps the residual state to ∣ψ[Aν′]⟩=G∣ψ[Aν]⟩\lvert\psi[A'_{\nu}]\rangle=G\lvert\psi[A_{\nu}]\rangle while leaving the physical state unchanged,

∣Ψν⟩=CEν∣ψ[Aν]⟩=(CGG†)(GEνG†)∣ψ[Aν′]⟩.(6)\lvert\Psi_{\nu}\rangle=CE_{\nu}\lvert\psi[A_{\nu}]\rangle =(CGG^{\dagger})(GE_{\nu}G^{\dagger})\lvert\psi[A'_{\nu}]\rangle. \tag*{(6)}

Rather than applying extra disentangling gates to the MPS at runtime, we realize these basis changes during compilation through the activation and measurement rules, updating later Pauli strings as Q→compileGQG†Q\xrightarrow{\mathrm{compile}}GQG^{\dagger} so that all shots share a common basis.

After fusion, we optimize this shared basis to shorten the MPS intervals spanned by rotations and measurements. Operations within one block need only a local tensor update, whereas wider operations require contraction and compression across inter-block MPS bonds. A candidate choice gg selects a vacant MPS position for qubit activation in Eq. (4), or a measurement pivot rr where QQ acts nontrivially in Eq. (5). Each choice changes the Clifford basis as in Eq. (6) and transforms later Pauli strings. Propagating these strings across a finite look-ahead window W\mathcal{W}, we minimize the total weighted width,

J(g)=∑j∈WwjΔj(g),\mathcal{J}(g)=\sum_{j\in\mathcal{W}}w_{j}\Delta_{j}(g),
g∗=arg min⁡g J(g).(7)g_{*}=\underset{g}{\operatorname{arg\,min}}\ \mathcal{J}(g). \tag*{(7)}

where Δj(g)\Delta_{j}(g) is the number of MPS bonds between the first and last blocks affected by operation jj. We set wj=1w_{j}=1 for rotations and wj=2w_{j}=2 for active measurements, since a measurement requires separate contractions to evaluate outcome probabilities and update the conditional state. Each shot then evolves its MPS using the optimized compiled instructions. Further details of compiled CAMPS are provided in the Supplemental Material (SM) [36].

**Numerical benchmarks.—**We evaluate the accuracy and sampling cost of compiled CAMPS against uncompiled CAMPS [27] and physical-qubit MPS baselines on rotated surface codes [33, 34] and the [[72,12,6]][[72,12,6]] bivariate bicycle (BB) code, a high-rate quantum low-density parity-check (qLDPC) code [35]. In uncompiled CAMPS, each shot updates its Clifford operator and nn-qubit MPS at runtime on the same backend, without qubit recycling, rotation fusion, or basis optimization. In both codes, coherent Pauli rotations are added to circuit-level Pauli noise models from earlier studies, while all simulators share a decoder built from the Pauli-twirled circuit. For circuit simulation, however, the Pauli-twirling approximation (PTA) is exact only for symmetric rotation-sign distributions and misses coherent interference in general.

We first simulate rotated surface-code XX memory over r=dr=d rounds with coherent ZZZZ rotations of angle θ=0.02\theta=0.02, decoded by minimum-weight perfect matching [37]. Following Ref. [27], the Pauli noise model assigns depolarizing probabilities p1=0.1pp_1=0.1p and p2=pp_2=p after one- and two-qubit Clifford gates, reset error probability pR=2pp_R=2p, and readout error probability pM=5pp_M=5p. As shown in Figure 1(c), free-qubit recycling substantially shortens the MPS required for these circuits, reducing n=49n=49 physical qubits to at most K=17K=17 active qubits at d=5d=5 and n=161n=161 to K=47K=47 at d=9d=9. Evolving the residual state vector gives an exact reference at K=17K=17. At K=47K=47, however, a dense state vector would require 2472^{47} complex amplitudes, whereas compiled CAMPS represents the residual state as an MPS with small bond

dimensions.

To test convergence under coherent noise, we set d=r=5d=r=5 and p=0.005p=0.005 with fixed rotation signs and track the logical error rate (LER) pLp_L versus χ\chi in Figure 1(d). In this fixed-sign setting, coherent interference raises pLp_L to more than twice the PTA prediction. Compiled CAMPS agrees with the untruncated reference within sampling uncertainty at χ=8\chi=8, whereas uncompiled CAMPS requires χ=32\chi=32 and the physical-qubit MPS remains unconverged through χ=64\chi=64. In Figure 1(e), compiled CAMPS further reduces the median time per shot for state evolution and measurement sampling by more than an order of magnitude relative to uncompiled CAMPS and physical MPS at equal χ\chi. With the same K=17K=17 active space and MPS backend, compiled CAMPS also converges at smaller χ\chi and samples faster than Clifford-compiled MPS evolution, as shown in Figure 1 of the End Matter.

At larger code distances, KK exceeds the reach of state-vector simulation, leaving fixed-sign coherent noise without an exact reference. To verify accuracy in this regime, we simulate larger surface codes and the BB code under random-sign coherent rotations, drawing each physical sign s=±1s=\pm1 independently and with equal probability in every shot. For a Pauli string PP and density matrix ρ\rho, averaging over e±iθPe^{\pm i\theta P} gives

12∑s=±1eisθPρe−isθP=cos⁡2θ ρ+sin⁡2θ PρP.(8)\frac{1}{2}\sum_{s=\pm1}e^{is\theta P}\rho e^{-is\theta P}=\cos^2\theta\,\rho+\sin^2\theta\,P\rho P. \tag*{(8)}

Averaging over the independent signs makes PTA exact and allows us to obtain the reference pLp_L by stabilizer sampling, whereas each compiled or uncompiled CAMPS shot still applies the coherent rotations eisθPe^{is\theta P}. Randomizing physical signs adds a sign flip per rotation without changing the compiled Pauli strings QjQ_j or the MPS basis, because the effective angles in Eq. (3) already take fluctuating signs determined by CC, the stochastic Pauli frame EνE_\nu, and fusion. At d=5d=5, Figure 5 of the End Matter confirms that compiled CAMPS converges similarly for fixed and random signs, reaching both exact references at χ=8\chi=8. Random-sign benchmarks thus provide a reliable accuracy test for general coherent noise.

Figure 5. Logical error rate pLp_L versus bond dimension χ\chi for fixed- and random-sign ZZZZ rotations in the surface-code circuit of Figure 1(d). Gray and purple dashed lines mark the untruncated K=17K=17 reference for fixed signs and the exact PTA reference for random signs. Inset: normalized ratio pL/prefp_L/p_{\mathrm{ref}} relative to each reference. Bars and shading show 95% confidence intervals.

Figure 2 compares the surface-code LER pLp_L for d=5d=5, 77, and 99 at χ=8\chi=8. Compiled CAMPS agrees closely with the exact PTA reference across all three distances and captures the suppression of logical errors with increasing dd at low pp. By contrast, uncompiled CAMPS at this bond dimension increasingly underestimates pLp_L as dd grows, with a pronounced deviation at d=9d=9 and p=10−3p=10^{-3}.

Figure 2. Surface-code logical errors under random-sign ZZZZ noise. XX memory with r=dr=d rounds and independent, equally likely e±iθZZe^{\pm i\theta ZZ} rotations (θ=0.02\theta=0.02); compiled and uncompiled CAMPS use χ=8\chi=8. Filled and open symbols denote compiled and uncompiled CAMPS; circles, triangles, and diamonds denote d=5d=5, 77, and 99. Compiled CAMPS agrees with the exact sign-averaged PTA reference, while uncompiled CAMPS increasingly underestimates logical errors as dd grows. Bars and shading show 95% confidence intervals.

Finally, we test compiled CAMPS beyond planar connectivity on six-round XX memory of the [[72,12,6]][[72, 12, 6]] BB code, which reduces qubit overhead at the cost of nonlocal parity checks [35]. Circuit noise includes Pauli errors of uniform probability pp on CNOT gates, idling, preparation, and readout, together with independent random-sign YY rotations of angle θ=0.01\theta=0.01 on each data qubit per round. Free-qubit recycling reduces the n=144n=144 physical qubits to at most K=45K=45 active qubits. We decode using belief propagation with ordered-statistics postprocessing [38], and Figure 3 reports the block LER, the probability that at least one of the twelve logical XX outcomes is incorrect. At χ=4\chi=4, both compiled and uncompiled CAMPS agree well with the exact PTA reference, while the inset of Figure 3 shows that compilation reduces the mean sampling time per shot by a factor of roughly 30 across the noise scan.

Figure 3. BB-code logical errors and compiled CAMPS sampling speedup. Six-round XX memory of the [[72,12,6]][[72,12,6]] code with independent, equally likely e±iθYe^{\pm i\theta Y} rotations (θ=0.01\theta=0.01); compiled and uncompiled CAMPS use χ=4\chi=4. Filled circles and open squares denote compiled and uncompiled CAMPS, both agreeing with the exact sign-averaged PTA reference at this small bond dimension. Inset: tˉuncomp/tˉcomp\bar{t}_{\mathrm{uncomp}}/\bar{t}_{\mathrm{comp}}, showing approximately 30× faster mean sampling with compiled CAMPS at equal χ\chi. Bars and shading show 95% confidence intervals.

**Conclusion and perspective.—**We have developed compiled CAMPS for repeated QEC sampling under coherent noise beyond Pauli twirling. Compiling the circuit once lets each shot update a Pauli frame and evolve a residual MPS, while free-qubit recycling, rotation fusion, and basis optimization reduce active qubits, residual entanglement, and operator spans. On surface- and BB-code benchmarks, compiled CAMPS yields accurate logical error estimates at small χ\chi and samples over an order of magnitude faster than uncompiled CAMPS at equal χ\chi.

In this work, neither uncompiled nor compiled CAMPS performs iterative disentangler optimization sweeps [9] during MPS evolution. Incorporating such sweeps remains a possible direction for further reducing χ\chi in deeper circuits. Mid-circuit feedforward [39] motivates adaptive compilation, while optimized unravelings [40, 41] may reduce residual MPS entanglement under dissipative noise. Beyond quantum memories, compiled CAMPS can simulate nonlocal QLDPC logical gates [42] as well as magic-state factories [43] and cultivation [29] under coherent hardware noise. Fast trajectory sampling also makes it practical to calibrate decoders beyond Pauli priors and train machine-learning decoders [44] on coherent errors.

Acknowledgments: We thank Riling Li and Yiming Zhang for helpful discussions. The computations in this work were run on the Siyuan-1 cluster supported by the Center for High Performance Computing at Shanghai Jiao Tong University. M.Q. acknowledges support from the National Natural Science Foundation of China (Grants No. 12522406 and No. 12774290), and the National Key Research and Development Program of MOST of China (2022YFA1405400). We acknowledge the use of ChatGPT for assistance with code development and manuscript editing. The authors take full responsibility for the content and conclusions of this work.

References

End Matter

Compiler comparison.—Different Clifford representations of the same physical state can require different MPS bond dimensions and update costs. On the fixed-sign ZZZZ surface-code benchmark of Figure 1(d), with d=r=5d=r=5, θ=0.02\theta=0.02, and p=0.005p=0.005, we compare the representations CE(b)CE(\mathbf{b}) from compiled CAMPS and Clifft [31] using the same block-2 MPS backend. Both compilations reduce the 49 physical qubits to a peak of K=17K=17 active qubits. Beyond qubit recycling, compiled CAMPS selects activation positions and measurement pivots using subsequent operator widths and combines rotations through two fusion stages.

Figure 4 shows that compiled CAMPS agrees with the untruncated reference within sampling uncertainty at χ=8\chi=8, and its LER pLp_L remains stable as χ\chi increases. At χ=8\chi=8, Clifft compilation followed by MPS evolution underestimates pLp_L by approximately 10% and approaches the reference more gradually at larger χ\chi. Compiled CAMPS thus yields better convergence with χ\chi and, as shown in the inset, faster sampling.

Fixed- and random-sign convergence.—Figure 5 compares convergence with bond dimension χ\chi for fixed- and random-sign coherent ZZZZ rotations in rotated surface-code X memory at d=r=5d=r=5, p=0.005p=0.005, and θ=0.02\theta=0.02. Fixed-sign rotations raise the untruncated K=17K=17 state-vector LER to more than 2.5 times the random-sign PTA value. The inset plots the normalized ratio pL/prefp_L/p_{\mathrm{ref}} relative to the state-vector reference for fixed signs and the PTA reference for random signs. Fixed signs give a lower ratio at χ=2\chi=2, but both compiled CAMPS curves are close to unity at χ=4\chi=4 and converge within sampling uncertainty at χ=8\chi=8, whereas uncompiled CAMPS requires χ=32\chi=32 in both settings.

Block MPS.—Grouping neighboring qubits into one tensor further reduces the cost of evolving the residual state. In a single-qubit MPS, a rotation coupling two neighboring qubits requires splitting the updated tensor by a singular-value decomposition (SVD). Placing both qubits in the same block turns this step into a local tensor update, as illustrated in the left inset of Figure 6. More generally, a block of bb qubits has a physical index of dimension 2b2^{b}, with χ\chi limiting only the bonds between blocks. Rotations and measurements supported within one block act directly on this physical index, avoiding SVDs across internal qubit boundaries.

Figure 6 compares b=1b = 1, 2, 3, and 4 on the fixed-sign ZZZZ benchmark of Figure 1(d), optimizing the compiled basis for each block size. Block-2 roughly halves the mean number of SVDs per shot, from 1914 to 938, and b=3b = 3 and 4 reduce it further to 628 and 448. In the right inset, blocking speeds up sampling relative to b=1b = 1 across all χ\chi. Because larger blocks reduce SVDs at the cost of a 2b2^{b} physical dimension, the fastest grouping depends on circuit structure and χ\chi. All other benchmarks here use block-2. The block partition can also be optimized together with the Clifford representation, for example by varying block sizes along the MPS or as the circuit evolves.

Supplemental Material: Accelerating Quantum Error Correction Simulations under Coherent Noise with Compiled Clifford-Augmented Matrix Product States

Jiale Huang; Yaojian Chen; Ke Liu; Dingshun Lv; Mingpu Qin

We compile a noisy circuit once for simulation with a compiled Clifford-augmented matrix product state (CAMPS). The compiler fixes the Pauli axes of rotations and measurements and the rules for their signs. Each shot samples the noise, evolves the stored matrix product state (MPS), and produces a measurement record for decoding. The circuits have fixed gate locations and can include Clifford gates, Pauli rotations, stochastic Pauli faults, measurements, resets, and parity-controlled Pauli feedback. Our rotation convention is

RP(θ)≡eiθP=cos⁡θI+isin⁡θP,RX(θ)=eiθX,RZ(θ)=eiθZ.R_{P}(\theta) \equiv e^{i\theta P} = \cos\theta I + i\sin\theta P,\qquad R_{X}(\theta) = e^{i\theta X},\qquad R_{Z}(\theta) = e^{i\theta Z}.

Here PP is a Hermitian Pauli string and θ∈R\theta\in\mathbb{R} is the rotation angle. Operator products act from right to left. Sections S1 and S2 derive the update rules. Section S3 builds the shared instruction list, Sec. S4 executes it for one shot, and Sec. S5 describes the noise models and how logical failures are counted. Two qubits per MPS block are used throughout, except in the block-size comparison.

Notation

SymbolDefinition
nnTotal number of physical circuit qubits, including ancillas.
k(t), K=max⁡tk(t)k(t),\ K=\max_t k(t)Active-qubit count and its peak; the KK stored positions hold active qubits and free qubits in ∣0⟩\lvert0\rangle.
C(t)C(t)Compiled nn-qubit Clifford, shared by all shots.
E(t;b), Eν(t)E(t;\mathbf{b}),\ E_\nu(t)Symbolic Pauli frame and its value E(t;bν)E(t;\mathbf{b}_\nu) in shot ν\nu.
bν\mathbf{b}_\nuBits for Pauli faults, readout errors, physical rotation signs when sampled, and residual measurement outcomes.
∣Ψν⟩\lvert\Psi_\nu\rangleFull physical state, CEν∣ψ[Aν]⟩CE_\nu\lvert\psi[A_\nu]\rangle.
∣ψ[Aν]⟩, ∣ϕν⟩\lvert\psi[A_\nu]\rangle,\ \lvert\phi_\nu\rangleFull residual state and stored KK-qubit state, related by ∣ψ[Aν]⟩=∣ϕν⟩⊗∣0⟩⊗(n−K)\lvert\psi[A_\nu]\rangle=\lvert\phi_\nu\rangle\otimes\lvert0\rangle^{\otimes(n-K)}.
AνA_\nuMPS tensors evolved numerically in shot ν\nu.
χ\chiMaximum retained MPS bond dimension between blocks.
Pj, QjP_j,\ Q_jPhysical Pauli string and compiled unsigned residual Pauli string.
θj, ϑj,ν\theta_j,\ \vartheta_{j,\nu}Physical rotation angle and effective residual angle in shot ν\nu, including compiled signs and fusion.
Δj\Delta_jNumber of MPS bonds between the first and last blocks on which residual operator jj acts nontrivially.

Table 3.

Compiled CAMPS representation

State decomposition

At circuit step tt, compiled CAMPS represents the physical state in shot ν\nu as [1, 2, 3]

∣Ψν(t)⟩=C(t)Eν(t)∣ψ[Aν(t)]⟩,Eν(t)=E(t;bν),∣ψ[Aν(t)]⟩=∣ϕν(t)⟩⊗∣0⟩⊗(n−K).(9)\begin{aligned} \lvert\Psi_\nu(t)\rangle&= C(t)E_\nu(t)\lvert\psi[A_\nu(t)]\rangle,\\ E_\nu(t) &= E(t;\mathbf{b}_\nu),\\ \lvert\psi[A_\nu(t)]\rangle&= \lvert\phi_\nu(t)\rangle\otimes\lvert0\rangle^{\otimes(n-K)}. \tag*{(9)} \end{aligned}

The Clifford C(t)C(t) is shared by all shots. The Pauli frame E(t;b)E(t;\mathbf{b}) stores stochastic faults and measurement corrections as functions of event bits b\mathbf{b}. Each shot supplies its own record bν\mathbf{b}_\nu and evolves its own MPS tensors AνA_\nu.

A free qubit is a residual qubit in the known state ∣0⟩\lvert0\rangle, unentangled with the other residual qubits. The compiler marks qubits as active when they enter the numerical evolution and releases them after suitable measurements. It reserves K=max⁡tk(t)K=\max_t k(t) MPS positions for the peak active count: at step tt, these hold k(t)k(t) active qubits and K−k(t)K-k(t) free qubits. The remaining n−Kn-K free qubits are represented by the final product state in Eq. (9). These labels refer to the residual state; the physical state is reconstructed by CEνCE_\nu.

Pauli-frame updates and rotation signs

Start from C=E=IC=E=I. A Clifford gate UU gives UCE=(UC)EUCE=(UC)E, while a Pauli fault FeF^e obeys FeC=C(C†FC)eF^eC=C(C^\dagger F C)^e. The updates are therefore

Physical operationCompiled update
Clifford UUC↦UCC\mapsto UC
Pauli fault FeF^eE↦(C†FC)eEE\mapsto(C^\dagger F C)^eE

Table 4.

The bit e=0e=0 denotes no fault and e=1e=1 denotes a fault; it is sampled for each trajectory. Successive Pauli components combine by exclusive OR (XOR), denoted by ⊕\oplus. For example,

Z1b2Z1b3=Z1b2⊕b3.Z_1^{b_2}Z_1^{b_3}=Z_1^{b_2\oplus b_3}.

If both events occur, the two Z1Z_1 operators cancel; if only one occurs, a Z1Z_1 remains. Clifford conjugation maps Pauli strings to Pauli strings. Thus, up to global phase, the frame can be stored as

E(b)=∏rXrxr(b)Zrzr(b).E(\mathbf{b})=\prod_r X_r^{x_r(\mathbf{b})}Z_r^{z_r(\mathbf{b})}.

where each binary exponent is an XOR of selected event bits and a possible fixed bit. Parity-controlled Pauli feedback has the same form.

Pauli-frame signs in residual rotations.—Clifford conjugation fixes the residual axis: C†PjC=±QjC^\dagger P_j C = \pm Q_j. The Pauli frame EE preserves this rotation when EQj=QjEEQ_j = Q_jE and reverses its angle when EQj=−QjEEQ_j = -Q_jE. For a single-qubit XX rotation,

X†RX(θ)X=RX(θ),Z†RX(θ)Z=RX(−θ),X^\dagger R_X(\theta)X = R_X(\theta), \qquad Z^\dagger R_X(\theta)Z = R_X(-\theta),

because X†XX=XX^\dagger X X = X and Z†XZ=−XZ^\dagger X Z = -X. For example, take E=X1b1Z1b2⊕b3E = X_1^{b_1}Z_1^{b_2 \oplus b_3}. Its X1X_1 component commutes with the rotation, while its Z1Z_1 component gives

E†RX1(θ)E={RX1(+θ),b2=b3,RX1(−θ),b2≠b3.E^\dagger R_{X_1}(\theta)E = \begin{cases} R_{X_1}(+\theta), & b_2=b_3,\\ R_{X_1}(-\theta), & b_2\ne b_3. \end{cases}

This example extends to any Pauli string:

Eν†C†RPj(θj)CEν=RQj(ϑj,ν),ϑj,ν=(−1)ℓj(bν)θj,(10)E_\nu^\dagger C^\dagger R_{P_j}(\theta_j)CE_\nu= R_{Q_j}(\vartheta_{j,\nu}), \qquad\vartheta_{j,\nu} = (-1)^{\ell_j(b_\nu)}\theta_j, \tag*{(10)}
ℓj(bν)=cj⊕⨁μhjμbν,μ.(11)\ell_j(b_\nu) = c_j \oplus\bigoplus_\mu h_{j\mu}b_{\nu,\mu}. \tag*{(11)}

Here hjμ=1h_{j\mu}=1 selects an event bit that reverses the rotation’s sign, and cjc_j includes fixed signs from the Clifford and frame. In the example above, cj=0c_j=0 and (hj1,hj2,hj3)=(0,1,1)(h_{j1},h_{j2},h_{j3})=(0,1,1): b1b_1 has no effect on the angle. Compilation fixes these coefficients. Each shot substitutes its event bits, obtaining +θj+\theta_j for ℓj=0\ell_j=0 and −θj-\theta_j for ℓj=1\ell_j=1. For a physical rotation RPj(sjθj)R_{P_j}(s_j\theta_j), the noise model supplies sjs_j and the Clifford and Pauli frame determine ℓj\ell_j. The residual angle in shot ν\nu is sj(−1)ℓj(bν)θjs_j(-1)^{\ell_j(b_\nu)}\theta_j.

Two-qubit example with measurement

Figure S1 starts from

Figure S1. The two-qubit example, with gates read from left to right. (a) Physical rotations and a Pauli fault, followed by a joint X0X1X_0X_1 measurement. (b) The corresponding residual rotation, Z0Z_0 measurement, and release. The dashed arrow writes mm into the Pauli frame; the dashed boxes reconstruct the conditional physical state using E(t;e,m)E(t;e,m) and the shared Clifford C(t)C(t). (c) Measurement probabilities for the two fault branches at θ1=θ2=π/8\theta_1=\theta_2=\pi/8.

∣0⟩0⊗∣ηβ⟩1,∣ηβ⟩=RX(β)∣0⟩=cos⁡β∣0⟩+isin⁡β∣1⟩,U0=CNOT⁡0→1H0.|0\rangle_0 \otimes|\eta_\beta\rangle_1, \qquad|\eta_\beta\rangle= R_X(\beta)|0\rangle= \cos\beta|0\rangle+ i\sin\beta|1\rangle, \qquad U_0 = \operatorname{CNOT}_{0\to1}H_0.

The state just before the physical X0X1X_0X_1 measurement in panel (a) is

∣Ψe⟩=RZ1(θ2)X1eRZ1(θ1)U0(∣0⟩0⊗∣ηβ⟩1).|\Psi_e\rangle= R_{Z_1}(\theta_2)X_1^eR_{Z_1}(\theta_1)U_0(|0\rangle_0 \otimes|\eta_\beta\rangle_1).

Conjugation by U0U_0 gives the residual axes and the fused angle:

U0†Z1U0=X0Z1≡Q,U0†X1U0=X1,U_0^\dagger Z_1U_0 = X_0Z_1 \equiv Q, \qquad U_0^\dagger X_1U_0 = X_1,
RQ(θ2)X1eRQ(θ1)=X1eRQ(Θe),Θe=θ1+(−1)eθ2.R_Q(\theta_2)X_1^eR_Q(\theta_1) = X_1^eR_Q(\Theta_e), \qquad\Theta_e = \theta_1 + (-1)^e\theta_2.

Activating qubit 0 absorbs CZ⁡01\operatorname{CZ}_{01} into the Clifford and leaves a single-qubit residual rotation:

C∗=U0CZ⁡01,E∗(e)=(Z0X1)e,C_* = U_0\operatorname{CZ}_{01}, \qquad E_*(e) = (Z_0X_1)^e,
∣Ψe⟩=C∗E∗(e)∣ψe⟩,∣ψe⟩=RX0(Θe)∣0⟩0⊗∣ηβ⟩1.|\Psi_e\rangle= C_*E_*(e)|\psi_e\rangle, \qquad|\psi_e\rangle= R_{X_0}(\Theta_e)|0\rangle_0 \otimes|\eta_\beta\rangle_1.

Now measure X0X1X_0X_1 with eigenvalue (−1)m(-1)^m, where m=0,1m=0,1. The Clifford maps this operator to Z0Z_0, and the frame preserves its sign:

C∗†(X0X1)C∗=Z0,E∗†Z0E∗=Z0,p0(e)=cos⁡2Θe,p1(e)=sin⁡2Θe.C_*^\dagger(X_0X_1)C_* = Z_0, \qquad E_*^\dagger Z_0E_* = Z_0, \qquad p_0(e)=\cos^2\Theta_e, \qquad p_1(e)=\sin^2\Theta_e.

The residual measurement leaves qubit 0 in ∣m⟩|m\rangle. Returning it to the free state ∣0⟩|0\rangle transfers its value into the frame as X0mX_0^m:

Eafter(e,m)=E∗(e)X0m,∣ψe,m⟩=∣0⟩0⊗∣ηβ⟩1,E_{\mathrm{after}}(e,m) = E_*(e)X_0^m, \qquad|\psi_{e,m}\rangle= |0\rangle_0 \otimes|\eta_\beta\rangle_1,
∣Ψe,m⟩≃C∗Eafter(e,m)∣ψe,m⟩.|\Psi_{e,m}\rangle\simeq C_*E_{\mathrm{after}}(e,m)|\psi_{e,m}\rangle.

Here ≃\simeq omits a branch-global phase. These are the dashed boxes in panel (b): C(t)=C∗C(t)=C_* and E(t;e,m)=Eafter(e,m)E(t;e,m)=E_{\mathrm{after}}(e,m). For θ1=θ2=π/8\theta_1=\theta_2=\pi/8, e=0e=0 gives Θ0=π/4\Theta_0=\pi/4 and p0=p1=1/2p_0=p_1=1/2, whereas e=1e=1 gives Θ1=0\Theta_1=0 and m=0m=0 with probability one [panel (c)]. Section S2 derives the activation and release identities and continues the example with qubit reuse.

Qubit activation, measurement, and reuse

A free qubit is in ∣0⟩\lvert0\rangle and unentangled with the other residual qubits. A rotation can activate it; a later measurement can make an active qubit free again. The identities below describe these two changes of representation and determine the active count k(t)k(t). Figure S2 illustrates them with two-qubit circuits.

Figure S2. Qubit activation and reuse in explicit circuits. (a) The rotation on ∣0⟩0∣η⟩1|0\rangle_0|\eta\rangle_1 becomes a local RX(ϑ)R_X(\vartheta) and a controlled ZZ absorbed into CC. (b) Case 3 for Q=Z0Z1Q=Z_0Z_1, with input ∣++⟩|++\rangle and C=E=IC=E=I. The first CNOT moves the parity to qubit 0; measurement and release leave the residual state ∣0+⟩|0+\rangle. The dashed boxes, E′=X0mE'=X_0^m and C′=G0C'=G_0, reconstruct the two physical parity states shown below the circuit. (c) The freed qubit is used by a later residual RX(λ)R_X(\lambda). The displayed product state is the new residual state.

Activating a free qubit

Consider a rotation whose Pauli string contains XX or YY on a free qubit ff: Q=σf⊗P‾fQ=\sigma_f\otimes\overline{P}_f, with σf=X\sigma_f=X or YY. The other qubits may be in any state ∣η⟩\lvert\eta\rangle. Define DfD_f as a controlled-P‾f\overline{P}_f gate with control qubit ff:

Df=∣0⟩⟨0∣f⊗I+∣1⟩⟨1∣f⊗P‾f.(12)D_f=\lvert0\rangle\langle0\rvert_f\otimes I+\lvert1\rangle\langle1\rvert_f\otimes\overline{P}_f. \tag*{(12)}

The rotation creates two terms,

RQ(ϑ)∣0⟩f∣η⟩=cos⁡ϑ∣0⟩f∣η⟩+isin⁡ϑ σf∣0⟩fP‾f∣η⟩.R_Q(\vartheta)\lvert0\rangle_f\lvert\eta\rangle=\cos\vartheta\lvert0\rangle_f\lvert\eta\rangle+i\sin\vartheta\,\sigma_f\lvert0\rangle_f\overline{P}_f\lvert\eta\rangle.

The two branches in the diagram reproduce these terms: DfD_f applies P‾f\overline{P}_f only when ff is in ∣1⟩\lvert1\rangle. Thus a local rotation followed by this Clifford gives the same state [4, 5]:

RQ(ϑ)(∣0⟩f⊗∣η⟩)=Df[Rσf(ϑ)∣0⟩f⊗∣η⟩].(13)R_Q(\vartheta)(\lvert0\rangle_f\otimes\lvert\eta\rangle)=D_f\left[R_{\sigma_f}(\vartheta)\lvert0\rangle_f\otimes\lvert\eta\rangle\right]. \tag*{(13)}

For example, Q=X0Z1Q=X_0Z_1 gives D0=CZ01D_0=CZ_{01} [Fig. S2(a)]:

cos⁡ϑ∣0⟩0∣η⟩1+isin⁡ϑ∣1⟩0Z1∣η⟩1=CZ01[(cos⁡ϑ∣0⟩0+isin⁡ϑ∣1⟩0)⊗∣η⟩1].\cos\vartheta\lvert0\rangle_0\lvert\eta\rangle_1+i\sin\vartheta\lvert1\rangle_0Z_1\lvert\eta\rangle_1=CZ_{01}\left[\left(\cos\vartheta\lvert0\rangle_0+i\sin\vartheta\lvert1\rangle_0\right)\otimes\lvert\eta\rangle_1\right].

Absorbing DfD_f into the compiled representation gives

C′=CDf,E′=Df†EDf,C' = CD_f,\qquad E' = D_f^\dagger E D_f,
∣ψ′⟩=Rσf(ϑ)∣0⟩f⊗∣η⟩,k′=k+1.|\psi'\rangle= R_{\sigma_f}(\vartheta)|0\rangle_f \otimes|\eta\rangle,\qquad k' = k + 1.

The stored state remains a product across ff and the other qubits, so activating ff changes only its local tensor and leaves the virtual bond dimensions unchanged. For XX the new vector is cos⁡ϑ∣0⟩+isin⁡ϑ∣1⟩\cos\vartheta|0\rangle+i\sin\vartheta|1\rangle; for YY it is cos⁡ϑ∣0⟩−sin⁡ϑ∣1⟩\cos\vartheta|0\rangle-\sin\vartheta|1\rangle. The compiler assigns ff to a free MPS position and includes this relabeling in CC.

If a rotation has only II or ZZ on free qubits, their known action is removed using Z∣0⟩=∣0⟩Z|0\rangle=|0\rangle. The remaining rotation acts on the active qubits through the matrix product operator (MPO) update in Sec. S4; if its Pauli string is the identity, it contributes a global phase.

Measurement cases and qubit release

For an unsigned residual Pauli QQ, outcome mm labels the eigenvalue (−1)m(-1)^m:

Πm(Q)=I+(−1)mQ2,pm=1+(−1)m⟨Q⟩2,m∈{0,1}.(14)\Pi_m(Q)=\frac{I+(-1)^mQ}{2},\qquad p_m=\frac{1+(-1)^m\langle Q\rangle}{2},\qquad m\in\{0,1\}. \tag*{(14)}

First remove any ZZ operators on free qubits using Z∣0⟩=∣0⟩Z|0\rangle=|0\rangle. The remaining Pauli operators determine which of the following rules applies.

CaseWhere QQ actsOutcome and state updateActive count
1Identitym=0m=0; state unchangedk→kk\to k
2XX or YY on a free qubitp0=p1=1/2p_0=p_1=1/2; update CC and EEk→kk\to k
3XX, YY, or ZZ only on active qubitsEvaluate ⟨Q⟩\langle Q\rangle; sample mm and release one qubitk→k−1k\to k-1

Table S1.

These are outcomes of the unsigned residual operator; conversion to the physical outcome via the compiled sign is described at the end of this section.

Case 1: a deterministic outcome.—The input is already a +1+1 eigenstate of QQ. For example, Q=ZfQ=Z_f with ff free gives Q∣ψ⟩=∣ψ⟩Q|\psi\rangle=|\psi\rangle. Thus p0=1p_0=1, the projection leaves the state unchanged, and k′=kk'=k.

Case 2: XX or YY on a free qubit.—Write Q=σf⊗PfQ=\sigma_f\otimes P_f with ff free. The known state of ff fixes the expectation value:

⟨Q⟩=⟨0∣σf∣0⟩⟨η∣Pf∣η⟩=0.\langle Q\rangle=\langle0|\sigma_f|0\rangle\langle\eta|P_f|\eta\rangle=0.

(14) therefore gives p0=p1=1/2p_0=p_1=1/2 for any ∣η⟩|\eta\rangle. For Q=XfQ=X_f, the normalized state of the measured qubit is HXm∣0⟩HX^m|0\rangle. The same HH applies for both outcomes. For a general PfP_f, the same construction uses the controlled Pauli DfD_f from (12):

Πm(Q)(∣0⟩f⊗∣η⟩)=12DfHσ,fXfm(∣0⟩f⊗∣η⟩).(15)\Pi_m(Q)(|0\rangle_f\otimes|\eta\rangle)=\frac{1}{\sqrt{2}}D_fH_{\sigma,f}X_f^m(|0\rangle_f\otimes|\eta\rangle). \tag*{(15)}

where HX=HH_X=H, HY=SHH_Y=SH, and S=diag⁡(1,i)S=\operatorname{diag}(1,i). Writing Ff=DfHσ,fF_f=D_fH_{\sigma,f}, the updates are

C′=CFf,E′=Ff†EFfXfm,∣ψ′⟩=∣ψ⟩.C'=CF_f,\qquad E'=F_f^\dagger EF_fX_f^m,\qquad|\psi'\rangle=|\psi\rangle.

The compiler fixes FfF_f for both outcomes. The sampled bit mm enters the frame through XfmX_f^m. The residual qubit ff stays free, so k′=kk'=k [2, 5].

Case 3: measurement on active qubits.—Here the remaining QQ is nonidentity and acts only on active qubits. The compiler chooses a pivot rr where QQ acts as XX, YY, or $Z (Sec. S3). Apply HH at each XX and HS†HS^\dagger at each YY, so that only II and ZZ remain. For each other qubit carrying ZZ, apply a CNOT from that qubit to rr. Together these gates form the Clifford GrG_r with GrQGr†=ZrG_rQG_r^\dagger=Z_r.

Each shot computes ⟨Q⟩\langle Q\rangle in its stored state and draws mm using (14). In the basis fixed by GrG_r, projection leaves rr in ∣m⟩|m\rangle. Returning it to ∣0⟩|0\rangle defines the release map

Mm,r=(⟨0∣⟨m∣r⊗Irˉ)Gr,M_{m,r}=(\langle0|\langle m|_r\otimes I_{\bar r})G_r,
∣ϕ′⟩=Mm,r∣ϕ⟩pm,Mm,r†Mm,r=Πm(Q),k′=k−1.(16)|\phi'\rangle=\frac{M_{m,r}|\phi\rangle}{\sqrt{p_m}},\qquad M_{m,r}^\dagger M_{m,r}=\Pi_m(Q),\qquad k'=k-1. \tag*{(16)}

The output has the form ∣0⟩r⊗∣ηm⟩|0\rangle_r\otimes|\eta_m\rangle. Store the outcome in E′E' and absorb the inverse basis change into C′C':

C′=CGr†,E′=GrEGr†Xrm.C'=CG_r^\dagger,\qquad E'=G_rEG_r^\dagger X_r^m.

These updates reconstruct the projected physical state, since

C′E′Mm,r=CEΠm(Q).C'E'M_{m,r}=CE\Pi_m(Q).

The remaining state ∣ηm⟩|\eta_m\rangle can depend on the outcome. An active qubit has become free, giving the k′=k−1k'=k-1 update in the third row of the table.

A parity-measurement example.—Take Q=Z0Z1Q=Z_0Z_1, choose r=0r=0, and write the normalized residual input as

∣ϕ⟩=∑u,v=01auv∣u⟩0∣v⟩1.|\phi\rangle=\sum_{u,v=0}^{1}a_{uv}|u\rangle_0|v\rangle_1.

Here G0=CNOT⁡1→0G_0=\operatorname{CNOT}_{1\to0} computes the parity on qubit 0:

∣u,v⟩→G0∣u⊕v,v⟩,G0(Z0Z1)G0†=Z0.|u,v\rangle\xrightarrow{G_0}|u\oplus v,v\rangle,\qquad G_0(Z_0Z_1)G_0^\dagger=Z_0.

Measuring Z0Z_0 selects u⊕v=mu\oplus v=m, so

Mm,0∣ϕ⟩=∣0⟩0⊗(am,0∣0⟩1+am⊕1,1∣1⟩1),M_{m,0}|\phi\rangle=|0\rangle_0\otimes\left(a_{m,0}|0\rangle_1+a_{m\oplus1,1}|1\rangle_1\right),
pm=∣am,0∣2+∣am⊕1,1∣2,∣ηm⟩1=am,0∣0⟩1+am⊕1,1∣1⟩1pm.p_m=|a_{m,0}|^2+|a_{m\oplus1,1}|^2,\qquad|\eta_m\rangle_1=\frac{a_{m,0}|0\rangle_1+a_{m\oplus1,1}|1\rangle_1}{\sqrt{p_m}}.

For example, ∣ϕ⟩=∣+⟩0∣+⟩1|\phi\rangle=|+\rangle_0|+\rangle_1, with ∣+⟩=(∣0⟩+∣1⟩)/2|+\rangle=(|0\rangle+|1\rangle)/\sqrt{2}, gives p0=p1=1/2p_0=p_1=1/2 and ∣ηm⟩=∣+⟩|\eta_m\rangle=|+\rangle. The released residual state is ∣0+⟩|0+\rangle. For initial C=E=IC=E=I, the updated Clifford and frame reconstruct the two parity eigenstates:

CNOT⁡1→0X0m∣0+⟩={(∣00⟩+∣11⟩)/2,m=0,(∣10⟩+∣01⟩)/2,m=1.\operatorname{CNOT}_{1\to0}X_0^{m}|0+\rangle= \begin{cases} (|00\rangle+|11\rangle)/\sqrt{2}, & m=0,\\ (|10\rangle+|01\rangle)/\sqrt{2}, & m=1. \end{cases}

Figure S2 shows this ∣++⟩|++\rangle example: the residual state becomes ∣0+⟩|0+\rangle, while C′=G0C' = G_0 and E′=X0mE' = X_0^m reconstruct the even- or odd-parity state.

Qubit reuse and physical readout

After release, a later residual rotation containing XrX_r or YrY_r can activate the same position by Eq. (13) [Figure S2]. In the example of Figure S1, Q=Z0Q = Z_0 already, so G0=IG_0 = I and

Mm,0∣ψe⟩=am(e)∣0⟩0∣ηβ⟩1,a0(e)=cos⁡Θe,a1(e)=isin⁡Θe.M_{m,0}|\psi_e\rangle= a_m(e)|0\rangle_0|\eta_\beta\rangle_1,\qquad a_0(e)=\cos\Theta_e,\qquad a_1(e)=i\sin\Theta_e.

The frame becomes Eafter=E∗X0mE_{\mathrm{after}} = E_*X_0^m. A subsequent physical RZ1(λ)R_{Z_1}(\lambda) then acts on the freed qubit because

C∗†Z1C∗=X0,Eafter†X0Eafter=(−1)eX0,∣0⟩0↦RX0((−1)eλ)∣0⟩0.C_*^\dagger Z_1 C_* = X_0,\qquad E_{\mathrm{after}}^\dagger X_0 E_{\mathrm{after}} = (-1)^eX_0,\qquad|0\rangle_0\mapsto R_{X_0}\left((-1)^e\lambda\right)|0\rangle_0.

Including the preparation of ∣ηβ⟩|\eta_\beta\rangle, the active count is

0→RX1(β)1→activation2→release1→reuse2,K=2.0 \xrightarrow{R_{X_1}(\beta)} 1 \xrightarrow{\mathrm{activation}} 2 \xrightarrow{\mathrm{release}} 1 \xrightarrow{\mathrm{reuse}} 2,\qquad K=2.

This schedule is compiled once and shared by all shots, including branches with $\Theta_e=0.

Physical outcomes and reset.—For a physical measurement of PP, the compiled sign obeys E†C†PCE=(−1)ℓjQE^\dagger C^\dagger PCE=(-1)^{\ell_j}Q. The parity ℓj\ell_j converts the residual outcome mm to the physical outcome mphysm_{\mathrm{phys}}. The readout error bit eMe_M determines the recorded result yy,

mphys=m⊕ℓj,y=mphys⊕eM.m_{\mathrm{phys}}=m\oplus\ell_j,\qquad y=m_{\mathrm{phys}}\oplus e_M.

Classical feedback uses yy. A physical reset after a ZZ measurement applies XmphysX^{m_{\mathrm{phys}}}, followed by any modeled preparation error. The residual release in Eq. (16) frees an MPS position while C′C' and E′E' retain the measured physical state; a circuit reset adds the physical correction just described.

Rotation fusion and operator-width optimization

After transporting the Clifford and Pauli frame as in Sec. S1, the compiler fuses rotations about the same Pauli axis. Applying the free-qubit rules of Sec. S2 can make two previously different axes equal, so the compiler fuses again. It then chooses activation positions and measurement pivots to shorten the MPS intervals of later operations.

First fusion and reordering

For a group FjF_j of rotations about the same unsigned axis QjQ_j, the signed angles add. Write the physical angle of rotation μ\mu as sμθμs_\mu\theta_\mu, with sμ=1s_\mu=1 when the circuit specifies θμ\theta_\mu directly. Then

∏μ∈FjRQj(sμθμ(−1)ℓμ(bν))=RQj(ϑj,ν),ϑj,ν=∑μ∈Fjsμθμ(−1)ℓμ(bν).(17)\prod_{\mu\in F_j} R_{Q_j}\left(s_\mu\theta_\mu(-1)^{\ell_\mu(b_\nu)}\right) =R_{Q_j}(\vartheta_{j,\nu}),\qquad \vartheta_{j,\nu}=\sum_{\mu\in F_j}s_\mu\theta_\mu(-1)^{\ell_\mu(b_\nu)}. \tag*{(17)}

The compiler adds the sign bit (1−sμ)/2(1-s_\mu)/2 to ℓμ\ell_\mu modulo two and collects terms with the same parity, as in α(−1)e+γ(−1)e=(α+γ)(−1)e\alpha(-1)^e+\gamma(-1)^e=(\alpha+\gamma)(-1)^e. Each shot evaluates the resulting sum once.

Reordering before fusion.—Rotations with the same axis may be separated by other operations. The compiler first brings them together so that Eq. (17) can be applied. For example, if [P,T]=0[P,T]=0,

RP(α)RT(β)RP(γ)=RT(β)RP(α)RP(γ)=RT(β)RP(α+γ).R_P(\alpha)R_T(\beta)R_P(\gamma)=R_T(\beta)R_P(\alpha)R_P(\gamma)=R_T(\beta)R_P(\alpha+\gamma).

Moving one PP rotation past the intervening TT rotation therefore reduces three rotations to two. Each such exchange must satisfy two conditions.

(i) The quantum operations commute. For example, P=X0X1P=X_0X_1 and T=Z0Z1T=Z_0Z_1 commute: exchanging XX and ZZ contributes one minus sign on each qubit, and the two signs cancel. For the general check, encode the local Paulis as I:(0,0)I:(0,0), X:(1,0)X:(1,0), Z:(0,1)Z:(0,1), and Y:(1,1)Y:(1,1), and collect these bits into P=(x,z)P=(\mathbf{x},\mathbf{z}) and T=(x′,z′)T=(\mathbf{x}',\mathbf{z}'). The commutation test is

ω(P,T)=x⋅z′+z⋅x′=0(mod2).\omega(P,T)=\mathbf{x}\cdot\mathbf{z}'+\mathbf{z}\cdot\mathbf{x}'=0\pmod2.

This sum counts local anticommutations modulo two; for X0X1X_0X_1 and Z0Z1Z_0Z_1, it gives 1+1=01+1=0 (mod 2). For a measurement of TT, the same condition gives RP(α)Πm(T)=Πm(T)RP(α)R_P(\alpha)\Pi_m(T)=\Pi_m(T)R_P(\alpha) for each outcome mm.

(ii) Classical bit dependencies are respected. Consider the execution order

measure Z2⟶m⟶RX0((−1)mα).\text{measure }Z_2 \longrightarrow m \longrightarrow R_{X_0}\left((-1)^m\alpha\right).

Here X0X_0 and Z2Z_2 commute, but the rotation must follow the measurement: mm selects the angle +α+\alpha or −α-\alpha. To check this dependence, let RiR_i be the classical bits read by instruction ii, and WiW_i the bits it produces or overwrites. Exchanging instructions ii and jj requires

Wi∩(Rj∪Wj)=∅,Wj∩Ri=∅.W_i \cap(R_j \cup W_j)=\varnothing,\qquad W_j\cap R_i=\varnothing.

Neither instruction may read or overwrite a bit written by the other. In the example, Wmeas∩Rrot={m}W_{\mathrm{meas}}\cap R_{\mathrm{rot}}=\{m\}, so the exchange fails this test. The same two checks allow measurement blocks to move earlier across eligible rotations, which can enable earlier qubit release. The measurements retain their order relative to one another.

Second fusion after free-qubit reduction

Let ff be free and qubits 0,10,1 be active, with input ∣0⟩f⊗∣η⟩01\lvert0\rangle_f\otimes\lvert\eta\rangle_{01}. Set P=ZfX0X1P=Z_fX_0X_1, T=Z0Z1T=Z_0Z_1, and Q=X0X1Q=X_0X_1, and consider

Ue=RP(α)RT(β)RP((−1)eγ)RQ(δ).U_e=R_P(\alpha)R_T(\beta)R_P\left((-1)^e\gamma\right)R_Q(\delta).

where ee is an event bit in the Pauli frame. Figure S3 follows this circuit through both fusion passes.

Figure S3. Two equal-axis fusion passes. Each gate encloses the Pauli factors of one rotation, with its angle above. Gates act from left to right. (a,b) The two blue rotations commute with the intervening Z0Z1Z_0Z_1 rotation and fuse. (c) Since Zf∣0⟩f=∣0⟩fZ_f\lvert0\rangle_f=\lvert0\rangle_f, both bracketed rotations now have axis X0X1X_0X_1. (d) Their angles add to Θe\Theta_e, leaving two rotations.

Since [P,T]=0[P,T]=0, the first pass combines the two PP rotations into RP(α+(−1)eγ)R_P\left(\alpha+(-1)^e\gamma\right). On the free qubit, Zf∣0⟩f=∣0⟩fZ_f\lvert0\rangle_f=\lvert0\rangle_f, so this rotation now has the same axis X0X1X_0X_1 as RQ(δ)R_Q(\delta). The second pass adds δ\delta, giving Θe=α+(−1)eγ+δ\Theta_e=\alpha+(-1)^e\gamma+\delta and

Ue(∣0⟩f⊗∣η⟩01)=∣0⟩f⊗RZ0Z1(β)RX0X1(Θe)∣η⟩01.U_e(\lvert0\rangle_f\otimes\lvert\eta\rangle_{01})=\lvert0\rangle_f\otimes R_{Z_0Z_1}(\beta)R_{X_0X_1}(\Theta_e)\lvert\eta\rangle_{01}.

For α=δ=θ/2\alpha=\delta=\theta/2 and γ=θ\gamma=\theta, Θ0=2θ\Theta_0=2\theta and Θ1=0\Theta_1=0; the latter branch skips its zero-angle update. An expression that vanishes for every event record is removed during compilation.

For each residual rotation, the compiler searches backward for an equal axis, crossing commuting rotations and stopping at an anticommuting one. A match is combined using Eq. (17). Activations and nonrotation instructions bound these sequences of rotations in fixed residual coordinates.

MPS layout and operator width

After fusion, the activation and release sequence fixes k(t)k(t) and KK. The compiler next chooses where each new active qubit is stored and which qubit is released at an active measurement. These choices use Clifford changes of the residual representation [1, 4]:

∣Ψν⟩=CEν∣ψ[Aν]⟩=(CG†)(GEνG†)∣ψ[Aν′]⟩,∣ψ[Aν′]⟩=G∣ψ[Aν]⟩.(18)|\Psi_\nu\rangle= CE_\nu|\psi[A_\nu]\rangle = (CG^\dagger)(GE_\nu G^\dagger)|\psi[A'_\nu]\rangle,\qquad|\psi[A'_\nu]\rangle= G|\psi[A_\nu]\rangle. \tag*{(18)}

Each later Pauli string becomes Qj′=GQjG†Q'_j = GQ_jG^\dagger. The compiler propagates these strings through the subsequent activation and release rules and scores the MPS intervals they occupy. The width Δj\Delta_j is the number of MPS bonds between the first and last blocks on which QjQ_j acts nontrivially. Group the stored positions as (0,1)∣(2,3)∣(4,5)∣⋯(0,1)|(2,3)|(4,5)|\cdots. Write Qj=⨂rσj,rQ_j = \bigotimes_r \sigma_{j,r} and let SjS_j contain the positions whose factor σj,r\sigma_{j,r} is XX, YY, or ZZ. For a nonempty SjS_j,

Δj=⌊max⁡Sj2⌋−⌊min⁡Sj2⌋.(19)\Delta_j = \left\lfloor\frac{\max S_j}{2}\right\rfloor-\left\lfloor\frac{\min S_j}{2}\right\rfloor. \tag*{(19)}

If Qj=IQ_j=I, the set SjS_j is empty and we set Δj=0\Delta_j=0. For example,

QjQ_jZ0Z1Z_0Z_1Z0Z3Z_0Z_3Z0Z5Z_0Z_5
Δj\Delta_j012

A rotation with Δ=0\Delta=0 updates one block; Δ=1\Delta=1 crosses one MPS bond. The tensor contractions on these intervals are given in Sec. S4.

For a candidate position or pivot gg, the score over the future window is

J(g)=∑j∈WrotΔj(g)+2∑j∈WmeasΔj(g),\mathcal{J}(g)=\sum_{j\in W_{\mathrm{rot}}}\Delta_j(g)+2\sum_{j\in W_{\mathrm{meas}}}\Delta_j(g),
g⋆=arg min⁡g J(g).(20)g_\star=\underset{g}{\operatorname{arg\,min}}\ \mathcal{J}(g). \tag*{(20)}

The window contains future rotations and active measurements. The measurement weight two accounts for its separate probability contraction and conditional-state update.

An activation example.—Suppose K=4K=4, with active qubits a,ba,b at stored positions 0, 2. Positions 1, 3 are free, and a new active qubit ff can use either one. Let the future window contain RZaZf(α)R_{Z_aZ_f}(\alpha) followed by a measurement of XaXfX_aX_f. Their spans give

position of ffΔrot\Delta_{\mathrm{rot}}Δmeas\Delta_{\mathrm{meas}}J\mathcal{J}
1000
3113

Table 5.

The compiler chooses position 1, placing both updates inside the first block [Fig. S4]. Both candidates have the same active count k=3k=3.

  • A measurement-pivot example.*—Now take four active positions and measure Q=Z0Z2Q=Z_0Z_2. Either position on which QQ acts can be released, using

G0=CNOT⁡2→0,G0QG0†=Z0,G_0=\operatorname{CNOT}_{2\to0},\qquad G_0QG_0^\dagger=Z_0,
G2=CNOT⁡0→2,G2QG2†=Z2.G_2=\operatorname{CNOT}_{0\to2},\qquad G_2QG_2^\dagger=Z_2.

After the measurement, the chosen pivot is free. Let the future window contain RZ2Z3(α)R_{Z_2Z_3}(\alpha) followed by a measurement of Z1Z2Z_1Z_2. For the two choices, the Z2Z_2 factor in both future operators becomes

Z2→G0Z2,Z2→G2Z0Z2→release 2Z0.Z_2 \xrightarrow{G_0} Z_2,\qquad Z_2 \xrightarrow{G_2} Z_0Z_2 \xrightarrow{\text{release }2} Z_0.

The last step uses Z2∣0⟩2=∣0⟩2Z_2|0\rangle_2=|0\rangle_2 after release. Figure S5 shows the resulting unsigned axes and update intervals. Pivot 2 gives the smaller score: its rotation crosses one bond, while its measurement becomes local to the first block. For an incoming frame E=IE=I, this choice gives E′=X2mE'=X_2^m. The outcome mm supplies a factor (−1)m(-1)^m to the later rotation angle and measurement sign, as in Sec. S2. Both choices release one qubit, giving k=3k=3.

Figure S5. Choosing a pivot for the measurement Z0Z2Z_0Z_2. The dashed circle marks the released position. The blue row gives the Pauli factors of the next rotation and the teal row those of the next measurement. Gray dots denote II. Brackets span the blocks used by that update. Releasing 00 makes the rotation local. Releasing 22 makes the measurement local and lowers J=Δrot+2Δmeas\mathcal{J}=\Delta_{\rm rot}+2\Delta_{\rm meas} from 22 to $1.

Figure S4. Choosing where to activate ff. Both panels group the positions as (0,1)∣(2,3)(0,1)|(2,3), with active qubits a,ba,b at 0,20,2. Blue circles mark the operands of the next rotation ZaZfZ_aZ_f and measurement XaXfX_aX_f. The bracket spans the blocks visited by both updates. (a) At position 11, ff shares a block with aa, giving J=0\mathcal{J}=0. (b) At position 33, both updates cross one bond, giving J=1+2=3\mathcal{J}=1+2=3.

Compilation procedure.—The compiler makes the position and pivot choices sequentially. For each candidate, it copies the current Clifford map, applies the trial choice, and propagates the following Pauli strings to evaluate Eq. (20).

Within a trial, a future activation uses the lowest free position with an active block partner, or the lowest free position otherwise. A future measurement uses the middle of the ordered positions carrying XX, YY, or ZZ, taking the upper middle when their number is even. At each later decision, all candidates are evaluated again. Ties keep this default choice, followed by the lowest position index.

In the pseudocode, I\mathcal{I} is the instruction list. The candidate set Gj\mathcal{G}_j contains the free positions for an activation, or the positions carrying XX, YY, or ZZ for an active measurement. ApplyChoice records the choice in instruction jj and updates the Clifford map for later instructions; Encode stores the position, transformed Pauli string, update interval, and angle or outcome parity.

Input: circuit U\mathcal{U} with noise distributions and classical dependencies.

  1. (C,E(b),I)←Transport⁡(U)(C,E(\mathbf{b}),\mathcal{I}) \leftarrow\operatorname{Transport}(\mathcal{U})

  2. I←ScheduleFuse⁡(I)\mathcal{I} \leftarrow\operatorname{ScheduleFuse}(\mathcal{I})

  3. I←FreeQubitReduce⁡(I)\mathcal{I} \leftarrow\operatorname{FreeQubitReduce}(\mathcal{I}) (Sec. S2)

  4. I←ResidualFuse⁡(I)\mathcal{I} \leftarrow\operatorname{ResidualFuse}(\mathcal{I})

  5. P←[ ]\mathcal{P} \leftarrow[\ ]

  6. for each instruction j∈Ij \in\mathcal{I} in order:

  7. if jj is an activation or an active measurement:

  8. g⋆←arg⁡min⁡g∈GjJ(g)g_\star\leftarrow\arg\min_{g\in\mathcal{G}_j}\mathcal{J}(g); ApplyChoice⁡(j,g⋆)\operatorname{ApplyChoice}(j,g_\star)

  9. P.append⁡(Encode⁡(j))\mathcal{P}.\operatorname{append}(\operatorname{Encode}(j))

Output: plan P\mathcal{P}, with angle and outcome rules evaluated using bν\mathbf{b}_\nu.

The searches use the following upper bounds:

StageQuantityMaximum
First fusion and schedulingOuter iterations8
Rotation-scheduling sweeps per iteration16
Instructions per moved nonrotation block64
Residual fusionPreceding surviving rotations examined64
Position and pivot searchFuture instructions / rotations per trial256 / 256

Table 1.

Scheduling stops early if the sequence is unchanged; residual fusion stops at an anticommuting rotation or a fixed-coordinate sequence boundary. The final layout and its angle rules are passed to the sampler in Sec. S4.

Block-MPS evolution and sampling

The compiled plan specifies each Pauli string, rotation-angle rule, activation position, and measurement pivot. Each shot evaluates the angles, updates the block tensors, and samples the measurement outcomes. An update crossing Δj\Delta_j MPS bonds spans Δj+1\Delta_j+1 consecutive blocks.

Block tensors and Pauli rotations

The KK stored positions form L=⌈K/2⌉L=\lceil K/2\rceil blocks,

∣ϕν⟩=∑s1,…,sLAν[1]s1Aν[2]s2⋯Aν[L]sL∣s1⋯sL⟩,Aν[a]sa∈Cχa−1×χa.(21)\lvert\phi_\nu\rangle= \sum_{s_1,\ldots,s_L} A_\nu^{[1]s_1} A_\nu^{[2]s_2}\cdots A_\nu^{[L]s_L}\lvert s_1\cdots s_L\rangle,\qquad A_\nu^{[a]s_a}\in\mathbb{C}^{\chi_{a-1}\times\chi_a}. \tag*{(21)}

Here χ0=χL=1\chi_0=\chi_L=1 and χa≤χ\chi_a\leq\chi. Each full block has four physical labels sa=00,01,10,11s_a=00,01,10,11; the last block has two labels if KK is odd. In a four-qubit example grouped as (0,1)∣(2,3)(0,1)|(2,3), we have s1=u0u1s_1=u_0u_1 and s2=u2u3s_2=u_2u_3, where ur∈{0,1}u_r\in\{0,1\} is the bit at stored position rr. We suppress the shot index ν\nu below.

If position 3 is free, its block tensor has components A[2]u2,0=Bu2A^{[2]u_2,0}=B^{u_2} and A[2]u2,1=0A^{[2]u_2,1}=0. An activation RX3(ϑ)R_{X_3}(\vartheta) gives

(A[2]u2,0,A[2]u2,1)=(Bu2,0)⟶(cos⁡ϑBu2,isin⁡ϑBu2).\left(A^{[2]u_2,0},A^{[2]u_2,1}\right)=\left(B^{u_2},0\right)\longrightarrow\left(\cos\vartheta B^{u_2},i\sin\vartheta B^{u_2}\right).

Only the physical components change; both virtual dimensions stay the same. This is the tensor implementation of the activation in Sec. S2.

A rotation as two MPO channels.—Consider Q=X0Z3Q=X_0Z_3 in this block-2 example. Its operators on the two blocks are q[1]=X⊗Iq^{[1]}=X\otimes I and q[2]=I⊗Zq^{[2]}=I\otimes Z, so

RQ(ϑ)=cos⁡ϑ I4⊗I4+isin⁡ϑ (X⊗I)⊗(I⊗Z).R_Q(\vartheta)=\cos\vartheta\,I_4\otimes I_4+i\sin\vartheta\,(X\otimes I)\otimes(I\otimes Z).

On a basis state, the second channel flips u0u_0 and multiplies its amplitude by (−1)u3(-1)^{u_3}. With c0=cos⁡ϑc_0=\cos\vartheta and c1=isin⁡ϑc_1=i\sin\vartheta, write (q[a]A[a])s=∑u(q[a])suA[a]u(q^{[a]}A^{[a]})^{s}=\sum_u(q^{[a]})_{su}A^{[a]u}. Combining the MPS and MPO bonds in Figure S6 gives the updated tensors

Figure S6. Block-2 MPS updates on (0,1)∣(2,3)(0,1)|(2,3). Physical indices run upward through the MPO. The horizontal lines carry the MPS bond α1\alpha_1 and the MPO bond β1\beta_1. (a) The β1=0\beta_1=0 and β1=1\beta_1=1 channels carry the two terms of RX0Z3(ϑ)R_{X_0Z_3}(\vartheta) shown below. (b) The two XOR updates accumulate u0⊕u3u_0\oplus u_3. The right boundary β2=m\beta_2=m selects the indicated bit pairs, and writing s2=u2s_2=u_2 releases qubit 3.

A~[1]s1=(c0A[1]s1c1(q[1]A[1])s1),A~[2]s2=(A[2]s2(q[2]A[2])s2).\widetilde{A}^{[1]s_1}=\left(c_0A^{[1]s_1}\quad c_1(q^{[1]}A^{[1]})^{s_1}\right),\qquad\widetilde{A}^{[2]s_2}=\begin{pmatrix} A^{[2]s_2}\\ (q^{[2]}A^{[2]})^{s_2}\end{pmatrix}.

Contracting the shared bond gives the amplitudes of c0∣ϕ⟩+c1Q∣ϕ⟩c_0\lvert\phi\rangle+c_1Q\lvert\phi\rangle.

The same construction applies across any number of blocks. For a compiled Pauli string,

RQj(ϑ)=c0I+c1Qj,Qj=⨂aqj[a].(22)R_{Q_j}(\vartheta)=c_0I+c_1Q_j,\qquad Q_j=\bigotimes_a q_j^{[a]}. \tag*{(22)}

Each qj[a]q_j^{[a]} is the tensor product of the single-qubit Pauli operators in block aa. Number the Δj+1\Delta_j+1 blocks from the first to the last block on which QjQ_j acts nontrivially as a=1,…,Δj+1a=1,\ldots,\Delta_j+1. When Δj>0\Delta_j>0, the MPO tensors are

W[1]=(c0Ic1qj[1]),W[a]=(I00qj[a]),1<a<Δj+1,W[Δj+1]=(Iqj[Δj+1]).(23)\begin{aligned} W^{[1]}&=\left(c_0I\quad c_1q_j^{[1]}\right),\\ W^{[a]}&=\begin{pmatrix} I & 0 \\ 0 & q_j^{[a]} \end{pmatrix},\quad1<a<\Delta_j+1,\\ W^{[\Delta_j+1]}&=\begin{pmatrix} I \\ q_j^{[\Delta_j+1]} \end{pmatrix}. \tag*{(23)} \end{aligned}

The virtual index βa=0,1\beta_a=0,1 selects the identity or Pauli channel throughout the interval. Multiplying the operator-valued matrices gives exactly the two terms in Eq. (22). An intermediate block with qj[a]=Iq_j^{[a]}=I carries both channels onward. Contracting each MPO tensor with its MPS tensor gives

A~(αa−1,βa−1),(αa,βa)[a]s=∑u(Wβa−1,βa[a])suAαa−1,αa[a]u.(24)\widetilde{A}^{[a]s}_{(\alpha_{a-1},\beta_{a-1}),(\alpha_a,\beta_a)} =\sum_u\left(W^{[a]}_{\beta_{a-1},\beta_a}\right)_{su}A^{[a]u}_{\alpha_{a-1},\alpha_a}. \tag*{(24)}

Combining the MPS index αa\alpha_a and the two-valued MPO index βa\beta_a gives an intermediate bond dimension at most 2χa2\chi_a [Fig. S6(a)]. Standard SVD compression retains a bond dimension of at most χ\chi. For Δj=0\Delta_j=0, the entire rotation is a local matrix update,

A[1]s←∑u(c0I+c1qj[1])suA[1]u,A^{[1]s}\leftarrow\sum_u\left(c_0I+c_1q_j^{[1]}\right)_{su}A^{[1]u},

with unchanged virtual dimensions.

Measurement probabilities and conditional updates

For the Z0Z3Z_0Z_3 measurement in Figure S6, take qubits 1, 2 in ∣00⟩12|00\rangle_{12}. In the order (0,3)(0,3), choose the two-qubit input

∣ϕ03⟩=∑u0,u3=01au0u3∣u0u3⟩=2∣00⟩+∣01⟩+i∣10⟩+∣11⟩7.|\phi_{03}\rangle=\sum_{u_0,u_3=0}^{1}a_{u_0u_3}|u_0u_3\rangle=\frac{2|00\rangle+|01\rangle+i|10\rangle+|11\rangle}{\sqrt{7}}.

Each basis pair has Q=Z0Z3Q=Z_0Z_3 eigenvalue (−1)m(-1)^m with m=u0⊕u3m=u_0\oplus u_3. Draw mm with probability pm=∑u0⊕u3=m∣au0u3∣2p_m=\sum_{u_0\oplus u_3=m}|a_{u_0u_3}|^2. Retain the amplitudes with parity mm and divide them by pm\sqrt{p_m}.

mmretained u0u3u_0u_3pmp_mΠm(Q)∣ϕ03⟩/pm\Pi_m(Q)|\phi_{03}\rangle/\sqrt{p_m}
000, 11(4+1)/7=5/7(4+1)/7=5/7(2∣00⟩+∣11⟩)/5(2|00\rangle+|11\rangle)/\sqrt{5}
101, 10(1+1)/7=2/7(1+1)/7=2/7(∣01⟩+i∣10⟩)/2(|01\rangle+i|10\rangle)/\sqrt{2}

Table 6.

The compiled pivot is r=3r=3. On every retained term, G3=CNOT⁡0→3G_3=\operatorname{CNOT}_{0\to3} puts the same bit mm on this pivot. The release map in Eq. (16) acts as

∣u0,u3⟩→G3∣u0,u0⊕u3⟩=∣u0,m⟩→∣0⟩⟨m∣3∣u0,0⟩.|u_0,u_3\rangle\xrightarrow{G_3} |u_0,u_0\oplus u_3\rangle=|u_0,m\rangle\xrightarrow{|0\rangle\langle m|_3} |u_0,0\rangle.

For m=1m=1, the residual output is (∣0⟩0+i∣1⟩0)⊗∣0⟩3/2(|0\rangle_0+i|1\rangle_0)\otimes|0\rangle_3/\sqrt{2}. In both branches qubit 3 factors out as ∣0⟩3|0\rangle_3 and is free for reuse. The Pauli frame carries X3mX_3^m as in Sec. S2.

The block-MPS sampler obtains the probabilities from one expectation value. In the example, the block operators Z⊗IZ\otimes I and I⊗ZI\otimes Z give ⟨Z0Z3⟩=p0−p1=3/7\langle Z_0Z_3\rangle=p_0-p_1=3/7. For a general active measurement, place the orthogonality center in the update interval and contract its blocks in order.

E0=I,Ea=∑s,u(qj[a])su(A[a]s)†Ea−1A[a]u,a=1,…,Δj+1,⟨Qj⟩=Tr⁡EΔj+1,pm=1+(−1)m⟨Qj⟩2.(25)\begin{aligned} \mathcal{E}_0&=I,\\ \mathcal{E}_a&=\sum_{s,u}(q^{[a]}_j)_{su}(A^{[a]s})^\dagger\mathcal{E}_{a-1}A^{[a]u},\qquad a=1,\ldots,\Delta_j+1,\\ \langle Q_j\rangle&=\operatorname{Tr}\mathcal{E}_{\Delta_j+1},\qquad p_m=\frac{1+(-1)^m\langle Q_j\rangle}{2}. \tag*{(25)} \end{aligned}

For the conditional update, the first box in Figure S6 passes β1=u0\beta_1=u_0 to the second. The second keeps inputs with β1⊕u3=m\beta_1\oplus u_3=m and writes the output u2 0u_2\,0. For a general QjQ_j, first turn each nonidentity factor into ZZ with the local basis changes

b(I)=b(Z)=I,b(X)=H,b(Y)=HS†.b(I)=b(Z)=I,\qquad b(X)=H,\qquad b(Y)=HS^\dagger.

For the rotated input label uu in block aa, let πa(u)\pi_a(u) be the XOR of the bits at these ZZ positions. Let fa,r(u)f_{a,r}(u) copy uu, setting the pivot bit to zero in the block containing rr. These two rules give the matrix elements of each MPO tensor

(Wβa−1,βa[a])su=δβa,βa−1⊕πa(u)⏟accumulate parity⋅δs,fa,r(u)⏟write output,β0=0,βΔj+1=m.(26)\left(W^{[a]}_{\beta_{a-1},\beta_a}\right)_{su} =\underbrace{\delta_{\beta_a,\beta_{a-1}\oplus\pi_a(u)}}_{\text{accumulate parity}} \cdot\underbrace{\delta_{s,f_{a,r}(u)}}_{\text{write output}}, \qquad\beta_0=0,\quad\beta_{\Delta_j+1}=m. \tag*{(26)}

The right boundary selects the sampled parity mm. Contract this MPO with the basis-transformed MPS as in Eq. (24), divide by pm\sqrt{p_m}, and compress the updated tensors.

Sampling one shot

Let Tχ,τ\mathcal{T}_{\chi,\tau} denote standard SVD compression of the updated bonds with maximum bond dimension χ\chi and cutoff τ\tau, followed by normalization. At the start of each shot, draw the Pauli faults, readout errors, and any random physical rotation signs from the noise model. At each depolarizing location, draw one Pauli operator, including the identity among the possible outcomes. At measurement jj, the compiled parity ℓj\ell_j uses bits already in the record, and eM,je_{M,j} is the readout-error bit.

Input: plan P\mathcal{P}, bond dimension χ\chi, cutoff τ\tau, and trajectory random numbers.

  1. ∣ϕ⟩←∣0⟩⊗K|\phi\rangle\leftarrow|0\rangle^{\otimes K}; bν←\mathbf{b}_\nu\leftarrow sampled noise bits

  2. for each instruction j∈Pj\in\mathcal{P} in order:

  3. activation: A[a]←Rσr[a][ϑj(bν)]A[a]A^{[a]}\leftarrow R_{\sigma_r}^{[a]}[\vartheta_j(b_\nu)]A^{[a]} (rr in block aa)

  4. rotation: ∣ϕ⟩←Tχ,τRQj[ϑj(bν)]∣ϕ⟩|\phi\rangle\leftarrow\mathcal{T}_{\chi,\tau}R_{Q_j}[\vartheta_j(b_\nu)]|\phi\rangle (ϑj≠0\vartheta_j\ne0)

  5. measurement: set μj\mu_j to 1 (deterministic), 0 (free-qubit X/YX/Y), or ⟨ϕ∣Qj∣ϕ⟩\langle\phi|Q_j|\phi\rangle (active). Draw m∈{0,1}m\in\{0,1\} with probabilities p0=(1+μj)/2p_0=(1+\mu_j)/2 and p1=(1−μj)/2p_1=(1-\mu_j)/2.

  6. if active: ∣ϕ⟩←Tχ,τ[Mm,r∣ϕ⟩/pm]|\phi\rangle\leftarrow\mathcal{T}_{\chi,\tau}[M_{m,r}|\phi\rangle/\sqrt{p_m}]; r←freer\leftarrow\mathrm{free}

  7. mphys←m⊕ℓj(bν)m_{\mathrm{phys}}\leftarrow m\oplus\ell_j(\mathbf{b}_\nu); yj←mphys⊕eM,jy_j\leftarrow m_{\mathrm{phys}}\oplus e_{M,j}. Store mm in bν\mathbf{b}_\nu.

  8. Compute detector bits dd and logical flips oo from the circuit’s specified parities of yy.

Output: record bν\mathbf{b}_\nu and logical-failure indicator 1[Decode⁡(d)≠o]\mathbf{1}[\operatorname{Decode}(d)\ne o].

Section S5 gives the noise model for step 1 and the decoder used to predict the logical flips from the detector bits.

Benchmark models and simulation protocol

Noise models for the surface and bivariate bicycle codes

We simulate two XX-memory experiments. Figure 2 of the main paper uses a rotated surface code with coherent ZZZZ crosstalk. At code distance dd, we run r=dr=d rounds of syndrome extraction. Figure 3 uses the [[72,12,6]]\left[\left[72,12,6\right]\right] bivariate bicycle (BB) code with coherent YY rotations.

CircuitPhysical qubits nnPeak active qubits KKCoherent rotation
Surface code, d=r=5d=r=54917RZZ(sθ)R_{ZZ}(s\theta), θ=0.02\theta=0.02
Surface code, d=r=7d=r=79730RZZ(sθ)R_{ZZ}(s\theta), θ=0.02\theta=0.02
Surface code, d=r=9d=r=916147RZZ(sθ)R_{ZZ}(s\theta), θ=0.02\theta=0.02
BB code, six rounds14445RY(sθ)R_Y(s\theta), θ=0.01\theta=0.01

Table 1 (PDF p. 22).

Here s=±1s=\pm1 is the sign of the physical rotation RP(sθ)=eisθPR_P(s\theta)=e^{is\theta P}. In both circuits, pp is the total probability of a depolarizing error on a CNOT pair.

Surface-code noise circuit.—Let E\mathcal{E} contain every data–ancilla pair used by a CNOT anywhere in the ideal circuit. After CNOT layer tt, we apply a ZZZZ rotation on each edge of E\mathcal{E} with at least one qubit that took part in a CNOT in that layer. The set of these edges and the product of their rotations are

Et={(u,v)∈E:u or v participates in layer t},\mathcal{E}_t=\{(u,v)\in\mathcal{E}:u\text{ or }v\text{ participates in layer }t\},
UZZ(t)=∏(u,v)∈EtRZuZv(suv,tθ).U_{ZZ}^{(t)}=\prod_{(u,v)\in\mathcal{E}_t}R_{Z_uZ_v}(s_{uv,t}\theta).

After UZZ(t)U_{ZZ}^{(t)}, we apply the two-qubit depolarizing channel D2(p)D_2(p) to each CNOT pair. In Figure S7, aa controls a CNOT on d0d_0. Both (a,d0)(a,d_0) and (a,d1)(a,d_1) receive a ZZZZ rotation because both edges meet aa. We then apply D2(p)D_2(p) to the CNOT pair (a,d0)(a,d_0).

Figure S7. Noise placement in the benchmark circuits. Gates act from left to right. Orange denotes coherent rotations and purple denotes stochastic errors. (a) The bold hardware edge carries the CNOT. Both edges receive a ZZZZ rotation before D2(p)D_2(p) acts on the CNOT pair. (b) At the end of a BB round, D2(p)D_2(p) acts on the CNOT pair and D1(p)D_1(p) on the idle data qubit. The data qubits then rotate about YY. Measuring the ancilla gives mphysm_{\mathrm{phys}}, recorded as y=mphys⊕eMy=m_{\mathrm{phys}}\oplus e_M. (c) A preparation fault in basis BB and depolarization after a surface-code HH gate.

BB noise circuit.—Each CNOT pair receives D2(p)D_2(p) after the gate. A qubit scheduled to idle receives D1(p)D_1(p). After the last CNOT layer of round tt and its Pauli errors, we apply a YY rotation to each of the 72 data qubits,

UY(t)=∏q=071RYq(sq,tθ),θ=0.01.U_Y^{(t)}=\prod_{q=0}^{71}R_{Y_q}(s_{q,t}\theta),\qquad\theta=0.01.

We then measure the XX-check ancillas in the XX basis [Fig. S7(b)]. The six rounds contain 72×6=43272 \times6 = 432 physical YY rotations.

*Pauli errors, preparation, and readout.—*At each depolarizing location we sample one Pauli operator. For total error probability qq, the identity has probability 1−q1-q. On one qubit, XX, YY, and ZZ each have probability q/3q/3. On a qubit pair, each of the 15 Pauli operators other than IIII has probability q/15q/15. Different noise locations are sampled independently. The surface-code rates follow Table I of Ref. [6], and the BB rates follow Ref. [7].

LocationSurface codeBB code
After a one-qubit Clifford gateD1(0.1p)\mathcal{D}_1(0.1p)—
Scheduled idle—D1(p)\mathcal{D}_1(p)
CNOT pairD2(p)\mathcal{D}_2(p) after the ZZZZ layerD2(p)\mathcal{D}_2(p) after the gate
Preparation or reset, pRp_R2p2ppp
Readout-bit flip, pMp_M5p5ppp

Table 1 (PDF p. 23).

For example, at p=0.005p = 0.005 the surface-code channels are D1(0.0005)\mathcal{D}_1(0.0005) and D2(0.005)\mathcal{D}_2(0.005), with pR=0.01p_R = 0.01 and pM=0.025p_M = 0.025. We sample the preparation and readout error bits eRe_R and eMe_M independently [Fig. S7(b,c)]. Each bit is 1 when its error occurs and 0 otherwise. For B=ZB = Z or XX,

∣0B⟩⟼FBeR∣0B⟩,Pr⁡(eR=1)=pR,\lvert0_B\rangle\longmapsto F_B^{e_R}\lvert0_B\rangle,\qquad\Pr(e_R = 1) = p_R,
y=mphys⊕eM,Pr⁡(eM=1)=pM.y = m_{\mathrm{phys}} \oplus e_M,\qquad\Pr(e_M = 1) = p_M.

A preparation error applies FZ=XF_Z = X to ∣0Z⟩=∣0⟩\lvert0_Z\rangle= \lvert0\rangle or FX=ZF_X = Z to ∣0X⟩=∣+⟩\lvert0_X\rangle= \lvert+\rangle. At readout, we record the physical outcome mphysm_{\mathrm{phys}} when eM=0e_M = 0 and flip its bit when eM=1e_M = 1.

Rotation signs and reference simulations

Figures 1(d,e), 4, and 6, as well as the fixed-sign curves in Figure 5, use the same surface-code circuit with d=r=5d = r = 5, p=0.005p = 0.005, and θ=0.02\theta= 0.02. Every ZZZZ rotation has sign sj=+1s_j = +1. We estimate the reference logical error rate by sampling this circuit with an untruncated residual state vector.

For Figure 2 and Figure 3, each shot draws an independent sign sj=±1s_j = \pm1 with equal probabilities for every physical rotation. CAMPS uses these signed angles in Eq. (17). For example, two consecutive rotations about the same PP fuse to an angle (s1+s2)θ(s_1+s_2)\theta. This angle is zero with probability 1/21/2 and takes each of the values +2θ+2\theta and −2θ-2\theta with probability 1/41/4. Averaging one rotation over its two signs gives

12∑s=±1RP(sθ)ρRP(sθ)†=cos⁡2θ ρ+sin⁡2θ PρP.(27)\frac{1}{2}\sum_{s=\pm1} R_P(s\theta)\rho R_P(s\theta)^\dagger= \cos^2\theta\,\rho+ \sin^2\theta\,P\rho P. \tag*{(27)}

The probability of applying PP is sin⁡2θ\sin^2\theta, about 4.00×10−44.00 \times10^{-4} for the surface code and 1.00×10−41.00 \times10^{-4} for BB. Since the signs are independent, replacing each rotation by this channel gives the circuit averaged over all signs. We use a stabilizer simulator to sample that circuit and estimate the reference logical error rate labeled PTA (Pauli-twirling approximation) in Figure 1(d), Figure 2, Figure 3, and Figure 5.

Decoding and logical error rates

For each circuit and value of pp, all simulators use the same decoder. We build it from the detector error model of the Pauli-twirled circuit. This model lists each error, its probability, and the detector and logical bits it flips.

In each shot, the circuit specifies which measurement bits in yνy_\nu (Sec. S4) to add modulo two. These sums give the detector outcomes dνd_\nu and the observed logical flips oνo_\nu. The decoder predicts the logical flips from dνd_\nu. A shot fails if its prediction differs from oνo_\nu. The estimated logical error rate is the number of failures divided by the number of shots NN.

o^ν=Decode⁡(dν),Lν=1[o^ν≠oν],p^L=1N∑ν=1NLν.\hat{o}_\nu= \operatorname{Decode}(d_\nu),\qquad L_\nu= 1[\hat{o}_\nu\ne o_\nu],\qquad\hat{p}_{\mathrm{L}} = \frac{1}{N}\sum_{\nu=1}^{N} L_\nu.

The surface-code experiment compares one logical XX bit. In the BB experiment, one or more wrong predictions among the 12 logical XX bits after six rounds count as one block failure.

References

CodeDetector error modelDecoder
SurfaceDecomposed into matching edgesPyMatching [8] minimum-weight perfect matching, with correlated matching disabled
BBUndecomposed (one column per error)Belief propagation (up to 50 iterations) with ordered-statistics decoding (order 4) [9]

Table 1 (PDF p. 24).

Shots per data point.—Compiled and uncompiled CAMPS evolve the Clifford-augmented MPS with and without compile-time reduction, respectively. Physical MPS denotes an MPS on the physical circuit qubits.

ComparisonppShots per tensor simulationReference shots
Figure 1(d)0.0055×1055 \times10^{5} (compiled and uncompiled CAMPS); 10410^{4} (physical MPS)5×1055 \times10^{5} each (state vector, PTA)
Figure 2, χ=8\chi= 80.001, 0.002, 0.00310510^{5}10610^{6} (PTA)
>0.003> 0.00310410^{4}10610^{6} (PTA)
Figure 3, χ=4\chi= 40.0012×1052 \times10^{5}10610^{6} (PTA)
>0.001> 0.00110410^{4}10610^{6} (PTA)
Figure 4, compiler comparison0.00510610^{6} per compiler at each χ\chi10610^{6} (state vector)
Figure 5, fixed signs0.0055×1055 \times10^{5} per method at each χ\chi5×1055 \times10^{5} (state vector)
Figure 5, random signs0.0055×1055 \times10^{5} per method at each χ\chi5×1055 \times10^{5} (PTA)
Figure 6, block-size comparison0.00510610^{6} per block size at each χ\chi10610^{6} (state vector)

Table 2.

Figure 4. Logical error rate pLp_L versus bond dimension χ\chi for compiled CAMPS and Clifft compilation + MPS on the same block-2 MPS backend (K=17K=17) in the benchmark of Figure 1(d). Bars and shading show 95% confidence intervals (10610^6 shots per point). Inset: median sampling speedup tClifft+MPS/tcompt_{\mathrm{Clifft+MPS}}/t_{\mathrm{comp}}.

References

  1. [1]X. Qian, J. Huang, and M. Qin, Augmenting density matrix renormalization group with Clifford circuits, Phys. Rev. Lett. 133, 190402 (2024).DOI
  2. [2]B. A. Chase and F. Labib, Clift†: Fast exact simulation of near-Clifford quantum circuits (2026), arXiv:2604.27058v2 [quant-ph].arxiv.org/abs/2604.27058
  3. [3]W. Fang, H. Lou, and R. Li, SymFT: Universal fault-tolerant quantum circuit simulation via symbolic Clifford–Pauli frames and stabilizer coordinates (2026), arXiv:2607.28600v2 [quant-ph].arxiv.org/abs/2607.28600
  4. [4]Z. Liu and B. K. Clark, Classical simulability of Clifford+T circuits with Clifford-augmented matrix product states, Phys. Rev. Research 8, 023116 (2026).DOI
  5. [5]A. Paviglianiti, G. Lami, M. Collura, and A. Silva, Estimating nonstabilizerness dynamics without simulating it, PRX Quantum 6, 030320 (2025).arxiv.org/abs/2405.06054
  6. [6]B. Harper, A. C. Nakhl, M. Sévior, and M. Usman, Non-Clifford crosstalk noise in surface codes using hybrid stabilizer-tensor network methods (2026), arXiv:2605.29514 [quant-ph].arxiv.org/abs/2605.29514
  7. [7]S. Bravyi, A. W. Cross, J. M. Gambetta, D. Maslov, P. Rall, and T. J. Yoder, High-threshold and low-overhead fault-tolerant quantum memory, Nature 627, 778 (2024).DOI
  8. [8]O. Higgott and C. Gidney, Sparse blossom: correcting a million errors per core second with minimum-weight matching, Quantum 9, 1600 (2025).DOI
  9. [9]J. Roffe, D. R. White, S. Burton, and E. Campbell, Decoding across the quantum low-density parity-check code landscape, Phys. Rev. Research 2, 043423 (2020).DOI

Paper details

vlnc:W_j64thgyb
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 2

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Physics and Astronomy

ChatGPT

View statement
Looking for related papers…
Contents