Imports
/- Copyright (c) 2026 Axiomatic-AI. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Matteo Cipollina, Krystian Nowakowski -/ module public import Physlib.QuantumMechanics.Operators.Unbounded

Expectation values and centered vectors

For a partial linear map T on a complex inner product space and ψ ∈ T.domain, this file defines the expectation value and the centered vector Tψ - ⟨T⟩_ψ ψ.

Main definitions

    LinearPMap.expectedValue: the real part of ⟪ψ, Tψ⟫_ℂ.

    LinearPMap.centered: the centered vector Tψ - ⟨T⟩ψ.

Main statements

    LinearPMap.expectedValue_eq_inner: for symmetric T, the complex inner product is real and equals the real expectation value coerced to .

References

    [B. C. Hall, Quantum Theory for Mathematicians, Chapter 12][hall2013quantum].

@[expose] public sectionprivate lemma conj_inner_apply_self_eq_of_isSymmetric (T : H →ₗ.[] H) (hT : T.IsSymmetric) (ψ : T.domain) : (starRingEnd ) (ψ : H), T ψ⟫_ = (ψ : H), T ψ⟫_ := H:Type u_1inst✝¹:NormedAddCommGroup Hinst✝:InnerProductSpace HT:H →ₗ.[] HhT:T.IsSymmetricψ:T.domain(starRingEnd ) ψ, T ψ⟫_ = ψ, T ψ⟫_ All goals completed! 🐙

Expectation value re ⟪ψ, Tψ⟫_ℂ for ψ ∈ T.domain.

For symmetric T, this agrees with ⟪ψ, Tψ⟫_ℂ after coercion from ; see expectedValue_eq_inner.

def expectedValue (T : H →ₗ.[] H) (ψ : T.domain) : := ((ψ : H), T ψ⟫_).re

The expectation value, unfolded as a real part.

lemma expectedValue_eq_re_inner (T : H →ₗ.[] H) (ψ : T.domain) : expectedValue T ψ = ((ψ : H), T ψ⟫_).re := rfl

If T is symmetric, ⟪ψ, Tψ⟫_ℂ is the expectation value, coerced to .

H:Type u_1inst✝¹:NormedAddCommGroup Hinst✝:InnerProductSpace HT:H →ₗ.[] HhT:T.IsSymmetricψ:T.domainh_re:(ψ, T ψ⟫_).re = ψ, T ψ⟫_ψ, T ψ⟫_ = (T.expectedValue ψ) All goals completed! 🐙

Reverse orientation of LinearPMap.expectedValue_eq_inner.

lemma inner_eq_expectedValue (T : H →ₗ.[] H) (hT : T.IsSymmetric) (ψ : T.domain) : (expectedValue T ψ : ) = (ψ : H), T ψ⟫_ := (expectedValue_eq_inner T hT ψ).symm

The centered vector Tψ - ⟨T⟩_ψ ψ.

def centered (T : H →ₗ.[] H) (ψ : T.domain) : H := T ψ - (expectedValue T ψ : ) (ψ : H)

The centered vector, unfolded to its raw expression.

lemma centered_eq (T : H →ₗ.[] H) (ψ : T.domain) : centered T ψ = T ψ - (expectedValue T ψ : ) (ψ : H) := rfl

A centered vector vanishes exactly when Tψ = ⟨T⟩_ψ ψ.

All goals completed! 🐙

For a unit vector and symmetric T, the centered vector is orthogonal to the state.

H:Type u_1inst✝¹:NormedAddCommGroup Hinst✝:InnerProductSpace HT:H →ₗ.[] HhT:T.IsSymmetricψ:T.domainhψ_norm:ψ = 1(T.expectedValue ψ) - (T.expectedValue ψ) * ψ, ψ⟫_ = 0 All goals completed! 🐙

The conjugate orientation of LinearPMap.inner_state_centered_eq_zero.

H:Type u_1inst✝¹:NormedAddCommGroup Hinst✝:InnerProductSpace HT:H →ₗ.[] HhT:T.IsSymmetricψ:T.domainhψ_norm:ψ = 1:ψ, T ψ⟫_ = (T.expectedValue ψ)hμ':T ψ, ψ⟫_ = (T.expectedValue ψ)(T.expectedValue ψ) - (starRingEnd ) (T.expectedValue ψ) * ψ, ψ⟫_ = 0 All goals completed! 🐙