Skip to main content

Clifft - fast exact simulator for near-Clifford quantum circuits

Project description

Clifft

Unitary Foundation Docs arXiv License Discord Chat

PyPI version Downloads CI codecov Contributor Covenant

Clifft is a fast exact simulator for near-Clifford quantum circuits.

Built and maintained by the Unitary Foundation.

Clifft accepts Stim-format circuits, extends them with non-Clifford gates, and compiles them into bytecode executed by a high-performance Schrödinger Virtual Machine. It is designed for circuits whose dominant structure is Clifford, but whose behavior depends on localized non-Clifford operations.

The main simulation cost scales with the active dimension k of the dense state vector, rather than directly with the total number of physical qubits n. Non-Clifford operations can increase k, while measurements can reduce it.

Why Clifft?

  • Stim-compatible format and API: parse Stim-format circuits with noise, detectors, observables, and repeat blocks, plus non-Clifford extensions.
  • Exact near-Clifford simulation: simulate localized non-Clifford effects without approximating the quantum state.
  • Optimizing compiler pipeline: compile once, then sample many shots with HIR and bytecode optimization passes.
  • Active-dimension scaling: for low-magic circuits, runtime and memory scale with the localized active state rather than the full Hilbert space.

For QEC workflows, Clifft also supports detector-based post-selection, survivor sampling, and stratified importance sampling for rare-event estimation.

Installation

pip install clifft
Platform / CPU family PyPI wheel
Linux x86_64 with AVX2 Supported
Linux aarch64 Supported
macOS arm64 Supported
Windows amd64 Supported

All other platforms and CPU families should build from source. See the installation docs.

Quick Start

import clifft

program = clifft.compile("""
    H 0
    CNOT 0 1
    T 2
    M 0 1 2
""")

result = clifft.sample(program, shots=1000, seed=42)
print(result.measurements[:5])

For more details and examples, check out the documentation or take Clifft for a spin in the web-based interactive playground.

Performance

Clifft is designed for near-Clifford circuits where non-Clifford activity remains localized. In this regime, the dominant cost scales with the peak active dimension k, not directly with the total number of physical qubits.

Regime Representative benchmark What the results show
Pure Clifford QEC Surface code d=7, r=7 ▶↗ Stim remains the right tool; Clifft is roughly 10× slower while preserving the same sampling-oriented workflow.
Low-magic FT circuits MSC d=3 cultivation ▶↗ Clifft reaches 10.4M shots/s, about 370× faster than Tsim on this benchmark.
Larger near-Clifford FT circuits MSC d=5 cultivation ▶↗ Clifft reaches ~135K shots/s on one CPU core, about 13× faster than SOFT at ~10.6K shots/s on one H800 GPU.
Dense universal circuits Quantum Volume In the worst-case dense limit, Clifft remains neck-and-neck with simulators like qiskit-aer and qsim.

Throughput numbers above were measured on cloud instances; the links to the in-browser WASM playground will report lower throughput.

For benchmark details, plots, hardware notes, and guidance on when Clifft is a good fit, see the performance section of the documentation.

The full methodology and scientific results are described in the Clifft paper and companion clifft-paper repo.

Citation

If you use Clifft in your work, please cite the arXiv preprint below.

