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 and on the 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 [33, 34] and the bivariate bicycle (BB) code [35] under coherent noise, compiled CAMPS converges at smaller bond dimensions and samples over an order of magnitude faster than uncompiled CAMPS at equal .
Compiled CAMPS.—CAMPS represents a quantum state as , with a Clifford operator augmenting an MPS specified by tensors [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 and a symbolic frame , where records noise realizations and measurement outcomes [31, 32]. At circuit step , shot evaluates the frame on its sampled record ,
The residual state contains active qubits and free qubits in known state. The compiler tracks their activation and release, reserving
MPS positions. For physical qubits, pairing neighboring positions into blocks and omitting the step label hereafter gives
Each block index has dimension four (or two for an unpaired final qubit), inter-block bonds have dimensions , and the vacant positions remain in . The effect of block size is analyzed in the End Matter (Figure 6). In each shot, the residual tensors 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 and its compiled residual action . The compiled is shared by all shots; and the block-2 MPS tensors vary between shots. The MPS uses positions. (c) Physical-qubit count and peak active-qubit count versus code distance for surface-code memory under coherent noise, with rounds. (d,e) Fixed-sign benchmark at , , and . (d) Logical error rate versus bond dimension . Gray and purple dashed lines mark the untruncated reference and PTA prediction. Compiled and uncompiled CAMPS and the state-vector reference each use shots. Bars and shading show 95% confidence intervals. Inset: zoom near the untruncated reference. (e) Median sampling time per shot versus . Compiled CAMPS is more than an order of magnitude faster than uncompiled CAMPS and physical MPS at equal .
Figure 6. Mean number of SVDs per shot versus block size at 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 versus bond dimension , where is the sampling time with qubits per block. Error bars show 95% confidence intervals.
We now construct the shared Clifford sequence and symbolic frame , with “compile” arrows denoting updates made before sampling. A physical Clifford gate gives , whereas a Pauli error ( for and for ) satisfies and updates , keeping symbolic until sampled in each shot. A non-Clifford noise rotation then acts on the residual state as
Here is the unsigned Pauli string in , while the binary function tracks this sign together with sign flips from anticommuting Pauli errors and measurement corrections. Both and are fixed during compilation, and each shot evaluates to determine its effective rotation angle [32].
Rotations sharing the same Pauli string can be fused when all intervening operations commute with ,
where is a group of rotations applied in a single MPS update per shot. We repeat this fusion after simplifying operators on free qubits, since removing trivial factors via can make additional Pauli strings identical.
When a rotation instead acts as or on a free qubit, its multi-qubit coupling can be absorbed into , leaving a local MPS update [23, 30, 31]. For with on a free qubit and on the remaining qubits, the controlled- Clifford gate (with control ) obeys
Because this identity holds for any state of the other qubits, compilation fixes from and , while each shot activates 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 acts only on active qubits (deterministic and free-qubit cases update and analytically), the compiler chooses a pivot qubit in its support and constructs a Clifford satisfying . The conditional release map projects onto the eigenspace of and resets to in the transformed basis,
Each shot evaluates from its current MPS, samples with probability , and substitutes into , with position now free for later rotations. Applying the compiled sign correction to the residual eigenvalue recovers the physical measurement outcome.
CAMPs reduces MPS entanglement by changing the Clifford representation [9] [23]. A Clifford gate on the stored positions maps the residual state to while leaving the physical state unchanged,
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 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 selects a vacant MPS position for qubit activation in Eq. (4), or a measurement pivot where 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 , we minimize the total weighted width,
where is the number of MPS bonds between the first and last blocks affected by operation . We set for rotations and 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 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 -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 memory over rounds with coherent rotations of angle , decoded by minimum-weight perfect matching [37]. Following Ref. [27], the Pauli noise model assigns depolarizing probabilities and after one- and two-qubit Clifford gates, reset error probability , and readout error probability . As shown in Figure 1(c), free-qubit recycling substantially shortens the MPS required for these circuits, reducing physical qubits to at most active qubits at and to at . Evolving the residual state vector gives an exact reference at . At , however, a dense state vector would require complex amplitudes, whereas compiled CAMPS represents the residual state as an MPS with small bond
dimensions.
To test convergence under coherent noise, we set and with fixed rotation signs and track the logical error rate (LER) versus in Figure 1(d). In this fixed-sign setting, coherent interference raises to more than twice the PTA prediction. Compiled CAMPS agrees with the untruncated reference within sampling uncertainty at , whereas uncompiled CAMPS requires and the physical-qubit MPS remains unconverged through . 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 . With the same active space and MPS backend, compiled CAMPS also converges at smaller and samples faster than Clifford-compiled MPS evolution, as shown in Figure 1 of the End Matter.
At larger code distances, 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 independently and with equal probability in every shot. For a Pauli string and density matrix , averaging over gives
Averaging over the independent signs makes PTA exact and allows us to obtain the reference by stabilizer sampling, whereas each compiled or uncompiled CAMPS shot still applies the coherent rotations . Randomizing physical signs adds a sign flip per rotation without changing the compiled Pauli strings or the MPS basis, because the effective angles in Eq. (3) already take fluctuating signs determined by , the stochastic Pauli frame , and fusion. At , Figure 5 of the End Matter confirms that compiled CAMPS converges similarly for fixed and random signs, reaching both exact references at . Random-sign benchmarks thus provide a reliable accuracy test for general coherent noise.
Figure 5. Logical error rate versus bond dimension for fixed- and random-sign rotations in the surface-code circuit of Figure 1(d). Gray and purple dashed lines mark the untruncated reference for fixed signs and the exact PTA reference for random signs. Inset: normalized ratio relative to each reference. Bars and shading show 95% confidence intervals.
Figure 2 compares the surface-code LER for , , and at . Compiled CAMPS agrees closely with the exact PTA reference across all three distances and captures the suppression of logical errors with increasing at low . By contrast, uncompiled CAMPS at this bond dimension increasingly underestimates as grows, with a pronounced deviation at and .
Figure 2. Surface-code logical errors under random-sign noise. memory with rounds and independent, equally likely rotations (); compiled and uncompiled CAMPS use . Filled and open symbols denote compiled and uncompiled CAMPS; circles, triangles, and diamonds denote , , and . Compiled CAMPS agrees with the exact sign-averaged PTA reference, while uncompiled CAMPS increasingly underestimates logical errors as grows. Bars and shading show 95% confidence intervals.
Finally, we test compiled CAMPS beyond planar connectivity on six-round memory of the BB code, which reduces qubit overhead at the cost of nonlocal parity checks [35]. Circuit noise includes Pauli errors of uniform probability on CNOT gates, idling, preparation, and readout, together with independent random-sign rotations of angle on each data qubit per round. Free-qubit recycling reduces the physical qubits to at most 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 outcomes is incorrect. At , 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 memory of the code with independent, equally likely rotations (); compiled and uncompiled CAMPS use . 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: , showing approximately 30× faster mean sampling with compiled CAMPS at equal . 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 and samples over an order of magnitude faster than uncompiled CAMPS at equal .
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 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 surface-code benchmark of Figure 1(d), with , , and , we compare the representations from compiled CAMPS and Clifft [31] using the same block-2 MPS backend. Both compilations reduce the 49 physical qubits to a peak of 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 , and its LER remains stable as increases. At , Clifft compilation followed by MPS evolution underestimates by approximately 10% and approaches the reference more gradually at larger . Compiled CAMPS thus yields better convergence with and, as shown in the inset, faster sampling.
Fixed- and random-sign convergence.—Figure 5 compares convergence with bond dimension for fixed- and random-sign coherent rotations in rotated surface-code X memory at , , and . Fixed-sign rotations raise the untruncated state-vector LER to more than 2.5 times the random-sign PTA value. The inset plots the normalized ratio relative to the state-vector reference for fixed signs and the PTA reference for random signs. Fixed signs give a lower ratio at , but both compiled CAMPS curves are close to unity at and converge within sampling uncertainty at , whereas uncompiled CAMPS requires 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 qubits has a physical index of dimension , with 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 , 2, 3, and 4 on the fixed-sign 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 and 4 reduce it further to 628 and 448. In the right inset, blocking speeds up sampling relative to across all . Because larger blocks reduce SVDs at the cost of a physical dimension, the fastest grouping depends on circuit structure and . 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
Here is a Hermitian Pauli string and 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
| Symbol | Definition |
| Total number of physical circuit qubits, including ancillas. | |
| Active-qubit count and its peak; the stored positions hold active qubits and free qubits in . | |
| Compiled -qubit Clifford, shared by all shots. | |
| Symbolic Pauli frame and its value in shot . | |
| Bits for Pauli faults, readout errors, physical rotation signs when sampled, and residual measurement outcomes. | |
| Full physical state, . | |
| Full residual state and stored -qubit state, related by . | |
| MPS tensors evolved numerically in shot . | |
| Maximum retained MPS bond dimension between blocks. | |
| Physical Pauli string and compiled unsigned residual Pauli string. | |
| Physical rotation angle and effective residual angle in shot , including compiled signs and fusion. | |
| Number of MPS bonds between the first and last blocks on which residual operator acts nontrivially. |
Table 3.
Compiled CAMPS representation
State decomposition
At circuit step , compiled CAMPS represents the physical state in shot as [1, 2, 3]
The Clifford is shared by all shots. The Pauli frame stores stochastic faults and measurement corrections as functions of event bits . Each shot supplies its own record and evolves its own MPS tensors .
A free qubit is a residual qubit in the known state , 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 MPS positions for the peak active count: at step , these hold active qubits and free qubits. The remaining 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 .
Pauli-frame updates and rotation signs
Start from . A Clifford gate gives , while a Pauli fault obeys . The updates are therefore
| Physical operation | Compiled update |
| Clifford | |
| Pauli fault |
Table 4.
The bit denotes no fault and denotes a fault; it is sampled for each trajectory. Successive Pauli components combine by exclusive OR (XOR), denoted by . For example,
If both events occur, the two operators cancel; if only one occurs, a remains. Clifford conjugation maps Pauli strings to Pauli strings. Thus, up to global phase, the frame can be stored as
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: . The Pauli frame preserves this rotation when and reverses its angle when . For a single-qubit rotation,
because and . For example, take . Its component commutes with the rotation, while its component gives
This example extends to any Pauli string:
Here selects an event bit that reverses the rotation’s sign, and includes fixed signs from the Clifford and frame. In the example above, and : has no effect on the angle. Compilation fixes these coefficients. Each shot substitutes its event bits, obtaining for and for . For a physical rotation , the noise model supplies and the Clifford and Pauli frame determine . The residual angle in shot is .
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 measurement. (b) The corresponding residual rotation, measurement, and release. The dashed arrow writes into the Pauli frame; the dashed boxes reconstruct the conditional physical state using and the shared Clifford . (c) Measurement probabilities for the two fault branches at .
The state just before the physical measurement in panel (a) is
Conjugation by gives the residual axes and the fused angle:
Activating qubit 0 absorbs into the Clifford and leaves a single-qubit residual rotation:
Now measure with eigenvalue , where . The Clifford maps this operator to , and the frame preserves its sign:
The residual measurement leaves qubit 0 in . Returning it to the free state transfers its value into the frame as :
Here omits a branch-global phase. These are the dashed boxes in panel (b): and . For , gives and , whereas gives and 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 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 . Figure S2 illustrates them with two-qubit circuits.
Figure S2. Qubit activation and reuse in explicit circuits. (a) The rotation on becomes a local and a controlled absorbed into . (b) Case 3 for , with input and . The first CNOT moves the parity to qubit 0; measurement and release leave the residual state . The dashed boxes, and , reconstruct the two physical parity states shown below the circuit. (c) The freed qubit is used by a later residual . The displayed product state is the new residual state.
Activating a free qubit
Consider a rotation whose Pauli string contains or on a free qubit : , with or . The other qubits may be in any state . Define as a controlled- gate with control qubit :
The rotation creates two terms,
The two branches in the diagram reproduce these terms: applies only when is in . Thus a local rotation followed by this Clifford gives the same state [4, 5]:
For example, gives [Fig. S2(a)]:
Absorbing into the compiled representation gives
The stored state remains a product across and the other qubits, so activating changes only its local tensor and leaves the virtual bond dimensions unchanged. For the new vector is ; for it is . The compiler assigns to a free MPS position and includes this relabeling in .
If a rotation has only or on free qubits, their known action is removed using . 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 , outcome labels the eigenvalue :
First remove any operators on free qubits using . The remaining Pauli operators determine which of the following rules applies.
| Case | Where acts | Outcome and state update | Active count |
| 1 | Identity | ; state unchanged | |
| 2 | or on a free qubit | ; update and | |
| 3 | , , or only on active qubits | Evaluate ; sample and release one qubit |
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 eigenstate of . For example, with free gives . Thus , the projection leaves the state unchanged, and .
Case 2: or on a free qubit.—Write with free. The known state of fixes the expectation value:
(14) therefore gives for any . For , the normalized state of the measured qubit is . The same applies for both outcomes. For a general , the same construction uses the controlled Pauli from (12):
where , , and . Writing , the updates are
The compiler fixes for both outcomes. The sampled bit enters the frame through . The residual qubit stays free, so [2, 5].
Case 3: measurement on active qubits.—Here the remaining is nonidentity and acts only on active qubits. The compiler chooses a pivot where acts as , , or $Z (Sec. S3). Apply at each and at each , so that only and remain. For each other qubit carrying , apply a CNOT from that qubit to . Together these gates form the Clifford with .
Each shot computes in its stored state and draws using (14). In the basis fixed by , projection leaves in . Returning it to defines the release map
The output has the form . Store the outcome in and absorb the inverse basis change into :
These updates reconstruct the projected physical state, since
The remaining state can depend on the outcome. An active qubit has become free, giving the update in the third row of the table.
A parity-measurement example.—Take , choose , and write the normalized residual input as
Here computes the parity on qubit 0:
Measuring selects , so
For example, , with , gives and . The released residual state is . For initial , the updated Clifford and frame reconstruct the two parity eigenstates:
Figure S2 shows this example: the residual state becomes , while and reconstruct the even- or odd-parity state.
Qubit reuse and physical readout
After release, a later residual rotation containing or can activate the same position by Eq. (13) [Figure S2]. In the example of Figure S1, already, so and
The frame becomes . A subsequent physical then acts on the freed qubit because
Including the preparation of , the active count is
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 , the compiled sign obeys . The parity converts the residual outcome to the physical outcome . The readout error bit determines the recorded result ,
Classical feedback uses . A physical reset after a measurement applies , followed by any modeled preparation error. The residual release in Eq. (16) frees an MPS position while and 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 of rotations about the same unsigned axis , the signed angles add. Write the physical angle of rotation as , with when the circuit specifies directly. Then
The compiler adds the sign bit to modulo two and collects terms with the same parity, as in . 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 ,
Moving one rotation past the intervening rotation therefore reduces three rotations to two. Each such exchange must satisfy two conditions.
(i) The quantum operations commute. For example, and commute: exchanging and contributes one minus sign on each qubit, and the two signs cancel. For the general check, encode the local Paulis as , , , and , and collect these bits into and . The commutation test is
This sum counts local anticommutations modulo two; for and , it gives (mod 2). For a measurement of , the same condition gives for each outcome .
(ii) Classical bit dependencies are respected. Consider the execution order
Here and commute, but the rotation must follow the measurement: selects the angle or . To check this dependence, let be the classical bits read by instruction , and the bits it produces or overwrites. Exchanging instructions and requires
Neither instruction may read or overwrite a bit written by the other. In the example, , 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 be free and qubits be active, with input . Set , , and , and consider
where 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 rotation and fuse. (c) Since , both bracketed rotations now have axis . (d) Their angles add to , leaving two rotations.
Since , the first pass combines the two rotations into . On the free qubit, , so this rotation now has the same axis as . The second pass adds , giving and
For and , and ; 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 and . 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]:
Each later Pauli string becomes . The compiler propagates these strings through the subsequent activation and release rules and scores the MPS intervals they occupy. The width is the number of MPS bonds between the first and last blocks on which acts nontrivially. Group the stored positions as . Write and let contain the positions whose factor is , , or . For a nonempty ,
If , the set is empty and we set . For example,
| 0 | 1 | 2 |
A rotation with updates one block; crosses one MPS bond. The tensor contractions on these intervals are given in Sec. S4.
For a candidate position or pivot , the score over the future window is
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 , with active qubits at stored positions 0, 2. Positions 1, 3 are free, and a new active qubit can use either one. Let the future window contain followed by a measurement of . Their spans give
| position of | |||
| 1 | 0 | 0 | 0 |
| 3 | 1 | 1 | 3 |
Table 5.
The compiler chooses position 1, placing both updates inside the first block [Fig. S4]. Both candidates have the same active count .
A measurement-pivot example.*—Now take four active positions and measure . Either position on which acts can be released, using
After the measurement, the chosen pivot is free. Let the future window contain followed by a measurement of . For the two choices, the factor in both future operators becomes
The last step uses 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 , this choice gives . The outcome supplies a factor to the later rotation angle and measurement sign, as in Sec. S2. Both choices release one qubit, giving .
Figure S5. Choosing a pivot for the measurement . 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 . Brackets span the blocks used by that update. Releasing makes the rotation local. Releasing makes the measurement local and lowers from to $1.
Figure S4. Choosing where to activate . Both panels group the positions as , with active qubits at . Blue circles mark the operands of the next rotation and measurement . The bracket spans the blocks visited by both updates. (a) At position , shares a block with , giving . (b) At position , both updates cross one bond, giving .
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 , , or , 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, is the instruction list. The candidate set contains the free positions for an activation, or the positions carrying , , or for an active measurement. ApplyChoice records the choice in instruction and updates the Clifford map for later instructions; Encode stores the position, transformed Pauli string, update interval, and angle or outcome parity.
Input: circuit with noise distributions and classical dependencies.
(Sec. S2)
for each instruction in order:
if is an activation or an active measurement:
;
Output: plan , with angle and outcome rules evaluated using .
The searches use the following upper bounds:
| Stage | Quantity | Maximum |
| First fusion and scheduling | Outer iterations | 8 |
| Rotation-scheduling sweeps per iteration | 16 | |
| Instructions per moved nonrotation block | 64 | |
| Residual fusion | Preceding surviving rotations examined | 64 |
| Position and pivot search | Future instructions / rotations per trial | 256 / 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 MPS bonds spans consecutive blocks.
Block tensors and Pauli rotations
The stored positions form blocks,
Here and . Each full block has four physical labels ; the last block has two labels if is odd. In a four-qubit example grouped as , we have and , where is the bit at stored position . We suppress the shot index below.
If position 3 is free, its block tensor has components and . An activation gives
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 in this block-2 example. Its operators on the two blocks are and , so
On a basis state, the second channel flips and multiplies its amplitude by . With and , write . Combining the MPS and MPO bonds in Figure S6 gives the updated tensors
Figure S6. Block-2 MPS updates on . Physical indices run upward through the MPO. The horizontal lines carry the MPS bond and the MPO bond . (a) The and channels carry the two terms of shown below. (b) The two XOR updates accumulate . The right boundary selects the indicated bit pairs, and writing releases qubit 3.
Contracting the shared bond gives the amplitudes of .
The same construction applies across any number of blocks. For a compiled Pauli string,
Each is the tensor product of the single-qubit Pauli operators in block . Number the blocks from the first to the last block on which acts nontrivially as . When , the MPO tensors are
The virtual index 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 carries both channels onward. Contracting each MPO tensor with its MPS tensor gives
Combining the MPS index and the two-valued MPO index gives an intermediate bond dimension at most [Fig. S6(a)]. Standard SVD compression retains a bond dimension of at most . For , the entire rotation is a local matrix update,
with unchanged virtual dimensions.
Measurement probabilities and conditional updates
For the measurement in Figure S6, take qubits 1, 2 in . In the order , choose the two-qubit input
Each basis pair has eigenvalue with . Draw with probability . Retain the amplitudes with parity and divide them by .
| retained | |||
| 0 | 00, 11 | ||
| 1 | 01, 10 |
Table 6.
The compiled pivot is . On every retained term, puts the same bit on this pivot. The release map in Eq. (16) acts as
For , the residual output is . In both branches qubit 3 factors out as and is free for reuse. The Pauli frame carries as in Sec. S2.
The block-MPS sampler obtains the probabilities from one expectation value. In the example, the block operators and give . For a general active measurement, place the orthogonality center in the update interval and contract its blocks in order.
For the conditional update, the first box in Figure S6 passes to the second. The second keeps inputs with and writes the output . For a general , first turn each nonidentity factor into with the local basis changes
For the rotated input label in block , let be the XOR of the bits at these positions. Let copy , setting the pivot bit to zero in the block containing . These two rules give the matrix elements of each MPO tensor
The right boundary selects the sampled parity . Contract this MPO with the basis-transformed MPS as in Eq. (24), divide by , and compress the updated tensors.
Sampling one shot
Let denote standard SVD compression of the updated bonds with maximum bond dimension and cutoff , 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 , the compiled parity uses bits already in the record, and is the readout-error bit.
Input: plan , bond dimension , cutoff , and trajectory random numbers.
; sampled noise bits
for each instruction in order:
activation: ( in block )
rotation: ()
measurement: set to 1 (deterministic), 0 (free-qubit ), or (active). Draw with probabilities and .
if active: ;
; . Store in .
Compute detector bits and logical flips from the circuit’s specified parities of .
Output: record and logical-failure indicator .
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 -memory experiments. Figure 2 of the main paper uses a rotated surface code with coherent crosstalk. At code distance , we run rounds of syndrome extraction. Figure 3 uses the bivariate bicycle (BB) code with coherent rotations.
| Circuit | Physical qubits | Peak active qubits | Coherent rotation |
| Surface code, | 49 | 17 | , |
| Surface code, | 97 | 30 | , |
| Surface code, | 161 | 47 | , |
| BB code, six rounds | 144 | 45 | , |
Table 1 (PDF p. 22).
Here is the sign of the physical rotation . In both circuits, is the total probability of a depolarizing error on a CNOT pair.
Surface-code noise circuit.—Let contain every data–ancilla pair used by a CNOT anywhere in the ideal circuit. After CNOT layer , we apply a rotation on each edge of 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
After , we apply the two-qubit depolarizing channel to each CNOT pair. In Figure S7, controls a CNOT on . Both and receive a rotation because both edges meet . We then apply to the CNOT pair .
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 rotation before acts on the CNOT pair. (b) At the end of a BB round, acts on the CNOT pair and on the idle data qubit. The data qubits then rotate about . Measuring the ancilla gives , recorded as . (c) A preparation fault in basis and depolarization after a surface-code gate.
BB noise circuit.—Each CNOT pair receives after the gate. A qubit scheduled to idle receives . After the last CNOT layer of round and its Pauli errors, we apply a rotation to each of the 72 data qubits,
We then measure the -check ancillas in the basis [Fig. S7(b)]. The six rounds contain physical rotations.
*Pauli errors, preparation, and readout.—*At each depolarizing location we sample one Pauli operator. For total error probability , the identity has probability . On one qubit, , , and each have probability . On a qubit pair, each of the 15 Pauli operators other than has probability . Different noise locations are sampled independently. The surface-code rates follow Table I of Ref. [6], and the BB rates follow Ref. [7].
| Location | Surface code | BB code |
| After a one-qubit Clifford gate | — | |
| Scheduled idle | — | |
| CNOT pair | after the layer | after the gate |
| Preparation or reset, | ||
| Readout-bit flip, |
Table 1 (PDF p. 23).
For example, at the surface-code channels are and , with and . We sample the preparation and readout error bits and independently [Fig. S7(b,c)]. Each bit is 1 when its error occurs and 0 otherwise. For or ,
A preparation error applies to or to . At readout, we record the physical outcome when and flip its bit when .
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 , , and . Every rotation has sign . 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 with equal probabilities for every physical rotation. CAMPS uses these signed angles in Eq. (17). For example, two consecutive rotations about the same fuse to an angle . This angle is zero with probability and takes each of the values and with probability . Averaging one rotation over its two signs gives
The probability of applying is , about for the surface code and 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 , 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 (Sec. S4) to add modulo two. These sums give the detector outcomes and the observed logical flips . The decoder predicts the logical flips from . A shot fails if its prediction differs from . The estimated logical error rate is the number of failures divided by the number of shots .
The surface-code experiment compares one logical bit. In the BB experiment, one or more wrong predictions among the 12 logical bits after six rounds count as one block failure.
References
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.
| Comparison | Shots per tensor simulation | Reference shots | |
| Figure 1(d) | 0.005 | (compiled and uncompiled CAMPS); (physical MPS) | each (state vector, PTA) |
| Figure 2, | 0.001, 0.002, 0.003 | (PTA) | |
| (PTA) | |||
| Figure 3, | 0.001 | (PTA) | |
| (PTA) | |||
| Figure 4, compiler comparison | 0.005 | per compiler at each | (state vector) |
| Figure 5, fixed signs | 0.005 | per method at each | (state vector) |
| Figure 5, random signs | 0.005 | per method at each | (PTA) |
| Figure 6, block-size comparison | 0.005 | per block size at each | (state vector) |
Table 2.
Figure 4. Logical error rate versus bond dimension for compiled CAMPS and Clifft compilation + MPS on the same block-2 MPS backend () in the benchmark of Figure 1(d). Bars and shading show 95% confidence intervals ( shots per point). Inset: median sampling speedup .
References
- [1]X. Qian, J. Huang, and M. Qin, Augmenting density matrix renormalization group with Clifford circuits, Phys. Rev. Lett. 133, 190402 (2024).DOI
- [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]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]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]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]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]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]O. Higgott and C. Gidney, Sparse blossom: correcting a million errors per core second with minimum-weight matching, Quantum 9, 1600 (2025).DOI
- [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












