What Bond Contract owns
Bond Contract stores a pure state as a chain of local tensors rather than as a full amplitude table. Each wire carries a site tensor. Neighboring sites share a bond index whose dimension χ is the bond width. The product’s promise is not “the exact state.” The promise is that every truncation is accounted: the sum of squares of the singular values thrown away is added to a running discarded weight, and a run that would pass the caller’s budget ε stops with a budget fault instead of returning a quieter approximation.
Use it when entanglement across a cut stays modest — shallow circuits, states that are nearly a product, or circuits whose gates respect a line geometry. Do not use it as a drop-in replacement for State Register on a circuit that builds volume-law entanglement. In that regime χ must grow until the factorization costs as much as the full table, and the contract will say so.
Shape of a factorized state
A width-n state in this product is a list of n site tensors. Site 0 and site n−1 are vectors along the bond. Interior sites are three-index arrays: a physical bit i ∈ {0,1} and two bond indices. Contracting every bond and summing the physical bits reconstructs an amplitude for each basis label. With a uniform bond width χ the storage is proportional to n χ² complex numbers, not to 2^n.
| Width n | Bond width χ | Complex numbers (order) | Compared with a full table |
|---|---|---|---|
| 32 | 32 | about 3×10^4 | Full table is 2^32 amplitudes |
| 64 | 64 | about 3×10^5 | Full table does not fit a single laboratory host |
| 64 | 256 | about 4×10^6 | Still far below 2^64 |
| 20 | 1024 | about 2×10^7 | Larger than the exact table of 2^20 — exact mode is cheaper |
Applying a gate
A one-wire gate contracts into that site and does not change χ. A two-wire gate is allowed only on neighboring sites in the current line order. The two sites and the gate are contracted into one joint tensor, that tensor is split by a singular-value decomposition, and singular values are dropped from the small end until either the bond is within χ or the discarded weight would exceed the remaining budget.
Discarded weight for one split is the sum of squares of the dropped singular values, divided by the sum of squares of all singular values of that split, so the figure is dimensionless and comparable across gates. The running total starts at zero when the state is a product |0…0⟩ and only increases. It is not reset between gates.
bonds = Lattice.bonds(width=64, chi=32, epsilon=1e-8, order="line")
bonds.apply("H", on=0)
bonds.apply("CNOT", control=0, target=1)
# A gate on non-neighbors is rejected until the caller inserts SWAPs
# and accepts the discarded weight those SWAPs may create.
bonds.report() # chi used, discarded weight, gates appliedA gate on non-adjacent wires is a fault unless the caller sets permit_swap_route. That flag inserts SWAPs that walk the two wires together, applies the gate, and walks them back. Each SWAP is an ordinary two-site update and can spend budget. The report lists those SWAPs separately from the gates the author wrote, so a notebook can see whether the route, rather than the circuit, consumed ε.
The Aether braid under the contract
The Aether braid prepares (|000⟩ + |111⟩) / √2, a state whose entanglement across the middle cut is one bit. A bond width of 2 is enough to hold it with discarded weight zero, because the singular spectrum across each cut of a GHZ-type state on a line has only one nonzero value once the local basis is chosen, and the second bond slot stays at zero rather than being dropped from a larger spectrum. Bond Contract’s regression records discarded weight 0 and χ used = 2 for this circuit at χ ceiling 8 and ε = 10^{-12}.
The same page’s State Register table is the reference. After contraction of the bond factorization, amplitudes on |000⟩ and |111⟩ match 1/√2 to the regression tolerance, and the other six basis states stay below that tolerance. A later edit that changes the SVD truncation rule must keep this case exact. It is the canary that the product still knows the difference between “nothing to drop” and “drop quietly.”
| Circuit | Ceiling χ | ε | Expected discarded weight |
|---|---|---|---|
| Aether braid, n=3 | 8 | 1e-12 | 0 |
| Product of H on every wire | 1 | 1e-12 | 0 (still a product state) |
| Depth-2 brickwork of random two-wire rotations, n=12 | 16 | 1e-6 | at most 1e-6, else budget fault |
Line order and cuts
The default geometry is a line: wires 0—1—2—…—(n−1). Authors who know a better order pass a permutation at open. The permutation is applied to the wire labels of every later gate, and the report prints both the author wire and the site index so the two are not confused. Changing the order after the first gate is forbidden. Start a new factorization if the geometry was wrong.
Expectation values of a Pauli string are computed without rebuilding the full table. A local Pauli is absorbed into the sites it touches, the bond chain is contracted from the left, and the scalar that remains is ⟨P⟩. A string that covers every wire still costs a single left-to-right contraction, linear in n and polynomial in χ. That is why Observable Ledger prefers Bond Contract for wide, low-χ states and State Register for narrow, unstructured ones.
Faults
- Budget fault: the next split would push discarded weight above ε. The state remains the pre-gate factorization.
- Geometry fault: a two-wire gate is off the line and permit_swap_route is off.
- Width fault: projected storage exceeds the exact table, or exceeds the byte ceiling.
- Spectrum fault: a split returns a non-finite singular value. The laboratory treats this as a defect, not as a large χ.
There is no mode that returns the truncated state together with a success flag when ε was exceeded. Callers who want the best state inside the budget raise χ or ε and run again. The discarded-weight number from the failed attempt is included in the fault so the next ceiling is chosen with evidence.