Imports
/- Copyright (c) 2025 Joseph Tooby-Smith. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joseph Tooby-Smith -/ module public import Physlib.QuantumMechanics.Operators.OneDimension.Parity public import Physlib.QuantumMechanics.Operators.OneDimension.Momentum public import Physlib.QuantumMechanics.Operators.OneDimension.Position

1d Harmonic Oscillator

The quantum harmonic oscillator in 1d. This file contains

    the definition of the Schrodinger operator

    the definition of eigenfunctions and eigenvalues of the Schrodinger operator in terms of Hermite polynomials

    proof that eigenfunctions and eigenvalues are indeed eigenfunctions and eigenvalues.

TODO "Generalize 1d harmonic oscillator to d dimensions and SpaceDHilbertSpace."@[expose] public section

Some preliminary results about Complex.ofReal .

To be moved.

lemma Complex.ofReal_hasDerivAt : HasDerivAt Complex.ofReal 1 x := x:HasDerivAt ofReal 1 x x:f1: := idHasDerivAt ofReal 1 x x:f1: := idHasDerivAt (f1 ofReal) 1 x x:f1: := idHasDerivAt f1 1 x x:f1: := idHasDerivAt id 1 x All goals completed! 🐙@[simp] lemma Complex.deriv_ofReal : deriv Complex.ofReal x = 1 := x:deriv ofReal x = 1 All goals completed! 🐙@[fun_prop] lemma Complex.differentiableAt_ofReal : DifferentiableAt Complex.ofReal x := x:DifferentiableAt ofReal x All goals completed! 🐙

The 1d Harmonic Oscillator

A quantum harmonic oscillator specified by a three real parameters: the mass of the particle m, a value of Planck's constant , and an angular frequency ω. All three of these parameters are assumed to be positive.

The mass of the particle.

The angular frequency of the harmonic oscillator.

structure HarmonicOscillator where m : ω : : 0 < ω hm : 0 < m
@[simp] lemma m_pos : 0 < Q.m := Q.hm@[simp] lemma m_nonneg : 0 Q.m := Q.hm.le@[simp] lemma m_ne_zero : Q.m 0 := Q.hm.ne'@[simp] lemma ω_pos : 0 < Q.ω := Q.@[simp] lemma ω_nonneg : 0 Q.ω := Q..le@[simp] lemma ω_ne_zero : Q.ω 0 := Q..ne'

The characteristic length

lemma ξ_nonneg : 0 Q.ξ := Real.sqrt_nonneg _Q:HarmonicOscillator0 < ( / (Q.m * Q.ω)) Q:HarmonicOscillator0 < / (Q.m * Q.ω) Q:HarmonicOscillator0 < Q:HarmonicOscillator0 < Q.m * Q.ω Q:HarmonicOscillator0 < All goals completed! 🐙 Q:HarmonicOscillator0 < Q.m * Q.ω All goals completed! 🐙@[simp] lemma ξ_ne_zero : Q.ξ 0 := Ne.symm (_root_.ne_of_lt Q.ξ_pos)Q:HarmonicOscillator( / (Q.m * Q.ω)) ^ 2 = / (Q.m * Q.ω) Q:HarmonicOscillator0 / (Q.m * Q.ω) Q:HarmonicOscillator0 Q:HarmonicOscillator0 Q.m * Q.ω Q:HarmonicOscillator0 All goals completed! 🐙 Q:HarmonicOscillator0 Q.m * Q.ω All goals completed! 🐙@[simp] lemma ξ_abs : abs Q.ξ = Q.ξ := abs_of_nonneg Q.ξ_nonnegQ:HarmonicOscillatorthis:0 < ( / (Q.m * Q.ω))⁻¹ = (Q.m * Q.ω / ) All goals completed! 🐙Q:HarmonicOscillator1 / Q.ξ = (Q.m * Q.ω / ) All goals completed! 🐙Q:HarmonicOscillator(Q.m * Q.ω / ) ^ 2 = Q.m * Q.ω / exact Real.sq_sqrt (Q:HarmonicOscillator0 Q.m * Q.ω / All goals completed! 🐙)@[inherit_doc momentumOperator] scoped[QuantumMechanics.OneDimension.HarmonicOscillator] notation "Pᵒᵖ" => momentumOperator@[inherit_doc positionOperator] scoped[QuantumMechanics.OneDimension.HarmonicOscillator] notation "Xᵒᵖ" => positionOperatorlemma schrodingerOperator_eq (ψ : ) : Q.schrodingerOperator ψ = (- ^ 2 / (2 * Q.m)) (deriv (deriv ψ)) + (1/2 * Q.m * Q.ω^2) ((fun x => Complex.ofReal x ^2) * ψ) := Q:HarmonicOscillatorψ: Q.schrodingerOperator ψ = (- ^ 2 / (2 * Q.m)) deriv (deriv ψ) + (1 / 2 * Q.m * Q.ω ^ 2) ((fun x => x ^ 2) * ψ) Q:HarmonicOscillatorψ: x:Q.schrodingerOperator ψ x = ((- ^ 2 / (2 * Q.m)) deriv (deriv ψ) + (1 / 2 * Q.m * Q.ω ^ 2) ((fun x => x ^ 2) * ψ)) x Q:HarmonicOscillatorψ: x:2⁻¹ * Q.m * Q.ω ^ 2 * x ^ 2 * ψ x = 2⁻¹ * Q.m * Q.ω ^ 2 * (x ^ 2 * ψ x) All goals completed! 🐙

The schrodinger operator written in terms of ξ.

lemma schrodingerOperator_eq_ξ (ψ : ) : Q.schrodingerOperator ψ = fun x => ( ^2 / (2 * Q.m)) * (- (deriv (deriv ψ) x) + (1/Q.ξ^2)^2 * x^2 * ψ x) := Q:HarmonicOscillatorψ: Q.schrodingerOperator ψ = fun x => ^ 2 / (2 * Q.m) * (-deriv (deriv ψ) x + (1 / Q.ξ ^ 2) ^ 2 * x ^ 2 * ψ x) Q:HarmonicOscillatorψ: x:Q.schrodingerOperator ψ x = ^ 2 / (2 * Q.m) * (-deriv (deriv ψ) x + (1 / Q.ξ ^ 2) ^ 2 * x ^ 2 * ψ x) Q:HarmonicOscillatorψ: x:-( ^ 2) / (2 * Q.m) * deriv (deriv ψ) x + 2⁻¹ * Q.m * (Q.ω ^ 2) * ((x ^ 2) * ψ x) = ( ^ 2) / (2 * Q.m) * (-deriv (deriv ψ) x + (Q.m * Q.ω / ) ^ 2 * (x ^ 2) * ψ x) Q:HarmonicOscillatorψ: x:this:Q.m 0-( ^ 2) / (2 * Q.m) * deriv (deriv ψ) x + 2⁻¹ * Q.m * (Q.ω ^ 2) * ((x ^ 2) * ψ x) = ( ^ 2) / (2 * Q.m) * (-deriv (deriv ψ) x + (Q.m * Q.ω / ) ^ 2 * (x ^ 2) * ψ x) Q:HarmonicOscillatorψ: x:this✝:Q.m 0this: 0-( ^ 2) / (2 * Q.m) * deriv (deriv ψ) x + 2⁻¹ * Q.m * (Q.ω ^ 2) * ((x ^ 2) * ψ x) = ( ^ 2) / (2 * Q.m) * (-deriv (deriv ψ) x + (Q.m * Q.ω / ) ^ 2 * (x ^ 2) * ψ x) Q:HarmonicOscillatorψ: x:this✝:Q.m 0this: 0(-(( ^ 2) * deriv (deriv ψ) x) + Q.m ^ 2 * (Q.ω ^ 2) * (x ^ 2) * ψ x) * ^ 2 = ( ^ 2) * (-(deriv (deriv ψ) x * ^ 2) + Q.m ^ 2 * (x ^ 2) * ψ x * Q.ω ^ 2) Q:HarmonicOscillatorψ: x:this✝:Q.m 0this: 0(-( ^ 2 * deriv (deriv ψ) x) + Q.m ^ 2 * Q.ω ^ 2 * x ^ 2 * ψ x) * ^ 2 = ^ 2 * (-(deriv (deriv ψ) x * ^ 2) + Q.m ^ 2 * x ^ 2 * ψ x * Q.ω ^ 2) All goals completed! 🐙

