Library / State Register / State Register API
State Register API
Types and calls for the exact amplitude table.
Types
| Type | Meaning |
|---|---|
| Register | An open amplitude table plus its ceiling and endianness. |
| Width | Integer n ≥ 1. The table has 2^n rows. |
| Endian | The only accepted value is little. |
| Ceiling | A byte budget parsed from a string such as 256 MiB. |
| GateName | A catalogue name, or the token custom. |
| Amplitude | A double-precision complex. The table is an ordered list of them. |
Calls
| Call | Returns | Faults |
|---|---|---|
| Lattice.open(width, endian, ceiling) | Register | Budget, endian |
| Register.apply(name, …) | None | Width, unitary, catalogue |
| Register.assert_norm(tol) | None | Norm |
| Register.amplitudes() | list of Amplitude | Closed |
| Register.expect(observables) | Ledger record, method exact | Syntax, support |
| Register.close() | None | Already closed is ignored |
expect is documented in full under Observable Ledger. State Register borrows that record type so a bare list of floats is never the return value.
Lattice script
register = Lattice.open(width=3, endian="little", ceiling="64 MiB") # … braid … record = register.expect(["Z0*Z1"]) record.method # "exact" record.source # "state-register" register.close()