1 Introduction

The Hartree–Fock (HF) approximation [1,2,3,4,5] provides a simple description of a many-electron system in terms of one-electron spin-orbitals. It explicitly accounts for the fermionic character of electrons by using the determinantal form of the many-electron wavefunction, though it neglects the correlations due to their mutual Coulomb interactions. The Slater determinants (or their combinations, for open-shell systems [6]) obtained for ground and excited states in the HF approximation are usually a good starting point in more sophisticated quantum-mechanical calculations which include electron correlations, like the Møller–Plesset perturbation theory [7], the coupled-cluster approach [8] or the quantum Monte-Carlo (QMC) method [9].

The HF one-electron spin-orbitals and their energies satisfy the HF equation including the Hartree (direct Coulomb) potential and the non-local (integral) exchange operator which both depend on the orbitals themselves. The equation takes the simplest form in the restricted HF method for the closed-shell systems where the orbitals are doubly occupied and the valence shell is fully filled. The accurate numerical solution of this eigenvalue equation for atoms with closed (sub)shells is the main focus of the present paper. The extension of the restricted HF method to open-shell systems [6, 10, 11] results in the Hamiltonians (Fock operators) which are different for each atomic subshell. As a result, the respective HF equations include off-diagonal Lagrange multipliers so they are not eigenvalue equations. Alternatively, these equations can be transformed into an eigenvalue problem by introducing a unified coupling operator, common for all the atomic orbitals with the same orbital number. However, this operator is not unique and its dependence on orbitals is more complex than for the Fock operator.

The HF integro-differential equation is usually solved by representing molecular orbitals in an atomic orbital basis (of Gaussian or Slater type) and subsequent diagonalization the resultant Roothan algebraic eigenvalue equations [6]. However, in the case of atoms and small molecules, alternative numerical methods based on finite-difference [12,13,14,15,16,17,18], spline [19,20,21,22,23,24], finite-element [25] or wavelet [26] representations are also feasible. The so obtained orbitals and their energies can be highly accurate and can serve for comparison with less accurate results obtained in calculations with orbital bases. The numerically obtained orbitals have also been used when a high accuracy is required, like in studies of the node structure of the HF orbitals [27]. This structure has an important role in the QMC calculations due to the fermion sign problem [28] since it is often assumed that the nodal surfaces of the correlated wavefunction are fixed at those of the trial HF wavefunction [9].

A very accurate solution is also possible in the case of the many-electron Schrödinger equation, with a numerical effort much smaller than in the full configuration-interaction variational approach. The iterative complement interaction (ICI) method proposed by Nakatsuji [29,30,31] takes advantage of the analytical form of the many-electron Hamiltonian and finds an analytical expansion of the many-electron wavefunction, with potentially arbitrarily high accuracy, by an iteration using of a suitably scaled Schrödinger equation. The total energies with 7 to 16 significant digits have thus been obtained for small atoms and molecules [31,32,33] and the remarkable 43-digit accuracy has been reached for the total energy of the He atom [34]. However, the ICI method is not suitable for determining the HF many-electron wavefunction (though this function can be used as a initial guess [34]) since the applied iteration would not preserve its determinantal form required in the HF approximation. Also, an application of this method to solve the herein investigated HF equation for one-electron orbitals is hindered by the presence of the non-analytical (Hartree and exchange) terms in the Fock operator.

Numerical solution of differential equations can also be obtained with the pseudospectral (PS) method which is based on a combination of the spectral and real-space representations. It has been found to be very accurate in solving one-dimensional Schrödinger equation [35,36,37,38,39,40], in particular the Kohn-Sham (KS) equation for atoms [41, 42] described with the density functional theory (DFT). The KS equation includes only the local (multiplicative) effective potential which makes the application of the PS method straightforward once suitable scaling is applied. The presence of the non-local orbital-dependent exchange operator in the HF equation makes the application of the PS method more complex. The approach proposed by Friesner [43, 44] over three decades ago combines expressing molecular orbitals in an atomic basis with the use of the PS representation for calculating the Coulomb integrals with a real-space quadrature. Although this approach was successfully applied to polyatomic molecules [45, 46], it does not provide the PS solution of the HF equation using the real-space representation of the orbitals and its accuracy depends on the applied basis. The purely PS representation of the HF equation has previously been formulated for atoms in intense magnetic fields using two-dimensional real-space grid in cylindrical coordinates [47] but its application was limited to helium and lithium atoms [48].

The present paper derives the one-dimensional (radial) PS representation of the HF equation for atoms at zero magnetic field and applies it to closed-(sub)shell atoms with the atomic number up to \(Z=102\). The developed method is different from Friesner’s approach since the HF orbitals are now represented directly by their values on a spatial grid which are found by solving the discretized (algebraic) HF equation. The use of the PS representation provides very high accuracy of the resulting orbitals for a moderate number of grid points. This accuracy is further enhanced when the precision of the floating-point format used in the calculations is extended from double to quadruple. The obtained results (orbitals and their energies, total energy and its components, the virial ratio, and the quotient defining the Kato cusp condition at the nucleus) are compared with the results of previous numerical HF calculations, in particular by Bunge et al. [49] and Tatewaki et al. [50] who have obtained the total energies of atoms with ten-digit accuracy using the HF code by Froese Fischer [13, 14]. The comparison is also done with the results of the Roothan–Hartree–Fock (RHF) calculations based on the expansions of the orbitals in the Slater-type basis [51, 52] and in the B-spline basis [21]. The latter basis is formed of specific splines which are piecewise functions composed of polynomials of a small order M and each of these basis functions vanishes outside a radial interval including exactly M neighbouring knots while different functions correspond to different intervals.

The present method for the PS solution of the HF-like equations was already used for investigating the DFT exchange potential in the previous works by the present author [53, 54]. In particular, the very high accuracy of this method was crucial for determining the correct dependence of the orbital-specific HF exchange potentials at large distances r from the nucleus in atoms. Surprisingly, this dependence is given by \(c_1+c_2/r\) with constants \(c_1<0\) and \(c_2>0\) for most orbitals, with the sole exceptions of the highest occupied orbital (HOMO) and atoms with s occupied orbitals only [53, 55]. However, other results for the HF atomic ground states and the actual PS formalism for the HF equation were not reported therein.

2 Theory

2.1 Hartree–Fock equation

In the unrestricted HF theory the many-electron wave function \(\varPsi\) describing a system of \(N_{\mathrm{el}}\) interacting electrons moving in an external potential \(v_{\text {ext}}(\mathbf{r}\)) is approximated by a single Slater determinant built of one-electron spin-orbitals \(\phi _{a\sigma }(\mathbf{r})\) (\(a=1,\ldots ,N_{\mathrm{el}}^{\sigma }\), \(N_{\mathrm{el}}^{\uparrow }+N_{\mathrm{el}}^{\downarrow }=N_{\mathrm{el}}\)) dependent on the electron spin \(\sigma\) (\(\uparrow\) or \(\downarrow\)) and the electron position \(\mathbf{r}\). In the ground state, these occupied (occ) orbitals \(\phi _{a\sigma }(\mathbf{r})\) and their energies \(\epsilon _{a\sigma }\) satisfy the HF equation

$$\begin{aligned} \Bigl [ -\frac{1}{2}\varvec{\nabla }^2 + v_{\text {ext}}(\mathbf{r})+ v_{\text {H}}(\mathbf{r})+ {\hat{v}}_{\text {x}\sigma }^{\text {F}}(\mathbf{r}) \Bigr ] \phi _{a\sigma }(\mathbf{r}) = \epsilon _{a\sigma } \phi _{a\sigma }(\mathbf{r}) \end{aligned}$$
(1)

obtained by minimizing the mean value \(\langle \varPsi |{{\hat{H}}}|\varPsi \rangle\) of the system Hamiltonian \({{\hat{H}}}\) over the subspace of normalized determinants \(\varPsi\). This equation includes the Hartree potential \(v_{\text {H}}(\mathbf{r})\) and the external potential \(v_{\text {ext}}(\mathbf{r})\) which are due to the electrostatic interaction between the electrons and their interaction with the external field of the atomic nuclei, respectively. The non-local Fock exchange operator \({\hat{v}}_{\text {x}\sigma }^{\text {F}}(\mathbf{r})\) is built of the occupied HF orbitals \(\phi _{a\sigma }\) (\(a=1,\ldots ,N_{\mathrm{el}}^{\sigma }\)) with spin \(\sigma\) and its action on an one-electron wave function \(\phi (\mathbf{r})\) yields [5]

$$\begin{aligned} {\hat{v}}_{\text {x}\sigma }^{\text {F}}(\mathbf{r}) \, \phi (\mathbf{r}) = -\sum _{b=1}^{N_{\mathrm{el}}^{\sigma }} \phi _{b\sigma } (\mathbf{r}) \int d \mathbf{r'}\, \frac{\phi _{b\sigma }^{*} (\mathbf{r}')\phi (\mathbf{r}')}{|\mathbf{r}'-\mathbf{r}|} \, . \end{aligned}$$
(2)

The Hartree potential \(v_{\text {H}}(\mathbf{r})=\int d\, \mathbf{r'} n_{\text {tot}}(\mathbf{r'})/|\mathbf{r}'-r|\) is found with the total electron density \(n_{\text {tot}}(\mathbf{r})=n_{\uparrow }(\mathbf{r})+n_{\downarrow }(\mathbf{r})\), given by the sum of the spin-projected densities \(n_{\sigma }(\mathbf{r})=\sum _{a=1}^{N_{\mathrm{el}}^{\sigma }} |\phi _{a\sigma }(\mathbf{r})|^2\). The HF equation needs to be solved selfconsistently. For sake of simplicity, the present paper considers closed-(sub)shell systems for which the orbitals \(\phi _{a\sigma }(\mathbf{r})=\phi _{a}(\mathbf{r})\) are the same for both spin directions and they are doubly occupied: \(N_{\mathrm{el}}^{\uparrow }=N_{\mathrm{el}}^{\downarrow }=N_{\mathrm{el}}/2\). This corresponds to the restricted HF method where the HF equation is common for the two spins so that the spin label \(\sigma\) can be skipped hereafter.

