Wick’s theorem for fermions in Mathematica

Use second-quantized fermionic operators and Wick contractions to derive the direct Hartree and exchange Fock terms for a filled Fermi sea.


Download Mathematica notebook · Manual, chapter 6

Start a fresh Mathematica kernel with SNEG installed. Evaluate the cells in order.

Needs["sneg`"]

Hartree-Fock energy. In a Slater determinant, the expectation value of the two-particle operator splits into the direct (Hartree) and the exchange (Fock) terms, 〈 c 1 ⁢ σ † ⁢ c 2 ⁢ σ ′ † ⁢ c 3 ⁢ σ ′ ⁢ c 4 ⁢ σ 〉 = n 1 ⁢ n 2 ( δ 14 ⁢ δ 23 - δ σ ⁢ σ ′ ⁢ δ 13 ⁢ δ 24 ) :

snegfermionoperators[c];
ordering[c] = SEA;
snegfreeindexes[k1, k2, k3, k4, s1, s2];
SimplifyKD[vevwick[nc[c[CR, k1, s1], c[CR, k2, s2], c[AN, k3, s2], c[AN, k4, s1]]]]
Out[4]=
(Subscript[\[Delta], k1,k4] Subscript[\[Delta], k2,k3]-Subscript[\[Delta], k1,k3] Subscript[\[Delta], k2,k4] Subscript[\[Delta], s1,s2]) UnitStep[-k1] UnitStep[-k2]

For the electron gas with H int = 1 2 ⁢ V ∑ kpqσ ⁢ σ ′ V q ⁢ c k + q ⁢   σ † ⁢ c p - q ⁢   σ ′ † ⁢ c p ⁢ σ ′ ⁢ c kσ , the direct term requires q = 0 (it cancels against the positive background), and the exchange term gives E x = - 1 2 ⁢ V ∑ kqσ V q ⁢ n k ⁢ n k + q .