寄存器布局 API 参考

超过 64 位原生机器字的逻辑寄存器,以多个原生机器字承载于真实 SparseState 。供 pysparq.rir 使用, 亦作为公共 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)[源代码]

基类: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]][源代码]

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