paulimer - Paulis, Cliffords and stabilizer simulation
High-performance Pauli operators, Clifford unitaries, and stabilizer simulation for quantum computing.
Installation
pip install paulimer
Quick Start
import paulimer
# Pauli operators
p = paulimer.DensePauli("XYZ")
q = paulimer.SparsePauli("X0 Z100")
print(q * q) # Identity
# Clifford gates
h = paulimer.CliffordUnitary.from_name("Hadamard", [0], qubit_count=1)
print(h.image_of(paulimer.DensePauli("X"))) # Z
# Decompose a Clifford into pi/4 Pauli exponents (Clifford transvections)
cnot = paulimer.CliffordUnitary.from_name("ControlledX", [0, 1], qubit_count=2)
factors, correction = cnot.to_transvections_minimal()
rebuilt = paulimer.CliffordUnitary.identity(2)
for pauli in factors:
rebuilt.left_mul_pauli_exp(pauli)
rebuilt.left_mul_pauli(correction)
assert rebuilt == cnot
# Stabilizer simulation
sim = paulimer.OutcomeCompleteSimulation(2)
sim.apply_unitary(paulimer.UnitaryOpcode.Hadamard, [0])
sim.apply_unitary(paulimer.UnitaryOpcode.ControlledX, [0, 1])
sim.measure(paulimer.SparsePauli("Z0"))
The minimal API returns the fewest rotations for the unsigned action and a final Pauli for all tableau signs.
The minimum excludes that Pauli. The greedy to_transvections() API still returns only an unsigned list.
Neither API reconstructs global phase because the input tableau does not record it.
Verifying parameterised circuits with symbolic angles
PhasedOutcomeCompleteSimulation tracks the exact global phase, so two circuits that share the same
free rotation angles can be checked for exact equality — even for exponents of higher-weight Paulis:
from paulimer import PhasedOutcomeCompleteSimulation, SparsePauli, UnitaryOpcode
def prepared_action(build):
sim = PhasedOutcomeCompleteSimulation(2)
for qubit in range(2):
sim.apply_unitary(UnitaryOpcode.Hadamard, [qubit]) # |++>
build(sim)
return sim.phased_action([], [0, 1]) # state-preparation action
def direct(sim): # e^{i alpha Z0 Z1} |++>
alpha = sim.allocate_symbolic_angle()
sim.apply_symbolic_pauli_exp(SparsePauli("Z_0 Z_1"), alpha)
def conjugated(sim): # CNOT . e^{i alpha Z1} . CNOT |++>
sim.apply_unitary(UnitaryOpcode.ControlledX, [0, 1])
alpha = sim.allocate_symbolic_angle()
sim.apply_symbolic_pauli_exp(SparsePauli("Z_1"), alpha)
sim.apply_unitary(UnitaryOpcode.ControlledX, [0, 1])
assert prepared_action(direct).is_equivalent(prepared_action(conjugated))
is_equivalent compares two circuits up to a common global phase. To also compare the global phase,
and so tell operators such as Co and -Co apart, use
PhasedCircuitAction.is_equivalent_with_global_phase(other). You can also read the zeta8 exponent
from the global_phase property. That exponent is a reference point, not an absolute property of the
operator. It is fixed by the canonical marginal-encoder convention and by the state a discarded
auxiliary qubit is left in, so the identity circuit gives 2 and not 0. Differences between two
values are meaningful when both actions are built the same way. The property uses the §4.3
auxiliary-qubit separation of arXiv:2603.24717 to recover the encoder's phase.
Decomposing a Clifford into pi/4 Pauli exponents
CliffordUnitary.to_pauli_exponents() returns an ordered product of pi/4 Pauli exponents that
reproduces the Clifford exactly, including the Pauli-image signs — so replaying it with exact phase
tracking yields a well-defined global phase:
from paulimer import CliffordUnitary, UnitaryOpcode
clifford = CliffordUnitary.identity(2)
clifford.left_mul(UnitaryOpcode.Hadamard, [0])
clifford.left_mul(UnitaryOpcode.ControlledX, [0, 1])
exponents = clifford.to_pauli_exponents() # list[SparsePauli], each factor exp(+-i pi/4 P)
rebuilt = CliffordUnitary.identity(2)
for pauli in exponents:
rebuilt.left_mul_pauli_exp(pauli)
assert rebuilt == clifford
Features
- DensePauli / SparsePauli - Pauli operators with phase tracking and multiplication
- CliffordUnitary - Clifford gates with conjugation, composition, and decomposition into
π/4Pauli exponents (to_pauli_exponents,to_transvections,to_transvections_minimal) - PauliGroup - Group operations including membership testing and factorization
- Stabilizer Simulation - Noiseless (OutcomeComplete, OutcomeFree, OutcomeSpecific) and noisy (Faulty) modes
- PhasedOutcomeCompleteSimulation - Outcome-complete simulation that additionally tracks the exact global phase, enabling exact equality checking of parameterised (symbolic-angle) circuits
Use Cases
Designed for quantum error correction research, including stabilizer circuit analysis and Clifford circuit verification. PhasedOutcomeCompleteSimulation extends this to exact verification of non-stabilizer circuits built from symbolic Pauli rotations e^{i alpha P}.
Performance
Built on binar for SIMD-accelerated binary linear algebra.
API Reference
See paulimer.pyi for complete type hints and documentation.
License
MIT License - See LICENSE file for details.
Contributing
Contributions welcome! See github.com/microsoft/qdk-ec for guidelines.
Metadata
Release files for paulimer 0.2.10
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
Total release size: 17.5 MB
Release files / paulimer-0.2.10-cp315-abi3.abi3t-win_arm64.whl
| Download URL | paulimer-0.2.10-cp315-abi3.abi3t-win_arm64.whl |
|---|---|
| Size | 785.4 kB |
| Tags | CPython 3.15 Windows ARM64 abi3 abi3t |
|
SHA-256 checksum How to use checksums |
4f9bb94ad7d5b7c70a506007426192558927162571fc2cec05aa2d32fc9922e6
|
|
BLAKE2b-256 checksum How to use checksums |
d55b7bc38b878b02b18c2597727e1d51d3014a2f3298ebbfdb75668daf788515
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
RestSharp/106.13.0.0
|
Release files / paulimer-0.2.10-cp315-abi3.abi3t-win_amd64.whl
| Download URL | paulimer-0.2.10-cp315-abi3.abi3t-win_amd64.whl |
|---|---|
| Size | 847.1 kB |
| Tags | CPython 3.15 Windows x86-64 abi3 abi3t |
|
SHA-256 checksum How to use checksums |
6c237bc9cf6901d8f776efd74f617197e3abd470f5cb16fce85bfa5b9ed33920
|
|
BLAKE2b-256 checksum How to use checksums |
cbe030218446fba745f65bff1feec774a375374ac3140b889ceab047a73e91b5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
RestSharp/106.13.0.0
|
Release files / paulimer-0.2.10-cp315-abi3.abi3t-manylinux_2_28_x86_64.whl
| Download URL | paulimer-0.2.10-cp315-abi3.abi3t-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 856.2 kB |
| Tags | CPython 3.15 Linux glibc 2.28+ x86-64 abi3 abi3t |
|
SHA-256 checksum How to use checksums |
81c88c8781a4f22bf1735425fba1a9e753e737811613ddb5bb8bdd7c2866644c
|
|
BLAKE2b-256 checksum How to use checksums |
54447b33944faed4984ad1ae0ba61fb30938e3bbac15fe2cdf316864c619b802
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
RestSharp/106.13.0.0
|
Release files / paulimer-0.2.10-cp315-abi3.abi3t-manylinux_2_28_aarch64.whl
| Download URL | paulimer-0.2.10-cp315-abi3.abi3t-manylinux_2_28_aarch64.whl |
|---|---|
| Size | 764.8 kB |
| Tags | CPython 3.15 Linux glibc 2.28+ ARM64 abi3 abi3t |
|
SHA-256 checksum How to use checksums |
de3cdf52a1925d89ae77825b96b36c60f0abc43deffaef22b52548455f1bb10a
|
|
BLAKE2b-256 checksum How to use checksums |
2676d1911d1d7821dc1d30fe757b2ab64669a26d7a20eed5508f6bdf408a2206
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
RestSharp/106.13.0.0
|
Release files / paulimer-0.2.10-cp315-abi3.abi3t-macosx_11_0_arm64.whl
| Download URL | paulimer-0.2.10-cp315-abi3.abi3t-macosx_11_0_arm64.whl |
|---|---|
| Size | 718.9 kB |
| Tags | CPython 3.15 abi3 abi3t macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
177f038e1827237dd3f6ee38121991399e0b26cbe71cba7c86727c911cfd9812
|
|
BLAKE2b-256 checksum How to use checksums |
605bbaa63835a5da7f27ac49ae16c56ab8ee63cefd30dbf4bfa75c681e835021
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
RestSharp/106.13.0.0
|
Release files / paulimer-0.2.10-cp315-abi3.abi3t-macosx_10_12_x86_64.whl
| Download URL | paulimer-0.2.10-cp315-abi3.abi3t-macosx_10_12_x86_64.whl |
|---|---|
| Size | 781.1 kB |
| Tags | CPython 3.15 abi3 abi3t macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
b005726eb140dd74d98bfcea94b98d602b3c3e0293ff4ed2b03aef7b3d34c2e5
|
|
BLAKE2b-256 checksum How to use checksums |
36763ee807efdfaa915d31907a63bda22cfdc08138e024f17f84af07bde982f7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
RestSharp/106.13.0.0
|
Release files / paulimer-0.2.10-cp314-cp314t-win_arm64.whl
| Download URL | paulimer-0.2.10-cp314-cp314t-win_arm64.whl |
|---|---|
| Size | 755.0 kB |
| Tags | CPython 3.14 CPython 3.14 free-threading Windows ARM64 |
|
SHA-256 checksum How to use checksums |
de4bbfe08758384618e20aebd22919d82fd5fc18d185e04abab483450c05350b
|
|
BLAKE2b-256 checksum How to use checksums |
9a602f3bda701f18ffbca4fdb7d5814ca58e39372b0a473e31a194e598777227
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
RestSharp/106.13.0.0
|
Release files / paulimer-0.2.10-cp314-cp314t-win_amd64.whl
| Download URL | paulimer-0.2.10-cp314-cp314t-win_amd64.whl |
|---|---|
| Size | 769.3 kB |
| Tags | CPython 3.14 CPython 3.14 free-threading Windows x86-64 |
|
SHA-256 checksum How to use checksums |
6e2b36916e7f1a3845eb3167706f78e9301f76a5239178b9d85f4df9a28c9c5b
|
|
BLAKE2b-256 checksum How to use checksums |
363a89565d2c07a7599d02733d74706a1884ab5240e36174a54586548ac5e472
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
RestSharp/106.13.0.0
|
Release files / paulimer-0.2.10-cp314-cp314t-manylinux_2_28_x86_64.whl
| Download URL | paulimer-0.2.10-cp314-cp314t-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 805.1 kB |
| Tags | CPython 3.14 CPython 3.14 free-threading Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
b72746f426d98d946c7b2f59036f551e82044545c968d5812b20413d2f4dd991
|
|
BLAKE2b-256 checksum How to use checksums |
118bcc48b2c191d5274bd8801c9e155bf28955f2a65cfb7bf45a4a76f9042598
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
RestSharp/106.13.0.0
|
Release files / paulimer-0.2.10-cp314-cp314t-manylinux_2_28_aarch64.whl
| Download URL | paulimer-0.2.10-cp314-cp314t-manylinux_2_28_aarch64.whl |
|---|---|
| Size | 729.9 kB |
| Tags | CPython 3.14 CPython 3.14 free-threading Linux glibc 2.28+ ARM64 |
|
SHA-256 checksum How to use checksums |
dc9aa78561a9a46241a1ea7f5da74dbdc1e3d22edec2d244d611ebf95c698752
|
|
BLAKE2b-256 checksum How to use checksums |
1dc02590376f4e50ef6dbe78e556f539d05d06a455e8c3ce2cae7cb057c75334
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
RestSharp/106.13.0.0
|
Release files / paulimer-0.2.10-cp314-cp314t-macosx_11_0_arm64.whl
| Download URL | paulimer-0.2.10-cp314-cp314t-macosx_11_0_arm64.whl |
|---|---|
| Size | 681.0 kB |
| Tags | CPython 3.14 CPython 3.14 free-threading macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
8f1ba31f1b84fdf231687463c3a2fe1ed14d4b1b95c01c90a263d86505d3d9dc
|
|
BLAKE2b-256 checksum How to use checksums |
75d32e572a444e8a716ab633455a64e40e1e429e97303a0caf0bdc42110f203b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
RestSharp/106.13.0.0
|
Release files / paulimer-0.2.10-cp314-cp314t-macosx_10_12_x86_64.whl
| Download URL | paulimer-0.2.10-cp314-cp314t-macosx_10_12_x86_64.whl |
|---|---|
| Size | 736.0 kB |
| Tags | CPython 3.14 CPython 3.14 free-threading macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
96d1ea546a915c301a1a76739060c412898d07bf34d8adaa0fb5bd3dd9f4ba2d
|
|
BLAKE2b-256 checksum How to use checksums |
9bf5292ab6f8fb8de69c1b160a510037ac4074f791e48ffd6006ee0665de16c1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
RestSharp/106.13.0.0
|
Release files / paulimer-0.2.10-cp314-cp314-pyemscripten_2026_0_wasm32.whl
| Download URL | paulimer-0.2.10-cp314-cp314-pyemscripten_2026_0_wasm32.whl |
|---|---|
| Size | 3.7 MB |
| Tags | CPython 3.14 PyEmscripten 2026.0+ WebAssembly |
|
SHA-256 checksum How to use checksums |
b543494398dc3365296960dcaa8d7639c24881d36bd48dba226880e7f1798af7
|
|
BLAKE2b-256 checksum How to use checksums |
52d0f25f906760b1f503ffd3d49539c088e9401ff669b61df0e78e2b8787a64d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
RestSharp/106.13.0.0
|
Release files / paulimer-0.2.10-cp39-abi3-win_arm64.whl
| Download URL | paulimer-0.2.10-cp39-abi3-win_arm64.whl |
|---|---|
| Size | 764.1 kB |
| Tags | CPython 3.9 Windows ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
4b05047f9f8f8ed355f438661234fb331b5fbd01fced0b2d91fe5acc7dbc161d
|
|
BLAKE2b-256 checksum How to use checksums |
5307dc84130f61434f97032b08aa70b89479fbb041d2a008bc95844cce12ca38
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
RestSharp/106.13.0.0
|
Release files / paulimer-0.2.10-cp39-abi3-win_amd64.whl
| Download URL | paulimer-0.2.10-cp39-abi3-win_amd64.whl |
|---|---|
| Size | 775.8 kB |
| Tags | CPython 3.9 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
6d8da204407257605341cde52566ad8bcb4291d7097ae7f863a9e37038f91b8e
|
|
BLAKE2b-256 checksum How to use checksums |
a425e2324b533f4cee84a32e039e44d7dcde96b075349ab7e74381fbeeaf89f4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
RestSharp/106.13.0.0
|
Release files / paulimer-0.2.10-cp39-abi3-manylinux_2_28_x86_64.whl
| Download URL | paulimer-0.2.10-cp39-abi3-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 807.5 kB |
| Tags | CPython 3.9 Linux glibc 2.28+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
4bdb0e57e217a589ff25cbc50f071b540880850ce4834e4324e95b9da257b5e1
|
|
BLAKE2b-256 checksum How to use checksums |
f0ed5e1f83969614035756a32de99186919113f5e86c4d47624a94bd013abd51
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
RestSharp/106.13.0.0
|
Release files / paulimer-0.2.10-cp39-abi3-manylinux_2_28_aarch64.whl
| Download URL | paulimer-0.2.10-cp39-abi3-manylinux_2_28_aarch64.whl |
|---|---|
| Size | 737.2 kB |
| Tags | CPython 3.9 Linux glibc 2.28+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
e7ff01d5907aceb68b2b18172a408bbd038c81d824fa75a5a5c1a267ec742563
|
|
BLAKE2b-256 checksum How to use checksums |
648b4eada280b6d9277f0ac2f2c2e18349aa5fdedece44a157bee0f1c5ff1a68
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
RestSharp/106.13.0.0
|
Release files / paulimer-0.2.10-cp39-abi3-macosx_11_0_arm64.whl
| Download URL | paulimer-0.2.10-cp39-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 694.4 kB |
| Tags | CPython 3.9 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
8c661243a21f2f2e8b61581dddc2584f12364604c18aa8e610010f87a7a1032a
|
|
BLAKE2b-256 checksum How to use checksums |
ec33fd54075ca469a80d31f4989ef1825973f8ff7ae8f8f2a1094d80de36fc4b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
RestSharp/106.13.0.0
|
Release files / paulimer-0.2.10-cp39-abi3-macosx_10_12_x86_64.whl
| Download URL | paulimer-0.2.10-cp39-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 749.3 kB |
| Tags | CPython 3.9 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
1b710af9ec82f8e699cc0ca88d35a3b476e24199d4c2ed116cfcf9753d40cadb
|
|
BLAKE2b-256 checksum How to use checksums |
701934d50d1712e8bcb988bcffc0a21a331790392d1fe02962838f2a7285e9f4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
RestSharp/106.13.0.0
|
Security for paulimer 0.2.10
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.