Library / State Register / State Register

State Register

Exact amplitude memory: open, catalogue, index, and faults.

Contract

State Register holds one pure state as a contiguous table of 2^n complex amplitudes in double precision. A gate is a unitary on one or two wires, or a custom 2×2 or 4×4 matrix that passes U†U = I. The product does not drop singular values and does not switch to Bond Contract when the ceiling is too small.

The essay, including the full index convention and the amplitude table, is /investor-relations/research/lattice-mesh/state-register. This page is the operational contract.

Table 1. Payload size, 16 bytes per amplitude, before scratch.
WidthPayload
161 MiB
2016 MiB
24256 MiB
3016 GiB

Opening a register

Lattice script
register = Lattice.open(width=20, endian="little", ceiling="256 MiB")

endian must be the string little. A request for the opposite endianness is a fault; reverse the wire labels at your boundary and document it. ceiling is a byte string the console parses (KiB, MiB, GiB). The open adds the largest gate tile’s scratch to the payload and refuses the call if the sum exceeds the ceiling.

Applying a gate

apply names a catalogue entry or a custom matrix. Controls use the positive convention: the target acts when every control bit is 1. Angles on Rx, Ry, Rz are radians and follow exp(−i θ P / 2).

Table 2. Catalogue names.
NameRequired arguments
I, X, Y, Z, H, S, Ton
Rx, Ry, Rzon, angle
CNOT, CZcontrol, target
SWAPon as a pair, or the two wire arguments wires=
custommatrix, wires

Faults

  • Budget fault at open.
  • Width fault when a wire index is outside 0 … n−1.
  • Unitary fault when a custom matrix fails the identity check.
  • Norm fault when assert_norm is armed and the norm leaves the band.