Documentation

CslibFrontier.Computability.Circuit.Frontier.TensorNetwork.ScheduledRecursion

The contraction recursion with the parameter schedule #

This file runs the contraction recursion (TensorNetwork.contractRec) with the parameter schedule of [OAI26k] (§D.4.2, (D.4)–(D.6), p. 58) from Cslib.Circuits.Frontier.ContractionSchedule, so that its correctness and the running-time certificate refer to the same calls.

The schedule of call parameters (ContractionSchedule.callParams s). For size s, a call at depth d with M edges is a leaf when M ≤ H = leafSize s. Otherwise it has a = slotBits s d slot bits, taper u = taper s d, multiplicity step h = ⌈3 M / u⌉ (taperStep), and degree bound Δ = degreeBound s. Its children are recovered at the precisions p_t = nodePrecision. Correctness of the recursion holds for this schedule as for every other (TensorNetwork.exists_contractRec_eq_add).

An active call. At a call with Active C s d M p and ActiveBounds C s d M p (the certificate exists_activeBounds gives the second from the first for s ≥ s₀) on a network that runs from rows to columns with at most Δ ports at each end, and with at least 2 ^ (4 ⌊log₂ s⌋) interpolation points:

These are the per-call facts that a certificate of the running time instantiates along the recursion tree.

Main definitions #

Main results #

References #

The schedule of call parameters #

The multiplicity step h = ⌈3 M / u⌉ of Lemma D.5 at depth d, with u = taper s d.

The schedule of call parameters for size s: a call at depth d with M edges is a leaf when M ≤ leafSize s, and otherwise has a = slotBits s d, u = taper s d, h = ⌈3 M / u⌉ and the degree bound Δ = degreeBound s.

theorem Cslib.Circuits.Frontier.ContractionSchedule.callParams_of_lt {s d M : ℕ} (h : leafSize s < M) :
callParams s d M = some { a := slotBits s d, u := taper s d, h := taperStep s d M, degree := degreeBound s }
theorem Cslib.Circuits.Frontier.ContractionSchedule.ActiveBounds.admissible {C s d M p : ℕ} (hB : ActiveBounds C s d M p) {N₀ : ℕ} (hN₀ : 2 ^ (4 * Nat.log 2 s) ≤ N₀) :
{ a := slotBits s d, u := taper s d, h := taperStep s d M, degree := degreeBound s }.Admissible M N₀

The parameters of an active call are admissible, given 2 ^ (4 ⌊log₂ s⌋) interpolation points.

An active call #

theorem Cslib.Circuits.Frontier.ContractionSchedule.contractRec_callParams_eq_callValue {K : Type u_1} [CommRing K] [Algebra ℚ K] (B : Subring K) (hB : ∀ c ∈ (Rat.padicValuation 2).integer, (algebraMap ℚ K) c ∈ B) {N₀ : ℕ} (pts : Fin N₀ → ↥B) {C s d n m p : ℕ} {N : TensorNetwork (↥B) Bool (Fin n) (Fin m)} {side : Fin n → Bool} (hA : Active C s d m p) (hAB : ActiveBounds C s d m p) (hN : N.RowsToColumnsLE side (degreeBound s)) (hN₀ : 2 ^ (4 * Nat.log 2 s) ≤ N₀) :
TensorNetwork.contractRec B hB (callParams s) pts d n m N side p = TensorNetwork.callValue B hB (fun (n' m' : ℕ) (N' : TensorNetwork (↥B) Bool (Fin n') (Fin m')) (side' : Fin n' → Bool) (p' : ℕ) => if m' < m then TensorNetwork.contractRec B hB (callParams s) pts (d + 1) n' m' N' side' p' else N'.contraction) N side ⋯ ⋯ (PacketPacking.packing N.src N.tgt (slotBits s d) 64) p (taper s d) (taperStep s d m) ⋯ fun (k : Fin (m * (2 * 2 ^ slotBits s d - 1) + 1)) => pts (Fin.castLE ⋯ k)

An active call of the scheduled recursion. At an active call (Active, ActiveBounds) on a network that runs from rows to columns within the degree bound, with at least 2 ^ (4 ⌊log₂ s⌋) interpolation points, the recursion is the active call callValue with the packing of Lemma D.3 at a = slotBits s d, u = taper s d and h = ⌈3 M / u⌉, and recursive calls at depth d + 1 for the children.

theorem Cslib.Circuits.Frontier.ContractionSchedule.sixteen_mul_card_edges_child_le {K : Type u_1} [CommRing K] [Algebra ℚ K] (B : Subring K) (hB : ∀ c ∈ (Rat.padicValuation 2).integer, (algebraMap ℚ K) c ∈ B) {C s d n m p : ℕ} {N : TensorNetwork (↥B) Bool (Fin n) (Fin m)} {side : Fin n → Bool} (hAB : ActiveBounds C s d m p) (hN : N.RowsToColumnsLE side (degreeBound s)) (hua : taper s d ≤ slotBits s d) {t : ℤ} (ht : t ∈ recoveryNodes (slotBits s d)) (hq : 0 < taperMult (taper s d) (taperStep s d m) t) (z : ↥B) (g : Fin 64) :
16 * Fintype.card ({ e : Fin m // (TensorNetwork.callSplitting B hB N side ⋯ ⋯ (PacketPacking.packing N.src N.tgt (slotBits s d) 64) p (taper s d) (taperStep s d m) hua ht hq z).group (N.src e) = g } ⊕ { e : Fin m // (TensorNetwork.callSplitting B hB N side ⋯ ⋯ (PacketPacking.packing N.src N.tgt (slotBits s d) 64) p (taper s d) (taperStep s d m) hua ht hq z).group (N.tgt e) = g }) ≤ m

The children of an active call have at most M / 16 edges, as Active.child requires (Lemma D.3 (3) under (D.6), TensorNetwork.mul_card_edges_child_callSplitting_le).

The children of an active call are evaluated within the precision schedule: a node of positive multiplicity passes p_t ≤ precisionBound C s (d + 1) to its children.

theorem Cslib.Circuits.Frontier.ContractionSchedule.card_modeBudget_callParams_le {K : Type u_1} [CommRing K] (B : Subring K) {C s d n m p : ℕ} {N : TensorNetwork (↥B) Bool (Fin n) (Fin m)} {side : Fin n → Bool} (hA : Active C s d m p) (hAB : ActiveBounds C s d m p) (hN : N.RowsToColumnsLE side (degreeBound s)) {t : ℤ} (hq : 0 < taperMult (taper s d) (taperStep s d m) t) :

The mode count (D.15) at an active call: at a node of positive multiplicity, there are at most 2 ^ e_d mode tuples for the packing of Lemma D.3, which has at most 3 M / L packets.