Library / Observable Ledger / Observable Ledger

Observable Ledger

The only supported way to publish a number from a Lattice Mesh state.

Contract

A ledger record is either an exact contraction or a seeded sample mean. The two are different types. The laboratory does not offer a function that returns a bare float, because notebooks were mixing them.

Field-by-field rules and the braid table are in /investor-relations/research/lattice-mesh/observable-ledger. Pauli strings use tokens such as Z0 and X0*X1*X2. A missing wire means I. Coefficients are real.

Exact records

Lattice script
record = state.expect(["Z0", "Z0*Z1", "X0*X1*X2"])
record.method      # "exact"
record.tolerance   # contraction tolerance
record.shots       # absent

source is state-register, bond-contract, or noise-channel. A bond-contract record includes discarded. A noise-channel record includes map.

Sample records

sample(observable, shots, seed) draws independent shots. The seed is an unsigned 64-bit integer and is mandatory. The same seed, state, and observable reproduce the same bit list. The record stores the mean, the standard error of the mean, the seed, and the shots. It does not replace the mean with the exact expectation.

Lattice script
sample = state.sample("Z0", shots=4096, seed=1729)
sample.method          # "sample"
sample.standard_error  # 1/sqrt(shots) for a fair ±1 on the braid