The Schrodinger operator commutes with the parity operator.

Q:HarmonicOscillatorψ: x:this: (ψ : ), (fun x => deriv (fun x => ψ (-x)) x) = fun x => -deriv ψ (-x)Q.schrodingerOperator (parityOperator ψ) x = parityOperator (Q.schrodingerOperator ψ) x All goals completed! 🐙

The Schrodinger operator is additive.

Q:HarmonicOscillatorψ: φ: :Differentiable ψhψ':Differentiable (deriv ψ):Differentiable φhφ':Differentiable (deriv φ)x:h_deriv_add:deriv (ψ + φ) = deriv ψ + deriv φ- ^ 2 / (2 * Q.m) * (deriv (deriv ψ) x + deriv (deriv φ) x) + 1 / 2 * Q.m * Q.ω ^ 2 * x ^ 2 * (ψ + φ) x = ((fun x => - ^ 2 / (2 * Q.m) * deriv (deriv ψ) x + 1 / 2 * Q.m * Q.ω ^ 2 * x ^ 2 * ψ x) + fun x => - ^ 2 / (2 * Q.m) * deriv (deriv φ) x + 1 / 2 * Q.m * Q.ω ^ 2 * x ^ 2 * φ x) x Q:HarmonicOscillatorψ: φ: :Differentiable ψhψ':Differentiable (deriv ψ):Differentiable φhφ':Differentiable (deriv φ)x:h_deriv_add:deriv (ψ + φ) = deriv ψ + deriv φ- ^ 2 / (2 * Q.m) * (deriv (deriv ψ) x + deriv (deriv φ) x) + 1 / 2 * Q.m * Q.ω ^ 2 * x ^ 2 * (ψ x + φ x) = - ^ 2 / (2 * Q.m) * deriv (deriv ψ) x + 1 / 2 * Q.m * Q.ω ^ 2 * x ^ 2 * ψ x + (- ^ 2 / (2 * Q.m) * deriv (deriv φ) x + 1 / 2 * Q.m * Q.ω ^ 2 * x ^ 2 * φ x) All goals completed! 🐙

The Schrodinger operator is homogeneous.

Q:HarmonicOscillatorc:ψ: :Differentiable ψhψ':Differentiable (deriv ψ)x:h_deriv_smul:deriv (c ψ) = c deriv ψ- ^ 2 / (2 * Q.m) * c deriv (deriv ψ) x + 1 / 2 * Q.m * Q.ω ^ 2 * x ^ 2 * (c ψ) x = (c fun x => - ^ 2 / (2 * Q.m) * deriv (deriv ψ) x + 1 / 2 * Q.m * Q.ω ^ 2 * x ^ 2 * ψ x) x Q:HarmonicOscillatorc:ψ: :Differentiable ψhψ':Differentiable (deriv ψ)x:h_deriv_smul:deriv (c ψ) = c deriv ψ- ^ 2 / (2 * Q.m) * (c * deriv (deriv ψ) x) + 1 / 2 * Q.m * Q.ω ^ 2 * x ^ 2 * (c * ψ x) = c * (- ^ 2 / (2 * Q.m) * deriv (deriv ψ) x + 1 / 2 * Q.m * Q.ω ^ 2 * x ^ 2 * ψ x) All goals completed! 🐙