@misc{chase2026clifftfastexactsimulation,
      title={Clifft: Fast Exact Simulation of Near-Clifford Quantum Circuits},
      author={Bradley A. Chase and Farrokh Labib},
      year={2026},
      eprint={2604.27058},
      archivePrefix={arXiv},
      primaryClass={quant-ph},
      url={https://arxiv.org/abs/2604.27058},
}

Development

See the building from source guide for build instructions.

AI Acknowledgement

We used generative AI tools during parts of the research, software-development, and writing workflow for this project. These tools assisted with code generation and review, implementation analysis, documentation editing, and checks of selected derivations or arguments. All substantive design, validation, and release decisions were made by the human contributors.

Funding

This work was supported by the U.S. Department of Energy, Office of Science, Office of Advanced Scientific Computing Research, Accelerated Research in Quantum Computing under Award Number DE-SC0025336.

This material is also based upon work supported by the U.S. Department of Energy, Office of Science, National Quantum Information Science Research Centers, Quantum Science Center.

License

Apache-2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

clifft-0.5.0.tar.gz (1.7 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

clifft-0.5.0-cp312-abi3-win_amd64.whl (378.8 kB view details)

Uploaded CPython 3.12+Windows x86-64

clifft-0.5.0-cp312-abi3-manylinux_2_28_x86_64.whl (720.3 kB view details)

Uploaded CPython 3.12+manylinux: glibc 2.28+ x86-64

clifft-0.5.0-cp312-abi3-manylinux_2_28_aarch64.whl (594.7 kB view details)

Uploaded CPython 3.12+manylinux: glibc 2.28+ ARM64

clifft-0.5.0-cp312-abi3-macosx_14_0_arm64.whl (597.1 kB view details)

Uploaded CPython 3.12+macOS 14.0+ ARM64

File details

Details for the file clifft-0.5.0.tar.gz.

File metadata

  • Download URL: clifft-0.5.0.tar.gz
  • Upload date:
  • Size: 1.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for clifft-0.5.0.tar.gz
Algorithm Hash digest
SHA256 a6045b3abd0a02ad62f1a089a33dd20bbf9bd7efe7932988719eeece3b21289a
MD5 76a416bd29ccfc09668e8db75d6debd9
BLAKE2b-256 d69b652e9b26ae6cd184bda5f6976e17de31ecc56342b0d7507698f2b298f290

See more details on using hashes here.

Provenance

The following attestation bundles were made for clifft-0.5.0.tar.gz:

Publisher: release.yml on unitaryfoundation/clifft

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file clifft-0.5.0-cp312-abi3-win_amd64.whl.

File metadata

  • Download URL: clifft-0.5.0-cp312-abi3-win_amd64.whl
  • Upload date:
  • Size: 378.8 kB
  • Tags: CPython 3.12+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for clifft-0.5.0-cp312-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 764d5ce40056aeb13891992f4cabbcde89c887ddd17dc97fc0f137a60216be93
MD5 f3d232504697dd2b2111d37c6e0f9f3f
BLAKE2b-256 18300adbfe0b947ffb1eb3ac55c5eebf62a42f2dfc45f7d838474accde22b7b2

See more details on using hashes here.

Provenance

The following attestation bundles were made for clifft-0.5.0-cp312-abi3-win_amd64.whl:

Publisher: release.yml on unitaryfoundation/clifft

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file clifft-0.5.0-cp312-abi3-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for clifft-0.5.0-cp312-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f9c97e21e3372454c104f83b4216a518425429a859c7ada740cfa493da53482b
MD5 063a80f614832666beb6b194a8d17d1e
BLAKE2b-256 6bddf9ccefda69317fa269da5e68fe3c53301199f68ed997d6a118fc8e612cc9

See more details on using hashes here.

Provenance

The following attestation bundles were made for clifft-0.5.0-cp312-abi3-manylinux_2_28_x86_64.whl:

Publisher: release.yml on unitaryfoundation/clifft

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file clifft-0.5.0-cp312-abi3-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for clifft-0.5.0-cp312-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 f84e32927a792aa5144d7bbda213f189dab5c06fc59942a82c8812ced999adf9
MD5 9d0f138b01837f8bb01551375954f9ef
BLAKE2b-256 7e29ea7b193e0d7169af44d1f7575af98731be04e5a96daaf093afcff818ee4a

See more details on using hashes here.

Provenance

The following attestation bundles were made for clifft-0.5.0-cp312-abi3-manylinux_2_28_aarch64.whl:

Publisher: release.yml on unitaryfoundation/clifft

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file clifft-0.5.0-cp312-abi3-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for clifft-0.5.0-cp312-abi3-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 9e4378f5043fd245a06889e94c93bda8efe9a109c1e25fa4f9dce2a201f32a62
MD5 b933804baa36adc9a0de8438259ffe86
BLAKE2b-256 8d1f2e7167b13d2161d3b8bcecd223b878d817183df9bfbea257dbd1af688f1b

See more details on using hashes here.

Provenance

The following attestation bundles were made for clifft-0.5.0-cp312-abi3-macosx_14_0_arm64.whl:

Publisher: release.yml on unitaryfoundation/clifft

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page