-- the Hartree-Fock potential of the [Ar] core of Fe on its 3d and 4s orbitals G, F, Atom = CalculateAtomicBasisFunctions(26) ind, NF = CreateAtomicIndicesList(Atom.Labels, {{"Kappas", true}}) NCore = 7 -- 1s, 2s, 2p1/2, 2p3/2, 3s, 3p1/2, 3p3/2 kappasCore, kappasValence = {}, {} for i = 1, #ind do if i <= NCore then kappasCore[i] = ind.kappas[i] else kappasValence[i - NCore] = ind.kappas[i] end end U = NewOperator("AU", NF, ind, G, F) Ucore = NewOperator("AU", NF, ind, G, F, kappasCore, kappasValence) -- the core filled, without and with one valence electron core = {} for i = 1, NCore do for _, k in ipairs(ind[i]) do core[k + 1] = true end end function Determinant(extra) local s = {} for k = 1, NF do s[k] = (core[k] or k == extra + 1) and "1" or "0" end return NewWavefunction(NF, 0, {{table.concat(s), 1}}) end psiCore = Determinant(-1) for i = NCore + 1, #ind do psi = Determinant(ind[i][1]) print(string.format("%-6s - = %.10f = %.10f Hartree", Atom.Labels[i], psi*U*psi - psiCore*U*psiCore, psi*Ucore*psi)) end