cfahlgren1's picture
download
raw
2.72 kB
import Mathlib
namespace OAI
noncomputable section
open scoped BigOperators Matrix.Norms.L2Operator
namespace QAC
abbrev Bit := Fin 2
abbrev Word (N : ℕ) := Fin N → Bit
abbrev Operator (N : ℕ) := Matrix (Word N) (Word N) ℂ
abbrev QubitOperator := Matrix Bit Bit ℂ
/-- Tensor product in the computational basis. -/
def tensorMatrix {N : ℕ} (a : Fin N → QubitOperator) : Operator N :=
fun x y => ∏ i, a i (x i) (y i)
/-- A one-qubit unitary or an unbounded-arity Toffoli gate. -/
inductive Gate (N : ℕ) where
| local (q : Fin N) (u : Matrix.unitaryGroup Bit ℂ)
| toffoli (controls : Finset (Fin N)) (target : Fin N) (hne : target ∉ controls)
namespace Gate
def support {N : ℕ} : Gate N → Finset (Fin N)
| .local q _ => {q}
| .toffoli c t _ => insert t c
/-- A Toffoli flips its target iff all controls are one. -/
def toffoliWord {N : ℕ} (c : Finset (Fin N)) (t : Fin N) (x : Word N) : Word N :=
if ∀ i ∈ c, x i = 1 then Function.update x t (1 - x t) else x
def matrix {N : ℕ} : Gate N → Operator N
| .local q u => tensorMatrix fun i => if i = q then (u : QubitOperator) else 1
| .toffoli c t _ => fun x y => if x = toffoliWord c t y then 1 else 0
end Gate
structure PhysicalLayer (N : ℕ) where
gates : List (Gate N)
disjoint : gates.Pairwise (fun A B => Disjoint A.support B.support)
def physicalLayerMatrix {N : ℕ} (L : PhysicalLayer N) : Operator N :=
(L.gates.map Gate.matrix).prod
/-- Chronological order: the rightmost matrix acts first. -/
def physicalCircuitMatrix {N : ℕ} (layers : List (PhysicalLayer N)) : Operator N :=
((layers.map physicalLayerMatrix).reverse).prod
/-- The computational-basis input with the remaining qubits initialized to zero. -/
def inputWord {n N : ℕ} (x : Word n) : Word N :=
fun i => if h : i.val < n then x ⟨i.val, h⟩ else 0
def parity {n : ℕ} (x : Word n) : Bit := ∑ i, x i
/-- Born probability, summing all final garbage with no cleanliness assumption. -/
def successProbability {n N : ℕ} (W : Operator N) (out : Fin N) (x : Word n) : ℝ :=
∑ y : Word N, if y out = parity x then Complex.normSq (W y (inputWord x)) else 0
/-- The literal measured-output, polynomial-total-qubit parity lower bound. -/
def ParityStatement : Prop :=
∀ (d : ℕ) (c ε : ℝ), 1 ≤ c → 0 < ε → ε ≤ 1 / 2 →
∃ n₀ : ℕ, ∀ n ≥ n₀, ∀ N : ℕ, n ≤ N → (N : ℝ) ≤ (n : ℝ) ^ c →
∀ layers : List (PhysicalLayer N), layers.length ≤ d →
∀ out : Fin N, ¬ (∀ x : Word n,
1 / 2 + ε ≤ successProbability (physicalCircuitMatrix layers) out x)
end QAC
theorem QAC.parity_lower_bound : QAC.ParityStatement := by
sorry
end
end OAI

Xet Storage Details

Size:
2.72 kB
·
Xet hash:
c22e5f16d3a8abbdf38e36850475baa944bbb185248637af402daef316d940f2

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.