Download Mathematica notebook · Manual, chapter 11
Start a fresh Mathematica kernel with SNEG installed. Evaluate the cells in order.
Needs["sneg`"]
BCS gap equation at finite temperature
The thermal anomalous average gives the gap equation . Here it is solved for a band with four momenta, , and , at :
snegfermionoperators[ck];
snegrealconstants[Dl, x, T];
snegrealfunctions[xi];
snegmomentumindexes[{k}, Ns];
hk = First[bdghamiltonian[sum[xi[k] number[ck[k]] - Dl (nc[ck[CR, k, UP], ck[CR, -k, DO]] + nc[ck[AN, -k, DO], ck[AN, k, UP]]), {k}], {ck}, k]] /. xi[-k] -> xi[k];
F = FullSimplify[ExpToTrig[gaussianaverage[nc[ck[AN, -k, DO], ck[AN, k, UP]], hk, {ck}, T, "Momentum" -> k] /. xi[k] -> x], Dl > 0 && T > 0 && Element[x, Reals]]
![(Dl Tanh[Sqrt[Dl^2+x^2]/(2 T)])/(2 Sqrt[Dl^2+x^2])](output-1.png)
FindRoot[Dl == 3/4 Sum[F /. {x -> -2 Cos[q] + 1/2, T -> 1/10}, {q, {0, Pi/2, Pi, 3 Pi/2}}], {Dl, 1}]

The same gap follows from the self-consistent mean-field solution of the attractive Hubbard ring with meanfieldsolve.