Register Layout API Reference

Logical registers wider than the 64-bit native machine word, backed by multiple native words on a real SparseState. Used by pysparq.rir and available as a public API.

Logical registers backed by multiple native words, without truncating high bits.

The C++ machine-word ABI stays intact. Every bit operation still executes on the real sparse-state backend; logical values are reconstructed as Python ints.

class pysparq.register_layout.RegisterLayout(state: Any)[source]

Bases: object

Own logical register allocations in one native SparseState.

add returns bit coordinates accepted by native gate operators. value reads a complete logical word from a basis state, including every high word. Names must be distinct within the process-global native register namespace.

pysparq.register_layout.register_bits(name: str, width: int) → list[tuple[str, int]][source]

Resolve one logical register to little-endian native bit coordinates.