Qiskit Spacetime Bridge
Outcome-code and spacetime-code construction for Qiskit Clifford circuits, implementing Algorithm 1 and the back-cumulant construction (Section 5.1) from Delfosse & Paetznick, "Spacetime codes of Clifford circuits" (arXiv:2304.05943).
Install
pip install -e .
Depends on qiskit>=2.0,<3 and numpy. Confirmed installing and running
correctly from a built wheel in a clean virtualenv (not just from source).
Usage
from qiskit import QuantumCircuit
from spacetime_bridge import Circuit, analyze
qc = QuantumCircuit(2, 2)
qc.measure(0, 0)
qc.measure(1, 1)
qc.cx(0, 1)
qc.measure(1, 1) # redundant: forced to equal the XOR of the first two
circuit = Circuit.from_qiskit_circuit(qc)
checks, depth = circuit.finalize()
generators = [circuit.build_spacetime_generator(tag) for (_, tag) in checks]
analyze(generators)
Supported instructions: h, s, sdg, cx, measure (Z-basis, as
standard for Qiskit). Anything else raises NotImplementedError rather
than silently mishandling it.
What's implemented and validated
algorithm1.py— Algorithm 1 (outcome code), augmented stabilizer tableau with sign-only phase tracking (justified in-module). 7 tests including two specifically stressing sign correctness.spacetime.py— back-cumulant construction (Section 5.1) turning each outcome-code check into a spacetime stabilizer generator. One test case independently hand-verified against the paper's closed-form formula (Proposition 2), separately from the iterative code.Circuit.from_qiskit_circuit— real integration withqiskit.QuantumCircuit(not a standalone reimplementation with a Qiskit-flavored API). Validated against a real Qiskit circuit reproducing the hand-verified CNOT case.analysis.py— symplectic matrix conversion,[[N,K]]parameters (Theorem 2), pairwise-commutativity sanity check.- Full test suite re-verified against the actual built wheel installed in a clean virtualenv, not just against local source files.
What's explicitly NOT implemented (honest scope limits)
- No CZ or SWAP gate rules — same pattern as H/S/CNOT to add.
- No Algorithm 3 (LDPC sparsification) or logical operators (Proposition 10) — the harder phase-2 work; not started.
- No code distance or distance bound anywhere — distance requires
logical operators; a generator's weight is not a valid stand-in, and
analyze()explicitly does not report one. - One level per instruction, not true parallel scheduling — always correct, but produces larger/non-minimal spacetime codes than an optimally-scheduled circuit would. Improving this is a performance concern, not correctness.
analysis.pyis a generic, package-agnostic implementation — not wired into qiskit-cayley-codes' actual CDZ analysis code (that source wasn't available in the session this was built in).to_symplectic_matrix()'s output is the standard stabilizer-matrix format and should drop in directly once that wiring happens.
Running the tests
pip install -e ".[test]"
pytest tests/
All currently pass.
Metadata
Release files for qiskit-spacetime-bridge 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| qiskit_spacetime_bridge-0.1.0.tar.gz | 16.7 kB | Without provenance | Details for qiskit_spacetime_bridge-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| qiskit_spacetime_bridge-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for qiskit_spacetime_bridge-0.1.0-py3-none-any.whl |
Total release size: 32.3 kB
Release files / qiskit_spacetime_bridge-0.1.0.tar.gz
| Download URL | qiskit_spacetime_bridge-0.1.0.tar.gz |
|---|---|
| Size | 16.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b98b06d5957110bb2edacf16d4203b8babe6a8cb65f38a8bd9a3c892d6e08982
|
|
BLAKE2b-256 checksum How to use checksums |
b357e28aafee1577d0765c8a50d9a88936f1f854f61e9fb1979cd1a6cd5c0919
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.1
|
Release files / qiskit_spacetime_bridge-0.1.0-py3-none-any.whl
| Download URL | qiskit_spacetime_bridge-0.1.0-py3-none-any.whl |
|---|---|
| Size | 15.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
35a94efcd8c83b7e8ef6eea2de0f15f60784c8d8fa58c4228e685cc601559536
|
|
BLAKE2b-256 checksum How to use checksums |
847ddbd544ade04d28fa668ac13ef62965d6f7c09eb49ccced6f37580370b4ec
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.1
|
Security for qiskit-spacetime-bridge 0.1.0
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.