Predicting the output of quantum circuits is a central bottleneck for verifying quantum processors because a generic wavefunction grows exponentially with system size. We introduce a neural statebank that learns this wavefunction along the circuit trajectory. Each layer is stored as an autoregressive Transformer checkpoint trained from local gate updates to the preceding checkpoint, producing a compact neural representation that can evaluate amplitudes and generate independent samples. On long-range circuits combining entanglement, magic, and non-diagonal branching, a 0.3-million-parameter statebank reaches $\sim 10^{-2}$ infidelity at 34 qubits, outperforming the other tested approximate simulators while using far less memory than exact state-vector evolution. The same architecture accurately simulates quantum approximate optimization, Clifford+$T$, and Clifford circuits.
Predicting the output of quantum circuits is a central bottleneck for verifying quantum processors because a generic wavefunction grows exponentially with system size. We introduce a neural statebank that learns this wavefunction along the circuit trajectory. Each layer is stored as an autoregressive Transformer checkpoint trained from local gate updates to the preceding checkpoint, producing a compact neural representation that can evaluate amplitudes and generate independent samples. On long-range circuits combining entanglement, magic, and non-diagonal branching, a 0.3-million-parameter statebank reaches ∼10−2 infidelity at 34 qubits, outperforming the other tested approximate simulators while using far less memory than exact state-vector evolution. The same architecture accurately simulates quantum approximate optimization, Clifford+T, and Clifford circuits.
Recently, deep neural networks have been proven capable of predicting output expectation values of certain random quantum circuits via a supervised learning approach. Here we investigate the potential of this possible approach to the emulation of quantum circuits, testing both its limitations and the successful applications where it might outperform conventional direct simulation methods. The testbeds we consider are circuits often employed in variational quantum algorithms, featuring layers of cnot gates alternated with single-qubit random rotations. On the one hand, we find that the computational cost of supervised learning scales exponentially with the interlayer variance of the random angles. This allows for entering a promising regime for quantum advantage, where quantum computers could easily outperform classical neural networks. On the other hand, circuits featuring only interqubit angle variations are easily emulated. In fact, thanks to a suitable scalable design, the trained networks accurately predict the expectation values of larger and deeper circuits than those used for training, even reaching circuit sizes, which, as we numerically show, are computationally intractable for the most common simulation libraries of state-vector and tensor-network algorithms. A repository of test data in the intractable regime is provided. We also analyze the most common metrics for the entanglement content, the expressibility, and the classical computational cost of quantum circuits, finding that they do not distinguish the easy from the hard circuit configurations.
Classically simulating large quantum circuits is well-known to be difficult due to its exponential scaling O(2n) in computations and memory with respect to the number of qubits (n). We propose a novel classical simulation framework for quantum circuits, combining pairwise-qubit subsystems (PQS) with deep learning, thus called PQS simulation, to achieve scalable and highly efficient circuit evaluation. By representing quantum states as sequences of reduced density matrices and modeling two-qubit interactions through learnable unitary operators, this representation yields quadratic space and linear time per elementary gate, i.e., O(n2) memory and O(n) time per-gate update. A custom multi-hidden long short-term memory architecture is trained to learn and predict the evolution of pairwise entangled qubit subsystems. We demonstrate the applicability of the method to Shor period-finding circuits in the special case where the period is a power-of-two, for which the ideal circuit yields a unique outcome and the period can be inferred from single-qubit measurement probabilities. Despite being trained on smaller circuits, the model generalizes to higher qubit counts than those required during training, achieving success probabilities up to 35.48% on the 18-qubit circuit, while simultaneously offering significant run-time advantages over exact simulation (up to 66 times faster on the 24-qubit circuit). Because Shor’s classical post-processing is cheap, we can wrap PQS simulation in an error-tolerant loop for these circuit instances, which results in an expected runtime of O(n4/(1 − ε)), where 1 − ε is the probability that PQS simulation returns the correct period. For comparisons, we provide FLOP/s-normalized projections: our measured 36-qubit Quantum Fourier Transform runtime projects to 0.158 s on a single Argonne Theta node (versus a reported 78.98 h), and 40-qubit Shor projects to 19.3 s on a 2,048-A100 cluster (versus ∼ 200 s). We also analyze failure modes via the distribution of single-qubit measurement probabilities and find errors concentrated in the lowest index qubit, suggesting that targeted mitigation on only a few qubits may suffice. The PQS simulation exhibits a promising direction for approximate, flexible, and scalable simulation of quantum algorithms on classical hardware.
While real quantum devices have been increasingly used to conduct research focused on achieving quantum advantage or quantum utility in recent years, executing deep quantum circuits or performing quantum machine learning with large-scale data on current noisy intermediate-scale quantum devices remains challenging, making classical simulation essential for quantum machine learning research. However, such classical simulation often suffers from the cost of gradient calculations, requiring enormous memory or computational time. To address these problems, we propose a method to fuse multiple consecutive gates in each of the forward and backward paths to improve throughput by minimizing global memory accesses. As a result, we achieved approximately 20 times throughput improvement for a Hardware-Efficient Ansatz with 12 or more qubits, reaching over 30 times improvement on a mid-range consumer GPU with limited memory bandwidth. By combining our proposed method with gradient checkpointing, we drastically reduced memory usage, making it possible to train a large-scale quantum machine learning model, a 20-qubit, 1,000-layer model with 60,000 parameters, using 1,000 samples in approximately 20 minutes per epoch. This implies that we can train the model on large datasets, comprising tens of thousands of samples, like MNIST or CIFAR-10, within a realistic time frame (e.g., 20 hours per epoch). Thus, our proposed method significantly accelerates such classical simulations, making a significant contribution to advancing research in quantum machine learning and variational quantum algorithms, such as verifying algorithms on large datasets or investigating learning theories of deep quantum circuits like barren plateaus.
Simulating quantum algorithms with classical resources generally requires exponential resources. However, heuristic classical approaches are often very efficient in approximately simulating special circuit structures, for example with limited entanglement, or based on one-dimensional geometries. Here we introduce a classical approach to the simulation of general quantum circuits based on neural-network quantum states (NQS) representations. Considering a set of universal quantum gates, we derive rules for exactly applying single-qubit and two-qubit Z rotations to NQS, whereas we provide a learning scheme to approximate the action of Hadamard gates. Results are shown for the Hadamard and Fourier transform of entangled initial states for systems sizes and total circuit depths exceeding what can be currently simulated with state-of-the-art brute-force techniques. The overall accuracy obtained by the neural-network states based on Restricted Boltzmann machines is satisfactory, and offers a classical route to simulating highly-entangled circuits. In the test cases considered, we find that our classical simulations are comparable to quantum simulations affected by an incoherent noise level in the hardware of about 10−3 per gate.
We show that every intermediate state of a broad class of non-Clifford quantum error-correction circuits is a third-order phase-polynomial state, even under stochastic Pauli noise. The class includes magic state distillation and cultivation, code switching and gauge fixing, transversal non-Clifford gates with syndrome extraction, and injection of diagonal magic states. Third-order phase-polynomial states strictly generalize stabilizer states, and we prove that they are exactly the stabilizer states of the diagonal-Clifford-and-Pauli (DCP) stabilizer formalism that we introduce. We characterize these states and show that their representations can be updated in polynomial time. This yields an exact polynomial-time simulation algorithm for these circuits and, more broadly, a framework for reasoning about their internal states and about magic states in general. We provide an open-source implementation, \texttt{merlin}, and benchmark it against existing non-Clifford simulators on distillation, cultivation, and code switching circuits. The benchmarks demonstrate improved runtime and memory scaling as the number of logical outputs grows in Bravyi-Haah distillation, and simulation of a code switching circuit beyond the reach of all other tested simulators.
Abstract Predicting the output of quantum circuits is a hard computational task that plays a pivotal role in the development of universal quantum computers. Here we investigate the supervised learning of output expectation values of random quantum circuits. Deep convolutional neural networks (CNNs) are trained to predict single-qubit and two-qubit expectation values using databases of classically simulated circuits. These circuits are built using either a universal gate set or a continuous set of rotations plus an entangling gate, and they are represented via properly designed encodings of these gates. The prediction accuracy for previously unseen circuits is analyzed, also making comparisons with small-scale quantum computers available from the free IBM Quantum program. The CNNs often outperform these quantum devices, depending on the circuit depth, on the network depth, and on the training set size. Notably, our CNNs are designed to be scalable. This allows us exploiting transfer learning and performing extrapolations to circuits larger than those included in the training set. These CNNs also demonstrate remarkable resilience against noise, namely, they remain accurate even when trained on (simulated) expectation values averaged over very few measurements.