Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

PRISM

Python CI

PRISM is a Qiskit transpiler for dual-rail qubits, where each logical qubit is a pair of physical modes (rails). A logical gate then has several physical realizations on different rails; PRISM keeps all of them through lowering and picks one per gate while routing.

pip install --pre prism-qc

Quickstart

import numpy as np
from qiskit import QuantumCircuit
from qiskit.transpiler import CouplingMap
from prism_qc import ErasureCheck, dualrail_pm

qc = QuantumCircuit(3, 3)
qc.rx(np.pi / 2, [0, 1, 2])
qc.crz(np.pi / 2, 0, 1)
qc.append(ErasureCheck(), [1], [1])
qc.crz(np.pi / 2, 1, 2)
qc.rx(np.pi / 2, [1, 2])
qc.measure(range(3), range(3))

pm = dualrail_pm(CouplingMap.from_line(6), seed=7)
out = pm.run(qc)
print(pm.property_set["circuit_metrics"])
CircuitMetrics(swaps=0, depth=6, active_gates=13, size=18)

The input circuit

The compiled circuit

Rails q<i>_0 and q<i>_1 carry logical qubit i. EarlyMeasurement measures qubit 0 before its crz, which becomes an rz on qubit 1 conditioned on qubit 0's bit. A measurement into clbit c[i] writes rail 0, the logical bit, to c[i] and rail 1 to c_rail1[i], where c_rail1 is a new register named after c; both 0 means the photon was lost. dualrail_pm(..., budget=SearchBudget(objective="depth")) prefers depth over SWAPs.

Gate set

Logical Physical, on the qubit's rails
rz(θ) rz(θ) on rail 0, or rz(-θ) on rail 1 once the rails are relabelled
rx(θ) rswap(θ), the exponential SWAP of the two rails
x none: the rails are relabelled; inside if_else, a swap of the two rails
crz(θ) crz(±θ) from either rail of the control to either rail of the target, with an rz on the target for a rail-1 control: four candidates
swap none: the logical stage relabels the qubits
measure measure on both rails
reset, and the initial state Initialize("10") on the two rails; initialize and prepare_state are not supported
ErasureCheck PauliProductMeasurement(Pauli("ZZ")) on the two rails: 1 if the photon is there, without disturbing the logical state
if_else if_else on the qubit's rails; each block holds only one-qubit operations and no measure

The physical Target allows the two-rail operations only on device edges, so no stock pass can leave the code space. No gate moves across an ErasureCheck. Barriers are dropped. Other control flow (for_loop, while_loop, switch_case) and delay are not supported. A multi-controlled X with three or more controls borrows an idle qubit as its ancilla, or adds one, so the circuit may need two more physical qubits.

Pipeline

prism_qc.prism_stages(coupling_map) is a MultiStagePassManager. Its passes are in prism_qc.passes:

Stage IR Passes
logical DAGCircuit stock passes, MCPrepare, MinRXCliffords, SplitIfElse and ElideLogicalPermutations to the logical gate set, then EarlyMeasurement
dag_to_multi_realization DAGCircuit -> MultiRealization each operation becomes a MultiRealizationOp with its candidates
multi_realization MultiRealization ElideRailExchanges and PrismRouting (layout, routing and a choice per op)
multi_realization_to_dag MultiRealization -> DAGCircuit each choice becomes gates, with the layout
physical DAGCircuit FenceErasureChecks, stock cleanups, stock layout and routing of unrouted operations, CommutativeOptimization, RescheduleCommutingDiagonals, RecordCircuitMetrics

Any pass that sets every choice is a complete multi_realization stage. The physical stage then lays out and routes with stock Qiskit:

import random

from qiskit import QuantumCircuit
from qiskit.passmanager import GenericPass
from qiskit.transpiler import CouplingMap, PassManager
from prism_qc import prism_stages
from prism_qc.ir import MultiRealization, MultiRealizationOp


class RandomChoice(GenericPass[MultiRealization, MultiRealization]):
    def run(self, passmanager_ir: MultiRealization) -> MultiRealization:
        for ins in passmanager_ir.data:
            if isinstance(op := ins.operation, MultiRealizationOp):
                op.choice = random.randrange(len(op.candidates))
        return passmanager_ir


qc = QuantumCircuit(3)
qc.rx(0.5, [0, 1, 2])
qc.crz(0.5, 0, 2)

stages = prism_stages(CouplingMap.from_line(6))
stages.multi_realization = [RandomChoice()]
out = PassManager([stages.to_flow_controller()]).run(qc)

Metadata

Release files for prism-qc 0.1.0rc1

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

Source distribution (sdist)

