Library / Observable Ledger / Observable Ledger API

Observable Ledger API

Record fields and calls.

Record fields

Table 1. Fields.
FieldExactSample
methodexactsample
sourcestate-register | bond-contract | noise-channelsame
observablecanonical Pauli sumsame
values or meancontractionsample mean
tolerancepresentabsent
shots, seed, standard_error, bitsabsentpresent
discardedpresent only for bond-contractsame rule
mappresent only for noise-channelsame rule
workerspresent when the source is a Device Spansame rule

Calls

Table 2. Calls available on Register, Bonds, Density, and Span.
CallFaults
expect(observables)Syntax, support, empty, hermiticity of a non-real coefficient
sample(observable, shots, seed)Seed, empty, support
Ledger.agree(left, right)Mismatch when method, source, or tolerance band disagrees

A change of measurement basis for a sample is a unitary on a copy of the state, then a Z sample, then the copy is dropped. The basis-change script is stored on the record. Exact expect of an X or Y string does not need that copy.