-- the Dirac operator of a bare nucleus (a hydrogen-like ion) against the Dirac formula Z = 50 G, F, Atom = CalculateAtomicBasisFunctions(Z, {{"Configuration", "1s0 2s0 2p0"}, {"Nucleus", "Point"}}) indices, NF = CreateAtomicIndicesList(Atom.Labels, {{"Kappas", true}}) H0 = NewOperator("Dirac", NF, Z, indices, G, F) -- a point nucleus without options c = PhysicalConstants.cAU.value M = OperatorToMatrix(H0) for i, orb in ipairs(Atom.Orbitals) do local k = indices[i][1] + 1 local gamma = math.sqrt(orb.kappa^2 - (Z/c)^2) local exact = c^2/math.sqrt(1 + (Z/c/(orb.n - math.abs(orb.kappa) + gamma))^2) - c^2 print(string.format("%-6s = %.10f Dirac formula %.10f Hartree", orb.Label, M[k][k], exact)) end