For a closed-(sub)shell atom in its ground state, the Fock exchange operator, acting on an atomic orbital \(\phi _a(\mathbf{r})=r^{-1}\chi _{nl}(r) Y_{lm}(\theta ,\varphi )\) (\(a\equiv nlm\)), yields

$$\begin{aligned} {\hat{v}}_{\text {x}}^{\text {F}}(\mathbf{r})\phi _a(\mathbf{r}) = r^{-1} F_{\text {x};nl}(r) \, Y_{lm}(\theta ,\phi ) \end{aligned}$$
(3)

where \(Y_{lm}(\theta ,\varphi )\) is the spherical harmonic and n, l, m are the principal, orbital, and magnetic quantum numbers, respectively. The factor

$$\begin{aligned} F_{\text {x};nl}(r) = \sum _{n'l'}^{\text {occ}} \mathop {{\sum }'}\limits _{l''=|l-l'|}^{l+l'} c(l,l',l'') \chi _{n'l'}(r) \ v_{l''}(n'l',nl;r) \end{aligned}$$
(4)

(where the step in the summation over \(l''\) is 2 which is marked with the prime next to the sum symbol) is defined [5] with the functions

$$\begin{aligned} v_{l''}(n'l',nl;r) = - \int _{0}^{\infty } dr' \frac{r_{<}^{l''}}{r_{>}^{l''+1}} \, , \chi _{n'l'}(r')\chi _{nl}(r') \end{aligned}$$
(5)

where \(r_{<}=\min (r,r')\), \(r_{>}=\max (r,r')\), and the Gaunt coefficients

$$\begin{aligned} c(l,l',l'')=(2l'+1) \left( \begin{array}{c c c} l &{} l' &{} l'' \\ 0 &{} 0 &{} 0 \\ \end{array} \right) ^{2} \end{aligned}$$
(6)

which are expressed in terms of the 3j Wigner symbols [5, 56]. The Hartree potential

$$\begin{aligned} v_{\text {H}}(r) = \int _{0}^{\infty } dr' \frac{\rho _{\text {tot}}(r') }{r_{>}} \end{aligned}$$
(7)

depends on the total radial density

$$\begin{aligned} \rho _{\text {tot}}(r)=2\sum _{nl}^{\text {occ}} (2l+1) \chi _{nl}^2(r)\, . \end{aligned}$$
(8)

The resulting HF equation for the radial orbitals \(\chi _{nl}(r)\) reads

$$\begin{aligned} \left[ -\frac{1}{2} \frac{d\,^2}{d\,r^2} +\frac{l(l+1)}{2r^2} + v_{\text {ext}}(r) +v_{\text {H}}(r) \right] \chi _{nl}(r) + F_{\text {x};nl}(r) = \epsilon _{nl} \chi _{nl}(r) \, . \end{aligned}$$
(9)

Note that both the angular and radial parts of the atomic orbitals \(\phi _a(\mathbf{r})\) are normalized to unity so that we have \(\int _0^{\infty } dr\, \chi ^2_{nl}(r)=1\) and, accordingly, the radial density (8) present in Eq. (7) integrates to the total number of electrons, \(\int _0^{\infty } dr\, \rho _{\text {tot}}(r)= 2\sum _{nl}^{\text {occ}} (2l+1)= N_{\text {el}}\).

In numerical calculations on a finite grid the functions \(v_{l''}(n'l',nl;r)\) defining the Fock exchange operator and the Hartree potential \(v_{\text {H}}(r)\) can be conveniently found by solving the corresponding Poisson equations

$$\begin{aligned}&\left[ \frac{d\,^2 }{d\,r^2} - \frac{l''(l''+1)}{r^2} \right] { {{{\tilde{v}}}}_{l''}(r) } = \frac{2l''+1}{r} \chi _{n'l'}(r) \chi _{nl}(r) \, , \end{aligned}$$
(10)
$$\begin{aligned}&\frac{d\,^2 {{{\tilde{v}}}}_{\text {H}}(r)}{d\,r^2} = - \frac{\rho _{\text {tot}}(r)}{r} \, . \end{aligned}$$
(11)

These equations, which originally included the radial part \(r^{-1}[d^2/dr^2]r\) of the Laplacian, have been multiplied by r on both sides, and, simultaneously, the modified quantities

$$\begin{aligned} {{{\tilde{v}}}}_{l''}(r)={\tilde{v}}_{l''}(n'l',nl;r)=r v_{l''}(n'l',nl;r) \end{aligned}$$
(12)

and \({{{\tilde{v}}}}_{\text {H}}(r)= r v_{\text {H}}(r)\) have been introduced. In a similar way, the Eq. (9) for the radial orbitals is obtained from the HF Eq. (1) after multiplying its both sides by r.

In the present paper, the Poisson and HF equations are solved numerically with the PS method in a similar way as it is done for the KS equation in the previous works [35, 41, 42].

2.2 Pseudospectral method—general considerations

The PS method [57, 58] is based on the (approximate) representation of a sought quantity f(x), depending on a variable x, as a linear combination

$$\begin{aligned} f(x)=\sum _{j=0}^N f(x_j) g_j(x) \end{aligned}$$
(13)

of cardinal functions \(g_j(x)\) where the expansion coefficients are values of f(x) at the grid points \(x_j\) (\(j=0,\ldots ,N\)). For boundary value problems the Lobatto-type grid is usually adopted so that the points \(x_1,\ldots ,x_{N-1}\) are defined as the zeros (nodes) of the derivative \(P'_N(x)\) of a polynomial of a high order N. In present work, the Legendre polynomials \(P_N(x)\) with N up to 200 are used and the zeros of \(P'_N(x)\) are found numerically with the subroutine ZELEGL by D. Funaro [59]; the two end (boundary) grid points used in Eq. (13) are \(x_0=-1\), \(x_N=1\).

The cardinal functions are the polynomials of order N that satisfy the relations

$$\begin{aligned} g_j(x_i)=\delta _{ij} \end{aligned}$$
(14)

(\(i,j=0,\ldots ,N\)). This makes the representation (13) accurate at all the grid points \(x_i\) while it is approximate for a general point \(x\in [-1,1]\). The cardinal functions are in fact Lagrange basis polynomials but they can be simply expressed in terms of the polynomial \(P_N(x)\) as [35, 41, 57]

