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:‖↑ψ‖ = 1hμ:⟪↑ψ, ↑T ψ⟫_ℂ = ↑(T.expectedValue ψ)hμ':⟪↑T ψ, ↑ψ⟫_ℂ = ↑(T.expectedValue ψ)⊢ ↑(T.expectedValue ψ) - (starRingEnd ℂ) ↑(T.expectedValue ψ) * ⟪↑ψ, ↑ψ⟫_ℂ = 0 All goals completed! 🐙