models Package

Packages

factories
qec
qubits

Classes

GSJ24CCXFactory

Implements the 8|T⟩ → >>|<<CCX⟩ magic state factory described in Fig. 24 of Gidney, Shutty, and Jones (2024). This design converts eight T magic states into a single CCX (Toffoli) state using lattice surgery operations on 12 logical qubits (including helper qubits) with a circuit depth of 6.

The output CCX error rate has two contributions:

  • Distillation error: 28 · p_T², where p_T is the T state error rate (from pairs of T states failing simultaneously).

  • Logical error: accumulated over 6 lattice surgery rounds on 12 qubits.

The factory production time includes an overhead factor of (1 + 8·p_T) to account for the failure probability when consuming the T states.

Reference:

  • C. Gidney, C. Shutty, C. Jones, "Magic state cultivation: growing T states with 78% reduced overhead", arXiv:2409.17595 (2024). https://arxiv.org/abs/2409.17595

  • C. Gidney, A. G. Fowler, "Efficient magic state factories with a catalyzed >>|<<CCZ⟩ to 2|T⟩ transformation", Quantum 3, 135 (2019). arXiv:1812.01238. https://arxiv.org/abs/1812.01238

GSJ24Factory

Implements the magic state cultivation factory from Gidney, Shutty, and Jones (2024) for producing logical >>|<<T⟩ states from physical-level operations.

Magic state cultivation gradually grows the size and reliability of a magic state within a surface code patch, using roughly the same number of physical gates as a lattice surgery CNOT gate of equivalent reliability. The approach refines ideas from Knill (1996), Jones (2016), Chamberland (2020), Gidney (2023/2024), Bombin (2024), and Hirano (2024).

Compared to prior magic state distillation approaches, cultivation uses an order of magnitude fewer qubit-rounds to reach logical error rates as low as 2·10⁻⁹ under 10⁻³ uniform depolarizing circuit noise. Halving the circuit noise to 5·10⁻⁴ improves the achievable logical error rate to 4·10⁻¹¹.

