Clifft - fast exact simulator for near-Clifford quantum circuits
Project description
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
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file clifft-0.3.0.tar.gz.
File metadata
- Download URL: clifft-0.3.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c8e7334fc85171477d8e8eaa3dbbade265b45dc488006a7744fce8c94c381c28
|
|
| MD5 |
f8760112d97997ace4cab374b9b11796
|
|
| BLAKE2b-256 |
9db41fea3a324bea61f7033a2cbbf4bca5aba70e30fa833d28f5c4c54e3d6456
|
Provenance
The following attestation bundles were made for clifft-0.3.0.tar.gz:
Publisher:
release.yml on unitaryfoundation/clifft
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
clifft-0.3.0.tar.gz -
Subject digest:
c8e7334fc85171477d8e8eaa3dbbade265b45dc488006a7744fce8c94c381c28 - Sigstore transparency entry: 1474096775
- Sigstore integration time:
-
Permalink:
unitaryfoundation/clifft@7dc0a263b3d79fecef20e29de36fca0adc25b3c8 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/unitaryfoundation
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@7dc0a263b3d79fecef20e29de36fca0adc25b3c8 -
Trigger Event:
push
-
Statement type:
File details
Details for the file clifft-0.3.0-cp312-abi3-win_amd64.whl.
File metadata
- Download URL: clifft-0.3.0-cp312-abi3-win_amd64.whl
- Upload date:
- Size: 365.1 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
33b4e171cd096f2f69c3858b7b948f1a5ed356b49f0aa1e9897101d499cdfa9e
|
|
| MD5 |
89adf9c4c31a757278447b048e27190c
|
|
| BLAKE2b-256 |
60a7d6c56b1f379890cb92407e351d01ff64aaca4be3fb12f8935aa36c2c2e3b
|
Provenance
The following attestation bundles were made for clifft-0.3.0-cp312-abi3-win_amd64.whl:
Publisher:
release.yml on unitaryfoundation/clifft
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
clifft-0.3.0-cp312-abi3-win_amd64.whl -
Subject digest:
33b4e171cd096f2f69c3858b7b948f1a5ed356b49f0aa1e9897101d499cdfa9e - Sigstore transparency entry: 1474096810
- Sigstore integration time:
-
Permalink:
unitaryfoundation/clifft@7dc0a263b3d79fecef20e29de36fca0adc25b3c8 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/unitaryfoundation
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@7dc0a263b3d79fecef20e29de36fca0adc25b3c8 -
Trigger Event:
push
-
Statement type:
File details
Details for the file clifft-0.3.0-cp312-abi3-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: clifft-0.3.0-cp312-abi3-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 744.4 kB
- Tags: CPython 3.12+, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
047a64d9b06c52014ab20e3050737a1d899d20002495cb4de80b61f7651dbce7
|
|
| MD5 |
c6289d994b973812b9a51c8397330932
|
|
| BLAKE2b-256 |
d9c50dd1c5333d93cde4b0b1b85763caa68b8ff1e9757e8812d630dbbfb0bdf1
|
Provenance
The following attestation bundles were made for clifft-0.3.0-cp312-abi3-manylinux_2_28_x86_64.whl:
Publisher:
release.yml on unitaryfoundation/clifft
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
clifft-0.3.0-cp312-abi3-manylinux_2_28_x86_64.whl -
Subject digest:
047a64d9b06c52014ab20e3050737a1d899d20002495cb4de80b61f7651dbce7 - Sigstore transparency entry: 1474096873
- Sigstore integration time:
-
Permalink:
unitaryfoundation/clifft@7dc0a263b3d79fecef20e29de36fca0adc25b3c8 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/unitaryfoundation
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@7dc0a263b3d79fecef20e29de36fca0adc25b3c8 -
Trigger Event:
push
-
Statement type:
File details
Details for the file clifft-0.3.0-cp312-abi3-manylinux_2_28_aarch64.whl.
File metadata
- Download URL: clifft-0.3.0-cp312-abi3-manylinux_2_28_aarch64.whl
- Upload date:
- Size: 600.0 kB
- Tags: CPython 3.12+, manylinux: glibc 2.28+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
095620153f8f24ab67b59ca015f9a7ef8290458b679bd7fdf24198f8fa6e1214
|
|
| MD5 |
610b402f663192d32ab9201a95bf786e
|
|
| BLAKE2b-256 |
0e63e7aa6dc56f71f9451d9e301850957ba9fc863188a4187ade176257b848d5
|
Provenance
The following attestation bundles were made for clifft-0.3.0-cp312-abi3-manylinux_2_28_aarch64.whl:
Publisher:
release.yml on unitaryfoundation/clifft
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
clifft-0.3.0-cp312-abi3-manylinux_2_28_aarch64.whl -
Subject digest:
095620153f8f24ab67b59ca015f9a7ef8290458b679bd7fdf24198f8fa6e1214 - Sigstore transparency entry: 1474096903
- Sigstore integration time:
-
Permalink:
unitaryfoundation/clifft@7dc0a263b3d79fecef20e29de36fca0adc25b3c8 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/unitaryfoundation
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@7dc0a263b3d79fecef20e29de36fca0adc25b3c8 -
Trigger Event:
push
-
Statement type:
File details
Details for the file clifft-0.3.0-cp312-abi3-macosx_14_0_arm64.whl.
File metadata
- Download URL: clifft-0.3.0-cp312-abi3-macosx_14_0_arm64.whl
- Upload date:
- Size: 659.5 kB
- Tags: CPython 3.12+, macOS 14.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cda2579c99f4bc0ec45a4a92a3eb8893468254971cca3ac5ca1c65461b16add5
|
|
| MD5 |
a84003dbe013e51ff48cd38252586f52
|
|
| BLAKE2b-256 |
507ef425b003b713fa8d6835935c2007336474628c51db0321d25c258781ddc3
|
Provenance
The following attestation bundles were made for clifft-0.3.0-cp312-abi3-macosx_14_0_arm64.whl:
Publisher:
release.yml on unitaryfoundation/clifft
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
clifft-0.3.0-cp312-abi3-macosx_14_0_arm64.whl -
Subject digest:
cda2579c99f4bc0ec45a4a92a3eb8893468254971cca3ac5ca1c65461b16add5 - Sigstore transparency entry: 1474096841
- Sigstore integration time:
-
Permalink:
unitaryfoundation/clifft@7dc0a263b3d79fecef20e29de36fca0adc25b3c8 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/unitaryfoundation
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@7dc0a263b3d79fecef20e29de36fca0adc25b3c8 -
Trigger Event:
push
-
Statement type: