hypergraphState
For a natural number n and a hypergraph H : Finset (Finset (Fin n)), hypergraphState n H is the quantum state vector in Hn n whose amplitude at each bitstring x : Fin n → Fin 2 is (1 / Real.sqrt (2 ^ n)) * ∏ e ∈ H, (if ∀ i ∈ e, x i = 1 then -1 else 1).
Statement
noncomputable def hypergraphState (n : ℕ) (H : Finset (Finset (Fin n))) : Hn n
- Defined in
- Quantum 8, 1422 (2024)
- Verified
- 06 Nov 2026
- Axioms
- none listed
- Built on 1
- HnThe $n$-qubit Hilbert space $\mathcal{H}_n = \ell^2\!\bigl(\{0,1\}^n,\mathbb{C}\bigr)$, implemented as \texttt{EuclideanSpace ℂ (Fin n →…
- Used by 1
- cubicHypergraphFluctuationFor an n-qubit 3-uniform hypergraph H : CubicHypergraph n, cubicHypergraphFluctuation n H is the magic fluctuation magicFluctuation n…
Read back from the Lean
Given a natural number $n$ and a finite set of hyperedges $H$ (where each hyperedge is a finite set of vertices in $\mathrm{Fin}\ n$), hypergraphState n H defines the vector in the Euclidean space $\mathbb{C}^{\mathrm{Fin}\ n \to \mathrm{Fin}\ 2}$ whose component at bitstring $x : \mathrm{Fin}\ n \to \mathrm{Fin}\ 2$ is given by
$$\frac{1}{\sqrt{2^n}} \prod_{e \in H} \begin{cases} -1 & \text{if } \forall i \in e,\, x(i) = 1 \\ 1 & \text{otherwise} \end{cases}$$
where the division and square root are evaluated in $\mathbb{R}$ and coerced to $\mathbb{C}$.
Written by a model that saw only the Lean, never the English above. If the two disagree, that is worth a challenge.
Lean source view module on GitHub
/-- The quantum hypergraph state in Hn n associated to a hypergraph H. -/ noncomputable def hypergraphState (n : ℕ) (H : Finset (Finset (Fin n))) : Hn n := EuclideanSpace.equiv (Fin n → Fin 2) ℂ |>.symm (fun x => (1 / Real.sqrt (2 ^ n : ℝ) : ℂ) * ∏ e ∈ H, if ∀ i ∈ e, x i = 1 then (-1 : ℂ) else 1)