Documentation

CslibFrontier.Computability.Circuit.Frontier.TensorNetwork.ChildEntries

The entries of the child networks from their descriptors #

A child network of the contraction recursion of [OAI26k] (ModeSplitting.child, §D.4.6, p. 63) is carried natively as a network of vertex descriptors (VertexDesc T) with port lists. This file proves that such a network has the contraction of the child, once each descriptor reads its ports in the right order.

Main results #

References #

Port lists #

theorem Cslib.Circuits.Frontier.DescribedNetwork.contraction_eq_of_ports {T : Type} {R : Type u_1} [CommSemiring R] {V : Type u_2} {E : Type u_3} [Fintype V] [Fintype E] [DecidableEq E] {k l : ℕ} (N : TensorNetwork R Bool V E) (ev : V ≃ Fin k) (ee : E ≃ Fin l) (ports : V → List E) (desc : V → T) (eval : T → List Bool → R) (h : ∀ (v : V) (x : E → Bool), eval (desc v) (List.map x (ports v)) = N.tensor v x) :
contraction eval { numEdges := l, vertices := List.ofFn fun (i : Fin k) => (List.map (fun (e : E) => ↑(ee e)) (ports (ev.symm i)), desc (ev.symm i)) } = N.contraction

A described network with port lists has the contraction of the network it describes. Number the vertices of N by ev and its edges by ee, and give each vertex v a list of edges ports v and a descriptor desc v. If the evaluator at desc v, read at the bits of every assignment on ports v, is the tensor of v at that assignment, the described network with the numbered ports and the descriptors has the contraction of N.

The ports of one side of a tagged list #

theorem Cslib.Circuits.Frontier.NativePacket.sidePorts_map {α : Type u_1} (cs : List α) (tag : α → Bool) (sl : α → ℕ) (y : α → Bool) (side : Bool) :
sidePorts (List.map (fun (c : α) => (tag c, sl c)) cs) (List.map y cs) side = List.map (fun (c : α) => (sl c, y c)) (List.filter (fun (c : α) => tag c == side) cs)

The ports of one side of a tagged list. If the ports of a vertex are tagged, in their order, by whether they are row ports and by their slots, and the bits are read in the same order, the ports of one side are the ports with that tag, with their slots and bits, in order.

Retained vertices #