The factory is parameterized by pre-computed simulation data (from Monte Carlo sampling at https://doi.org/10.5281/zenodo.13777072) that maps physical error rates to (logical_error, num_qubits, volume, steps) tuples for supported distance pairs.

Hyper parameters: distance: Tuple (d_color, d_surface) specifying the color code distance and surface code distance used in the cultivation protocol. Supported values are (3, 15) and (5, 15). Larger color code distance (5 vs 3) yields lower logical error rates at the cost of higher qubit count and more time steps.

Reference:

GateBased

A generic gate-based architecture. The error rate can be set arbitrarily and is either 1e-3 or 1e-4 in the reference.

References:

  • Michael E. Beverland, Prakash Murali, Matthias Troyer, Krysta M. Svore, Torsten Hoefler, Vadym Kliuchnikov, Guang Hao Low, Mathias Soeken, Aarthi Sundaram, Alexander Vaschillo: Assessing requirements to scale to practical quantum advantage, arXiv:2211.07629

  • Jens Koch, Terri M. Yu, Jay Gambetta, A. A. Houck, D. I. Schuster, J. Majer, Alexandre Blais, M. H. Devoret, S. M. Girvin, R. J. Schoelkopf: Charge insensitive qubit design derived from the Cooper pair box, arXiv:cond-mat/0703002

Litinski19Factory

T and CCZ factories based on the paper arXiv:1905.06903.

It contains two categories of estimates. If the input T error rate is similar to the Clifford error, it produces magic state instructions based on Table 1 in the paper. If the input T error rate is at most 10 times higher than the Clifford error rate, it produces magic state instructions based on Table 2 in the paper.

It requires Clifford error rates of at most 0.1% for CNOT, H, and MEAS_Z instructions. If these instructions have different error rates, the maximum error rate is assumed.

References:

  • Daniel Litinski: Magic state distillation: not as costly as you think, arXiv:1905.06903
MagicUpToClifford

An ISA transform that adds Clifford equivalent representations of magic states. For example, if the input ISA contains a T gate, the provided ISA will also contain SQRT_SQRT_X, SQRT_SQRT_X_DAG, SQRT_SQRT_Y, SQRT_SQRT_Y_DAG, and T_DAG. The same is applied for CCZ gates and their Clifford equivalents.

Example:

Majorana

This class models physical instructions that may be relevant for future Majorana qubits. For these qubits, we assume that measurements and the physical T gate each take 1 µs. Owing to topological protection in the hardware, we assume single and two-qubit measurement error rates (Clifford error rates) in $10^{-4}$, $10^{-5}$, and $10^{-6}$ as a range between realistic and optimistic targets. Non-Clifford operations in this architecture do not have topological protection, so we assume a 5%, 1.5%, and 1% error rate for non-Clifford physical T gates for the three cases, respectively.

References:

  • Torsten Karzig, Christina Knapp, Roman M. Lutchyn, Parsa Bonderson, Matthew B. Hastings, Chetan Nayak, Jason Alicea, Karsten Flensberg, Stephan Plugge, Yuval Oreg, Charles M. Marcus, Michael H. Freedman: Scalable Designs for Quasiparticle-Poisoning-Protected Topological Quantum Computation with Majorana Zero Modes, arXiv:1610.05289

  • Alexei Kitaev: Unpaired Majorana fermions in quantum wires, arXiv:cond-mat/0010440

  • Sankar Das Sarma, Michael Freedman, Chetan Nayak: Majorana Zero Modes and Topological Quantum Computation, arXiv:1501.02813

NeutralAtom

A movement-aware neutral-atom architecture with explicit atom transport.

This model captures a neutral-atom device with native single-qubit operations, Rydberg-mediated entangling gates, Z-basis measurement, and a physical move instruction that carries hardware motion constraints. The instruction set includes free virtual RZ rotations, single-qubit SQRT_X and H gates, CZ as the native two-qubit interaction, CNOT with a duration derived from one Rydberg interaction plus two single-qubit operations, and MEAS_Z/MEAS_RESET_Z for readout.

The motion model is exposed through PHYSICAL_MOVE and parameterized by atom spacing, maximum velocity, maximum acceleration, and an optional handoff time used when atoms enter or leave an interaction or measurement zone.

References:

  • M. Saffman, T. G. Walker, K. Molmer: Quantum information with Rydberg atoms, arXiv:0909.4777

    1. Bernien, S. Schwartz, A. Keesling, et al.: Probing many-body

      dynamics on a 51-atom quantum simulator, arXiv:1707.04344

    1. Bluvstein, H. Levine, G. Semeghini, et al.: A quantum processor

      based on coherent transport of entangled atom arrays, arXiv:2112.03923

    1. Tian, W. J. Wee, A. Qu, et al.: Parallel assembly of arbitrary

    defect-free atom arrays with a multi-tweezer algorithm, arXiv:2209.08038

      1. Evered, D. Bluvstein, M. Kalinowski, et al.: High-fidelity

    parallel entangling gates on a neutral atom quantum computer, arXiv:2304.05420

    1. Wintersperger, F. Dommert, T. Ehmer, et al.: Neutral atom quantum

    computing hardware: performance and end-user perspective, arXiv:2304.14360

    1. Wang, P. Liu, D. B. Tan, et al.: Atomique: A Quantum Compiler for

      Reconfigurable Neutral Atom Arrays, arXiv:2311.15123

    1. Bluvstein, S. J. Evered, A. A. Geim, et al.: Logical quantum

      processor based on reconfigurable atom arrays, arXiv:2312.03982

  • W.-H. Lin, D. B. Tan, J. Cong: Reuse-Aware Compilation for Zoned

    Quantum Architectures Based on Neutral Atoms, arXiv:2411.11784

    1. Savola, A. Paler: ATLAS: Efficient Atom Rearrangement for

    Defect-Free Neutral-Atom Quantum Arrays Under Transport Loss, arXiv:2511.16303

OneDimensionalYokedSurfaceCode

This class models the Yoked surface code to provide a generic memory instruction based on lattice surgery instructions from a surface code like error correction code.

Hyper parameters: shape_heuristic: ShapeHeuristic The heuristic to determine the shape of the surface code patch for a given number of logical qubits. (Default is ShapeHeuristic.MIN_AREA)

References:

  • Craig Gidney, Michael Newman, Peter Brooks, Cody Jones: Yoked surface codes, arXiv:2312.04522
RoundBasedFactory

A magic state factory that produces T gate instructions using round-based distillation pipelines.

This factory explores combinations of distillation units (such as "15-to-1 RM prep" and "15-to-1 space efficient") to find optimal configurations that minimize time and space while achieving target error rates. It supports both physical-level distillation (when the input T gate is physically encoded) and logical-level distillation (using lattice surgery via surface codes).

In order to account for the success probability of distillation rounds, the factory models the pipeline using a failure probability requirement (defaulting to 1%) that each round must meet. The number of distillation units per round is adjusted to meet this requirement, which in turn affects the overall space requirements.

Space requirements are calculated using a user-provided function that aggregates per-round space (e.g., sum or max). The sum function models the case in which qubits are not reused across rounds, while the max function models the case in which qubits are reused across rounds.

For the enumeration of logical-level distillation units, the factory relies on a user-provided ISAQuery (defaulting to SurfaceCode.q()) to explore different surface code configurations and their corresponding lattice surgery instructions. These need to be provided by the user and cannot automatically be derived from the provided implementation ISA, as they can only contain a subset of the required instructions. The user needs to ensure that the provided query matches the architecture for which this factory is being used.

Results are cached to disk for efficiency.

References:

  • Sergei Bravyi, Alexei Kitaev: Universal Quantum Computation with ideal Clifford gates and noisy ancillas, arXiv:quant-ph/0403025

  • Michael E. Beverland, Prakash Murali, Matthias Troyer, Krysta M. Svore, Torsten Hoefler, Vadym Kliuchnikov, Guang Hao Low, Mathias Soeken, Aarthi Sundaram, Alexander Vaschillo: Assessing requirements to scale to practical quantum advantage, arXiv:2211.07629

SurfaceCode

This class models the gate-based rotated surface code.

Hyper parameters: distance: int The code distance of the surface code.

References:

  • Dominic Horsman, Austin G. Fowler, Simon Devitt, Rodney Van Meter: Surface code quantum computing by lattice surgery, arXiv:1111.4022

  • Austin G. Fowler, Matteo Mariantoni, John M. Martinis, Andrew N. Cleland: Surface codes: Towards practical large-scale quantum computation, arXiv:1208.0928

  • David S. Wang, Austin G. Fowler, Lloyd C. L. Hollenberg: Quantum computing with nearest neighbor interactions and error rates over 1%, arXiv:1009.3686

SurfaceCodeLowMove

This class models a rotated surface code tailored to a reconfigurable, zoned neutral-atom architecture with mobile ancillas.

The syndrome-extraction schedule is based on a mobile-ancilla surface-code scheme in which a single ancilla visits the data qubits of each plaquette, combined with the atom-transport model used by NeutralAtom. In this model, the ancilla is moved within the Rydberg interaction range of each data atom to execute the entangling sequence, while other atoms and gate sites remain separated by about 10 microns to suppress crosstalk. The time model therefore combines the single-ancilla plaquette circuit with explicit motion overhead from horizontal and diagonal transport segments.

Hyper parameters: distance: int The code distance of the surface code.

-[ References ]-

      1. Wang, A. G. Fowler, L. C. L. Hollenberg: Quantum computing with

      nearest neighbor interactions and error rates over 1%, arXiv:1009.3686

    1. Horsman, A. G. Fowler, S. Devitt, R. Van Meter: Surface code quantum

      computing by lattice surgery, arXiv:1111.4022

      1. Fowler, M. Mariantoni, J. M. Martinis, A. N. Cleland: Surface

      codes: Towards practical large-scale quantum computation, arXiv:1208.0928

    1. Bluvstein, H. Levine, G. Semeghini, et al.: A quantum processor based

      on coherent transport of entangled atom arrays, arXiv:2112.03923

    1. Bluvstein, S. J. Evered, A. A. Geim, et al.: Logical quantum

      processor based on reconfigurable atom arrays, arXiv:2312.03982

    1. Jandura, L. Pecorari, G. Pupillo: Surface Code Stabilizer

    Measurements for Rydberg Atoms, arXiv:2405.16621

  • W.-H. Lin, D. B. Tan, J. Cong: Reuse-Aware Compilation for Zoned Quantum

    Architectures Based on Neutral Atoms, arXiv:2411.11784

    1. Bluvstein, A. A. Geim, S. H. Li, et al.: Architectural mechanisms of

      a universal fault-tolerant quantum computer, arXiv:2506.20661

ThreeAux

This class models the pairwise measurement-based surface code with three auxiliary qubits per stabilizer measurement.

Hyper parameters: distance: int The code distance of the surface code.

single_rail: bool Whether to use single-rail encoding.

References:

  • Linnea Grans-Samuelsson, Ryan V. Mishmash, David Aasen, Christina Knapp, Bela Bauer, Brad Lackey, Marcus P. da Silva, Parsa Bonderson: Improved Pairwise Measurement-Based Surface Code, arXiv:2310.12981
TwoDimensionalYokedSurfaceCode

This class models the Yoked surface code to provide a generic memory instruction based on lattice surgery instructions from a surface code like error correction code.

Hyper parameters: shape_heuristic: ShapeHeuristic The heuristic to determine the shape of the surface code patch for a given number of logical qubits. (Default is ShapeHeuristic.MIN_AREA)

References:

  • Craig Gidney, Michael Newman, Peter Brooks, Cody Jones: Yoked surface codes, arXiv:2312.04522