Hilbert operators and unitary gates #
HilbertOperator n is the raw 2^n × 2^n complex matrix type. It is used for
observables, projectors, matrix sums, and block-encoding operators that are not
necessarily unitary.
Gate n is a unitary Hilbert operator. Gate application maps pure states to
pure states; arbitrary linear combinations stay at the raw StateVector layer
until separately normalized.
Pinned Mathlib API: Matrix.mulVec (and mulVec_add/smul/single_one,
one_mulVec, mulVec_mulVec), Matrix.mem_unitaryGroup_iff,
Equiv.Perm.permMatrix (and Matrix.permMatrix_mulVec,
Matrix.conjTranspose_permMatrix, Matrix.permMatrix_mul,
Matrix.permMatrix_one), Finset.sum_ite_eq'.
A Hilbert operator acts on a raw state vector by matrix-vector multiplication.
Equations
- A.applyVec ψ = WithLp.toLp 2 (Matrix.mulVec A ψ.ofLp)
Instances For
A Hilbert operator sends a basis ket to its corresponding column.
A unitary Hilbert operator preserves inner products on raw state vectors.
A unitary Hilbert operator preserves raw vector norms.
A unitary gate on an n-qubit Hilbert space.
- op : HilbertOperator n
Underlying Hilbert-space operator.
Gates are unitary by definition.
Instances For
Equations
Equations
- QuantumAlg.Gate.instHMulHilbertOperator = { hMul := fun (G : QuantumAlg.Gate n) (A : QuantumAlg.HilbertOperator n) => G.op * A }
Equations
- QuantumAlg.Gate.instHMulHilbertOperator_1 = { hMul := fun (A : QuantumAlg.HilbertOperator n) (G : QuantumAlg.Gate n) => A * G.op }
Build a gate from a unitary Hilbert operator.
Equations
- QuantumAlg.Gate.ofUnitary U hU = { op := U, unitary := hU }
Instances For
Equations
- One or more equations did not get rendered due to their size.
Conjugate transpose of a unitary gate, again as a gate.
Equations
Instances For
Equations
A gate acts on a raw vector by its underlying Hilbert operator.