WorksPhysics and Astronomy
General Noise Channels and Mid-Circuit Measurements for Pre-Trajectory Sampling with Batched Execution
Abstract
Many studies of quantum protocols require fast sampling of large amounts of measurement data from noisy quantum circuits, such as for training machine-learning decoders for quantum error correction. Exact simulation of realistic noise is expensive, while stabilizer-based simulators are fast but approximate, for example through Pauli twirling, which generally alters the output statistics. Pre-trajectory sampling with batched execution (PTSBE) accelerates exact trajectory simulation by sampling noise before state evolution. This method requires the outcome probability of every stochastic event to be independent of the state, which excludes mid-circuit measurements and general Kraus channels. We present a generalization of PTSBE to measurement and Kraus operators without approximation. Each event is partially pre-sampled, while deferred outcomes are drawn during grouped execution via multinomial branching and cached-state reuse. We implement the method for GPUs as an extension of CUDA-Q. On distance-3 topological code memories under amplitude damping, it is up to 24x faster than conventional trajectory sampling in CUDA-Q. On 30-qubit random circuits with mid-circuit measurements, it is up to 83x faster and outperforms the near-Clifford simulator Clifft when more than about 25% of the gates are non-Clifford. With repeated sampling of each final state, its sampling rate per trajectory exceeds that of CUDA-Q by nearly five orders of magnitude. Our method also allows us to compare exact amplitude damping with its Pauli-twirled channel on a surface-code memory, revealing that twirling overestimates the detection rate by 21% and raises the logical error rate of a lookup decoder by 8%. This work makes exact, high-throughput simulation practical for general noisy circuits, from data generation for training decoders to studying measurement-based fault-tolerant protocols under realistic noise.
Introduction
The classical simulation of noisy quantum circuits serves many purposes, from predicting hardware behavior to generating training data for machine-learning models. Moreover, most such applications require large numbers of sampled measurement records, one per execution of the circuit, called a shot, under a hardware-accurate noise model. A prominent example is quantum error correction (QEC), which relies on repeated measurements to identify errors while preserving encoded quantum information [1, 2]. These measurement records are increasingly processed by machine-learning decoders [3, 4, 5], which must be trained on large datasets representative of the noise encountered during computation. Hardware can provide such data directly, but collecting data at scale is costly and offers limited control over the underlying error processes. Simulation is a complementary data source, provided that it combines high sampling throughput with a faithful treatment of the noise model of interest.
The fastest QEC simulators achieve much of their efficiency by exploiting structure in the circuit or noise model. Stabilizer simulators, such as Stim [6], enable extremely fast sampling of Clifford circuits with Pauli noise, while more recent methods such as Clifft [7] extend efficient simulation into the near-Clifford regime. More general noise processes can often be replaced by stochastic Pauli models, for example through Pauli twirling, making them compatible with such specialized simulators. This approximation often reproduces logical error rates well [8, 9], but it can bias them [10, 11, 12] and does not in general preserve the full effect of the original channel on a QEC circuit. Approximations by Clifford channels and Pauli measurements come closer, but still do not reproduce the channel [13, 14, 15].
For applications in which simulated measurement records become the input to statistical analysis or machine-learning pipelines, changes in the distribution of these records can matter directly. Efforts to retain the exact channel have so far relied on density-matrix simulation, limited to about 17 qubits [16], or on tensor networks, which either assume perfect syndrome measurements [17] or take seconds per shot [18]. Quasiprobability decompositions also retain the exact channel and estimate circuit statistics without bias, but return signed-weight samples [19, 20, 21, 22]. Quantum-trajectory simulation handles any channel through stochastic pure-state evolution [23, 24, 25, 26, 27] and can be accelerated with a delayed inner product algorithm [28]. Conventional trajectory simulators [28, 29], however, evolve every shot independently and closely related trajectories can repeat the same state evolution.
Several simulators exploit this redundancy. Approximate schemes reuse states across a fixed tree of subcircuits at a bounded cost in accuracy [30]. Among exact simulators, some fix every noise outcome before the simulation starts, so that identical prefixes can be found and evolved once [31, 32, 33]. Pre-trajectory sampling with batched execution (PTSBE) [34, 35] also fixes all outcomes in advance, and gains its speed by evolving each distinct trajectory once and drawing its measurement records in a single batch, with control over how many records each trajectory produces, including nonproportional allocations. Fixing outcomes in advance, however, requires their probabilities to be independent of the state, which excludes mid-circuit measurements (MCMs) and general (non-mixture-of-unitaries) Kraus channels unless decoherence is first twirled into Pauli noise [33]. Other exact simulators draw each outcome during state evolution and copy the state shared by several shots only when their outcomes differ [36], which handles any channel or measurement but fixes nothing in advance. To our knowledge, no exact simulator combines the speed of pre-sampled, batched execution with support for state-dependent operations.
In this work, we generalize PTSBE to circuits containing mid-circuit measurements and general Kraus channels [Fig. 1], in a GPU simulator based on CUDA-Q [29]. With the lower bounds of the delayed inner product algorithm [28], the outcome probabilities of each stochastic event are split into a state-independent part, pre-sampled before execution, and a residual distribution, evaluated on the intermediate state when the trajectory reaches the event. Each trajectory is thus first drawn as a proposal, which holds for every event either a pre-sampled outcome or, for a deferred event, the residual distribution. Identical proposals evolve as one group. At a deferred event, a single multinomial draw from the residual distribution splits the group that reaches it, and sibling groups restart from the state cached before the event, in a tree-based simulation structure [30, 32].
Together, these mechanisms retain the computational advantages of PTSBE across state-dependent operations and without approximation. On distance-3 topological code memories under amplitude damping, generalized PTSBE achieves 11–24× higher sampling throughput than conventional trajectory sampling with CUDA-Q v0.15.1, a leading GPU-accelerated statevector simulator [29, 37]. On random monitored circuits of 16 to 30 qubits with Pauli noise, it is 47–318× faster than CUDA-Q, and it outperforms Cliftt above a crossover density of non-Clifford gates that falls from 62% to 24% as the qubit count grows, reaching up to a speedup. With amplitude damping, which Cliftt does not support, the speedup over CUDA-Q is 83–176×. In the nonproportional sampling regime, our sampling rate per trajectory exceeds that of CUDA-Q by a factor of more than , and about 90% of the shots are distinct in their trajectory and terminal bits.
The rest of this manuscript is organized as follows. Section II reviews trajectory simulation, the original, fully pre-sampled PTSBE, and the delayed inner product algorithm. Section III generalizes PTSBE to partially pre-sampled trajectories, with grouped execution and terminal readout. Section IV first demonstrates that replacing amplitude damping by its Pauli-twirled channel changes the syndrome statistics of a surface-code memory, motivating exact channel simulation, and then benchmarks generalized PTSBE against CUDA-Q and Cliftt. Finally, § 1.4 discusses the origin of the speedups, exact noise-model advantages, and future research directions.
Background
The generalized implementation of PTSBE presented in this manuscript combines the trajectory reuse of the original PTSBE [34, 35] with the state-independent lower bounds of the delayed inner product algorithm [28]. We review both after summarizing the foundations of conventional trajectory simulation for noisy quantum systems.
Quantum trajectories
We consider a circuit in which deterministic unitary blocks are interleaved with stochastic events , , such as noise channels and mid-circuit measurements [Fig. 1(a)]. Each trajectory is represented by a statevector initialized in . For event , let denote the finite set of its possible outcomes, such as which Kraus operator of a noise channel acts or which result a measurement gives, and the associated operators, satisfying
Figure 1. Pre-trajectory sampling with batched execution for state-dependent stochastic events. (a) An example circuit with deterministic unitary blocks and stochastic events , colored by their pre-sampling probability in all panels: orange for mid-circuit measurements (), blue for general Kraus channels (), and green for mixed-unitary channels (). Each bar shows how the draw of an event splits into pre-sampled outcomes and a part drawn on the intermediate state (Sec. II C). (b) Conventional trajectory simulation draws stochastic outcomes during propagation and evolves each trajectory independently. (c) Original PTSBE pre-samples complete trajectories when every event has , deduplicates repeated trajectories, and prepares each retained trajectory once for terminal samples. (d) A diagram of the generalized PTSBE process presented in this work. (1) At event , a proposal stores either a pre-sampled outcome, with total probability (solid), or, with probability , the residual distribution (hatched). Identical proposals are grouped with their multiplicity. (2) At a deferred event, is evaluated once on the group’s intermediate state, and a multinomial draw splits the group into sibling groups, one per occupied outcome. Dashed arrows mark siblings that resume from the cached state. (3) Each trajectory is prepared once and sampled in a batch at the terminal readout, here with proportional sampling, such that each trajectory receives as many terminal samples as its multiplicity.
In a trajectory, a noise channel acting on density matrices as applies its Kraus operator when outcome occurs, and a projective measurement applies the projector of result , for instance with for a single-qubit measurement. For a normalized immediately before an event, the probability of outcome is
and, for , the corresponding renormalized state is
For a mid-circuit measurement, outcome is also added to the classical measurement record. Trajectory simulation draws the outcome of each stochastic event with the probabilities of Eq. (2) on the intermediate state and updates the state by Eq. (3). Conventional implementations evolve one independent trajectory per shot [Fig. 1(b)].
Original PTSBE
In its original version, PTSBE [34, 35] obtains its efficiency in two steps, illustrated in Fig. 1(c). It first samples the noise outcomes of every trajectory before state evolution (pre-trajectory sampling) and groups repeated trajectories. It then evolves each distinct trajectory once and reuses its final state for batched terminal readout (batched execution). Each final state is sampled either a fixed, possibly large, number of times or in proportion to the trajectory’s probability. However, selecting outcomes in advance requires state-independent probabilities. By Eq. (2), this means that original PTSBE only works for operators conforming to , i.e., Kraus operators that are proportional to unitaries, as is the case for Pauli and other mixture-of-unitary channels. As a result, MCMs, qubit resets, and general Kraus channels fall outside the scope of the original PTSBE algorithm.
The delayed inner product algorithm
The delayed inner product algorithm [28] assigns to each outcome of event a probability lower bound that holds for any input state,
where denotes the smallest singular value of , so that is the smallest eigenvalue of . The quantity is the largest state-independent lower bound on over all normalized input states, attained when is an eigenvector for this eigenvalue. Since the total probability is normalized for any state, .
At each event, the algorithm draws a number uniformly between 0 and 1 and compares it with .
If , the interval is cut into consecutive segments of length , one per outcome, which are known before the simulation. Outcome is selected if falls in its segment, without evaluating any .
If , the interval is cut into segments of length , the excess of each probability over its bound. These lengths depend on the intermediate state, so they are computed only in this case.
Outcome thus covers a total length , and the selection follows Eq. (2) exactly. The bound sum is the probability that , so that the outcome is selected without evaluating any probability on the state, and we call it the pre-sampling probability of the event. The algorithm draws separately for each trajectory when it reaches the event. It therefore skips evaluating , an inner product with the state, whenever , but still evolves every trajectory separately.
Generalized PTSBE
Partially pre-sampled trajectories
The original PTSBE requires at every event. We relax this requirement by allowing trajectories to remain partially pre-sampled until the relevant quantum state becomes available.
For , normalizing the state-dependent segments of Sec. II C by their total length gives the residual probability distribution
These probabilities are nonnegative and sum to one, giving the exact decomposition
This decomposition allows part of the outcome selection to take place before state evolution. Before execution, we draw for each event a random variable with state-independent probabilities
If , outcome is pre-sampled. If , the event is deferred, and its outcome is drawn at run time from the residual distribution evaluated on the intermediate state. By Eq. (6), the total probability of selecting is , with the corresponding state given by Eq. (3). A partially pre-sampled trajectory is represented by the proposal sequence
When at every event, all outcomes are selected before state evolution and the original PTSBE is recovered [Fig. 1(c)], which happens exactly for Kraus operators proportional to unitaries (Supplementary Note S2 B). Nontrivial MCMs have , so their outcomes are always sampled during execution. General Kraus channels, including nonunital noise channels, can take intermediate values , giving the partially pre-sampled events illustrated in Fig. 1(a).
Amplitude damping, for instance, has Kraus operators for no decay and for decay, where is the decay probability of . By Eq. (4), and , so a trajectory needs the state at a damping location only with probability .
Grouped execution and terminal sampling
Algorithm 1 summarizes generalized PTSBE. It consists of a preprocessing step and the three stages of Fig. 1(d), which the paragraphs below motivate in order. Supplementary Note S1 proves that the trajectories follow the law of independent trajectory simulations.
Preprocessing. Once per channel and before constructing any states, we compute the lower bounds and pre-sampling probabilities of Eq. (4) and the operators that evaluate Eq. (5). The Kraus representation of a noise channel is not unique, and depends on it. Refactoring the Kraus operators to raise reduces the expected number of deferred events per proposal, , and we provide a search over equivalent representations that maximizes it (Supplementary Note S2). The standard form of amplitude damping, used later in our benchmarks, is already optimal. A larger does not guarantee a shorter runtime, because the new representation also changes how often trajectories coincide and branch, so we propose this search as an optional preprocessing step for other noise models.
Pre-sampling and grouping. Using only the lower bounds, we independently sample proposals, Eq. (8), from Eq. (7) and group identical proposals with their multiplicities [Fig. 1(d), stage 1]. Each distinct proposal is then evolved once for all its
Figure 1 (PDF p. 5).
copies. A group contains identical proposals , which have the same pre-sampled outcomes and the same deferred events. These proposals share a quantum state and advance through the circuit together.
Pre-sampled and deferred events. When a group reaches the stochastic event , it proceeds based on its associated random variable [Fig. 1(d), stage 2]. If , all proposals advance through outcome by Eq. (3), without evaluating the residual distribution. If , the residual distribution is evaluated a single time on the shared state , for the whole group. The group is then split by a single multinomial draw
where is the number of proposals assigned to outcome . This draw is exact because the members share , so their residual draws are independent and identically distributed. Outcomes with are never simulated. For each outcome with , applying according to Eq. (3) produces a successor group of proposals. Each successor group then continues, updating the measurement
| Algorithm 1. Generalized PTSBE. evolves identical proposals from , starting at event . |
| Require: , , , , mode for |
| Preprocessing |
| 1: Eq. (4) |
| Stage 1: pre-sampling and grouping |
| 2: Eq. (7) independently |
| 3: Group identical into groups |
| Stage 2: grouped execution, depth first |
| 4: for all groups do |
| Stage 3: terminal sampling |
| 5: for all do draw samples from |
| 6: procedure |
| 7: for do |
| 8: |
| 9: if then deferred |
| 10: Eq. (9) |
| 11: Cache if several |
| 12: for all with do |
| 13: |
| 14: |
| 15: return |
| 16: Eq. (3) |
| 17: all outcomes fixed: trajectory |
| 18: final state of |
| 19: multiplicity of |
Table 1.
record at mid-circuit measurements.
Branching and caching. When the multinomial draw gives several outcomes with , the group splits into sibling groups, one per such outcome, which all start from the state cached immediately before the event. The first branch continues from the intermediate state, and the others restart from the cached copy. Depth-first traversal bounds the number of cached states by the number of deferred events on the current path (Supplementary Note S6 A). Different proposals can produce the same trajectory, because an outcome can be pre-sampled or drawn on the intermediate state. Their multiplicities are therefore added.
Terminal sampling. Let denote the accumulated multiplicity of a trajectory . Each trajectory is re-executed once to prepare its final state, from which measurement records are drawn in a batch (Fig. 1(d), stage 3). We provide three modes for : 1) proportional sampling, , which gives the same distribution of measurement counts as independent trajectory sampling, 2) rescaled proportional sampling, with a positive integer , which draws more records from the same sampled trajectories, and 3) nonproportional sampling, for every trajectory independently of its multiplicity (suited to generating large labeled datasets), with the terminal samples of each trajectory weighted by to estimate circuit statistics (Supplementary Note S3).
Applications and performance
We generalize PTSBE to trajectory sampling with any Kraus channel and mid-circuit measurement, for general-purpose circuit simulation as well as QEC dataset generation. We first show why exact simulation of such channels matters, by comparing amplitude damping with its Pauli-twirled channel on a surface-code memory (Sec. IV A). We then measure the speedup on random monitored circuits and QEC memories over exact conventional trajectory sampling and over the near-Clifford simulator Clifft in the noise regime it supports (Sec. IV B).
QEC statistics with general noise channels
We consider a distance-3 rotated surface-code memory over three rounds, with single-qubit amplitude damping after every layer as the only noise source (Supplementary Note S4 A). Each shot yields a syndrome , the outcomes of the 24 detectors comparing successive stabilizer measurements, and a logical bit , equal to 1 when the stored state is flipped. We compare two noise models, the exact channel, simulated with our method, and the Pauli-twirled channel, sampled with Stim [6], through the total-variation distance (TVD) between their distributions of the syndrome ,
which ranges from 0 for identical distributions to 100% for distributions with no syndrome in common. Given a detection, the two distributions lie at a TVD of 19.8%, well above the 0.4% that finite sampling alone produces with about sampled syndromes each. This disagreement appears both in individual syndromes, whose probabilities change by up to 329-fold (Figure 2(a), Supplementary Note S5 B), and in the detection rate, which the twirled noise overestimates by 21%, with at least one detection in 30.3% of shots against 25.1% under exact noise (Figure 2(a), inset).
Figure 2. Effect of Pauli twirling on syndrome statistics and decoding. Exact amplitude damping (generalized PTSBE) is compared with its twirled channel (Stim) for a distance-3 rotated surface-code memory storing over three rounds. In (a) and (c), points are shaded by . (a) Ratio for the 1,000 most probable syndromes with a detection, with s.d. bars. Triangles mark syndromes absent from all exact shots. The TVD, Eq. (10), is computed given a detection and compared with the TVD that finite sampling alone would produce. Inset: share of shots with at least one detection. Syndrome data sampled with the twirled channel, as stabilizer simulators require, therefore misweight individual syndromes by up to a factor of 329 and overestimate the detection rate by 21%. (b) TVD between the exact and twirled syndrome distributions given the error set , the locations where a decay can occur. Error sets are ordered from most to least probable, and vertical lines separate the regions with locations, each labeled with its share of shots. The distance grows with and clusters on horizontal plateaus at 25%, 50%, and 75%. The insets explain these plateaus by breaking down the syndrome mismatch for three example error sets, with each syndrome listed by the detectors that fire. For instance, exact damping leaves a Z-check ancilla in quiet, whereas the twirled channel erroneously fires its detector pair half the time (50% plateau). (c) Logical-flip probability of each syndrome under the exact and twirled channels. Circled syndromes lie on opposite sides of (tinted quadrants), so lookup decoders built from the two models apply opposite corrections to them. Decoding with twirled statistics raises the logical error rate from 0.424% to 0.458% on exact shots. Shown are syndromes seen in at least 100 shots under both models (99.75% of exact shots, standard errors at most 0.05%).
To locate where the two models differ, we sort shots by their error set (Figure 2(b)), the locations where a decay can occur. Our pre-sampling identifies these locations as the deferred events of a proposal. Each location enters with probability , so is known in closed form and lets us estimate the exact distribution set by shot (Supplementary Note S5 A). We draw the Pauli errors of the twirled channel at the same locations and compare the two models for each . The distance is near zero when is empty, since no decay can occur. It grows with , because each location in is a place where the two models act differently. For each , distances cluster near zero and along plateaus at 25%, 50%, and 75%. The syndrome distributions of three example error sets (Figure 2(b), zooms) reveal the origin of this structure. Amplitude damping leaves unchanged, whereas the twirled channel can flip it. Consequently, a location of on a Z-check ancilla in produces no detection event under exact damping, but triggers a detector pair half the time under the twirled channel, generating the 50% plateau. With two such locations, the Pauli twirling approximation spreads over four equally likely syndromes and the distance reaches 75%.
Finally, a decoder built from these statistics inherits the identified mismatch (Figure 2(c)). We build a lookup table from each model and test both on the same exact-noise records. The table built from the twirled model fails on 0.458% of these records, against 0.424% for the exact table, an 8% relative increase in logical error rate. Because the test records follow the exact noise, each syndrome counts in proportion to its exact probability. Figure 2(c) shows only syndromes seen in at least 100 shots under both models. Given that rarer syndromes arise mostly from larger error sets, where the models differ more Figure 2(b), one could expect them to receive opposite corrections more often. This lookup decoder is a
simple case, which uses only the side of on which each estimate of falls, and twirling could affect more sophisticated decoders more. For instance, soft-output decoders, which estimate this probability itself [38], also respond to shifts that do not cross , and learned decoders that take the full measurement bitstrings as input [4], not only the syndromes computed from them, are also sensitive to differences that the syndromes do not show.
Accelerating exact trajectory simulation
We compare the sampling throughput of our implementation with conventional trajectory sampling in CUDA-Q v0.15.1 [29], using its cuStateVec-based GPU statevector simulator [37], in both terminal allocation modes of Sec. III B. We also compare with the near-Clifford simulator Clifft [7] on circuits with only Pauli noise, since it does not support noise channels with non-unitary Kraus operators, such as amplitude damping. Our generalized PTSBE and CUDA-Q both evolve single-precision GPU statevectors under the same exact channels on one GPU. Clifft runs on 16 CPU cores. We expect the timings reported here to improve as we continue to develop our open-source implementation (Supplementary Note S7 B).
Proportional sampling
We first run the 17-qubit surface-code memory of Sec. IV A, its X-basis counterpart, and a 10-qubit distance-3 color-code memory, all under amplitude damping, and measure the throughput for shots, one per proposal Figure 3(a). At , the speedup is to , depending on the memory circuit, because the draws contain only 54 distinct proposals in each surface-code memory and 37 in the color code. As increases, the most probable trajectories keep recurring and the fraction of distinct shots falls, so that at the speedup reaches for both surface-code memories. The color code has fewer noise locations, 261 against 384, so its trajectories repeat more often, leading to a greater speedup of .
Figure 3. Speedup of generalized PTSBE over trajectory sampling and near-Clifford simulation. (a) Speedup over trajectory sampling in CUDA-Q (top) and fraction of distinct shots, the number of distinct (trajectory, terminal bitstring) pairs per shot (bottom), against the number of shots , for three distance-3 memories run for three rounds under amplitude damping. Clifft is not shown, since it can only approximate this noise channel. (b) Speedup at shots over CUDA-Q (solid) and over Clifft (dashed), against the density of non-Clifford gates in random monitored circuits of , , and qubits and depth . Each Clifford gate is replaced with probability by a non-Clifford Pauli rotation, under the same noise at every . Generalized PTSBE is faster than CUDA-Q at every density and outperforms Clifft beyond a crossover density that falls from at to at . Clifft is faster in the shaded region, where the speedup is below 1. The points labeled AD repeat the circuits with amplitude damping in place of the Pauli gate noise, which Clifft does not support. Points are geometric means over three runs, and bars show one standard deviation of the log rate.
To go beyond QEC circuits, we consider random monitored circuits [39, 40] of , , and qubits with alternating layers of random single- and two-qubit Clifford gates Figure 3(b). Each gate is replaced with probability by a non-Clifford Pauli rotation, so that sets the non-Clifford gate density. Some qubits are measured and reset after every second layer, and Pauli gate noise of probability acts throughout, independently of . Details and circuits are discussed in Supplementary Note S7. We sweep and compare with CUDA-Q and Clifft. Near the Clifford regime, Clifft is faster since it is designed for such circuits. Its cost grows with the number of non-Clifford rotations, however, and our method outperforms it above , , and for , , and , reaching up to , , and respectively at . The speedup over CUDA-Q is nearly flat in , reaching – depending on the circuit size, since a statevector engine applies Clifford and non-Clifford gates at the same cost.
We also run the circuits with the Pauli gate noise replaced by amplitude damping (AD) of strength after single-qubit layers and per qubit after two-qubit layers [Fig. 3(b), AD]. Stabilizer and near-Clifford simulators such as Stim and Clifft can only approximate this channel, so we compare with CUDA-Q only, giving speedups of , , and for , , and , of the same order as with Pauli noise.
The speedup decreases with , because larger circuits have more noise locations, so trajectories repeat less often, and because the reported runs sample the final states only once all trajectories are complete, which requires preparing each of them again, a cost that grows with . A future version of our implementation will offer an alternative readout mode, which samples each trajectory as soon as its final state is reached.
Nonproportional sampling
As in the original PTSBE algorithm [34], our simulator supports a nonproportional mode which assigns the same number of terminal samples to every trajectory, yielding many labeled shots per trajectory evolution, as needed for instance for large QEC datasets. We now apply it in the presence of state-dependent events, using a random monitored circuit with , , , and amplitude damping on every qubit, which records 14 mid-circuit and 30 terminal bits per shot [Fig. 4]. We draw 100 proposals, which give 100 distinct trajectories.
Conventional trajectory sampling in CUDA-Q evolves one trajectory per shot, at 0.723 shots/s, and we compare this rate with our shot rate per trajectory (Supplementary Note S7 E). The speedup rises from at to over at , because generating the trajectories takes a fixed 46.3 s while sampling their final states grows only from 55.5 s to 149 s over five orders of magnitude in . Across these batch sizes, the fraction of distinct shots stays above 0.89 [Fig. 4, bottom], so most additional terminal samples still yield new labeled records, for instance as training data for decoders.
All records share the noise realizations of these 100 trajectories, and each carries its trajectory label. Because the number of trajectories and the number of samples per trajectory are set independently, a dataset can cover more noise realizations or draw more terminal samples from each trajectory. When trajectories repeat, weighting each record by the multiplicity of its trajectory restores unbiased estimates of circuit statistics (Supplementary Note S3B).
Discussion
Generalized PTSBE is faster than conventional trajectory sampling in all of the diverse benchmarks explored in this manuscript. In particular, it is up to faster on QEC memories in the proportional mode, up to faster on random monitored circuits, and up to faster per trajectory in the nonproportional mode. It also outperforms the near-Clifford simulator Clifft beyond a crossover density of non-Clifford gates. In generalized PTSBE, each distinct trajectory is evolved just once, regardless of how many shots it serves, so the speedup depends on how many such trajectories and shots a circuit requires.
For QEC applications, these quantities grow with the number of likely error configurations, which is in turn set by code size, number of rounds, and error rates, such that larger codes and longer memories potentially lead to smaller speedups (Supplementary Note S6 A). Conversely, for larger codes, each evolution acts on a larger statevector, which increases the time saved per avoided evolution, as this grows exponentially in qubit number. The net effect of these two competing phenomena is system-dependent and could be evaluated in future studies. The nonproportional mode speedup is insensitive to the number of distinct trajectories, because its gain comes from repeated readout of each one, and thus strictly benefits from larger codes. Both modes should also benefit from further optimization of our implementation (Supplementary Note S7 B).
Pauli twirling is often adopted so that high-throughput simulators can be used, but this choice is not generally accurate for QEC data. In our comparison, a lookup decoder built from twirled statistics makes 8% more logical errors on exact noise, whereas the syndrome distribution that a decoder takes as input shifts by a TVD of 19.8% given a detection. The conditional analysis traces this shift to error sets in which the twirled channel flips states that damping leaves unchanged. Stabilizer simulators can avoid the Pauli twirling approximation when a channel is a mixture of Clifford operations and reset with positive weights, as thermal relaxation is for [12]. Pure amplitude damping, with as in Sec. IV A, requires negative weights, which cannot serve as sampling probabilities, while our method samples it exactly.
Together, the speed and exactness of our approach enable large-scale simulation of protocols built on mid-circuit measurements and non-Clifford gates under realistic non-Pauli noise, providing a practical tool for the development of fault-tolerant quantum computers. In particular, at millions of labeled shots per second, each tagged with the trajectory that produced it, our method can supply the large and accurate datasets that AI-based decoders require under realistic nonunital channels, such as amplitude damping.
These capabilities open several directions for future work, as we expect the speedups of our method to benefit any study that samples many shots of a generally and realistically noisy circuit. For QEC, the most direct application is to train learned decoders on these extensive and exact datasets. Such decoders could also be compared with ones trained on twirled data, beyond the distance-three code and lookup decoder of Sec. IV A. The same contrast between exact and approximate noise models extends to logical gadgets, in particular to protocols based on repeat-until-success [41, 42] or postselection, whose mid-circuit measurements our method treats exactly, such as gate synthesis, magic-state distillation [43], and cultivation [44]. Identifying the regimes in which approximate models fail would accelerate the design of such gadgets and of their circuit implementations, a task that models trained on exact data could also support. Combining partial pre-sampling with tensor-network PTSBE, which has been demonstrated on circuits of up to 200 qubits with Pauli noise [35], could bring mid-circuit measurements and general noise channels beyond the 30 qubits of statevector simulation. Finally, our framework can be applied immediately to rare-event sampling, as is vital for achieving low logical error-rate decoders [45, 46].
acknowledgments
L.F. performed part of this work during an internship at NVIDIA. L.F. and D.R.E. acknowledge research funding from NVIDIA to MIT. The authors acknowledge the use of AI tools to assist with code development and manuscript editing. The authors reviewed all AI-assisted output and take full responsibility for the content of this work.
code availability
Our implementation will soon be released as open-source software.
competing interests
T.L.P., J.G.L., and L.F. are inventors on a patent application filed by NVIDIA, titled “Statevector caching and batching techniques for efficient mid-circuit measurement simulations”. The other authors declare no competing interests.
Author contributions
T.L.P., J.G.L., and L.F. conceived the project. L.F. developed the method and its software implementation, performed the simulations, and analyzed the results. I.S. contributed to the algorithm for general Kraus channels, T.N. to the software implementation, and J.G.L. to the quantum error correction applications. P.P. supported the final code development and optimization, large-scale benchmarks, and the preparation of the open-source software. D.L., B.K., and K.M.S. provided guidance on the applications, simulations, and analysis. T.L.P. and D.R.E. supervised the research. L.F. wrote the manuscript with input from all authors.
References
Supplementary Information:
Exactness of the method
Events, proposals, and trajectories
The circuit starts in a normalized pure state and contains stochastic events, each a local Markovian channel or a measurement. Event has outcomes with square Kraus operators , and we write , so that .
A proposal carries one variable per event, either a pre-sampled outcome or the residual distribution . A trajectory lists every outcome needed to reconstruct its state, including reset outcomes that are never recorded. A shot consists of the recorded mid-circuit outcomes and one bitstring sampled from the trajectory’s final state. Each final state is sampled times, so several shots can share a trajectory.
Pre-sampled and deferred outcomes
Eqs. (4)–(6) split each outcome probability into a state-independent part , the lower bound of the delayed inner product algorithm [28], and a residual part. Two facts complete the argument. First, , so for the operators
are positive semidefinite and sum to the identity. The residual probabilities of Eq. (5) therefore form a distribution on every normalized state. Second, the are drawn before execution, independently across events, with
and a deferred event is completed at run time by an independent draw from on the intermediate state. Both routes apply the update of Eq. (3), and by Eq. (6) their probabilities add up to . Each event therefore selects its outcome and its conditional state with the ordinary trajectory law. Since the variables are independent, induction over the events extends this to the joint law of all mid-circuit and terminal measurements. The argument holds in exact arithmetic, and Supplementary Note S6 B gives the numerical tolerances.
Any smaller bounds give the same result once and are recomputed from them. Supplementary Note S4 C uses this freedom. At every event is deferred and . At , completeness forces , so the outcome probabilities do not depend on the state and no residual draw occurs.
Grouped execution
The proposals are independent draws, and grouping identical ones extends the trajectory reuse of the original PTSBE [34] algorithm. The members of a group share their outcomes so far, their mid-circuit record, and their remaining proposal, hence the same state . At a deferred event, drawing their outcomes independently would give outcome counts , with , distributed as
One draw of this vector reproduces these counts, and only outcomes with are evolved. Repeating the argument at every later event shows that grouped and independent execution produce the same law.
Two proposals can end in the same trajectory , because an outcome can be pre-sampled or drawn on the intermediate state. They then share a final state and are merged by adding their multiplicities.
The multiplicities sum to , so drawing terminal samples from each final state reproduces the counts of independent trajectory simulations. Supplementary Note S3 treats larger terminal allocations, and Algorithm 1 summarizes the procedure.
Measurements, resets, and readout
A projective measurement with more than one possible outcome has for every projector, hence , and its residual law is the Born rule. A reset to uses and . Its outcome is not recorded but stays in the trajectory, because for an entangled input the two outcomes leave the other qubits in different states. Terminal measurements of commuting Pauli products are sampled jointly after one basis change, which preserves their correlations.
Kraus representation and max-
Unitary freedom and objective
Suppressing the event index, let a channel on a -dimensional space have Kraus operators . Any unitary gives another representation of the same channel, since
The trajectories change with the representation [47, 48, 49, 50], and so does the pre-sampling probability. Max- preprocessing searches for the representation with the largest
It applies only to noise channels whose outcomes are not recorded, since remixing the outcomes of a measurement would change the record. A larger leaves fewer deferred draws, per proposal on average.
Upper bound and amplitude damping
The matrix has the same eigenvalues as , so . Summing over gives , hence
for every representation, where the last inequality follows from . A representation that reaches is optimal.
If , the positive semidefinite matrices sum to zero and all vanish. Each nonzero is then times a unitary, and the representation is a mixture of unitaries. Conversely, a channel that is a mixture of unitaries has in its mixture form, even when another of its representations has . Nonunital channels never reach , since a mixture of unitaries maps to .
The standard amplitude-damping representation of Eq. (22) has and , and
It is therefore optimal, and preprocessing leaves it unchanged. The Pauli channels of the random circuits already have , so preprocessing plays no role in the reported timings. For generalized amplitude damping with equilibrium excited population (Sec. S2 D), and .
Numerical search
The search starts from the supplied representation and from random unitaries. Each step multiplies by for a random Hermitian , keeps the step only if increases, and shrinks after a rejection. It stops within of the bound (S6) or after a fixed number of steps. A candidate must reproduce the Choi matrix of the input to and pass the checks of Supplementary Note S6 B. Otherwise the original representation is kept, so the adopted never decreases.
Examples
Table S1 applies the search to five channels.
| Channel | Input | After search | |
| Amplitude damping, | 0.700 | 0.70000 | 0.70000 |
| Phase damping, | 0.600 | 1 | |
| Generalized damping, , | 0.800 | 0.91985 | 0.92000 |
| Two-qubit dephasing, | 0.800 | 1 | |
| Random channel, rank three | 0.345 | 0.86311 | 0.86313 |
Table S1. Pre-sampling probability before and after the search of Sec. S2 C, and the bound of Eq. (16). For phase damping and two-qubit dephasing, the closed forms of Sec. S2 D reach exactly. Every adopted representation reproduces the input Choi matrix to .
Amplitude damping, Eq. (22), is already optimal (Sec. S2 B).
Phase damping with parameter , with and , multiplies the coherences by . So does the mixture , with , which has .
Generalized amplitude damping with equilibrium excited population uses , , , and , with the amplitude-damping operators of Eq. (22).
Two-qubit dephasing, with and , attenuates the coherences involving . It has the same closed form as phase damping, with in place of .
The random rank-three channel draws three matrices with independent standard normal real and imaginary entries and sets .
Terminal allocation
Proportional mode
Let be the probability of the trajectory , mid-circuit outcomes included, and that of the bitstring given . The proposals give independent trajectory draws with multiplicities , and the terminal samples are independent given the trajectories. Supplementary Note S1 C shows that reproduces independent sampling.
The allocation , with a positive integer, gives records. It corresponds to the optional proportional resampling of the original PTSBE [34], with sampled multiplicities in place of trajectory probabilities. A record picked at random follows the circuit distribution, but records drawn from the same trajectory are correlated. For a real statistic with mean and variance given , the average of over the records has variance
A larger shrinks the second term. The first term depends only on the number of trajectory draws.
Nonproportional mode
Nonproportional mode gives the same number of terminal samples to each of the distinct trajectories. An unweighted average over the records then weights every trajectory by instead of . The multiplicities are kept, and with the mean of over the samples of , the weighted estimator
is unbiased over the trajectory draws. Its variance has the same trajectory term as Eq. (18), plus a measurement term proportional to . When the proposals are chosen deliberately, as in Supplementary Note S5 A where each error set receives its own number of runs, the records of each error set are averaged first and the averages are weighted by , as in Eq. (27).
In Figure 4, , so all weights are equal.
Figure 4. Bulk generation of labeled shots with generalized PTSBE in nonproportional mode. A random monitored circuit of qubits and depth , with amplitude damping on every qubit, is sampled from 100 trajectories that each receive the same number of shots. Top: shot rate per trajectory, the total rate divided by the number of trajectories, against . Conventional trajectory sampling in CUDA-Q (blue) simulates one trajectory per shot. The speedup grows from at to 70,000 at . Bottom: fraction of distinct shots, the number of distinct (trajectory, terminal bitstring) pairs per shot. Each shot carries its trajectory label.
Fraction of distinct shots
The fraction of distinct shots is the number of distinct pairs among the shots, divided by . Two shots with the same bitstring and different trajectories count as distinct. The fraction measures repetition in the labeled dataset and says little about how often trajectories repeat. At and , almost every shot is distinct even though each trajectory serves about four shots (Figure S3).
Figure S3. Trajectory reuse in the random monitored circuits at proportional shots. a, Distinct trajectories per shot. Each distinct trajectory is prepared once for terminal sampling. b, Fraction of distinct shots, the number of distinct (trajectory, measurement outcome) pairs per shot. At and almost every shot is distinct, even though each trajectory serves about four shots. Open markers are the AD circuits at . Means over three runs.
For one trajectory sampled times, the expected number of distinct bitstrings is
A uniform distribution over bitstrings would still give a distinct fraction of about 0.995 at . The measured 0.89 in Figure 4 shows that each trajectory’s readout distribution is far from uniform.
Amplitude damping and its Pauli twirl
Memory circuit and noise
Figure 2 uses a distance-three rotated surface-code memory storing , the distance-three memory of the Clifft benchmark suite [7] with its noise instructions removed. Nine data qubits and eight ancillas run three rounds of stabilizer measurement, followed by a -basis measurement of the data qubits. The syndrome collects all detectors: four at the first round, eight comparing each pair of successive rounds, and four at the final readout. Each detector, like the logical bit , is a parity of measurement outcomes that vanishes without errors.
Each round lasts 1.1 , the cycle time of the distance-three experiment of Ref. [51], and uses that experiment’s gate and readout durations: two 40-ns single-qubit layers, four 98-ns entangling layers, and a 400-ns readout interval. The remaining 228 ns form the reset interval. Amplitude damping acts on every qubit after each gate layer and before readout, and on the nine data qubits during reset, which gives noise locations. An exposure duration gives the damping parameter
with , the mean operating of the 105-qubit processor of Ref. [52]. We omit additional dephasing, so the model has , and amplitude damping is the only noise source. Gates, initialization, and measurements are otherwise ideal, and the exact and twirled simulations share the circuit, the detectors, and the noise locations.
Twirl formulas
At location , amplitude damping has Kraus operators
A qubit with excited population decays with probability . The channel leaves unchanged and is nonunital, since it maps to . The Pauli twirl of a single-qubit channel [8], with , removes the cross terms between the Pauli components of the Kraus operators. It leaves the Pauli channel with probabilities , which for amplitude damping are
The twirled channel is unital and flips with probability , where damping does nothing. Using Eq. (23) at every location gives the Pauli circuit that we sample with Stim [6].
Conditioning on an error set
The standard representation has and , so each location is deferred with probability . The error set of a proposal is its set of deferred locations, which need not coincide with the locations where a decay occurs. It has probability
Outside the update is applied, and inside the qubit decays with probability on the intermediate state.
Figure 2(b) conditions the twirled channel on the same by applying Supplementary Note S1 B to the twirled channel with bounds and . The twirled model then applies the identity outside and, inside , a Pauli drawn from the residual distribution
Supplementary Note S1 then gives
with the same as the exact model. Other bounds give the same unconditional twirl with different conditional distributions, so the per-set comparison depends on this choice, while the global comparisons do not.
Each injected Pauli flips a fixed set of detectors, so summing over the at most assignments gives exactly. Under exact noise the updates outside still act, so even the empty set gives a detection, with probability , whereas its twirled distribution is always quiet.
Statistics of the QEC comparison
Estimate of the exact distribution
Our method generates the exact-noise records in single precision, with one terminal sample per draw, each record being a pair . We estimate their distribution error set by error set. Every set with is simulated on its own, and sets with are drawn from Eq. (24) conditioned on and pooled into one tail sample (Table S2). Counts are kept separately for each error set, even when two error sets lead to the same trajectory. With the fraction of the records of error set equal to , and the same fraction among the records with ,
for any value of or of . The weights are known exactly, so the allocation sets the precision without biasing the estimate. Sampling is independent within and across error sets, which gives the plug-in variance
Figure 2(a) uses Stim records and Figure 2(c) uses . A separate set of exact-noise records from proportional sampling serves as the decoder test set and checks this estimate: the two quiet-syndrome probabilities differ by 0.3 combined standard errors. Rebuilding the twirled distribution from its conditional distributions through Eq. (26) also agrees with direct Stim sampling, with standardized differences of mean 0.02 and standard deviation 0.97 over the 1,000 most likely nonzero syndromes.
Syndrome ratios and distances
Figure 2(a) ranks the nonzero syndromes by and shows the first 1,000, which carry 95% of the exact and 93% of the twirled probability given a detection. It plots the ratio , with pointwise bars around it, where
and counts in the twirled sample. Among the displayed syndromes seen under both models, the largest ratio is 329, with , and 11 ratios exceed 100. Another 25 displayed syndromes never occur in the exact sample and are marked separately.
A detection occurs in 25.1% of the exact shots and 30.3% of the twirled ones. We compute the total-variation distance between the full distributions and between the distributions given a detection (Table S3). For the uncertainty, 200 Poisson bootstrap replicates replace every count by a Poisson draw with that mean and renormalize each error set and the tail sample with their weights fixed. The standard error is the standard deviation of the replicate distances. Their mean exceeds the observed distance by 0.02 percentage points over all syndromes and 0.05 given a detection, which is how much finite sampling inflates the estimate. The noise reference is the 95th percentile over replicates of , where is the resampled minus the original estimate. It gives the distance that sampling alone produces.
| All syndromes | Given a detection | |
| Estimate | 6.54 | 19.84 |
| Bootstrap standard error | 0.001 | 0.004 |
| Noise reference | 0.10 | 0.38 |
Table S3. Total-variation distances between the exact and twirled syndrome distributions of Figure 2, in percent.
Distances given the error set
Figure 2(b) shows, for every set with at most two deferred locations and for the three-location sample, the distance , with tied ranks spread at random. Weighted by , or by draw multiplicity in the three-location sample, its mean is 0.06%, 9.9%, 20.1%, and 28.8% for , 1, 2, and 3. If the exact conditional distributions equaled the twirled ones, finite sampling alone would give 0, 0.04%, 1.9%, and 3.1%, the same weighted mean of the median distance between each set’s twirled distribution and 200 multinomial samples of the exact sample size. These references are not subtracted. The three examples are the most probable sets whose distance lies within 0.02 of 0.5, 0.75, and 0.25.
Logical flips and decoders
Figure 2(c) plots each model’s estimate of for the syndromes with at least 100 twirled records and at least 100 effective exact records, , among the quiet syndrome and the most likely nonzero ones. The 4,588 syndromes kept carry 99.75% of the exact probability. On the twirled side, 100 records bound the binomial standard error of by 0.05. On the exact side, the delta-method standard error is at most 0.05 for every displayed syndrome.
Each lookup decoder applies the logical correction when its model gives , and no correction for ties or for syndromes absent from the data used to build it. We freeze both tables and evaluate them on the same independent exact-noise records. The table built from exact statistics fails on of them and the table built from twirled statistics on . The paired difference, percentage points, is a relative increase of 7.9%. The uncertainties are one standard error over the test records, with the tables held fixed, and do not include the finite-sample error of the tables themselves, which could flip syndromes whose estimates of lie close to . The 53 circled syndromes, whose estimates of lie on opposite sides of , carry 0.11% of the exact probability.
Implementation
Execution and caching
Three random-number streams derived from one seed serve the proposals, the residual draws, and the terminal samples, so changing the terminal allocation leaves the trajectories unchanged. Groups are traversed depth first. At a branch, the first occupied outcome continues from the intermediate state, and each other one keeps its outcomes and a reference to a copy of the state before the branch. In the benchmarks these copies stay on the GPU within a memory budget, and the oldest are evicted when memory runs out. A missing copy is rebuilt by re-applying without new draws, so the cache capacity changes the run time and leaves the results unchanged.
The number of distinct proposals limits the reuse. For independent draws, its expectation is
much smaller than when a few proposals dominate, while branching at deferred events raises the number of distinct trajectories again. Figure S3 shows the result for the random circuits. Doubling the depth gives about ten times more distinct trajectories per shot. A deferred damping location that ends without a decay applies , as a pre-sampled one does, so proposals that differ only at such locations merge into one trajectory. The amplitude-damping circuits accordingly give two to four times fewer distinct trajectories than their Pauli counterparts.
Finite precision
Channel preprocessing runs in double precision and the statevectors in single precision. The state is not renormalized after every operator. If the stored state is , then
because the residual operators sum to the identity, so residual probabilities are read without renormalizing. Pre-sampled outcomes apply , which limits the loss of norm along long sequences of pre-sampled outcomes and leaves the normalized state unchanged.
Each channel must preserve the trace to , and when its residual operators must sum to the identity to in spectral norm. Below the residual branch is dropped. In exact arithmetic, this changes the outcome distribution of that event by at most in total variation, and that of the circuit by at most the sum of the dropped masses. For small circuits, host-side tests compare the probability of every measurement record, summed over the pre-sampled and deferred routes, with a density-matrix calculation. They also check trace preservation, the bound decomposition, and the invariance of the Choi matrix under remixing.
Benchmarks
Circuits and noise
The memory benchmarks use the surface-code memory of Supplementary Note S4 A, the memory with the same layout and damping schedule and with -basis preparation and readout, and a distance-three color-code memory generated with Stim [6]. The color code has seven data qubits and three ancillas. Each round applies and to the data qubits, then six CNOT layers and ancilla measurement and reset, with intervals of 40 ns, ns, 400 ns, and 228 ns. Damping acts on all ten qubits during the first eight intervals and on the data qubits during reset, which gives locations. All three memories use and run three rounds.
The random monitored circuits have qubits and alternating layers of single-qubit gates from and two-qubit gates CX or CZ on random pairs. Each gate is replaced, with probability , by a rotation about an axis drawn from or . The angle is drawn uniformly from , kept at least 0.05 away from multiples of 0.5, and rounded to three decimals. One random instance is fixed for each and , and the rotated gates are nested as grows over , so raising only replaces more gates. After every second layer except the last, qubits are measured and reset, and all qubits are measured at the end, which records bits per shot. Main-text Figure 3(b) shows , and Figure S1–Figure S3 add for and 24, where deeper circuits give less reuse and smaller speedups.
Figure S1. Throughput for the random monitored circuits. Green curves are our method in proportional mode at , , and shots, blue curves CUDA-Q, and orange curves Clifft with 16 workers. AD denotes the circuits with amplitude damping in place of the Pauli gate noise. Points are geometric means over three runs, and bars span one standard deviation of the log rate.
The noise is the same for every . Each single-qubit layer is followed by a Pauli channel of strength on every qubit, cycling through depolarizing, , , and errors across the gate locations. Each two-qubit layer is followed by two-qubit depolarizing noise of strength on every pair, and a bit flip of probability precedes every measurement. A Pauli error of strength applies its Pauli with probability , and depolarizing noise of strength applies each nonidentity Pauli with probability on one qubit and on two. The AD circuits keep the gates and the bit flips and replace the gate noise by amplitude damping, with after single-qubit layers and per qubit after two-qubit layers. All engines read the same circuit files.
Engines and timing
The reported runs used an earlier version of our implementation, which drives an internal NVIDIA GPU statevector backend directly. The released code will use the public cuStateVec library instead, with comparable timings in our tests. The reference calls cudaq.run with the nvidia target of CUDA-Q [29], which returns the full measurement record of every shot, mid-circuit outcomes included. It launches the kernel once per shot, so CUDA-Q evolves one trajectory per shot. Both engines use single-precision statevectors and simulate the exact channels, so the speedups combine trajectory reuse with the difference between the two execution paths.
Our execution time is . Trajectory generation covers proposal sampling, grouping, grouped evolution, and branching. Sampling covers the re-execution of each trajectory to its final state and the terminal draws. A future version of our implementation will sample each trajectory as soon as its evolution ends, which avoids this re-execution. Circuit parsing, channel preparation including max-s preprocessing, backend initialization, and the formatting and writing of the output are left out of the timer. All proportional benchmarks use , so a run of draws produces shots at a rate .
The CUDA-Q reference warms up, sets a batch size from a short probe, and times fixed-size batches over a 120-s window, or a 30-min window at , on one GPU. Its rate is the mean over batches of shots per batch time, without compilation and loading. The Clifft reference [7] runs 16 single-threaded workers pinned to distinct cores, each with its own compiled circuit, over 120-s windows after an untimed probe, and its rate is the sum of the workers’ mean rates. Clifft does not support amplitude damping.
Hardware and cache use
The proportional benchmarks ran on exclusive nodes with eight NVIDIA H100 80-GB GPUs and two Intel Xeon Platinum 8480CL CPUs, with one GPU per run. Bulk generation used one H100 GPU of a node of the same type. State copies are kept on the GPU, and before a new copy is stored, the oldest are evicted until at least bytes would remain free (Supplementary Note S6 A). A copy takes bytes, 8 GiB at . The copies held at any time stayed below 1.7 GiB at , reached 16 to 48 GiB at , and reached 56 GiB, seven copies, in bulk generation. No run evicted a copy.
Run conditions and error bars
GPU clocks and thermal state were logged and competing GPU use was monitored in every session. The Clifft windows ran one at a time.
Each proportional point has three runs. The random-circuit runs of both GPU engines use three different sampling seeds. The QEC runs of our method repeat one seed, which measures timing variation on identical data, and their CUDA-Q references use three seeds. The Clifft windows are timing repetitions. Points are geometric means of the three rates, with bars spanning one sample standard deviation of the log rate on each side. A speedup is the ratio of two geometric means, with , which assumes that the engines vary independently. The bars show the run-to-run spread on fixed circuits.
Bulk generation
The bulk-generation circuit has , , , and amplitude damping, and records 14 mid-circuit and 30 terminal bits per shot. The 100 proposals give distinct trajectories, each sampled times. Each budget repeats one seed three times, and the CUDA-Q reference uses three seeds over 30-min windows. The plotted rate per trajectory is , the total shot rate divided by , and the speedup is its ratio to the CUDA-Q rate. Supplementary Note S3 B discusses what repeated readout from shared trajectories means statistically.
The CUDA-Q reference produces 0.723 shots/s, from 1,333 to 1,344 shots per window. The rates of the three runs of each budget agree to within 2%, so the error bars of Figure 4 are hidden by the markers. The largest ratio is 70,822.
Trajectory generation takes 46.3 s at every budget, and sampling grows from 55.5 s at to 149 s at (Figure S4). For shots the execution takes 195 s, or shots/s. The whole run takes 1,106 s of wall time, most of it spent formatting the readout (744 s) and handling records outside the timer.
Figure S4. Simulation and record-handling time for bulk generation. Three runs per point on the , amplitude-damping circuit, with 100 trajectories sampled times each on one H100 GPU. Points are means. a, Trajectory generation, sampling, and readout formatting. Only the first two count toward the execution time. b, Execution time and total wall time, which adds setup, formatting, and record handling.
Figure S2. Speedup at proportional shots. Ratios of the rates of Figure S1 to those of CUDA-Q (blue) and Clifft (orange), with error bars adding the two log standard deviations in quadrature. Our method is faster in the white region.
References
- [1]A. G. Fowler, M. Mariantoni, J. M. Martinis, and A. N. Cleland, Surface codes: Towards practical large-scale quantum computation, Phys. Rev. A 86, 032324 (2012).DOI
- [2]B. M. Terhal, Quantum error correction for quantum memories, Rev. Mod. Phys. 87, 307 (2015).DOI
- [3]G. Torlai and R. G. Melko, Neural decoder for topological codes, Phys. Rev. Lett. 119, 030501 (2017).DOI
- [4]J. Bausch, A. W. Senior, F. J. H. Heras, T. Edlich, A. Davies, M. Newman, C. Jones, K. Satzinger, M. Y. Niu, S. Blackwell, G. Holland, D. Kafri, J. Atalaya, C. Gidney, D. Hassabis, S. Boixo, H. Neven, and P. Kohli, Learning high-accuracy error decoding for quantum processors, Nature 635, 834 (2024).
- [5]Y. Alexeev, M. H. Farag, T. L. Patti, M. E. Wolf, N. Ares, A. Aspuru-Guzik, S. C. Benjamin, Z. Cai, S. Cao, C. Chamberland, Z. Chandani, F. Fedele, I. Hamamura, N. Harrigan, J.-S. Kim, E. Kyoseva, J. G. Lietz, T. Lubowe, A. McCaskey, R. G. Melko, K. Nakaji, A. Peruzzo, P. Rao, B. Schmitt, S. Stanwyck, N. M. Tubman, H. Wang, and T. Costa, Artificial intelligence for quantum computing, Nature Communications 16, 10829 (2025).DOI
- [6]C. Gidney, Stim: a fast stabilizer circuit simulator, Quantum 5, 497 (2021).DOI
- [7]B. A. Chase and F. L. Labib, Clifft: Fast exact simulation of near-Clifford quantum circuits (2026), arXiv:2604.27058 [quant-ph].arxiv.org/abs/2604.27058
- [8]M. R. Geller and Z. Zhou, Efficient error models for fault-tolerant architectures and the Pauli twirling approximation, Phys. Rev. A 88, 012314 (2013).DOI
- [9]M. Gutiérrez and K. R. Brown, Comparison of a quantum error-correction threshold for exact and approximate errors, Phys. Rev. A 91, 022335 (2015).
- [10]Y. Tomita and K. M. Svore, Low-distance surface codes under realistic quantum noise, Phys. Rev. A 90, 062320 (2014).DOI
- [11]A. Katabarwa and M. R. Geller, Logical error rate in the Pauli twirling approximation, Scientific Reports 5, 14670 (2015).DOI
- [12]S. R. Garner, N. M. Myers, M. Wang, S. Stein, C. Liu, and A. Li, Simulation of thermal-relaxation noise for quantum error correction, Phys. Rev. Res. 8, 023134 (2026).DOI
- [13]J. Magesan, D. Puzzuoli, C. E. Granade, and D. G. Cory, Modeling quantum noise for efficient testing of fault-tolerant circuits, Phys. Rev. A 87, 012324 (2013).DOI
- [14]D. Puzzuoli, C. Granade, H. Haas, B. Criger, E. Magesan, and D. G. Cory, Tractable simulation of error correction with honest approximations to realistic fault models, Phys. Rev. A 89, 022306 (2014).DOI
- [15]M. Gutiérrez, L. Svec, A. Vargo, and K. R. Brown, Approximation of realistic errors by Clifford channels and Pauli measurements, Phys. Rev. A 87, 030302(R) (2013).DOI
- [16]T. E. O’Brien, B. Tarasinski, and L. DiCarlo, Density-matrix simulation of small surface codes under current and projected experimental noise, npj Quantum Information 3, 39 (2017).
- [17]A. S. Darmawan and D. Poulin, Tensor-network simulations of the surface code under realistic noise, Phys. Rev. Lett. 119, 040502 (2017).DOI
- [18]F. P. Barone, D. Jaschke, I. Siloi, and S. Montanegero, Color code thresholds under circuit-level noise beyond the Pauli framework, Quantum Science and Technology 11, 035065 (2026).DOI
- [19]H. Pashayan, J. J. Wallman, and S. D. Bartlett, Estimating outcome probabilities of quantum circuits using quasiprobabilities, Phys. Rev. Lett. 115, 070501 (2015).DOI
- [20]M. Howard and E. Campbell, Application of a resource theory for magic states to fault-tolerant quantum computing, Phys. Rev. Lett. 118, 090501 (2017).DOI
- [21]R. S. Bennink, E. M. Ferragut, T. S. Humble, J. A. Laska, J. J. Nutaro, M. G. Pleszkoch, and R. C. Pooser, Unbiased simulation of near-Clifford quantum circuits, Phys. Rev. A 95, 062337 (2017).DOI
- [22]J. R. Seddon and E. T. Campbell, Quantifying magic for multi-qubit operations, Proceedings of the Royal Society A: Mathematical, Physical and Engineering Sciences 475, 20190251 (2019).DOI
- [23]J. Dalibard, Y. Castin, and K. Mølmer, Wave-function approach to dissipative processes in quantum optics, Phys. Rev. Lett. 68, 580 (1992).pubmed.ncbi.nlm.nih.gov/10045937
- [24]R. Dum, P. Zoller, and H. Ritsch, Monte Carlo simulation of the atomic master equation for spontaneous emission, Phys. Rev. A 45, 4879 (1992).pubmed.ncbi.nlm.nih.gov/9907570
- [25]K. Mølmer, Y. Castin, and J. Dalibard, Monte Carlo wave-function method in quantum optics, Journal of the Optical Society of America B 10, 524 (1993).DOI
- [26]M. B. Plenio and P. L. Knight, The quantum-jump approach to dissipative dynamics in quantum optics, Rev. Mod. Phys. 70, 101 (1998).DOI
- [27]A. J. Daley, Quantum trajectories and open many-body quantum systems, Advances in Physics 63, 77 (2014).DOI
- [28]S. V. Isakov, D. Kafri, O. Martin, C. Vollgraf Heidweller, W. Mruckkiewicz, M. P. Harrigan, N. C. Rubin, R. Thomson, M. Broughton, K. Kissell, E. Peters, E. Gustafson, A. C. Y. Li, H. Lamm, G. Perdue, A. K. Ho, D. Strain, and S. Boixo, Simulations of quantum circuits with approximate noise using qsim and Cirq (2021), arXiv:2111.02396 [quant-ph].arxiv.org/abs/2111.02396
- [29]The CUDA-Q development team, CUDA-Q, https://github.com/NVIDIA/cuda-quantum (2026), version 0.15.1.
- [30]M. Wang, S. Tannu, and P. J. Nair, Accelerating simulation of quantum circuits under noise via computational reuse, in Proceedings of the 52nd Annual International Symposium on Computer Architecture (ISCA ’25) (ACM, 2025) pp. 1539–1553.
- [31]G. Li, Y. Ding, and Y. Xie, SANQ: A simulation framework for architecting noisy intermediate-scale quantum computing system (2019), arXiv:1904.11590 [quant-ph].
- [32]G. Li, Y. Ding, and Y. Xie, Eliminating redundant computation in noisy quantum computing simulation, in 2020 57th ACM/IEEE Design Automation Conference (DAC) (2020) pp. 1–6.DOI
- [33]S. Dangwal, T. Oberoi, A. Saipolar, D. Shah, and F. T. Chong, TUSQ: Tracking, uncomputation, and sampling for noisy quantum simulation, in 2026 ACM/IEEE 53rd Annual International Symposium on Computer Architecture (ISCA) (2026) pp. 2318–2332.arxiv.org/abs/2508.04880
- [34]T. L. Patti, T. Nguyen, J. G. Lietz, A. J. McCaskey, and B. Khailany, Augmenting simulated noisy quantum data collection by orders of magnitude using pre-trajectory sampling with batched execution, in Proceedings of the International Conference for High Performance Computing, Networking, Storage and Analysis (SC ’25) (ACM, 2025) pp. 762–773, arXiv:2504.16297 [quant-ph].arxiv.org/abs/2504.16297
- [35]T. L. Patti, P. Pari, Y. Gao, A. Haidar, T. Nguyen, T. Lubowe, D. Lowell, and B. Khailany, Accelerating quantum tensor network simulations with unified path variations and non-degenerate batched sampling (2026), arXiv:2604.08467 [quant-ph].arxiv.org/abs/2604.08467
- [36]J. Doi, H. Horii, and C. Wood, Efficient techniques to GPU accelerations of multi-shot quantum computing simulations (2023), arXiv:2308.03399 [quant-ph].arxiv.org/abs/2308.03399
- [37]The CUDA-Q development team, Noisy simulators, CUDA-Q documentation, https://nvidia.github.io/cuda-quantum/0.15.0/using/backends/sims/noisy.html (2026), version 0.15.0.
- [38]N. Meister, C. A. Pattison, and J. Preskill, Efficient soft-output decoders for the surface code (2024), arXiv:2405.07433 [quant-ph].arxiv.org/abs/2405.07433
- [39]B. Skinner, J. Ruhman, and A. Nahum, Measurement-induced phase transitions in the dynamics of entanglement, Phys. Rev. X 9, 031009 (2019).DOI
- [40]Y. Li, X. Chen, and M. P. A. Fisher, Measurement-driven entanglement transition in hybrid quantum circuits, Phys. Rev. B 100, 134306 (2019).DOI
- [41]A. Paetznick and K. M. Svore, Repeat-until-success: non-deterministic decomposition of single-qubit unitaries, Quantum Info. Comput. 14, 1277–1301 (2014).arxiv.org/abs/1311.1074
- [42]A. Bocharov, M. Roetteler, and K. M. Svore, Efficient synthesis of universal repeat-until-success quantum circuits, Phys. Rev. Lett. 114, 080502 (2015).pubmed.ncbi.nlm.nih.gov/25768742
- [43]S. Bravyi and A. Kitaev, Universal quantum computation with ideal Clifford gates and noisy ancillas, Phys. Rev. A 71, 022316 (2005).DOI
- [44]C. Gidney, N. Shutty, and C. Jones, Magic state cultivation: growing T states as cheap as CNOT gates (2024), arXiv:2409.17595 [quant-ph].arxiv.org/abs/2409.17595
- [45]S. Bravyi and A. Vargo, Simulation of rare events in quantum error correction, Phys. Rev. A 88, 062308 (2013).DOI
- [46]S. Heußen, D. Winter, M. Rispler, and M. Müller, Dynamical subset sampling of quantum error-correcting protocols, Phys. Rev. Res. 6, 013177 (2024).DOI
- [47]T. Vovk and H. Pichler, Entanglement-optimal trajectories of many-body quantum Markov processes, Phys. Rev. Lett. 128, 243601 (2022).DOI
- [48]Z. Chen, Y. Bao, and S. Choi, Optimized trajectory unraveling for classical simulation of noisy quantum dynamics, Phys. Rev. Lett. 133, 240304 (2024).DOI
- [49]R. Daraban, F. Salas-Ramírez, and J. Schachenmayer, Non-unity maximizing unraveling of open quantum dynamics, SciPost Physics 18, 048 (2025).DOI
- [50]S. Cichy, P. K. Faehrmann, L. Bittel, J. Eisert, and H. Pashayan, Classical simulation of noisy quantum circuits via locally entanglement-optimal unravelings, Phys. Rev. A 114, 022430 (2026).DOI
- [51]S. Krinner, N. Lacroix, A. Remm, A. Di Paolo, E. Genois, C. Leroux, C. Helling, S. Lazar, F. Swiadek, J. Herrmann, G. J. Norris, C. K. Andersen, M. Müller, A. Blais, C. Eichler, and A. Wallraff, Realizing repeated quantum error correction in a distance-three surface code, Nature 605, 609 (2022).DOI
- [52]Google Quantum AI and Collaborators, Quantum error correction below the surface code threshold, Nature 638, 920 (2025).DOI