$$\begin{aligned} g_j(x)= \frac{-1}{N(N+1)P_N(x_j)}\frac{(1-x^2)P'_N(x)}{x-x_j} \, . \end{aligned}$$
(15)

The PS solution of the HF problem also requires the values of the second derivative of the cardinal functions at the grid points [35, 60],

$$\begin{aligned} g''_j(x_i) &= {\tilde{g}}''_j(x_i) \frac{P_N(x_i)}{P_N(x_j)} \, , \end{aligned}$$
(16)
$$\begin{aligned} {\tilde{g}}''_j(x_i)= & {} \left\{ \begin{array}{lr} -\frac{1}{3} N(N+1)/(1-x_i^2) \,, &{} i=j \\ -2/(x_i-x_j)^2 \,, &{} i\ne j \end{array} \right. \end{aligned}$$
(17)

(\(i=1,\ldots ,N-1\), \(j=1,\ldots ,N-1\)) ; note that \({\tilde{g}}''_j(x_i) ={\tilde{g}}''_i(x_j)\). Their first derivative is needed in the calculation of the kinetic energy (see Sect. 2.5) and it is expressed as follows [57]

$$\begin{aligned} g'_j(x_i) &= {\tilde{g}}'_j(x_i) \frac{P_N(x_i)}{P_N(x_j)} \, , \end{aligned}$$
(18)
$$\begin{aligned} {\tilde{g}}'_j(x_i)= & {} \left\{ \begin{array}{lr} \frac{1}{4} N(N+1) \,, &{} i=j=0 \\ -\frac{1}{4} N(N+1) \,, &{} i=j=N \\ 0 \,, &{} i=j \,\text { and } \, 1\le j \le N-1 \\ 1/(x_i-x_j) \,, &{} i\ne j \end{array} \right. \end{aligned}$$
(19)

If the value of calculated function f(x) needs to be determined also at x points between the grid points, the original definition of \(g_j(x)\), Eq. (15), can be replaced with an equivalent expression

$$\begin{aligned} g_j(x)= -\frac{1}{N(N+1)P_N^2(x_j)} \left[ N P_N(x_j)P_N(x) + \sum _{k=0}^{N-1} (2k+1)P_k(x_j)P_k(x) \right] \end{aligned}$$
(20)

which is the expansion of the cardinal function in terms of the Legendre polynomials and does not include the denominator \(x-x_j\), troublesome at x close to \(x_j\). This expression is obtained from the summation formula [61]

$$\begin{aligned} \sum _{k=0}^{N-1} (2k+1)P_k(a)P_k(x) = \frac{N}{a-x} \left[ P_{N}(a)P_{N-1}(x) - P_{N-1}(a)P_{N}(x) \right] \end{aligned}$$
(21)

(valid for any x and a, in particular for \(a=x_j\)) combined with the identity [57]

$$\begin{aligned} (x^2-1)P'_N(x)=N \left( x P_{N}(x) - P_{N-1}(x) \right) \, . \end{aligned}$$
(22)

applied for any x, and, separately, at the grid points \(x=x_j\) where the function \((1-x^2)P'_N(x)\) vanishes for all \(j=0,\ldots ,N\). To the author’s best knowledge, the formula (20) has not been reported before. Its computational cost is similar to that of the original expression (15) for \(g_j(x)\) since the recurrence relations that are used to find \(P'_N(x)\) simultaneously yield \(P_k(x)\), \(k=1,\ldots ,N\).

The grid points \(x_j\) can also be used as the nodes of the highly accurate Gauss-Legendre-Lobatto (GLL) quadrature

$$\begin{aligned} \int _{-1}^1 f(x) dx = \sum _{i=0}^N w_i f(x_i) \end{aligned}$$
(23)

where the weights are defined as [57]

$$\begin{aligned} w_i =\frac{2}{N(N+1)[P_N(x_j)]^2} \, . \end{aligned}$$
(24)

The GLL quadrature is used for numerical integration in this work. For this purpose the integral of a function q(r) over r is first transformed to \(\int _{-1}^{1} f(x) dx\), where \(f(x)={\dot{r}}(x) q(r(x))\) and \({\dot{r}}=dr/dx\), by applying the following mapping \([-1,1] \ni x\rightarrow r\in [0,\infty ]\)

$$\begin{aligned} r=L\frac{1+x}{1-x} \, \end{aligned}$$
(25)

where L is a constant. Accordingly, the grid points \(x_j\) are mapped to the points \(r_j=r(x_j)\) (\(j=0,1,\ldots , N\)) of the radial grid with \(r_0=0\) and \(r_N=\infty\). There are formally \(N+1\) points \(r_j\), but, since the outermost point \(r_N\) is at the infinity, the actual number of the radial grid points is N and it is so denoted in this paper.

2.3 Fock exchange operator and the Hartree potential in the pseudospectral method

The present paper determines the PS representation of the Fock exchange operator and Hartree potential. The mapping (25), previously used in the PS solution of the KS equation, [35, 41, 42, 62] is now also applied in solving the HF and Poisson Eqs. (9), (10) and (11) with the PS method. It is accompanied by suitable scaling of the sought functions (multiplying them by \(({\dot{r}})^{-1/2}\)) to avoid the occurrence of their first derivative over x in the scaled HF and Poisson equations which would lead to non-symmetric matrices in the final discretized forms of these equations. Subsequently, the PS representation of the scaled functions is used in the transformed equations.

In particular, for the functions \({{{\tilde{v}}}}_{l''}(n'l',nl;r)\) that define the exchange operator through Eq. (4) the scaling reads

$$\begin{aligned} p_{l''}(n'l',nl;x)=({\dot{r}})^{-1/2} {\tilde{v}}_{l''}(n'l',nl;r) \end{aligned}$$
(26)

and the scaled functions \(f(x)=p_{l''}(n'l',nl;x)\) are further represented as in Eq. (13). As a result, the Poisson Eq. (10) is transformed into the algebraic equation

$$\begin{aligned} \sum _{j=1}^{N-1} A_{ij} y_{j} = b_i \end{aligned}$$
(27)

(\(i=1,\ldots ,N\)) where

$$\begin{aligned} y_{j} = \frac{(\dot{r_j})^{1/2}}{P_N(x_j)}v_j \,. \end{aligned}$$
(28)

is expressed with \(v_j=v_{l''}(n'l',nl;r_j)\), \(r_j=r(x_j)\), \({\dot{r}}_j={\dot{r}}(x_j)=2L/(1-x_j)^2\) and

$$\begin{aligned} b_{i} = (2l''+1)\frac{(\dot{r_i})^{1/2}}{P_N(x_i)} \chi _{n'l'}(r_i) \chi _{nl}(r_i) \,. \end{aligned}$$
(29)

The matrix \(A=(A_{ij})\) is defined as

$$\begin{aligned} A_{ij}= r_i(\dot{r_i})^{-1} {{{\tilde{g}}}}''_{ij} (\dot{r_j})^{-1}r_j - l''(l''+1) \delta _{ij} \end{aligned}$$
(30)

and it is symmetric according to Eq. (16).

Equation (27) is solved for \(\mathbf {y}=(y_1,\ldots ,y_{N-1})\) and its solution \(\mathbf {y}=A^{-1}\mathbf {b}\) is found for each of the several right-hand sides \(\mathbf {b}=(b_1,\ldots ,b_{N-1})\) corresponding to different quantum numbers {nl, \(n'l'\)}. This multiple operation does not increase significantly the computational cost of finding \(F_{\text {x};nl}(r)\) at the points \(r=r_i\) (\(i=1,\ldots ,N-1\)) since the matrix A is independent of nl and \(n'l'\). However, the solutions still need to be obtained separately for different values of \(l''={|l-l'|},{|l-l'|+2,}\ldots , l+l'\) because \(A=A(l'')\) depends on \(l''\). In practice, prior to actually solving Eq. (27) for \(\mathbf {y}\), the matrix A can be inverted for \(l''=0,\ldots , 2 l_{\mathrm{max}}\) where \(l_{\mathrm{max}}\) is the highest orbital number l of the occupied HF orbitals \(|nl\rangle\).

Equation (27) accounts for the boundary conditions at the end points \(x_0=-1\) and \(x_N=1\). As a result, the \(j=0\) and \(j=N\) terms are removed from the sum of \(A_{ij}y_j\) for \(1 \le i\le N-1\) since \(A_{i0}y_0=0\) and \(A_{iN}y_N=0\) . The latter relations are obtained by noting that \(v_{l''}(n'l',nl;r)\sim O(r^{l+l'+2}) +O(r^{l''})\) for \(r\rightarrow 0\) and \(v_{l''}(n'l',nl;r)\sim 1/r^{l''+1}\) for \(r\rightarrow \infty\) and accounting for the variation of \({\dot{r}}(x)\) near the two end points: \({\dot{r}}=L/2\) at \(x=-1\) (i.e., at \(r=0\)) and \({\dot{r}}=(2L)^{-1} r^2\) for \(x\rightarrow 1\) (i.e., for \(r\rightarrow \infty\)). These boundary conditions also lead to vanishing of \(\sum _{j=0}^{N} A_{ij} y_j\) and \(b_i\) for \(i=0\) and \(i=N\) so that the equations for the two values of i are not included in Eq. (27). Thus, the \((N-1)\times (N-1)\) linear problem, given by Eq. (27), finally emerges.

The PS representation of the Poisson Eq. (11) for the Hartree potential \(v_{\mathrm{H}}(r)\) also leads to Eq. (27), with \(y_i=[(\dot{r_i})^{1/2}/P_N(x_i)] v_{\text {H}}(r_i)\), \(A=A(l''=0)\) and \(b_i=-[(\dot{r_i})^{1/2}/P_N(x_i)] \rho _{\text {tot}}(r_i)\). By solving this equation we obtain \(v_{\mathrm{H}}(r)\) at the grid points \(r=r_i\), \(i=1,\ldots ,N-1\). The value of the Hartree potential at the nucleus (\(r=0\)) can be found directly from its definition using the GLL quadrature:

$$\begin{aligned} v_{\text {H}}(r=0)=\int _{0}^{\infty } dr \, \rho _{\text {tot}}(r)/r = \int _{-1}^{1} dx \, {\dot{r}}(x) \rho _{\text {tot}}(r)/r = \sum _{j=1}^{N-1} w_j {\dot{r}}_j \rho _{\text {tot}}(r_j)/r_j \, . \end{aligned}$$
(31)

where the \(i=0\) and \(i=N\) terms are excluded since the integrand vanishes at \(r=0\) and \(r=\infty\).

2.4 Pseudospectral representation of the Hartree–Fock equation

The radial atomic orbitals \(\chi _{nl}(r)\) are scaled in a similar manner [35, 41, 42, 62]

$$\begin{aligned} \gamma _{nl}(x)= ({\dot{r}})^{-1/2} \chi _{nl}(r) \end{aligned}$$
(32)

as in Eq. (26) and the function \(f(x)=\gamma _{nl}(x)\) is represented for each (nl) as in Eq. (13). This PS representation is used in Eq. (1) and combined with the PS solutions for \(v_{\text {H}}(r)\) and \(F_{\text {x};nl}(r)\) obtained from Eq. (27) at the grid points \(r=r_i\). It results in the following algebraic equation

$$\begin{aligned}&\sum _{j=1}^{N-1} \left\{ - \frac{1}{2}(\dot{r_i})^{-1} {{{\tilde{g}}}}''_{ij}\, (\dot{r_j})^{-1} +\left[ \frac{l(l+1)}{2r_i^2} + v_{\text {ext}}(r_i)+ v_{\text {H}}(r_i) \right] \delta _{ij} + F_{\text {x};ij}^{(l)} \right\} u_{j}^{(nl)} \nonumber \\&\quad = \epsilon _{nl} u_{i}^{(nl)} \end{aligned}$$
(33)

which is the sought PS representation of the restricted HF Eq. (9) for closed-shell atoms. The dimensionless quantity

$$\begin{aligned} u_{i}^{(nl)}=\frac{({\dot{r}}_i)^{1/2}}{P_N(x_i)} \chi _{nl}(r_i) \end{aligned}$$
(34)

(\(i=1,\ldots ,N-1\)) represents the atomic orbitals at the grid points. The exchange matrix and the Hartree potential present in Eq. (33) are expressed in terms of \(u_{i}^{(n'l')}\) for the occupied orbitals and the matrices \(A(l'')\) as

$$\begin{aligned} F_{\text {x};ij}^{(l)}= & {} \sum _{n'l'}^{\text {occ}} \mathop {{\sum }'}\limits _{l''=|l-l'|}^{l+l'} (2l''+1) c(l,l',l'') \left[ u_{i}^{(n'l')} \mathcal{F}(l'')_{ij} u_{j}^{(n'l')}\right] \, , \end{aligned}$$
(35)
$$\begin{aligned} v_{\text {H}}(r_i)= & {} - \sum _{j=1}^{N-1} \mathcal{F}(l''=0)_{ij} \, {{\tilde{\rho }}}_j \end{aligned}$$
(36)

where

$$\begin{aligned} \mathcal{F}(l'')_{ij} = \frac{P_N(x_i)}{({\dot{r}}_i)^{1/2}} [A^{-1}(l'')]_{ij} \frac{P_N(x_j)}{({\dot{r}}_j)^{1/2}} \end{aligned}$$
(37)

and

$$\begin{aligned} {{\tilde{\rho }}}_j = \sum _{n'l'}^{\text {occ}} (2l' +1) [u_{j}^{(n'l')}]^2 \, . \end{aligned}$$
(38)

Note that both \(\chi _{nl}(r_i)\) and \(u_{i}^{(nl)}\) vanish at the end points \(r_0=0\) (\(x=-1\)) and \(r_N=\infty\) (\(x=1\)) so that the terms with \(j=0\) and \(j=N\) are absent in the PS representation of the HF Eq. (33).

Since the matrices \(({{{\tilde{g}}}}''_{ij})\) and \(A(l'')\) are symmetric the matrix expressing the HF hamiltonian (the total Fock operator) in the PS representation (33) is also symmetric. This allows for its diagonalization with standard numerical techniques, which gives the energies \(\epsilon _{nl}\) and the radial wavefunctions \(\chi _{nl}(r_i)= P_N(x_i)({\dot{r}}_i)^{-1/2}u_{i}^{(nl)}\) of the atomic HF orbitals. The exchange matrix \(F_{\text {x};ij}^{(l)}\) and the Hartree potential \(v_{\text {H}}(r_i)\) entering Eq. (33) depend on the orbitals, thus the iteration of the HF solution is needed to achieve its convergence.

2.5 Hartree–Fock energy and its components

The energy of the external (electron-nucleus) interaction \(v_{\mathrm{ext}}(r)=-Z/r\), the electrostatic (direct Coulomb) energy and the exchange energy are found from their integral definitions by the application of the GLL quadrature:

$$\begin{aligned} E_{\mathrm{ext}}= & {} \int _{0}^{\infty } dr \, \rho _{\text {tot}}(r) v_{\mathrm{ext}}(r) = \sum _{i=1}^{N-1} w_i {\dot{r}}_i \rho _{\text {tot}}(r_i)v_{\mathrm{ext}}(r_i) \, , \end{aligned}$$
(39)
$$\begin{aligned} E_{\mathrm{es}}= & {} \frac{1}{2}\int _{0}^{\infty } dr \, \rho _{\text {tot}}(r) v_{\mathrm{H}}(r) = \frac{1}{2}\sum _{i=1}^{N-1} w_i {\dot{r}}_i \rho _{\text {tot}}(r_i) v_{\mathrm{H}}(r_i) \, , \end{aligned}$$
(40)
$$\begin{aligned} E_{\mathrm{x}}= & {} \frac{1}{2} \sum _{\sigma }\sum _{nl}^\mathrm{occ} (2 l +1)\int _{0}^{\infty } dr \, \chi _{nl}(r) F_{\text {x};nl}(r) = \sum _{nl}^{\mathrm{occ}}\sum _{i=1}^{N-1} (2 l +1) w_i {\dot{r}}_i \chi _{nl}(r_i) F_{\text {x};nl}(r_i) \, \end{aligned}$$
(41)

where the \(i=0\) and \(i=N\) terms are excluded since the respective integrands vanish at \(r=0\) and \(r=\infty\).

The kinetic energy, defined as the sum of the integrals of \(-(1/2) \phi _a^{*}(\mathbf{r})\nabla ^2 \phi _a(\mathbf{r})\) for the occupied orbitals \(\phi _a=\phi _{nlm}\) of both spins, can also be found with the GLL quadrature

$$\begin{aligned} E_{\mathrm{kin}} = \sum _{nl}^\mathrm{occ}\sum _{i=i_0(l)}^{N-1} 2(2l +1) w_i {\dot{r}}_i \left[ \frac{1}{2} [\chi '_{nl}(r_i)]^2 + l(l+1)\chi _{nl}^2(r_i)/(2 r_i^2) \right] \end{aligned}$$
(42)

where \(i_0=0\) for \(l=0\) and \(i_0=1\) for \(l>0\). The derivatives \(\chi '_{nl}=d\chi '_{nl}/dr\) are found by expressing them as \(\chi '_{nl}=({\dot{r}})^{-1/2}\gamma '_{nl}+(2L)^{-1/2}\gamma _{nl}\) with Eq. (32) and applying the PS representation (13) of \(f(x)=\gamma _{nl}(x)\), also used to find \(\gamma '_{nl}(x)=d\gamma _{nl}(x)/dx\). This gives

$$\begin{aligned} \chi '_{nl}(r_i)= \frac{P_N(x_i)}{({\dot{r}}_i)^{1/2}}\sum _{j=1}^{N-1} {{{\tilde{g}}}}'_{ij} ({\dot{r}}_j)^{-1} u_{j}^{(nl)} + (2L)^{-1/2} \frac{P_N(x_i)}{{\dot{r}}_i} u_{i}^{(nl)} \, \end{aligned}$$
(43)

where \({{{\tilde{g}}}}'_{ij}\) is defined in Eq. (18). Alternatively, once the energy components \(E_{\mathrm{ext}}\), \(E_{\mathrm{es}}\) and \(E_{\mathrm{x}}\) are found, the kinetic energy \(E_{\mathrm{kin}}\) can be immediately calculated as

$$\begin{aligned} {E_{\mathrm{kin}}^{\mathrm{alt}} } = 2 \sum _{nl}^{\mathrm{occ}} (2l +1)\epsilon _{nl} -E_{\mathrm{ext}}-2 E_{\mathrm{es}}-2 E_{\mathrm{x}} \, . \end{aligned}$$
(44)

This known formula is obtained by multiplying the HF Eq.  (1) by \(\phi ^{*}_{nlm\sigma }(\mathbf{r})\), followed by the integration of the resultant equation over \(\mathbf{r}\) and the summation over all occupied orbitals of both spins.

The total energy is finally found as the sum of all its components

$$\begin{aligned} E_{\mathrm{tot}}= E_{\mathrm{kin}}+E_{\mathrm{ext}} +E_{\mathrm{es}} + E_{\mathrm{x}} \, . \end{aligned}$$
(45)

The accuracy of \(E_{\mathrm{tot}}\) can be estimated by checking how well the virial theorem \(E_{\mathrm{pot}}=-2E_{\mathrm{kin}}\), or equivalently \(E_{\mathrm{tot}}=-E_{\mathrm{kin}}\), is satisfied. This theorem involves the total potential energy \(E_{\mathrm{pot}}=E_{\mathrm{ext}} +E_{\mathrm{es}} + E_{\mathrm{x}}\).

2.6 Kato cusp condition

For atoms the Kato cusp condition is defined for s orbitals by ratio of the derivative of the wavefunction \(\phi _{n00}(r)=(4\pi )^{-1/2} r^{-1}\chi _{n0}(r)\) to itself at the position of the nucleus:

$$\begin{aligned} q_{n0}=\phi '_{n00}(0)/\phi _{n00}(0) = \frac{1}{2}\chi ''_{n0}(0)/\chi '_{n0}(0) \, . \end{aligned}$$
(46)

This quotient should be equal to \(-Z\) according to the Kato theorem This theorem is also valid for the ratio \(q_{\mathrm{tot}}=n'_{\mathrm{tot}}(0)/n_{\mathrm{tot}}(0)\) which, again, should be equal to \(-Z\).

The values of the total electron density \(n_{\mathrm{tot}}(r)\) and its derivative at the nucleus (\(r=0\)) are calculated as follows

$$\begin{aligned} n_{\mathrm{tot}}(0)= & {} \frac{2}{4\pi }\sum _{n}^{\mathrm{occ}} [\chi '_{n0}(0)]^2 , \end{aligned}$$
(47)
$$\begin{aligned} n'_{\mathrm{tot}}(0)= & {} \frac{2}{4\pi } \sum _{n}^\mathrm{occ} \chi '_{n0}(0) \chi ''_{n0}(0) \end{aligned}$$
(48)

where \(\chi '_{n0}(0)\) (here replacing \(\phi _{n00}(0)\)) is found with Eq. (43) for \(l=0\) and \(i=0\). The second derivative of \(\chi _{n0}(r)\) at \(r=0\) is calculated with the following formula

$$\begin{aligned} \chi ''_{nl}(r_i)= \frac{P_N(x_i)}{({\dot{r}}_i)^{3/2}}\sum _{j=1}^{N-1} {{{\tilde{g}}}}''_{ij} ({\dot{r}}_j)^{-1} u_{j}^{(nl)}\, \end{aligned}$$
(49)

at \(i=0\) and \(l=0\), with \({{{\tilde{g}}}}''_{ij}\) defined in Eq. (16). This expression is obtained from the scaling relation \(\chi ''_{nl}(r)=({\dot{r}})^{-3/2}\gamma ''_{nl}(x)\) and the PS representation (13) of \(f(x)=\gamma _{nl}(x)\). Let us note that the formula (49) and a similar expression for \(d^2{{{\tilde{v}}}}_{l''}(n'l',nl;r)/dr^2\) at \(r=r_i\) in terms of \({{{\tilde{g}}}}''_{ij}\) and \(y_j\) (\(j=1,\ldots ,N-1\)) stand behind the transformation of the Laplacian terms present in the HF and Poisson Eqs. (9), (11), (10) to the PS representations of these terms in Eqs. (30) and (33).

The PS solution of the HF equation is subject to the Dirichlet boundary conditions: \(\chi _{nl}(0)=0\) and \(\chi _{nl}(\infty )=0\) which are taken into account in deriving the discretized representation (33) of this equation. Thus, the Kato cusp condition, satisfied by the exact HF orbitals with the s symmetry at \(r=0\) due to the \(-1/r\) singularity of the Coulomb potential, is not directly imposed on the approximate orbitals in the PS method, unlike in the finite-difference methods that involve outward integration of the HF equation starting at a finite radius very close to \(r=0\) with the initial condition set using the cusp condition [5, 13]. Therefore, the ratios \(q_{n0}\) and \(q_{\mathrm{tot}}\) obtained with the PS method are not exactly equal to \(-Z\) though their deviations from this value are expected to rapidly decrease as the PS solution becomes more accurate with increasing the number of grid points N.

3 Results

3.1 PS solution for closed-(sub)shell atoms and the iteration method

The HF equation is solved with the aid of the derived PS formalism for the atoms with closed shells or subshells, from He to No. The reported results include the orbitals and their energies, the total and exchange energies, as well as the quantities that are the subject of the virial theorem and the Kato cusp condition.

The radial wavefunctions \(\chi _{nl}\) obtained as the PS solution of the HF equation are further modified at each iteration step k by the linear mixing

$$\begin{aligned} \chi _{nl}^{(k+1) \text {in}}=(1-\alpha )\chi _{nl}^{(k)\text {in}}+ \alpha \chi _{nl}^{(k)\text {out}} \end{aligned}$$
(50)

of input and output values of the HF orbitals at all grid points \(r=r_i\), with a fixed mixing parameter \(\alpha\). Here the output \(\chi _{nl}^{(k)\text {out}}\) is the solution of the PS HF Eq. (33) including the Fock matrix calculated with the input \(\chi _{nl}^{(k)\text {in}}\) obtained in the previous iteration step. The speed at which the iterated HF orbitals converge strongly depends on \(\alpha\) which is tested by choosing \(\alpha =0.1, 0.2,\ldots ,2.0\) and calculating \(|q_{\mathrm{vir}}-2|\) in consecutive iteration steps (see Fig. 1). The optimal value of \(\alpha\) and the corresponding minimal number of iteration steps \(k_{\mathrm{min}}\) after which the solution approaches its convergence limit are shown in Table 1. Other iteration schemes, like the Pulay method [63], could be also be applied in order to speed up the convergence. However, this is actually not needed since the presented PS method of numerically solving the HF equation is very undemanding computationally. Indeed, the calculations with \(N=100\) grid points and 200 iterations, run as a Fortran programme on a low-end processor (Intel Core i3-2310M, 2.10 MHz, installed in a notebook), require the CPU time of no more than 3 s even for the heaviest atoms.

Fig. 1
figure 1

Absolute difference \(|q_{\mathrm{vir}}-2|\) versus iteration step k for the Ar and Yb atoms, obtained using the double-precision (DP) and quadruple-precision (QP) floating-point formats. The virial ratio \(q_{\mathrm{vir}} = - E_{\mathrm{pot}}/E_{\mathrm{kin}}\), with \(E_{\mathrm{kin}}\) found from Eq. (42), is obtained with the \(N=N_{\mathrm{min}}\) grid points and various values of the mixing parameter \(\alpha\) (two left panels), and with the value of \(\alpha =0.9\) optimal for Ar and various \(N \le N_{\mathrm{min}}\) (right panel). If \(|q_{\mathrm{vir}}-2|\) obtained with the DP becomes less than \(10^{-13}\) after \(k_{\mathrm{min}}=k_{\mathrm{min}}(N,\alpha )\) (Table 1) iteration steps the parameter \(\alpha =0.1\) is used in steps \(k \ge k_{\mathrm{min}}+10\) to reduce oscillations of \(q_{\mathrm{vir}}\). In the QP calculations, \(\alpha =0.1\) is used after 45 steps at \(N=90\) for the Ar atom

Table 1 The number of grid points \(N=N_{\mathrm{min}}\) for which the converged value of \(|q_{\mathrm{vir}}-2|\) becomes less than \(5\times 10^{-14}\), the optimal value of the mixing parameter \(\alpha\) that gives the fastest convergence in the linear mixing scheme and the respective minimal number of iteration steps \(k_{\mathrm{min}}\) after which \(|q_{\mathrm{vir}}-2|\) becomes less than \(10^{-13}\)

This estimate of the CPU time is valid for the standard version of the developed programme which assumes the double precision (DP), i.e., the 64-bit floating-point format and is used to obtain most of the reported results. The code makes use of the Intel Math Kernel library (MKL) [64] which contains linear-algebra routines from the LAPACK and BLAS libraries [65] and is optimized for the applied Fortran compiler and hardware (processor). In particular, the solution of the discretized Poisson equation (27) is done with the DPOTRF and DPOTRI routines (and other routines used by them) and the routine DSYEVR is used to find the numerical solution of the HF eigenvalue problem with the symmetric matrix defined in Eq. (33). Since the numerical precision of the DP floating-point calculations is limited to 15–16 digits, this also limits a maximum accuracy of the obtained results, with an expected loss of one or a few significant digits due to roundoff errors.

To increase the accuracy beyond this limit, the programme has been converted (with suitable compiler options) to its alternative version which uses the quadruple precision (QP), i.e. the 128-bit representation of the floating-point numbers. Since the MKL library package bundled with the compiler does not provide such an extended precision, the original LAPACK and BLAS libraries [65] have been used instead after compiling them with options automatically providing the QP for all floating-point variables and constants. These modifications resulted in a significant increase of computation time, by around two orders of magnitude, due to the extended precision and the use of unoptimized library routines. However, the CPU time required, using the above specified computer, for the QP calculation with 130 grid points and 200 iterations does not exceed 320 s for heaviest atoms, like No, while the accuracy of the results is improved by many orders of magnitude, as it is presented below. Thus, the LAPACK and BLAS libaries compiled in the QP have been successfully applied in the present calculations although these two libraries are officially dedicated only for the use in the single (32-bit) and double precisions.

The constant L used in the mapping (25) is found to give highly accurate results for a wide range of its values, from 0.3 a.u. to 2.0 a.u.. The applied value \(L=1.5\) a.u (1.2 a.u for Ra, Rn, No) is optimal for the accuracy of the total energy and the satisfaction of the virial and Kato-cusp theorems.

3.2 Total energies and the virial theorem

The overall accuracy of the HF solution can be conveniently examined by calculating the deviation of the virial ratio \(q_{\mathrm{vir}}=-E_{\mathrm{pot}}/E_{\mathrm{kin}}\) from its theoretical value 2. The absolute difference \(|q_{\mathrm{vir}}-2|\) decreases exponentially in consecutive iteration steps k and converges to values less than \(10^{-13}\) in the calculations with the DP, provided that the number of grid points N is sufficiently large, as seen in Fig. 1. This limit is reached after a moderate number of iterations \(k_{\mathrm{min}}\) : 14 for He, 23 for Ca, 33 for Hg, 42 for Yb, and between 19 and 40 for other atoms (Table 1), using the linear mixing method. A very similar number of iterations is needed for the convergence of the total energy: its value converges to 13 digits after \(k_{\mathrm{min}}\) iteration steps. The energy values with 14 significant digits are achieved by lowering the mixing parameter to \(\alpha =0.1\) for \(k>k_{\mathrm{min}}+10\) which reduces very small oscillations of \(E_{\mathrm{tot}}\) during iteration. Averaging of \(E_{\mathrm{tot}}\) over many iteration steps (\(k_{\mathrm{min}}+20 \le k \le k_{\mathrm{min}}+120)\) finally improves its convergence to 15 significant digits, the ultimate numerical accuracy in computations using the double-precision floating-point format. Thus maximally converged values of \(E_{\mathrm{tot}}=E_{\mathrm{tot}}(N)\) are obtained for each number of the grid points N.

However, the HF solutions and the converged values of \(E_{\mathrm{tot}}(N)\) can have much lower accuracy if the number of the grid points N is too small. This is illustrated in Fig. 1 (bottom panel)) where the absolute difference \(|q_{\mathrm{vir}}-2|\) converges to values a few orders larger than \(10^{-13}\) if N is not large enough. The numerical errors in the present calculations are the combined effect of the approximate PS representation which becomes more accurate for larger N and the round-off errors growing with increasing N which defines the size of the matrices involved in the solution of the HF and Poisson equations. These counteracting trends are clearly seen in the dependence of \(|q_{\mathrm{vir}}-2|\) on N in Fig. 2 and result in a crossover at some \(N=N_{\mathrm{min}}\) so that for larger N the rapidly decreasing error of the applied PS method is dominated by the unavoidable numerical (round-off) errors. The optimal number \(N_{\mathrm{min}}\) of grid points depends on the type of atom and varies from around 35 to around 70, being smaller for lighter atoms though this is not a strict trend (Table 1). The total energy \(E_{\mathrm{tot}}(N)\) converges after N reaches \(N_{\mathrm{min}}\): for \(N>N_{\mathrm{min}}\) the energy \(E_{\mathrm{tot}}(N)\) oscillates as a function of N around an average value \(E_{\mathrm{tot}}^{\mathrm{av}}\) and the amplitude of these oscillations (affecting only the 14-th and higher digits of the energy value) slowly grows with N due to increasing round-off errors; see Fig. 3. The energy \(E_{\mathrm{tot}}^{\mathrm{av}}\) is well approximated by the mean value of \(E_{\mathrm{tot}}(N)\) in the interval \(N_{\mathrm{min}}+5\le N \le N_{\mathrm{min}}+5+\varDelta N\) of the width \(\varDelta N=30\) and it is taken as the final value of the total energy \(E_{\mathrm{tot}}\) given in Table 2. By examining the convergence of \(E_{\mathrm{tot}}^{\mathrm{av}}\) with increasing \(\varDelta N\), the accuracy of the so obtained \(E_{\mathrm{tot}}=E_{\mathrm{tot}}^{\mathrm{av}}(\varDelta N=30)\) is found to be 14 significant digits for all investigated atoms. This conclusion is supported by the fact that the values of \(|q_{\mathrm{vir}}-2|\) are less than \(10^{-14}\) if the virial ratio \(q_{\mathrm{vir}}=-E_{\mathrm{pot}}/E_{\mathrm{kin}}\) is calculated with \(E_{\mathrm{pot}}\) and \(E_{\mathrm{kin}}\) obtained using the similar averaging scheme as for \(E_{\mathrm{tot}}=E_{\mathrm{tot}}^{\mathrm{av}}\). The same values of the total energy with 14 significant digits and the virial ratio differing from 2 by less than \(10^{-14}\) are obtained if the kinetic energy is found from the alternative formula (44). If the described averaging over N is not applied the energy \(E_{\mathrm{tot}}=E_{\mathrm{tot}}(N)\) shows minute oscillations for \(N \ge N_{\mathrm{min}}\) and thus its accuracy in the calculations with the DP is reduced to 13 significant digits (Fig. 3).

Fig. 2
figure 2

Maximum values of \(|q_{\mathrm{vir}}-2|\) obtained, using the DP and QP floating-point formats, during the iteration between steps \(k=120\) and \(k=200\) for the Ar and Yb atoms versus the number of grid points N. The optimal fixed values of the mixing parameter, \(\alpha =0.9\) for the Ar atom and \(\alpha =0.6\) for the Yb atom, are taken in iteration steps \(k<k_{\mathrm{min}}+10\) in the DP calculations and k less than 45 and 105, respectively, in the QP calculations, while \(\alpha =0.1\) is used for larger k. The DP and QP results coincide for \(N<N_{\mathrm{min}}\) (Table 1) within the figure’s scale

Fig. 3
figure 3

Deviation of the total energy from its final value \(E_{\mathrm{tot}}^{\mathrm{av}}\) shown in Table 2 versus the number of grid points N for the Ar and Yb atoms. The chosen vertical scale directly represents changes of the 14-th digit in the value of \(E_{\mathrm{tot}}\). The results are obtained using the DP floating-point format

Table 2 Total atomic energy \(E_{\mathrm{tot}}\), the exchange energy \(E_{\mathrm{x}}\), the deviation of the virial ratio from 2 (the exact value), and the HOMO energy \(\epsilon _{\mathrm{HOMO}}\) for closed-(sub)shells atoms from He to No

The roundoff errors in the calculated energies due to finite numerical precision also manifest themselves as the rapid tiny oscillations of \(|q_{\mathrm{vir}}-2|\) (with \(10^{-15}\) to \(10^{-13}\) amplitude for the DP results) versus both the number of iterations k and the number of grid points N after this deviation reaches the range of its lowest possible values for \(k>k_{\mathrm{min}}\) and \(N>N_{\mathrm{min}}\); see the flat portions of the plots in Figs. 1 and 2. In addition, the absolute deviation \(|q_{\mathrm{vir}}-2|\) of the virial ratio shows another type of non-smooth dependence before it reaches the convergence, i.e., for \(k<k_{\mathrm{min}}\) and \(N<N_{\mathrm{min}}\), with significant lowering of \(|q_{\mathrm{vir}}-2|\) in some iteration steps k and for some specific N. In this regime, the dependence of \(q_{\mathrm{vir}}-2\) on k is smooth in fact but this deviation oscillates around 0 during iteration and thus changes its sign at some steps k. Consequently, its absolute value has a local minimum in each of such iteration steps which leads to the obtained irregularities in the otherwise linear decay of \(\ln |q_{\mathrm{vir}}-2|\) with increasing k as seen in Fig. 1. A similar argument explains the quasi-periodic irregularities in the roughly linear dependence of \(\ln |q_{\mathrm{vir}}-2|\) on N (Fig. 2) which arise because the deviation \(q_{\mathrm{vir}}-2\) also oscillates around 0 and changes its sign for some N when the number of grid points is gradually increased.

The total energy values, obtained with the DP version of the code, have a very high accuracy close to the precision of the DP floating-point representation (15-16 digits) used in the calculations. The 14-digit values of \(E_{\mathrm{tot}}\) given in Table 2 are fully reproduced (with the sole exception of the last digit for the Sr atom) in the even more accurate numerical calculations done with the QP version of the code which provides further 11 significant digits of \(E_{\mathrm{tot}}\). Indeed, as shown in Table 3 and Figs. 1 and 2 , the absolute deviation \(|q_{\mathrm{vir}}-2|\) of the virial ratio found in the QP calculations reaches the limit of \(10^{-25}\) to \(10^{-27}\) with increasing N. Simultaneously, the values of \(E_{\mathrm{tot}}(N)\) converge up to 25 or more digits as illustrated for the atom Yb in the lower part of Table 3. Thus, it can be claimed that the total atomic energies calculated with the QP have at least 25 significant digits. This remarkable accuracy is achieved with a moderate number of grid points, from \(N=80\) for the Ne atom to \(N=130\) for the heaviest atoms like Ra and No. The number of grid points needed for convergence of \(E_{\mathrm{tot}}\) in the QP calculations is roughly doubled compared to the respective number (denoted by \(N_{\mathrm{min}}\) in Table 1) required to obtain the values of \(E_{\mathrm{tot}}\) with 14 significant digits in the calculations using the DP. The number of iterations needed to reach the convergence of the total energy is also doubled compared to the respective iteration number \(k_{\mathrm{min}}\) (Table 1) required in the DP calculations. Such doubling results from the fact that the deviation \(|q_{\mathrm{vir}}-2|\) decays roughly exponentially with both the number of iterations k and the number of grid points N so that the logarithm \(\log _{10}|q_{\mathrm{vir}}-2|\) decreases roughly linearly with k and N (Figs. 1 and 2) while its minimum value drops almost twice, from around \(-14\) to around \(-26\), upon extending the floating-point precision from DP to QP.

Table 3 Total energy \(E_{\mathrm{tot}}\) with the 25-digit accuracy, the virial ratio deviation \(q_{\mathrm{vir}}-2\), and the HOMO energy \(\epsilon _{\mathrm{HOMO}}\) with the 22- to 25-digit accuracy for the closed-(sub)shells atoms from He to No

The obtained values of \(E_{\mathrm{tot}}\) fully agree with the 9- and 10-digit values of the total HF atomic energies obtained, respectively, by Tatewaki et al. [50] in the numerical HF calculations with a finite-difference method and by Koga [52] in the RHF calculations with a modified Slater orbital basis. The present results also show that the last figure in the 10-digit values of the numerical HF total energies reported by Bunge et al. [49] is slightly incorrect for most of the closed-(sub)shell atoms (usually differs by 1 from the correct figure) while the accuracy of \(E_{\mathrm{tot}}\) found by Bunge et al. in the RHF calculations with a Slater basis [51] is limited to 8 digits for most of these atoms. The present 14-digit and 25-digit values of the total energy fully agree with its 12-digit values obtained by Saito [21] in the RHF calculations based on the expansion of the orbitals in the B-spline basis. Lastly, the present value of \(E_{\mathrm{tot}}\) for the He atom agrees in all 14 digits with the result obtained by Ozaki and Toyoda [25] with a finite-element technique. Although those authors do not give the values of the total energy for other atoms they report that their HF calculations required up to a few thousand of grid points to satisfy the virial theorem with the 13- to 14-digit accuracy for the noble gas atoms. The PS method proves clearly superior in this respect as only 33 to 71 grid points (Table 1) are needed to achieve the same accuracy level using the standard DP format of the floating-point numbers in numerical calculations. Furthermore, it is sufficient to double the number of grid points to obtain the energy values with 25 significant digits though it is then necessary to use the QP floating-point representation to implement the calculations at such an extreme accuracy level.

3.3 Orbital energies

The energies \(\epsilon _{nl}\) of the occupied HF orbitals obtained in the DP calculations are also found to converge at \(N=N_{\mathrm{min}}\) given in Table 1. They show very small oscillations for larger N so that the accuracy of \(\epsilon _{nl}\) can be improved by one order of magnitude by the described averaging over N. The values of \(\epsilon _{\mathrm{HOMO}}\) are given for all closed-(sub)shell atoms in Table 2, while the energies of all occupied HF orbitals for four chosen atoms (Be, Ar, Zn and Yb) are given in Table 4. The accuracy of the DP values of the orbital energies reaches 14 digits for innermost shells, and is lowest, with 12 significant digits, for the HOMO energy \(\epsilon _{\mathrm{HOMO}}\). Thus, the obtained orbital energies are much more accurate, up to 7 orders of magnitude, than in the previously reported calculations. Their values fully agree with the \(\epsilon _{nl}\) values of \(10^{-6}\) a.u. accuracy (corresponding to 6-11 significant digits) given by Saito. [21] The occupied orbital energies \(\epsilon _{nl}\) obtained by Bunge et al. in the RHF calculations are slightly higher than their present more accurate values, by \(10^{-6}\) a.u. for Be and Ar, and \(10^{-5}\) or \(2\times 10^{-5}\) a.u. for Zn. The present values of \(\epsilon _{\mathrm{HOMO}}\) also fully agree with the 6-digit values of this energy reported for He, Be, Ne, Mg and Ar by Tatewaki et al. [50]

Table 4 Energies of the occupied HF orbitals in the Be, Ar, Zn and Yb atoms

Performing the calculations in the QP with the doubled number of grid points \(N\approx 2 N_{\mathrm{min}}\) provides not only the 25-digit values of \(E_{\mathrm{tot}}\) but also the orbital energies with the greatly enhanced accuracy – their values converge to 22 to 25 significant digits, as for the HOMO energies given Table 3. The QP values of \(\epsilon _{\mathrm{HOMO}}\) fully confirm the 12-digit values of this energy obtained for closed-(sub)shell atoms in the DP calculations (Table 2), apart from the Yb, Hg and No atoms for which the 12-th digit of the respective DP values differs by -1 from the correct digit obtained in the QP calculations.

3.4 Electron density at nucleus and Kato’s theorem

To verify how accurately Kato’s condition is satisfied by the presently obtained HF orbitals with s symmetry the quantities \(k_{n0}=|-q_{n0}/Z -1|\) are calculated. The magnitude of the index \(k_{n0}\) obtained with the code using the DP becomes smallest, of the order of \(10^{-10}\) or \(10^{-11}\), for N significantly larger (even more than twofold) than the grid number \(N_{\mathrm{min}}\) optimal for the total energy. The number of grid points leading to lowest values of \(k_{n0}\) (and thus the best accuracy of \(\phi _{n00}(r=0)\)) grows with increasing n, reaching \(N\ge 100\) for the outmost occupied s orbital, since more expanded orbitals require more grid points for their accurate representation in the real space with the PS method. The same order of magnitude is found for the index \(k_{\mathrm{tot}}=|-q_{\mathrm{tot}}/Z -1|\) referring to the total electron density \(n_{\mathrm{tot}}(0)\) at the nucleus. It should be noted that the deviation of \(-q_{\mathrm{tot}}/Z\) from 1 comes mainly from the inaccuracy of the derivative \(n'_{\mathrm{tot}}(0)\) which converges up to 10 or 11 significant digits. However, a further increase of this accuracy and the corresponding decrease of \(k_{\mathrm{tot}}\) and \(k_{n0}\) are limited by the finite precision of the applied DP floating-point format, similarly as for the total and orbital energies.

The value of the density \(n_{\mathrm{tot}}(0)\), after averaging over several tens of iteration steps for each N, converges up to 12 digits in the DP calculations. The accuracy of the s orbitals and density at the nucleus can be improved to 13 significant digits (except for Yb) by further averaging of \(\chi _{n0}(r)\) over N within the interval of \(N_{\min }^{\mathrm{Kato}} +5\le N \le N_{\min }^{\mathrm{Kato}}+35\) where \(N_{\min }^{\mathrm{Kato}}\) corresponds to the lowest N for which \(k_{n0}\) becomes less than \(10^{-11}\) (or \(10^{-10}\) for the He and Be atoms) for the outmost occupied s orbital; see Table 1. The so obtained values of \(n_{\mathrm{tot}}(0)\) and the corresponding Kato-cusp indices \(k_{n0}\) and \(k_{\mathrm{tot}}\) are included in Table 5. These indices are of the order of \(10^{-13}\) (\(10^{-14}\) for Ne, Ar, Kr and Pd) for most atoms, apart for some atoms (He, Be, Mg, Ca and Yb) with HOMO of the s symmetry, for which \(k_{\mathrm{tot}}\) is one or two orders larger.

The accuracy of the electron density and the s orbitals at \(r=0\) can be further enhanced by using a larger number of grid points which however this requires performing calculations in the QP to reduce roundoff errors (since these errors grow with increasing N at a fixed floating-point precision). In particular, it is found for the Yb atom that the cusp index \(k_{\mathrm{tot}}\) decreases down to \(10^{-22}\) for \(N=200\) and the corresponding indices \(k_{n0}\) are of the order of \(10^{-26}\) for the 1s, 2s, 3s orbitals, \(10^{-25}\) for the 4s, 5s orbitals and \(10^{-18}\) for the 6s orbital.

Table 5 HF electron density \(n_{\mathrm{tot}}(0)\) at the nucleus and the quantities \(k_{\mathrm{tot}}=|-q_{\mathrm{tot}}/Z-1|\) and \(k_{n0}=|-q_{n0}/Z -1|\) which determine the deviation from the Kato cusp condition in closed-(sub)shells atoms from He to No

The obtained DP values of the electron density at the nucleus, calculated up to 13 significant digits (Table 5), show that the five-digit values of \(n_{\mathrm{tot}}(0)\) found by Koga et al. [66] with the RHF method, are accurate apart from their last digit which differs by 1 from the present values of \(n_{\mathrm{tot}}(0)\) for some atoms. However, this slight inaccuracy of those previous results is consistent with the magnitude of \(k_{\mathrm{tot}}=|-q_{\mathrm{tot}}/Z-1|\) of the order of \(10^{-5}\) given by Koga et al. [66]. It should also be noted that the RHF values of \(n_{\mathrm{tot}}(0)\) reported by Bunge et al. [51] are less accurate, limited to four significant digits, due to an error in those calculations which was identified Koga et al. [66]. Lastly, the present PS solution determined with the DP provides the electron density at \(r=0\) with the accuracy better by 5 orders than the 8-digit values of \(n_{\mathrm{tot}}(0)\) obtained by Saito with the B-spline expansion [21].

3.5 Node structure of the HF atomic orbitals

The applied PS method provides very accurate representation of the orbitals in real space throughout the whole atomic volume. In particular, it correctly reproduces the node structure of the exact HF orbitals and avoids artificial nodes arising in the RHF calculations with finite atomic bases. [27] However, there are additional nodes, which are usually considered spurious though they are due to the oscillations in the tails of the exact HF radial wavefunctions [16, 67]. Such additional nodes are found with the PS method in all closed-(sub)shell atoms heavier than Mg. This is illustrated in Fig. 4 which shows the occupied orbitals in the Ar atom and their radial nodes as the negative peaks in the plots of \(\log _{10}\chi _{nl}\). The 2s, 3s, 2p and 3p orbitals have the expected number of \(n-l\) nodes, if we disregard distant atomic regions (\(r>20\) a.u.) where the values of \(\chi _{nl}(r)\) drop below \(10^{-14}\) and become completely inaccurate due to the limited precision (here the DP) of the numerical calculations. An additional node in the Ar atom is found for the 1s orbital at \(r=1.0932657894\) a.u. in its tail region where \(\phi _{100}(r)\) is very low (around seven orders lower than at \(r=0\)). Similar additional nodes are found for the Kr atom, at \(r=0.4483419357\) a.u. and \(r=1.255565714\) a.u. for the 1s orbital and at \(r=1.506285094\) a.u. for the 2s orbital. The latter node, at the same position (\(r=1.51\) a.u.), has also been found in the recent numerical HF calculations, with two different finite-difference methods, by Mendez et al. [67] (the 1s orbital in Kr was not discussed by them). The present solution also predicts a node for the 1s orbital in the Zn atom, at the position \(r=0.5588720448\) a.u. which nearly coincides with the node at \(r=0.549308\) a.u. found for this orbital by Takeda et al. [68] in the RHF calculations. Hence, this particular node is a feature of the exact HF 1s orbital and is not the result of its approximate representation in a finite atomic orbital basis as it was assumed by those authors.

Fig. 4
figure 4

Occupied radial orbitals in the Ar atom at the points \(r_i\) of the PS grid with \(N=120\) (circles) and their values on a denser mesh with 99 extra points between each pair of neighbouring grid points (lines). The values of \(\chi _{nl}(r)\) outside the grid points \(r_i\) are obtained with the PS representation (13) for the function \(f(x)=\gamma _{nl}(x)\) defined in Eq. (32). The plotted orbitals are obtained using the DP floating-point format

3.6 Asymptotic variation of the HF orbitals and electron density at large r

The radial wavefunctions \(\chi _{nl}(r)\) of the occupied HF atomic orbitals have the common exponential decay with the rate \(\beta _{\mathrm{H}} =\sqrt{-2\epsilon _{\mathrm{HOMO}}}\) governed by the HOMO energy and the leading term of their asymptotic expansion [69,70,71]

$$\begin{aligned} \chi _{nl}^\mathrm{asymp}(r)=b_{nl}r^{\alpha _{nl}}\exp (-\beta _{\mathrm{H}}r) \end{aligned}$$
(51)

also includes an orbital-dependent power prefactor \(r^{\alpha _{nl}}\) and the constant coefficient \(b_{nl}\) whose approximate value can be found by fitting \(\chi _{nl}^{\mathrm{asymp}}(r)\) to the numerical \(\chi _{nl}(r)\) at some large r. The exponent \(\alpha _{nl}\) takes the highest value \(\alpha _{\mathrm{H}}=1/\beta _{\mathrm{H}}\) for the HOMO and is lower than \(\alpha _{\mathrm{H}}\) for other occupied orbitals. It is equal to \(\alpha _{nl}=\alpha _{\mathrm{H}}-3\) for atomic orbitals with the same orbital number \(l=l_{\mathrm{H}}\ne 0\) as the HOMO, while for orbitals with \(l\ne l_{\mathrm{H}}\) this exponent is \(\alpha _{nl}=\alpha _{\mathrm{H}}-|l-l_{\mathrm{H}}|-1\). In the specific case of \(l=l_{\mathrm{H}}=0\), the value of \(\alpha _{nl}=\alpha _{\mathrm{H}}-2(l_{\mathrm{min}}+1)\) is determined by the lowest nonzero orbital number \(l_{\mathrm{min}}\) among the occupied orbitals, unless for atoms with s orbitals only (\(l_{\mathrm{min}}=0\)), for which each \(\chi _{n0}(r)\) decays with its own rate \(\beta _{n0} =\sqrt{-2\epsilon _{n0}}\) and \(\alpha _{n0}=1/\beta _{n0}\). Thus. apart from the last case, the HF orbitals do not follow the orbital-specific exponential decay \(\exp (-\beta _{nl}r)\) (where \(\beta _{nl}=\sqrt{-2\epsilon _{nl}}\)) characteristic for the solutions of the Schrödinger equation with a local multiplicative spherical potential vanishing at \(r\rightarrow \infty\). In particular, such a decay is found for atomic orbitals satisfying the Kohn-Sham equation within the density-functional theory [72], but it is not valid for the solution of the HF equation which includes the nonlocal (integral) exchange operator defined by Eqs. (3)-(5).

The very high accuracy of the PS solution for the HF equation leads to excellent reproduction of the described asymptotic behaviour of the HF atomic orbitals \(\chi _{nl}(r)\). In particular, the common exponential decay is confirmed numerically for the Ar atom in Fig. 5 where the calculated \(\ln |\chi _{nl}(r)|\) shows an almost linear dependence on r, with the slope similar for all HF orbitals and close to the theoretical value \(-\beta _{\mathrm{H}}=-\sqrt{-2\epsilon _{3p}}\approx -1.0872\) a.u. In fact, all the numerically obtained orbitals \(\chi _{nl}(r)\) nearly coincide with their asymptotic form (51) within in a wide interval of r, up to a large radial distance at which the orbitals reach very low values and stop to rapidly decrease with increasing r. This boundary radius, possibly orbital-dependent, determines the spatial region where the PS solution is valid, and the radius increases with increasing the number of grid points N while the corresponding values of \(|\chi _{nl}(r)|\) decrease. However, the possibility of such improvement by increasing N is limited by the finite precision of the float-point format used in the calculations.

Fig. 5
figure 5

Tails of the occupied HF radial orbitals in the Ar atom: the values at the points \(r_i\) of the PS grid (symbols) and the linear interpolation between the grid points (solid lines), obtained with a the DP and \(N=120\), b the QP and \(N=150\). The dashed lines mark the asymptotic form \(\chi _{nl}^\mathrm{asymp}(r)\) of the HF orbitals, Eq. (51), with \(\beta _{\mathrm{H}}\) and \(\alpha _{nl}\) found with \(\epsilon _{\mathrm{HOMO}}=\epsilon _{3p}\) from Table 2 and the coefficients \(b_{nl}\) obtained by fitting \(\chi _{nl}^\mathrm{asymp}(r)\) to \(\chi _{nl}(r)\) at \(r=15.3411\) a.u. (\(nl=\)1s, 2s, 2p) and \(r=20.5373\) a.u. (\(nl=\)3s, 3p) in case (a), and \(r=36.1702\) a.u. in case (b). The fitted values (in a.u.) are \(b_{1s}=0.000303\), \(b_{2s}=0.020834\), \(b_{3s}=6.498505\), \(b_{2p}=0.015615\), \(b_{3p}=2.404484\) in case (a) and \(b_{1s}=0.000291\), \(b_{2s}=0.019993\), \(b_{3s}=5.676217\), \(b_{2p}=0.013437\), \(b_{3p}=2.359189\) in case (b)

In particular, the asymptotic dependence of the HF orbitals is very well reproduced for each orbital with a moderate number of grid points (\(N=120\)) in the DP calculations, as shown for the Ar atom in Fig. 5a. In this case, the PS solution starts to break down at a radial distance between 20 a.u. (1s orbital) and 32 a.u. (3p orbital) where the numerical wavefunctions stop to decay exponentially while reaching values of the order of \(10^{-15}\) to \(10^{-13}\) a.u. (corresponding to \(\ln |\chi _{nl}|\) from -35 to -30). These limit values cannot be substantially lowered and, consequently, the validity of the PS solution cannot be extended to larger r by merely increasing the number of grid points beyond \(N=120\) in the calculations using the DP. This is so because the minimal values of the computed orbitals cannot be smaller than inevitable numerical inaccuracies (roundoff errors) due to the finite precision of the applied floating-point representation (15 to 16 significant digits for the DP).

Thus, to increase the accuracy of the calculated orbitals and by that means to extend the region where the PS solution is valid, a higher precision of the floating-point arithmetic is required alongside a larger number of grid points. Indeed, the computations done for the Ar atom with the QP and \(N=150\) lead to an even more accurate numerical solution which follows the correct asymptotic dependence of the HF orbitals up to \(r=50\) a.u. In this case, the boundary radius is similar for different orbitals while their respective values range from \(10^{-29}\) a.u. (1s orbital) to \(10^{-22}\) a.u. (3p orbital), which corresponds to the values of \(\ln |\chi _{nl}|\) from -67 to -51 as seen in Fig. 5b. If the number of grid points is increased to \(N=200\), the boundary of the region where the numerical solution is valid is extended to \(r=60\) a.u at which radius all the Ar occupied orbitals become less than \(10^{-27}\) a.u.

The QP solution facilitates an even closer look at the large-r variation of the HF orbitals determined with the PS method. In particular, it is revealed for the Ar atom that these numerically obtained wavefunctions reproduce very accurately not only the theoretically predicted exponential decay of the HF orbitals but also the power prefactors \(r^{\alpha _{nl}}\) present in their asymptotic expansion \(\chi _{nl}^{\mathrm{asymp}}(r)\). Indeed, the quantities \(S_{nl}(r)=\ln |\chi _{nl}(r)/\chi _{3p}^{\mathrm{asymp}}(r)|\) plotted in Fig. 6 almost exactly follow linear dependencies on \(\ln (r)\) for \(20\ \mathrm{a.u.} \le r \le 45\ \mathrm{a.u.}\), which have the form of \(-2\ln r+c_{nl}\) for the s orbitals and \(-3\ln r+c_{2p}\) for the 2p orbital, while the relation \(S_{nl}=0\) is well satisfied for the 3p orbital (HOMO), all this in excellent agreement with the asymptotic formula (51) if we take \(c_{nl}=\ln (b_{nl}/b_{3p})\).

Fig. 6
figure 6

Logarithm of \(\chi _{nl}(r)/\chi _{3p}^{\mathrm{asymp}}(r)\) (symbols and solid lines) for the occupied orbitals in the Ar atom obtained numerically with \(N=150\) using the QP, compared with the asymptotic expansion \(\ln |\chi _{nl}^{\mathrm{asymp}}(r)/\chi _{3p}^{\mathrm{asymp}}(r)|= (\alpha _{nl}-\alpha _{3p})\ln r+c_{nl}\) (dashed lines, see Eq. (51)) where \(\alpha _{nl}-\alpha _{3p}\) is -2 for \(nl=1s\), 2s, 3s and \(-3\) for \(nl=2p\) while the constants \(c_{nl}=\ln (b_{nl}/b_{3p})\) are found with the fitted values \(b_{nl}\) given in the caption of Fig. 5

The asymptotics of the HOMO wavefunction also determines the asymptotic variation of the total radial density, which is thus given by

$$\begin{aligned} \rho _{\mathrm{tot}}^{\mathrm{asymp}}(r)=2(2l_{\mathrm{H}}+1)\left[ \chi _{\mathrm{HOMO}}^{\mathrm{asymp}}(r)\right] ^2 = 2(2l_{\mathrm{H}}+1) b_{\mathrm{H}}^2r^{2\alpha _{\mathrm{H}}}\exp (-2\beta _{\mathrm{H}}r) \end{aligned}$$
(52)

where \(l_{\mathrm{H}}\) is the orbital number of the HOMO and \(b_{\mathrm{H}}\) is the coefficient \(b_{nl}\) in its asymtotic expansion (51). It is found that the theoretical relation (52) is very well reproduced by \(\rho _{\mathrm{tot}}(r)\) obtained in the PS calculations with the DP in a wide interval of r outside the occupied shells. In particular, this is true for radial distances up to 32, 42 and 58 a.u. from the nucleus for the Ar, Zn and Yb atoms, respectively; see Fig. 7.

Fig. 7
figure 7

Logarithm of the radial density \(\rho _{\mathrm{tot}}(r)\) (symbols and solid lines) obtained numerically with the DP and \(N=120\) for the Ar, Zn and Yb atoms, compared to its asymptotic expansion \(\ln \rho _{\mathrm{tot}}^{\mathrm{asymp}} (r) = -2\beta _{\mathrm{H}}r +2\alpha _{\mathrm{H}} \ln r + 2\ln b_{\mathrm{H}}\) (dashed lines), Eq. (51)), where \(\beta _{\mathrm{H}}=\sqrt{-2\epsilon _{\mathrm{HOMO}}}\) and \(\alpha _{\mathrm{H}}=1/\beta _{\mathrm{H}}\) are found with the HOMO orbital energy (Table 2), and \(b_{\mathrm{H}}\) (2.38385, 1.47165 and 0.77293 a.u. for Ar, Zn and Yb, respectively) is obtained by fitting \(\chi _{\mathrm{HOMO}}^{\mathrm{asymp}}(r)\) to the numerical \(\chi _{\mathrm{HOMO}}(r)\) at \(r=25.5146\) a.u

4 Conclusions

The HF equation for closed-(sub)shell atoms takes a simple form and can be easily solved numerically when one-electron wavefunctions are discretized on a radial grid with the PS method. Its solution involves standard problems in linear algebra like matrix inversion and diagonalization of a symmetric matrix. The boundary conditions are accounted for in the exact way in the derived formalism and no special treatment is needed to determine the numerical solution at points close to the nucleus and very distant from it. The PS solution of the HF equation allows for immediate calculation of various radial integrals (like those defining the total energy and its constituents) by using the highly accurate GLL quadrature based on the PS grid points. The results obtained in calculations using the DP floating-point format are of very high numerical accuracy which is achieved for grids including just a few tens of radial points In particular, the values of the total energy and the electron density at the nucleus are determined with 14 significant digits while the HOMO energies are found with 12-digit accuracy. The PS calculations also yield extremely accurate radial wavefunctions which are valid up to distances of few tens of atomic units from the nucleus and remarkably well reproduce the specific asymptotic variation of the HF orbitals, including their common exponential decay. The excellent accuracy of the obtained results is enhanced even further, to 25 significant digits for the total energies and 22 to 25 significant digits for the orbital energies, by extending the precision of the floating-point format to the QP while still using a moderate number of about 100 grid points.

Summarizing, the simple formalism and its straightforward numerical implementation combined with the unsurpassed accuracy of the calculated quantities make the PS method superior to other approaches to the numerical solution of the HF equation for closed-shell atoms. Further investigations are needed to extend this approach to open-shell atoms, described either with orbital-specific Fock operators or unified coupling operator in the restricted HF method.