Hartree-Fock Hamiltonian, Fock matrix and orbital energies
DefinitionKochHF_HamiltonianLet be a complex matrix (one-body matrix elements) and a complex 4-index array (two-body matrix elements). Following Sec. 3.2 the Hamiltonian with one- and two-body terms is
For a set of occupied reference orbitals (the determinant ):
- (Eq. (65));
- the Fock matrix (Eq. (64)) ;
- the Hartree-Fock orbital energy (Eq. (65)) ;
- the determinant energy .
These definitions are used in the milestones on the Fock matrix, the Hartree-Fock energy, Koopmans' theorem and electron-hole excitation energies.
Formalization Note The occupied orbitals are an arbitrary subset of the reference orbitals rather than the first of them; is defined as the diagonal entry , which is the source's Eq. (65) and coincides with the Fock eigenvalue when is diagonal (self-consistency).
import Mathlib
import Definitions.Def_KochHF_FockSpace
/-!
# The Hartree-Fock Hamiltonian, Fock matrix and orbital energies
E. Koch, *Mean-Field Theory: Hartree-Fock and BCS*, Sec. 3.2 (Hamiltonian before Eq. (64),
Eqs. (64), (65)).
-/
noncomputable section
namespace KochHF
/-- `Ĥ = Σ_{n,m} c†_n T_{nm} c_m + Σ_{n>n', m>m'} c†_n c†_{n'} (U_{nn',mm'} - U_{nn',m'm}) c_{m'} c_m`
(Sec. 3.2). -/
def hamiltonian {K : ℕ} (T : Matrix (Fin K) (Fin K) ℂ) (U : Fin K → Fin K → Fin K → Fin K → ℂ) :
FockOp K :=
(∑ n, ∑ m, T n m • (cdag n * cann m)) +
∑ n, ∑ n', ∑ m, ∑ m',
if n' < n ∧ m' < m then
(U n n' m m' - U n n' m' m) • (cdag n * cdag n' * cann m' * cann m)
else 0
/-- `Δ_{mm'} = U_{mm',mm'} - U_{mm',m'm}` (Eq. (65)). -/
def hfDelta {K : ℕ} (U : Fin K → Fin K → Fin K → Fin K → ℂ) (m m' : Fin K) : ℂ :=
U m m' m m' - U m m' m' m
/-- Fock matrix of the determinant with occupied reference orbitals `S` (Eq. (64)):
`F_{nm} = T_{nm} + Σ_{m' ∈ S} (U_{nm',mm'} - U_{nm',m'm})`. -/
def fockMatrix {K : ℕ} (T : Matrix (Fin K) (Fin K) ℂ) (U : Fin K → Fin K → Fin K → Fin K → ℂ)
(S : Finset (Fin K)) (n m : Fin K) : ℂ :=
T n m + ∑ m' ∈ S, (U n m' m m' - U n m' m' m)
/-- Hartree-Fock orbital energy `ε_m = F_{mm} = T_{mm} + Σ_{m' ∈ S} Δ_{mm'}` (Eq. (65)). -/
def hfOrbitalEnergy {K : ℕ} (T : Matrix (Fin K) (Fin K) ℂ)
(U : Fin K → Fin K → Fin K → Fin K → ℂ) (S : Finset (Fin K)) (m : Fin K) : ℂ :=
fockMatrix T U S m m
/-- Energy expectation value `⟨S|Ĥ|S⟩` of the Slater determinant `|S⟩ = Π_{m ∈ S} c†_m |0⟩`
of reference orbitals. -/
def detEnergy {K : ℕ} (T : Matrix (Fin K) (Fin K) ℂ) (U : Fin K → Fin K → Fin K → Fin K → ℂ)
(S : Finset (Fin K)) : ℂ :=
matEl (basisState S) (hamiltonian T U) (basisState S)
end KochHF
end
Read-back
What the Lean code literally says, in plain math · Aristotle (Harmonic) — NON-BLIND: same agent that drafted the statements
Non-blind read-back — not independent testimony. This read-back was written by the same agent that drafted the Lean statement, with full knowledge of the source text and of the intended meaning. It is not a blind audit and must not be mistaken for independent testimony; reviewers should compare the Lean code against the source themselves.
Parameters: , an arbitrary complex matrix , and an arbitrary function of four indices in with complex values (no symmetry or hermiticity is imposed in this file). Using the creators , annihilators and basis states of the Fock-space definition file:
- , where all four indices range over and the bracket is if the condition holds and otherwise.
- .
- For a finite set : , and .
- , the diagonal matrix element of in the basis state .
For the sums over are empty, so .
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.