Skip to main content

paulistrings-rs

CI docs license

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) or TruncationPolicy without 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.

Average X magnetization vs time for a 6x6 periodic Ising quench, two field strengths h (color) and five TopN term caps each (opacity)

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

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.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for paulistrings-rs 0.1.1
File
paulistrings_rs-0.1.1-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details
paulistrings_rs-0.1.1-cp39-abi3-manylinux_2_28_x86_64.whl CPython 3.9 abi3 Linux glibc 2.28+ x86-64 Details
paulistrings_rs-0.1.1-cp39-abi3-manylinux_2_28_aarch64.whl CPython 3.9 abi3 Linux glibc 2.28+ ARM64 Details
paulistrings_rs-0.1.1-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details
paulistrings_rs-0.1.1-cp39-abi3-macosx_10_12_x86_64.whl CPython 3.9 abi3 macOS 10.12+ x86-64 Details

Total release size: 9.0 MB

Release files / paulistrings_rs-0.1.1-cp39-abi3-win_amd64.whl

Download URL paulistrings_rs-0.1.1-cp39-abi3-win_amd64.whl
Size 2.1 MB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
c4ff51c778d6c3d07fd20c5a1e32c08a963db753eb01576894e598765279df24
BLAKE2b-256 checksum
How to use checksums
cca9c65eb861cca5c2b5fbf74d4984512989b7af92fa962a9938bb9c478e563c
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

Release files / paulistrings_rs-0.1.1-cp39-abi3-manylinux_2_28_x86_64.whl

Download URL paulistrings_rs-0.1.1-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
f0d12b763679970f56e2f9d586d28b98ddab5b8db5a3b9449fe098a2a46c0b73
BLAKE2b-256 checksum
How to use checksums
224f6ae7f6bbfd50c7805c7d573549d26e7a4e398fbc2eca709cf41be6cb7d81
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

Release files / paulistrings_rs-0.1.1-cp39-abi3-manylinux_2_28_aarch64.whl

Download URL paulistrings_rs-0.1.1-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
edd757de616b8d08468a5d77c0437247ace5ce01ed191f68b6c43c9cb023e146
BLAKE2b-256 checksum
How to use checksums
295807fe279bac3eb825d16cdaec1806bf6d1e355113cd416068d527b70773e1
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

Release files / paulistrings_rs-0.1.1-cp39-abi3-macosx_11_0_arm64.whl

Download URL paulistrings_rs-0.1.1-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
3e89e8e7b7f8057665101b8959d9f9f7834a6f6f8f26380e6eb1bbe4a72ebe18
BLAKE2b-256 checksum
How to use checksums
2f8daf18e19fd68ba944ad23c80c3b9cd9954a567cde7d21ef8f719ffbbc40eb
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

Release files / paulistrings_rs-0.1.1-cp39-abi3-macosx_10_12_x86_64.whl

Download URL paulistrings_rs-0.1.1-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
2a7e6dd68f4ce0e4c23cf1c0b3bf52cad1f6c00bdab75b74279b4daae3ffef40
BLAKE2b-256 checksum
How to use checksums
91fba816677955be16950e64c9b8d35ab1af3d94d1cc57574abca49f567cae1b
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

Release history Release notifications | RSS feed

0.1.2

6 release files

This release

0.1.1 This release

5 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page