types#
Full path: iqm.qrisp_iqm.passes.routing.core.types
Dynamic index-type selection for plasma-sabre routing passes.
Provides a single source of truth for choosing the narrowest numpy integer
dtype that can safely represent a given index range. All data structures
(coupling topology, instruction DAGs, layout permutations, depth trackers,
etc.) should derive their dtype from the functions in this module rather
than hard-coding np.int32.
Rationale#
Plasma-sabre targets NISQ devices (< 32 768 qubits). Quantum circuits are
expected to contain fewer than 32 768 two-qubit gates before decoherence
destroys any meaningful entanglement. Under these assumptions all index
values fit into np.int16, which doubles cache-line density compared to
np.int32 and substantially improves ALU throughput in the hot SABRE
metric loop.
Functions
|
Return dtype for |
|
Return the narrowest numpy signed-integer dtype for the given range. |
|
Return dtype suitable for per-DAG-node data structures. |
|
Return dtype suitable for per-qubit data structures. |