Source distribution for prism-qc 0.1.0rc1
File Size Uploaded Provenance Actions
prism_qc-0.1.0rc1.tar.gz 113.3 kB With provenance Details for prism_qc-0.1.0rc1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for prism-qc 0.1.0rc1
File Actions
prism_qc-0.1.0rc1-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details for prism_qc-0.1.0rc1-cp310-abi3-win_amd64.whl
prism_qc-0.1.0rc1-cp310-abi3-manylinux_2_28_x86_64.whl CPython 3.10 abi3 Linux glibc 2.28+ x86-64 Details for prism_qc-0.1.0rc1-cp310-abi3-manylinux_2_28_x86_64.whl
prism_qc-0.1.0rc1-cp310-abi3-manylinux_2_28_aarch64.whl CPython 3.10 abi3 Linux glibc 2.28+ ARM64 Details for prism_qc-0.1.0rc1-cp310-abi3-manylinux_2_28_aarch64.whl
prism_qc-0.1.0rc1-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details for prism_qc-0.1.0rc1-cp310-abi3-macosx_11_0_arm64.whl
prism_qc-0.1.0rc1-cp310-abi3-macosx_10_12_x86_64.whl CPython 3.10 abi3 macOS 10.12+ x86-64 Details for prism_qc-0.1.0rc1-cp310-abi3-macosx_10_12_x86_64.whl

Total release size: 2.4 MB

Release files / prism_qc-0.1.0rc1.tar.gz

Download URL prism_qc-0.1.0rc1.tar.gz
Size 113.3 kB
Tags Source
SHA-256 checksum
How to use checksums
6fadbd9e48db26b4d2e99bbfa1f214a4a7528072f3cef81b2a17f728e94b9685
BLAKE2b-256 checksum
How to use checksums
bd551b5a879516f57fc568e14d27d241773ecdecba05e43b49c988b9e297d724
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 17, 2026.

Transparency log

Release files / prism_qc-0.1.0rc1-cp310-abi3-win_amd64.whl

Download URL prism_qc-0.1.0rc1-cp310-abi3-win_amd64.whl
Size 611.9 kB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
d8973f558a1fa14ee81d6d939b926d51f779df5d1372377b2b77e6c44e954f95
BLAKE2b-256 checksum
How to use checksums
4e01993fca3c3f7781c5b3c1200d3b16823d447fd07dcd9e7af6a8f0b5f160ad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 17, 2026.

Transparency log

Release files / prism_qc-0.1.0rc1-cp310-abi3-manylinux_2_28_x86_64.whl

Download URL prism_qc-0.1.0rc1-cp310-abi3-manylinux_2_28_x86_64.whl
Size 454.6 kB
Tags CPython 3.10 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
c45172185f8810ad4dc9e9be9f16f26f34425a6a7371cd21a75ed4dbabe6e87f
BLAKE2b-256 checksum
How to use checksums
b987a53e1a97ae7ce5a0583cef37951f616d614b646873ce048c64291b86aadf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 17, 2026.

Transparency log

Release files / prism_qc-0.1.0rc1-cp310-abi3-manylinux_2_28_aarch64.whl

Download URL prism_qc-0.1.0rc1-cp310-abi3-manylinux_2_28_aarch64.whl
Size 427.1 kB
Tags CPython 3.10 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
a1c7fdbfa803d420070040c2094eb4fa989b50f4b303f07c150ad4b9211ff684
BLAKE2b-256 checksum
How to use checksums
d5942629c587279b39d088591632f7e6e3ee1145150b79318b783915199d1123
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 17, 2026.

Transparency log

Release files / prism_qc-0.1.0rc1-cp310-abi3-macosx_11_0_arm64.whl

Download URL prism_qc-0.1.0rc1-cp310-abi3-macosx_11_0_arm64.whl
Size 406.4 kB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
7ced775f0bcba632113958ea884f443dcf8171bfc88fbe653c825ae78e8c0dfd
BLAKE2b-256 checksum
How to use checksums
26c88eae57789411df09d0cb09454ed4404418bb38470885b7b34d0ad1489adb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 17, 2026.

Transparency log

Release files / prism_qc-0.1.0rc1-cp310-abi3-macosx_10_12_x86_64.whl

Download URL prism_qc-0.1.0rc1-cp310-abi3-macosx_10_12_x86_64.whl
Size 424.5 kB
Tags CPython 3.10 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
b57c0b5b11a19e99686089bde3ac133a37775185cad5c513e10c2fb93b7c105d
BLAKE2b-256 checksum
How to use checksums
99d84a9f3b4764c276a73f57872da883a1268142d7e3de8370908955fb1412df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 17, 2026.

Transparency log

Security for prism-qc 0.1.0rc1

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.

Full provenance

All 6 files in this release have been uploaded with provenance metadata.

Select from 6 files

Attestation for prism_qc-0.1.0rc1.tar.gz

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 Nov 17, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release
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