paulistrings-rs
Library for simulating quantum circuits in the Pauli basis, built to scale across threads, processes and nodes. Pauli strings are stored as symplectic bitvectors, and terms are assigned to workers by a hash function that is linear over the bitfield. As a result, the library can efficiently parallelize the work and compute the communication patterns for a given circuit. Additionally, for standard gate and noise sets, the amount of communication remains bounded and no global synchronization or reduction is required.
Inspired by PauliStrings.jl.
Highlights
- Operator-basis Pauli propagation at scale — evolve the observable, not the wavefunction, in either the Schroedinger or Heisenberg picture.
- GF(2)-bucketed, write-disjoint parallel engine — layers are partitioned by a GF(2)-linear hash, so output buckets are statically predictable and never collide across threads.
- Partitioned across NUMA domains and MPI ranks — Support for scaling to arbitrary amount of nodes.
- CUDA backend — one GPU runs a saturated dense two-qubit layer about 10× faster than a 16-thread host, scaling to several devices in one process or one GPU per MPI rank, included in the Linux and Windows wheels (
device=from Python). - Open extension traits for research — plug in a custom
Channel(gate or noise model) orTruncationPolicywithout touching the engine. - Rust core, Python front-end — Low-overhead efficient engine with a convenient interface.
Python quickstart
pip install paulistrings-rs # or: uv add paulistrings-rs
Wheels cover Linux, macOS and Windows, with the CUDA backend included on Linux and Windows; Installation covers GPUs, MPI and building from source.
import math
from paulistrings import Circuit, PauliSum
# Observable: average X magnetization on 4 qubits.
observable = PauliSum.from_strings(
{"XIII": 0.25, "IXII": 0.25, "IIXI": 0.25, "IIIX": 0.25}, num_qubits=4
)
circuit = Circuit(4)
circuit.rz(math.pi / 8, 0)
circuit.cnot(0, 1)
circuit.h(2)
evolved = observable.propagate(circuit, direction="heisenberg")
print(evolved.expectation("x+").real)
Showcase
A 2D transverse-field Ising quench, evolved by Heisenberg-propagating the average-X-magnetization observable through a Trotter circuit on a 6×6 lattice — a regime where exact diagonalization is already infeasible (2^36 amplitudes) but Pauli propagation with modest truncation finishes in seconds to minutes.
Walkthrough: Quenched time-evolution on the documentation site.
A larger Python examples & benchmarks suite lives under examples/: a 127-qubit heavy-hex kicked-Ising cross-check against PauliPropagation.jl and stim, operator-scrambling/OTOC diagnostics, noisy utility verification, operator-backpropagation depth reduction, and stabilizer-state preparation.
Start at examples/README.md.
Documentation
- Documentation site — showcases, benchmarks and cross-engine comparisons, rebuilt on every push to
main: lkdvos.github.io/paulistrings-rs. Source and local build instructions:docs/. - Rust developer reference: docs.rs/paulistrings, or the rustdoc rendered alongside the site at lkdvos.github.io/paulistrings-rs/api/.
Repository layout
crates/
paulistrings/ # core Rust library
benches/ # criterion microbenchmarks
examples/ # phase_breakdown measurement probe
tests/ # cross-module and differential test nets
paulistrings-py/ # PyO3 bindings (cdylib `_paulistrings`)
membench/ # memory-bandwidth roofline probe
python/
paulistrings/ # Python package; re-exports the extension module
examples/
common/ # circuit builders, oracles, timing harness, report plots
data/ # checked-in, provenance-tagged inputs (127q coupling map, published observables)
tests/ # showcase and example test suites
b1_operator_scrambling/, b2_noisy_verification/, b5_operator_backpropagation/,
b6_resource_probes/, b7_stabilizer_prep/ # one Part-B showcase per directory — see examples/README.md
xxz_chain/ # Benchmark D — Part A's fourth benchmark lives here, not under benchmarks/
benchmarks/
python/ # pytest-benchmark suites + cross-library comparisons (Part A benchmarks), tests/ alongside
julia/ # subprocess-driven PauliPropagation.jl baseline
results/ # raw benchmark output (gitignored)
docs/
book/ # mdBook source for the documentation site (showcases, benchmarks,
# comparisons); rendered to docs/book/site/ (gitignored)
figures/ # source figures the book's assets are synced from
sync-assets.sh # links the site's figures to the committed SVGs they came from
research/
FINDINGS.md # one entry per experiment: question, verdict, the number that matters
HARDWARE.md # measured host facts (bandwidth ceilings, roofline tables, node types)
Building from source and developing
Python is the user interface, documented on the documentation site.
The Rust crate's rustdoc is a developer guide to the engine rather than a user API.
CLAUDE.md lists the build, test and benchmark commands.
module load uv # Flatiron; elsewhere see https://docs.astral.sh/uv/
./scripts/setup.sh # one-time: uv sync into .venv, builds the extension
cargo test # workspace tests (Rust toolchain pinned in rust-toolchain.toml)
cargo bench -p paulistrings # criterion microbenchmarks (release-only)
uv run pytest python/paulistrings/tests # rebuilds the extension first after any Rust change
License
Dual-licensed under the MIT License or Apache License 2.0, at your option.
Metadata
Release files for paulistrings-rs 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| paulistrings_rs-0.1.2.tar.gz | 617.8 kB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| paulistrings_rs-0.1.2-cp39-abi3-win_amd64.whl | CPython 3.9 | abi3 | Windows x86-64 | Details |
| paulistrings_rs-0.1.2-cp39-abi3-manylinux_2_28_x86_64.whl | CPython 3.9 | abi3 | Linux glibc 2.28+ x86-64 | Details |
| paulistrings_rs-0.1.2-cp39-abi3-manylinux_2_28_aarch64.whl | CPython 3.9 | abi3 | Linux glibc 2.28+ ARM64 | Details |
| paulistrings_rs-0.1.2-cp39-abi3-macosx_11_0_arm64.whl | CPython 3.9 | abi3 | macOS 11.0+ ARM64 | Details |
| paulistrings_rs-0.1.2-cp39-abi3-macosx_10_12_x86_64.whl | CPython 3.9 | abi3 | macOS 10.12+ x86-64 | Details |
Total release size: 9.7 MB
Release files / paulistrings_rs-0.1.2.tar.gz
| Download URL | paulistrings_rs-0.1.2.tar.gz |
|---|---|
| Size | 617.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9401900b91aacd96151dd3e4c2737ef893c4d3a4ec4ce44202bd5a738363884b
|
|
BLAKE2b-256 checksum How to use checksums |
bc30c0f49b8e1cef5253446b04c9114ebfef7d092a522fa66ee1bd867b5ebc1c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 15, 2026.
Transparency logRelease files / paulistrings_rs-0.1.2-cp39-abi3-win_amd64.whl
| Download URL | paulistrings_rs-0.1.2-cp39-abi3-win_amd64.whl |
|---|---|
| Size | 2.1 MB |
| Tags | CPython 3.9 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
b78281533757b82989cadf772628bf7c626bfe97e58282dd23db6f6d6ff83163
|
|
BLAKE2b-256 checksum How to use checksums |
76a153a79f5bc1242dbf1d9895f54989a1b36c39a674ee5552af35a08f6feb11
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 15, 2026.
Transparency logRelease files / paulistrings_rs-0.1.2-cp39-abi3-manylinux_2_28_x86_64.whl
| Download URL | paulistrings_rs-0.1.2-cp39-abi3-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 2.1 MB |
| Tags | CPython 3.9 Linux glibc 2.28+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
3da53f5fab1053506cf7bbea83c853c58e9e6557ba54e01eb6bb90863dc95502
|
|
BLAKE2b-256 checksum How to use checksums |
a06aaf413919481216291c72b44d050b72e1eb78d07cb60a6a7494b1add90f92
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 15, 2026.
Transparency logRelease files / paulistrings_rs-0.1.2-cp39-abi3-manylinux_2_28_aarch64.whl
| Download URL | paulistrings_rs-0.1.2-cp39-abi3-manylinux_2_28_aarch64.whl |
|---|---|
| Size | 2.0 MB |
| Tags | CPython 3.9 Linux glibc 2.28+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
a2d0ff80f3e0c1ec45a44f4944546294a8528a2e096fa59d799bf3a246693cd4
|
|
BLAKE2b-256 checksum How to use checksums |
8ef5717930cc6fbee33d1ee5fd3a738df9fa6d8f6fa2a49a6a88c0e15c8659de
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 15, 2026.
Transparency logRelease files / paulistrings_rs-0.1.2-cp39-abi3-macosx_11_0_arm64.whl
| Download URL | paulistrings_rs-0.1.2-cp39-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 1.4 MB |
| Tags | CPython 3.9 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
4fcb07bd0119733a12dca19f29027c0772c8971a858ec2e095b9262e7c085d81
|
|
BLAKE2b-256 checksum How to use checksums |
d8c4ca198d935d0680807405ee736897fc630990555e1fcfd5822ef3470aa029
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 15, 2026.
Transparency logRelease files / paulistrings_rs-0.1.2-cp39-abi3-macosx_10_12_x86_64.whl
| Download URL | paulistrings_rs-0.1.2-cp39-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 1.5 MB |
| Tags | CPython 3.9 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
14391419764ccc546fdab3be119b987235405bffaf9d6134373ee55a3b7e0253
|
|
BLAKE2b-256 checksum How to use checksums |
f31019911ed3f7f26a237fc52d7df301397af3a6922b35166eb0b420dfb56b33
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 15, 2026.
Transparency log