Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| documentation:language_reference:functions:calculateatomicbasisfunctions [2026/11/16 08:24] – Maurits W. Haverkort | documentation:language_reference:functions:calculateatomicbasisfunctions [2026/11/16 23:35] (current) – Maurits W. Haverkort | ||
|---|---|---|---|
| Line 3: | Line 3: | ||
| <color # | <color # | ||
| ;;# | ;;# | ||
| - | |||
| ### | ### | ||
| - | // | + | //G, F, Atom = CalculateAtomicBasisFunctions(Z, |
| ### | ### | ||
| Line 21: | Line 20: | ||
| <code Quanty Example.Quanty> | <code Quanty Example.Quanty> | ||
| -- the Ni atom: the ground-state configuration, | -- the Ni atom: the ground-state configuration, | ||
| - | G, F, x, Atom = CalculateAtomicBasisFunctions(28) | + | G, F, Atom = CalculateAtomicBasisFunctions(28) |
| print(Atom.Configuration, | print(Atom.Configuration, | ||
| Line 56: | Line 55: | ||
| * //Z// : Real, the nuclear charge. | * //Z// : Real, the nuclear charge. | ||
| - | * // | ||
| * Options : (optional) A table of options. Possible options are: | * Options : (optional) A table of options. Possible options are: | ||
| + | * //" | ||
| * //" | * //" | ||
| * //" | * //" | ||
| Line 78: | Line 77: | ||
| ===== Output ===== | ===== Output ===== | ||
| - | * //G// : A table of the large components $P(r) = r g(r)$ of the orbitals, interpolating functions of type //" | + | * //G// : A table of the large components $P(r) = r g(r)$ of the orbitals, |
| - | * //F// : A table of the small components $Q(r) = r f(r)$ (empty without relativity). The functions are normalized as $\int (P^2 + Q^2) \, \mathrm{d}r = 1$. | + | * //F// : A table of the small components $Q(r) = r f(r)$ (empty without relativity). The functions are normalized as $\int (P^2 + Q^2) \, \mathrm{d}r = 1$. Every function returned, also the potentials in //Atom.Potential//, gives the radial points of the quadrature |
| - | * //x// : The radial points of the quadrature. | + | |
| * //Atom// : A table with | * //Atom// : A table with | ||
| - | * //Etot//, //Ekin//, //Eenuc// and // | + | * //Etot//, //Ekin//, //Eenuc// and // |
| * // | * // | ||
| * //Labels// : the labels of the orbitals, in the order of //G// and //F//: all calculated orbitals, ordered by $n$, $l$ and $j$. A selection is made in Lua. | * //Labels// : the labels of the orbitals, in the order of //G// and //F//: all calculated orbitals, ordered by $n$, $l$ and $j$. A selection is made in Lua. | ||
| Line 89: | Line 87: | ||
| * //Zeta// : the spin-orbit coupling constant of every shell returned with both $j$, // | * //Zeta// : the spin-orbit coupling constant of every shell returned with both $j$, // | ||
| * //Nucleus// : the nucleus as a list of options, to pass on to // | * //Nucleus// : the nucleus as a list of options, to pass on to // | ||
| - | * // | + | * // |
| - | * // | + | * // |
| All energies are in Hartree and all lengths in bohr. The speed of light is // | All energies are in Hartree and all lengths in bohr. The speed of light is // | ||
| Line 112: | Line 110: | ||
| <code Quanty Example.Quanty> | <code Quanty Example.Quanty> | ||
| -- Hartree-Fock Slater integrals and spin-orbit coupling of Ni2+ in a 3d8 multiplet calculation | -- Hartree-Fock Slater integrals and spin-orbit coupling of Ni2+ in a 3d8 multiplet calculation | ||
| - | G, F, x, Atom = CalculateAtomicBasisFunctions(28, | + | G, F, Atom = CalculateAtomicBasisFunctions(28, {{" |
| eV = 27.211386 | eV = 27.211386 | ||
| F2 = Atom.SlaterIntegralsNL[" | F2 = Atom.SlaterIntegralsNL[" | ||
| Line 156: | Line 154: | ||
| <code Quanty Example.Quanty> | <code Quanty Example.Quanty> | ||
| -- the full relativistic Hamiltonian of Ne from its own Dirac-Fock orbitals | -- the full relativistic Hamiltonian of Ne from its own Dirac-Fock orbitals | ||
| - | G, F, x, Atom = CalculateAtomicBasisFunctions(10) | + | G, F, Atom = CalculateAtomicBasisFunctions(10) |
| indices, NF = CreateAtomicIndicesList(Atom.Labels, | indices, NF = CreateAtomicIndicesList(Atom.Labels, | ||
| H = NewOperator(" | H = NewOperator(" | ||
| Line 182: | Line 180: | ||
| <code Quanty Example.Quanty> | <code Quanty Example.Quanty> | ||
| -- a confined basis for Fe: all orbitals up to 5s, 4p and 4d, the empty 4p and 4d contracted | -- a confined basis for Fe: all orbitals up to 5s, 4p and 4d, the empty 4p and 4d contracted | ||
| - | G, F, x, Atom = CalculateAtomicBasisFunctions(26, | + | G, F, Atom = CalculateAtomicBasisFunctions(26, {{" |
| {" | {" | ||
| {" | {" | ||
| Line 214: | Line 212: | ||
| ### | ### | ||
| The energies are those of the equation each function was calculated with, including its confinement and its extra charge. // | The energies are those of the equation each function was calculated with, including its confinement and its extra charge. // | ||
| + | ### | ||
| + | |||
| + | ===== The potentials ===== | ||
| + | |||
| + | ### | ||
| + | // | ||
| + | ### | ||
| + | |||
| + | * //rVN// : $r V_N(r)$, the potential of the nucleus. It is $-Z$ for a point nucleus; for a finite nucleus it goes from 0 at the origin to $-Z$ outside the nucleus. | ||
| + | * //rVH// : $r V_H(r)$, the Hartree potential of the electron density. It goes from 0 at the origin to the number of electrons $N$ far from the atom. | ||
| + | * //rVxc// : $r V_{xc}(r)$, the exchange-correlation potential, only in density functional theory. For the gradient corrected functionals //" | ||
| + | |||
| + | ### | ||
| + | $r V(r)$ stays finite at the nucleus and becomes constant far from the atom, where $V$ itself diverges as $1/r$ or goes to 0 slowly. Each potential is a //BSpline// of the degree of the radial functions through its values on the radial points of the quadrature, //G[1].x//. It equals the numbers of the calculation on these points and interpolates between them. The three have the same points and degree, so their sum is again a // | ||
| + | ### | ||
| + | |||
| + | ### | ||
| + | The derivative of a function $f(r) = r V(r)$ is $f'(r) = V(r) + r V' | ||
| + | $$ | ||
| + | V'(r) = \frac{f' | ||
| + | $$ | ||
| + | with //f(r, 1)// for $f' | ||
| + | ### | ||
| + | |||
| + | ### | ||
| + | The potentials of Kr in LDA. $-r V(r)$ is the charge an electron at $r$ sees: the nucleus, screened by the electrons. | ||
| + | ### | ||
| + | |||
| + | <code Quanty Example.Quanty> | ||
| + | -- the potentials of the Kr atom in LDA, as r V(r) | ||
| + | G, F, Atom = CalculateAtomicBasisFunctions(36, | ||
| + | V = Atom.Potential | ||
| + | print(V.rVN.type, | ||
| + | |||
| + | -- the charge an electron sees: the nucleus, screened by the electrons | ||
| + | ZNH = -(V.rVN + V.rVH) | ||
| + | ZKS = -(V.rVN + V.rVH + V.rVxc) | ||
| + | print(" | ||
| + | for _, r in ipairs({0.001, | ||
| + | print(string.format(" | ||
| + | end | ||
| + | |||
| + | eV = 27.211386 | ||
| + | for _, o in ipairs(Atom.Orbitals) do | ||
| + | if o.Label == " | ||
| + | end | ||
| + | |||
| + | -- the plot on a logarithmic r axis | ||
| + | function Curve(f) | ||
| + | local c = {} | ||
| + | for i = 0, 500 do local t = -3 + i*4.5/500; c[i+1] = {t, f(10^t)} end | ||
| + | return c | ||
| + | end | ||
| + | pl = Graphics.Plot({Curve(ZNH), | ||
| + | | ||
| + | {" | ||
| + | | ||
| + | file = io.open(" | ||
| + | file: | ||
| + | file: | ||
| + | </ | ||
| + | |||
| + | <file Quanty_Output Example.out> | ||
| + | BSpline 8 true | ||
| + | r -r(V_N+V_H) | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | energy of the 4p3/2 orbital -9.179 eV | ||
| + | </ | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | ### | ||
| + | The black curve, $-r(V_N + V_H)$, goes from $Z = 36$ at the nucleus to $Z - N = 0$ for the neutral atom. The red curve includes the exchange-correlation potential. Far from the atom an electron sees the positive ion that remains, and the exact Kohn-Sham potential goes to $-1/r$: $-r V$ goes to 1 (the blue line). The LDA potential goes to 0 exponentially instead, because the Hartree potential contains the interaction of every electron with itself, and LDA removes this only in part. The outer electrons are therefore bound too weakly: the energy of the 4p orbital is $-9.2$ eV, while the ionization energy of Kr is 14.0 eV. | ||
| + | ### | ||
| + | |||
| + | ### | ||
| + | The derivative gives the spin-orbit coupling of a nonrelativistic calculation, | ||
| + | $$ | ||
| + | \zeta_{nl} = \frac{1}{2c^2} \int_0^\infty P_{nl}(r)^2 \, \frac{1}{r} \frac{\mathrm{d}V}{\mathrm{d}r} \, \mathrm{d}r, | ||
| + | $$ | ||
| + | here for the 3d shell of Ni. The integrand is made into an interpolating function through the radial points of the quadrature, //x = G[1].x//, and integrated. | ||
| + | ### | ||
| + | |||
| + | <code Quanty Example.Quanty> | ||
| + | -- the spin-orbit coupling of the Ni 3d shell from the derivative of the potential | ||
| + | G, F, Atom = CalculateAtomicBasisFunctions(28, | ||
| + | x = G[1].x | ||
| + | c = Atom.c | ||
| + | rV = Atom.Potential.rVN + Atom.Potential.rVH + Atom.Potential.rVxc | ||
| + | for i, label in ipairs(Atom.Labels) do if label == " | ||
| + | -- zeta = 1/(2c^2) int P^2 (1/r) dV/dr dr, with (1/r) dV/dr = (f'(r) - f(r)/r)/r^2 for f = r V | ||
| + | P, f, df = G[d](x), rV(x), rV(x, 1) | ||
| + | y = {} | ||
| + | for i = 1, #x do y[i] = P[i]^2*(df[i] - f[i]/ | ||
| + | zeta = InterpolatingFunction.Integrate(InterpolatingFunction.BSpline(x, | ||
| + | |||
| + | G, F, Dirac = CalculateAtomicBasisFunctions(28, | ||
| + | eV = 27.211386 | ||
| + | print(string.format(" | ||
| + | </ | ||
| + | |||
| + | <file Quanty_Output Example.out> | ||
| + | zeta(3d) = 0.0974 eV from the Schroedinger potential, 0.0962 eV from the Dirac calculation | ||
| + | </ | ||
| + | |||
| + | ### | ||
| + | The two agree to about 1 %. The Dirac value comes from the splitting of the $3d_{3/2}$ and $3d_{5/2}$ energies and includes the relativistic change of the 3d function. | ||
| ### | ### | ||
| Line 224: | Line 336: | ||
| ===== Table of contents ===== | ===== Table of contents ===== | ||
| {{indexmenu> | {{indexmenu> | ||
| + | |||