Documentation

CslibFrontier.Foundations.Quantum.Measurement

Measurement of finite-dimensional quantum states #

A pure state of a finite-dimensional quantum system with computational basis ι is a unit vector of the Euclidean space ℂ^ι, with basis states |x⟩ (Cslib.Quantum.ket). Measuring a unit state ψ in the computational basis gives outcome y with probability |ψ_y|² (Cslib.Quantum.measure); the probability of an outcome in a set S is ∑_{y ∈ S} |ψ_y|² (Cslib.Quantum.measureProb) Arora, Barak, Chapter 10.

Both quantum models of the library measure through this API: the circuit model on ι = Fin n → Bool (CslibFrontier/Computability/Circuit/Quantum/Basic.lean), and the query model, whose register probability Cslib.Quantum.regProb is measureProb of the outcomes with a given query index (CslibFrontier/Computability/QueryComplexity/Quantum/Search.lean).

Main definitions #

Main results #

References #

noncomputable def Cslib.Quantum.ket {ι : Type u_1} [DecidableEq ι] (x : ι) :

The computational basis state |x⟩.

@[simp]
theorem Cslib.Quantum.ket_apply {ι : Type u_1} [DecidableEq ι] (x y : ι) :
(ket x).ofLp y = if y = x then 1 else 0
@[simp]
theorem Cslib.Quantum.norm_ket {ι : Type u_1} [Fintype ι] [DecidableEq ι] (x : ι) :
noncomputable def Cslib.Quantum.measureProb {ι : Type u_1} (ψ : EuclideanSpace ℂ ι) (S : Finset ι) :

The probability ∑_{y ∈ S} |ψ_y|² that measuring ψ in the computational basis gives an outcome in S.

The outcome probabilities of a state sum to its squared norm.

theorem Cslib.Quantum.measureProb_ket {ι : Type u_1} [DecidableEq ι] (x : ι) (S : Finset ι) :
measureProb (ket x) S = if x ∈ S then 1 else 0

Measuring a basis state |x⟩ gives outcome x with certainty.

theorem Cslib.Quantum.measureProb_mono {ι : Type u_1} (ψ : EuclideanSpace ℂ ι) {S T : Finset ι} (h : S ⊆ T) :
theorem Cslib.Quantum.measureProb_compl {ι : Type u_1} [Fintype ι] [DecidableEq ι] (ψ : EuclideanSpace ℂ ι) (S : Finset ι) :

The outcomes outside S have the remaining probability.

theorem Cslib.Quantum.measureProb_smul {ι : Type u_1} (c : ℂ) (ψ : EuclideanSpace ℂ ι) (S : Finset ι) :
measureProb (c • ψ) S = ‖c‖ ^ 2 * measureProb ψ S

Outcome probabilities scale with the squared modulus of a scalar.

theorem Cslib.Quantum.sum_smul_ket {ι : Type u_1} [Fintype ι] [DecidableEq ι] (ψ : EuclideanSpace ℂ ι) :
∑ x : ι, ψ.ofLp x • ket x = ψ

A state is the sum of the basis states weighted by its amplitudes.

theorem Cslib.Quantum.ofLp_eq_zero_of_measureProb_eq_zero {ι : Type u_1} {ψ : EuclideanSpace ℂ ι} {S : Finset ι} (h : measureProb ψ S = 0) {y : ι} (hy : y ∈ S) :
ψ.ofLp y = 0

A state measured in S with probability zero has no amplitude in S.

theorem Cslib.Quantum.ofLp_eq_zero_of_measureProb_eq_one {ι : Type u_1} [Fintype ι] {ψ : EuclideanSpace ℂ ι} {S : Finset ι} (hψ : ‖ψ‖ = 1) (h : measureProb ψ S = 1) {y : ι} (hy : y ∉ S) :
ψ.ofLp y = 0

A unit state measured in S with certainty has no amplitude outside S.

theorem Cslib.Quantum.measureProb_map_sum_orthonormal {ι : Type u_1} [Fintype ι] {κ : Type u_2} {E : Type u_3} [Fintype κ] [NormedAddCommGroup E] [InnerProductSpace ℂ E] (U : E →ₗᵢ[ℂ] EuclideanSpace ℂ ι) {v : κ → E} (hv : Orthonormal ℂ v) (c : κ → ℂ) (S : Finset ι) (A : κ → Prop) [DecidablePred A] (h₁ : ∀ (k : κ), A k → measureProb (U (v k)) S = 1) (h₀ : ∀ (k : κ), ¬A k → measureProb (U (v k)) S = 0) :
measureProb (U (∑ k : κ, c k • v k)) S = ∑ k : κ with A k, ‖c k‖ ^ 2

Measuring an isometric image of a superposition of orthonormal states, each measured in S with probability 0 or 1: the probability of S is the total squared weight of the states measured in S with certainty, as the images of the others have no amplitude in S.

noncomputable def Cslib.Quantum.measure {ι : Type u_1} [Fintype ι] (ψ : EuclideanSpace ℂ ι) (hψ : ‖ψ‖ = 1) :
PMF ι

Measurement in the computational basis: a unit state ψ gives outcome y with probability |ψ_y|².

@[simp]
theorem Cslib.Quantum.measure_apply {ι : Type u_1} [Fintype ι] (ψ : EuclideanSpace ℂ ι) (hψ : ‖ψ‖ = 1) (y : ι) :
(measure ψ hψ) y = ENNReal.ofReal (‖ψ.ofLp y‖ ^ 2)
theorem Cslib.Quantum.measure_toOuterMeasure_apply {ι : Type u_1} [Fintype ι] (ψ : EuclideanSpace ℂ ι) (hψ : ‖ψ‖ = 1) (S : Finset ι) :

The measurement gives an outcome in S with probability measureProb ψ S.