Download Mathematica notebook · Manual, chapter 9
Start a fresh Mathematica kernel with SNEG installed. Evaluate the cells in order.
Needs["sneg`"]
Take and in the Anderson--Holstein atom. In the empty sector the predicted lowest energy is . With a cutoff of two phonons inspect this sector alone. The off-diagonal elements should be and :
snegfermionoperators[d];
ham[n_] := isozsq[d[]]/2 + phononnumber[n] +
nc[number[d[]]-1, phononx[n]]/2;
empty[n_] := First[keyselect[makematricesbzvc[ham[n],
transformtoPH[qsbasisvc[{d[]}],{n}]], {-1,0}]][[2]];
empty[2] // MatrixForm
![(1/2 -(1/2) 0 -(1/2) 3/2 -(1/Sqrt[2]) 0 -(1/Sqrt[2]) 5/2 )](output-1.png)
Increasing the cutoff grows the variational space, so its lowest energy approaches the exact answer from above. High precision resolves a small truncation error that a rounded energy would hide:
rows = Table[With[{e = Min[Eigenvalues[N[empty[n],35]]]},
{n, N[e,8], N[-Log[10,e-1/4],5]}], {n,{1,2,4,8}}];
TableForm[rows, TableHeadings -> {None,{"Cutoff","Energy","-log10(error)"}}]