theorem Cslib.Circuits.Frontier.TensorNetwork.ModeSplitting.child_tensor_inl_eq_tensor {R : Type u_1} {V : Type u_2} {E : Type u_3} {G : Type u_4} {P : Type u_5} {M : Type u_6} [CommRing R] [Fintype M] [DecidableEq V] [Fintype E] [DecidableEq E] [DecidableEq P] [DecidableEq G] [DecidableEq M] {N : TensorNetwork R Bool V E} {W : Matrix E E R} (S : N.ModeSplitting W G P M) (β : M → ℕ) (g : G) (v : { v : V // S.group v = g }) (y : { e : E // S.group (N.src e) = g } ⊕ { e : E // S.group (N.tgt e) = g } → Bool) :
(S.child β g).tensor (Sum.inl v) y = N.tensor ↑v fun (e : E) => if S.side ↑v = true then if h : S.group (N.src e) = g then y (Sum.inl ⟨e, h⟩) else false else if h : S.group (N.tgt e) = g then y (Sum.inr ⟨e, h⟩) else false

The retained vertices of a child: a vertex of group g keeps its tensor in the child of group g, reading at each of its edges the child edge of that edge: a row its row ports and a column its column ports.

Packet vertices #

theorem Cslib.Circuits.Frontier.TensorNetwork.map_val_entry_child_inr {R : Type u_1} {V : Type u_2} {E : Type u_3} {G : Type u_4} {P : Type u_5} [CommRing R] [Fintype E] [DecidableEq E] [Fintype P] [DecidableEq G] [DecidableEq P] {N : TensorNetwork R Bool V E} {group : V → G} {packet : E → P} {slot : E → ℕ} {sym : P → G × G} {i : ℕ} (side : V → Bool) (hsrc : ∀ (e : E), side (N.src e) = true) (htgt : ∀ (e : E), side (N.tgt e) = false) (horient : ∀ (e : E), (group (N.src e), group (N.tgt e)) = if (slot e).testBit i = true then (sym (packet e)).swap else sym (packet e)) {a : ℕ} (hslot : ∀ (e : E), slot e < 2 ^ a) (hia : i < a) (κ : ↥(Rat.padicValuation 2).integer →+* R) (ζ : R) {p : ℕ} (hp : 2 ^ p = 0) {t : ℤ} (ht : t ∈ cauchyGrid (2 ^ a)) (hti : 2 ^ i ∣ t) (hti' : ¬2 ^ (i + 1) ∣ t) [DecidableEq V] {T : Type} {ev : T → List Bool → List ℕ} (β : P × Fin (2 ^ (i + 1)) × Fin p → ℕ) (g : G) (q : P) (cs : List ({ e : E // (cauchyModeSplitting side hsrc htgt horient hslot hia κ ζ hp ht hti hti').group (N.src e) = g } ⊕ { e : E // (cauchyModeSplitting side hsrc htgt horient hslot hia κ ζ hp ht hti hti').group (N.tgt e) = g })) (hcs : cs.Nodup) (hcs' : ∀ (c : { e : E // (cauchyModeSplitting side hsrc htgt horient hslot hia κ ζ hp ht hti hti').group (N.src e) = g } ⊕ { e : E // (cauchyModeSplitting side hsrc htgt horient hslot hia κ ζ hp ht hti hti').group (N.tgt e) = g }), c ∈ cs ↔ packet (Sum.elim Subtype.val Subtype.val c) = q) (c : NativePacket.PacketCtx) (βd : List ℕ) (ψ : GaloisRingArith.Ring c.p c.fl →+* R) (hζ : ψ (GaloisRingArith.val c.p c.fl c.ζ) = ζ) (ha : c.a = a) (hL : c.L = 2 ^ a) (hi : c.i = i) (htiles : c.tiles = 2 ^ (i + 1)) (ht' : c.t = t) (hnb : c.nb = p) (he₁ : c.e₁ = decide ((sym q).1 = g)) (he₂ : c.e₂ = decide ((sym q).2 = g)) (hdiffer : c.differ = decide ((sym q).1 ≠ (sym q).2)) (hβ : ∀ (Z : Fin (2 ^ (i + 1)) × Fin p), βd.getD (↑(finProdFinEquiv Z)) 0 = β (q, Z)) (y : { e : E // (cauchyModeSplitting side hsrc htgt horient hslot hia κ ζ hp ht hti hti').group (N.src e) = g } ⊕ { e : E // (cauchyModeSplitting side hsrc htgt horient hslot hia κ ζ hp ht hti hti').group (N.tgt e) = g } → Bool) :
ψ (GaloisRingArith.val c.p c.fl (VertexDesc.entry ev (Sum.inr (c, List.map (fun (e : { e : E // (cauchyModeSplitting side hsrc htgt horient hslot hia κ ζ hp ht hti hti').group (N.src e) = g } ⊕ { e : E // (cauchyModeSplitting side hsrc htgt horient hslot hia κ ζ hp ht hti hti').group (N.tgt e) = g }) => (e.isLeft, slot (Sum.elim Subtype.val Subtype.val e))) cs, βd)) (List.map y cs))) = ((cauchyModeSplitting side hsrc htgt horient hslot hia κ ζ hp ht hti hti').child β g).tensor (Sum.inr q) y

The packet vertices of a Cauchy child, from their descriptors. Let the ports of the packet vertex q in the child of group g be the child edges of packet q, listed without repetition in any order, and let the descriptor's ports tag each of them, in the same order, with whether it is a row port and with its slot. Let the packet's context have the node t of valuation i < a, L = 2 ^ a slots, 2 ^ (i + 1) tiles and p exponents per tile, the symbols of q against g, an interpolation value mapping to ζ, and the dense exponents of β at q. Then along a ring map ψ from A_p, at the packet's precision, to R, the descriptor's entry at the bits on its ports is the child's entry.