The gadget acts on symbol-level states as
ProvedOPI.SymEnc.eGad_JSymbols from a finite set (with a distinguished element ) are stored in qubits via an injective encoding with . For coordinates, each coordinate has two registers of qubits, placed on the system wires by an embedding . A symbol-level amplitude is turned into a qubit state , which assigns amplitude to the configuration where hold and all other wires are .
The gadget on coordinate uses a control qubit , a flag , a scratch list with and ancillas with ; all these wires are distinct from each other and from the symbol registers. It applies , , a swap of and controlled on , and .
Statement. If implies and , then
In ket notation, for , with all ancillas returned to . This is the antisymmetrizing step of the per-coordinate decoder (Appendix A.3 of the paper).
import Definitions.Def_TwoFoldOPI_CL_Part01
import Mathlib
import Definitions.Def_QAlgorithms_Defs_Circuit
import Definitions.Def_QAlgorithms_Defs_GradientMethods
import Definitions.Def_QAlgorithms_Defs_OPIOraclePrograms
import Definitions.Def_QAlgorithms_Defs_OPIUniformity
import Definitions.Def_QAlgorithms_Defs_Fourier
import Definitions.Def_TwoFoldOPI_elemBits
import Definitions.Def_TwoFoldOPI_schurSquare
import Definitions.Def_TwoFoldOPI_schurFailureSum
import Definitions.Def_CodingTheory
import Definitions.Def_OAIThreeMachineSched01
import Definitions.Def_CookLevin_Cost
import Definitions.Def_TwoFoldOPI_codeOf
import Definitions.Def_TwoFoldOPI_solves
import Definitions.Def_TwoFoldOPI_Input
import Definitions.Def_TwoFoldOPI_CLSerializableF
open OPI OPI.SymEnc
open QAlgorithms
variable {n m L : ℕ} {K : Type} [Fintype K] [DecidableEq K] [Zero K]
{reg : Fin m × Bool × Fin L ↪ Fin n} {enc : K → Qubits L}
variable (i : Fin m) (Z as : List (Fin n)) (a f : Fin n)
variable (hnd : ([a] ++ (List.ofFn (bReg reg i false) ++ List.ofFn (bReg reg i true)) ++ Z ++ as ++
[f]).Nodup) (hZ : 2 * L = Z.length) (hlen : 1 + 2 * L ≤ as.length + 2)
(hout : ∀ p, reg p ≠ a ∧ reg p ≠ f ∧ (∀ x ∈ Z, reg p ≠ x) ∧ ∀ x ∈ as, reg p ≠ x)
include hnd hZ hlen hout
theorem OPI.SymEnc.eGad_J (henc : Function.Injective enc) (henc0 : enc 0 = fun _ => false)
(Fn : (Fin m → K × K) → ℂ) (hF : ∀ b, Fn b ≠ 0 → (b i).2 = 0 ∧ (b i).1 ≠ 0) :
(Circuit.unitary (eGad (reg := reg) i Z as a f)).mulVec (J reg enc Fn) =
J reg enc (opK i kE Fn) := by sorry