1 Introduction

The equations of correlated many-body quantum systems such as the Coulombic system, which are described mainly by Schrödinger equation, are not possible to solve analytically. The problem arises with the integrals in the calculations of the expectation values of energy, namely that the integrals generally are multi-dimensional ones and can be seldom calculated analytically. For this reason, one must use appropriate approximation method to solve Schrödinger equation specially under the influence of external potentials.

Over the last decade, continuing effort has gone into calculating, with ever increasing accuracy and with various methods, the energies of atoms and ions in neutron star magnetic fields. The motivation comes largely from the fact that features discovered [1, 2] in the thermal emission spectra of isolated neutron stars may be due to absorption of photons by heavy atoms in the hot, thin atmospheres of these strongly magnetized cosmic objects [3]. The accurate and detailed calculations were carried out by Ivanov [4] and Rosner et al. [5] for hydrogen atom in intermediate and strong magnetic fields. For helium atom, it was investigated at different field strengths using 2D mesh Hartree–Fock (HF) method [6] and by including the correlation energy using quantum Monte Carlo approach [7]. In addition, lithium atom and iso-electronic ions up to Z = 10 were investigated in [8] and [9] at different magnetic field strengths using diffusion and variational Monte Carlo methods.

For free four electron system, Barbosa, and Nascimento [10] used proper independent particle model at the generalized valence bond and generalized multi-structural levels (GMS) for the ground state of the beryllium atom. The used wave functions showed that the correlation energy of the valence shell is small. Also, it was found that by including the 1s22p2 configuration, the stabilization happened neither due to non-dynamic nor dynamic correlation effects. Feng Wu and Lijuan Meng [11] used the double-parameter double-fold perturbation scheme by considering spin–spin interaction of electrons to calculate the ground state energy of the beryllium atom. It was found that the effective nuclear charge seen by the outer shell electrons is optimized by the repulsion of the inner shell electrons.

Moreover, the beryllium atom under the influence of external magnetic field was studied by Guan and Taylor [12] where the authors used a modified freezing full-core (modified FFC) method using Slater basis set and calculated the ground and low-lying excited states of beryllium atom in different regions of magnetic field. The results were accurate compared with the unrestricted Hartree–Fock (HF) calculations of smaller base extension. Also, O. A. Al-Hujaj and P. Schmelcher [13] studied the ground and the excited states of the singlet, triplet, and quintet multiplicity of many states for positive and negative parity of beryllium atom in strong magnetic field based on full configuration interaction (FCI) method. They also calculated the total and the one particle ionization energies beside the allowed wavelengths as functions of different magnetic field strengths. Furthermore, Wang and Qiao [14] investigated the beryllium atom using the FFC method for the weak magnetic field region of strength \(\beta ,\) \(0 \le \beta < 0.5\) a. u., and the full-core-plus-correlation calculation for the strong magnetic field region \(0.5 \le \beta \le 10\) a. u., based on the anisotropic Gaussian basis set. They obtained a significant improvement in the precision of the singlet states and the same precision of the triplet states compared to the FCI method. In addition, the energies of the first and the second ions in different regions of magnetic field beside the ionization energies of the beryllium atom were provided.

On using such approximation methods, the quantum Monte Carlo (QMC) techniques are used to solve the Schrödinger equation which are classified as variational Monte Carlo (VMC) [15, 16], diffusion Monte Carlo [17] and Green’s function Monte Carlo methods [18]. The VMC method is based on a combination of two ideas: namely, the variational principle and the Monte Carlo evaluation of integrals using importance sampling based on the Metropolis algorithm [19].

Accordingly, the aim of the present work is to apply the VMC method, using trial wave functions including the correlation term, to evaluate the free ground state of the beryllium atom, its ions, and iso- electronic ions and under the influence of the external magnetic field on these states. Moreover, our aim is to investigate the excited states of this atom in external magnetic field.

2 The method of calculations

In the VMC method, the evaluation of the expectation value of the Hamiltonian operator is obtained by multiplying and dividing the integrand by the trial wave function, as follows

$$ E_{{{\text{VMC}}}} = \frac{{\mathop \smallint \psi^{*} \left( R \right)\frac{{\hat{H}\psi \left( R \right)}}{\psi \left( R \right)} \psi \left( R \right){\text{d}}R}}{{\mathop \smallint \psi^{*} \left( R \right)\psi \left( R \right){\text{d}}R}} $$
(1)

where \(\psi \left( R \right)\) is a trial wave function depending on variational parameters which are optimized to obtain the minimum energy eigenvalue using importance sampling based on the Metropolis algorithm. We rewrite Eq. (1) as follows:

$$ E_{{{\text{VMC}}}} = \smallint P\left( R \right)E_{L} \left( R \right){\text{d}}\left( R \right) $$
(2)

where \(P\left( R \right) = \frac{{\left| {\psi \left( R \right)} \right|^{2} }}{{\smallint \left| {\psi \left( R \right)} \right|^{2} {\text{d}}R}}{ }\) is interpreted as a probability distribution function and \(E_{L} \left( R \right) = \frac{{\hat{H}\psi \left( R \right) }}{\psi \left( R \right)}\) is the local energy function which is evaluated using a series of points \(R_{lj}\) proportional to \(P\left( R \right)\) according to the Metropolis algorithm. The trial wave function for a given state must produce an energy which is above the exact value of that state;\({ } E_{{{\text{VMC}}}} \ge E_{{{\text{exact}}}} .\)

After enough evaluations, \(E_{{{\text{VMC}}}}\) can be written in the form:

$$ E_{VMC} = \left\langle {E_{L} } \right\rangle = \mathop {\lim }\limits_{N \to \infty } \mathop {\lim }\limits_{M \to \infty } \frac{1}{N}\frac{1}{M}\mathop \sum \limits_{j = 1}^{N} \mathop \sum \limits_{i = 1}^{M} E_{L} \left( {R_{ij} } \right) $$
(3)

where \({\text{M}}\) is the ensemble size of generated random numbers \(\left\{ {R_{1} ,R_{2} , \ldots ,R_{M} } \right\}\) and \(N\) is the number of ensembles. Also, the standard deviation of the energy of the system is given by

$$ \sigma = \sqrt {\frac{{\langle E_{L}^{2}\rangle - \langle E_{L}\rangle^{2} }}{{M\left( {N - 1} \right)}}} $$
(4)

Generally, the essential idea of the VMC numerical method is not to evaluate the integrand at every one of many quadrature points, but rather at only a representative random sampling of abscissae. The Monte Carlo strategy turns out to be very appropriate for a broad class of problems in statistical and quantum mechanics, by evaluating integrals of high dimension. The VMC quadrature involves two basic operations: generating abscissa randomly distributed over the integration volume with a specified distribution \(w\left( {\varvec{x}} \right)\) and then evaluating the average value of the function \(f/w\), where \(f\) is the function to be integrated, at these abscissae. Although the methods for generating random numbers according to a specified distribution can be very efficient, it is difficult or impossible to generalize them to sample a complicated weight function in many dimensions, and so an alternative approach is required. One very general way to produce random variables with a given probability distribution of arbitrary form is known as the Metropolis algorithm, as it requires only the ability to calculate the weight function for a given value of the integration variables. The algorithm has been applied widely in statistical mechanics problems, where the weight function of the canonical ensemble can be a very complicated function of the coordinates of the system and so cannot be sampled conveniently by other methods.

In our work, the Metropolis algorithm within the VMC method was implemented by a FORTRAN-95 computer program for many electron systems either in free state or under the influence of external magnetic field or plasma state. The most important thing in this technique is the use of a suitably chosen trial wave function including the correlation part and the spin function in the calculations. This method proved that it gives results in excellent agreement with previous findings for few electron atoms. Specifically, when compared with the method of Lagrange mesh [20] for helium atom in plasma states, the direct variational and the SCF Hartree–Fock methods for confined lithium atom [21]. In all the above-mentioned calculations, our code was implemented successfully for all the used many electron systems and the code was made without any cost.

3 The Hamiltonian of the system

The Hamiltonian operator using the Born–Oppenheimer approximation in the absence of the field and in a. u. \(\left( {e = \hbar = m = 4{\uppi }\varepsilon_{0} = 1} \right)\) is given by

$$ H = - \frac{1}{2}\mathop {\sum\limits_{i = 1}^{n} {\left( {\nabla_{i}^{2} + \frac{2Z}{{r_{i} }}} \right)} }\limits_{{}} + \mathop \sum \limits_{i < j} \frac{1}{{r_{ij} }} $$
(5)

where n is the total number of electrons, Z is the nuclear charge (here, Z = 4 for Be, Be+ and Be2+, but for B+ and C2+, Z = 5 and 6, respectively), \({\mathrm{r}}_{\mathrm{i}}\) is the distance between the ith electron and the nucleus, and \({\mathrm{r}}_{\mathrm{ij}}\) are the inter-electron distances.

In the present work, the Hamiltonian was introduced using Hylleraas Coordinates [22] as

$$\begin{aligned}& H = - \frac{1}{2}\left( \mathop \sum \limits_{{i = 1}}^{n}\frac{{\partial ^{2} }}{{\partial r_{i}^{2} }} + \mathop \sum \limits_{{i = 1}}^{n} \frac{2}{{r_{i} }}\frac{\partial }{{\partial r_{i} }} + \mathop \sum \limits_{{i < j}}^{n} 2\frac{{\partial ^{2}}}{{\partial r_{{ij}}^{2} }}+ \mathop \sum \limits_{{i < j}}^{n} \frac{4}{{r_{{ij}} }}\frac{\partial }{{\partial r_{{ij}} }}\right.\\&\qquad + \mathop \sum \limits_{{i \ne j}}^{n} \frac{{r_{i}^{2} +r_{{ij}}^{2} - r_{j}^{2} }}{{r_{i} r_{{ij}} }}\frac{{\partial ^{2}}}{{\partial r_{i} \partial r_{{ij}} }}+ \mathop \sum \limits_{{i \ne j}}^{n} \mathop \sum \limits_{{k > j}}^{n} \frac{{r_{{ij}}^{2} + r_{{ik}}^{2} - r_{{jk}}^{2} }}{{r_{{ij}} r_{{ik}} }}\frac{{\partial ^{2} }}{{\partial r_{{ij}} \partial r_{{ik}} }} \hfill \\&\quad \quad + \mathop \sum \limits_{{i = 1}}^{n} \frac{1}{{r_{i}^{2} }}\frac{{\partial ^{2} }}{{\partial \theta _{i}^{2} }} + \mathop \sum \limits_{{i = 1}}^{n} \frac{1}{{r_{i}^{2} \sin ^{2} \theta _{i} }}\frac{{\partial ^{2} }}{{\partial \varphi _{i}^{2} }} + \mathop \sum \limits_{{i = 1}}^{n} \frac{{\cot \theta _{i} }}{{r_{i}^{2} }}\frac{\partial }{{\partial \theta _{i} }}~ \\&\qquad + \mathop \sum \limits_{{i \ne j}}^{n} \left( {2\frac{{r_{j} \cos \theta _{j} }}{{r_{i} r_{{ij}} \sin \theta _{i} }}~ + \cot \theta _{i} \frac{{r_{{ij}}^{2} - r_{i}^{2} - r_{j}^{2} }}{{r_{i}^{2} r_{{ij}} }}} \right)\frac{{\partial ^{2} }}{{\partial \theta _{i} \partial r_{{ij}} }} \hfill \\&\quad \quad \left. { + \mathop \sum \limits_{{i \ne j}}^{n} 2\frac{{r_{j} \sin \theta _{j} }}{{r_{i} r_{{ij}} \sin \theta _{i} }}\sin \left( {\varphi _{i} - ~\varphi _{j} } \right)\frac{{\partial ^{2} }}{{\partial \varphi _{i} \partial r_{{ij}} }}} \right)\\&\qquad + \mathop \sum \limits_{{i = 1}}^{n} \frac{{ - Z}}{{r_{i} }} + \mathop \sum \limits_{{i < j}}^{n} \frac{1}{{r_{{ij}} }} \hfill \\\end{aligned} $$
(6)

The Hamiltonian of the system in the presence of a magnetic field can be written as

$$ H_{{{\text{Mag}}}} = H + \frac{1}{8}\gamma^{2} \rho^{2} + \frac{{\gamma \left( {L_{z} + 2S_{z} } \right)}}{2} $$
(7)

where \({\upgamma }\) is the strength of the magnetic field in a. u., \(\rho^{2} = \sum\nolimits_{i = 1}^{4} {\rho_{i}^{2} } = \sum\nolimits_{i = 1}^{4} {x_{i}^{2} } + y_{i}^{2}\), \({\text{S}}_{{\text{z}}}\) is the z-component of the total spin, and \({\text{L}}_{{\text{z}}}\) is the z-component of the total angular momentum, \(\frac{{\gamma L_{z} }}{2}\) is the diamagnetic term and \( \gamma S_{z}\) is the Zeeman term. For the ground state of beryllium atom and iso-electronic ions (B+ and C2+), where \(L_{z} = 0\) and \( S_{z} = 0\), the term \(\frac{1}{8}\gamma^{2} \rho^{2}\) was considered only as an additional term with \(H{ }\) in the calculations. But for the excited states and beryllium ions, the total Hamiltonian was considered.

4 The trial wave functions

4.1 The ground and excited states of beryllium atom, and its iso-electronic ions

In our calculations of the ground state energy of the beryllium atom, iso-electronic ions, and the excited states, we applied the VMC method and used a trial wave function with the spin part and correlation factor as follows

$$ \psi \left( {r_{1} ,r_{2} ,r_{3} ,r_{4} } \right) = A \left[ {\varphi \left( {r_{1} ,r_{2} ,r_{3} ,r_{4} } \right) \chi \left( {1,2,3,4} \right) \mathop \prod \limits_{i < j} f\left( {r_{ij} } \right)} \right], $$
(8)

where A is the antisymmetrization operator [23] which takes the form

$$ \begin{aligned} A & = \hat{e} - \hat{P}_{12} - \hat{P}_{13} - \hat{P}_{14} - \hat{P}_{23} - \hat{P}_{24} - \hat{P}_{34} + \hat{P}_{123} \\ & \quad+ \hat{P}_{132} + \hat{P}_{124} + \hat{P}_{142} + \cdot \hat{P}_{134} + \hat{P}_{143} + \hat{P}_{234} \\ \hat{P}_{243} & - \hat{P}_{1234} - \hat{P}_{1243} - \hat{P}_{1324} - \hat{P}_{1342} - \hat{P}_{1423}\\ & \quad - \hat{P}_{1432} + \hat{P}_{12} \cdot \hat{P}_{34} + \hat{P}_{13} \cdot \hat{P}_{24} + \hat{P}_{14} \cdot \hat{P}_{23} \end{aligned} $$
(9)

In Eq. (9), \(\widehat{\mathrm{e}}\) is the identity permutation, while \({\widehat{P}}_{ij}\) is the permutation of the ith and jth particles. Analogously, the operators \({\widehat{P}}_{ijk}\) and \({\widehat{\mathrm{P}}}_{\mathrm{ijkl}}\) are the permutations of three particles i, j, and k and four particles i, j, k, and l, respectively. The spin part (\(\chi \left(\mathrm{1,2},\mathrm{3,4}\right)\)) of the wave function for the ground state of beryllium atom, iso-electronic ions and singlet excited states is given by

$$ \chi \left( {1,2,3,4} \right) = \frac{\alpha \left( 1 \right)\beta \left( 2 \right) - \alpha \left( 2 \right)\beta \left( 1 \right)}{{\sqrt 2 }} \times \frac{\alpha \left( 3 \right)\beta \left( 4 \right) - \alpha \left( 4 \right)\beta \left( 3 \right)}{{\sqrt 2 }} $$
(10)

But for the triplet states, it takes the form

$$ \chi \left( {1, \, 2, \, 3, \, 4} \right) \, = \frac{\alpha \left( 1 \right)\beta \left( 2 \right) - \alpha \left( 2 \right)\beta \left( 1 \right)}{{\sqrt 2 }}\beta \left( 3 \right)\beta \left( 4 \right) $$
(11)

where α, β are the spinor indices.

The spatial part of the trial wave function for the ground state of beryllium atom and its iso-electronic ions is given by

$$ \begin{aligned}\varphi _{1} \left( {r_{1} ,r_{2} ,r_{3} ,r_{4} } \right){\text{ }}&= \frac{{\left( {z^{\prime } z^{{\prime \prime }} } \right)^{3}}}{{8\pi ^{2} }}\exp \left( { - z^{\prime } \left( {r_{1} + r_{2} }\right) - z^{{\prime \prime }} \left( {\frac{{r_{3} }}{2} +\frac{{r_{4} }}{2}} \right)} \right);\\&\quad \left( {1 - \frac{{z^{{\prime \prime }} r_{3} }}{2}}\right)\left( {1 - \frac{{z^{{\prime \prime }} r_{4} }}{2}} \right)\end{aligned} $$
(12)

But for the low-lying excited states, (1s22s2p, 1s22s3s and 1s22s3p), it is given by

$$ \begin{aligned}\varphi _{2} \left( {r_{1} ,r_{2} ,r_{3} ,r_{4} } \right) &=\frac{{\left( {z^{\prime } } \right)^{3} }}{\pi }\exp \left( { -z^{\prime } \left( {r_{1} + r_{2} } \right)} \right)R_{{nl}} \left({z^{{\prime \prime }} ,r_{3} } \right)\\&\quad {\text{ }}Y_{{lm}} \left( {\theta _{3} ,\varphi _{3} }\right)R_{{nl}} \left( {\kappa ,r_{4} } \right)Y_{{lm}} \left({\theta _{4} ,\varphi _{4} } \right)\end{aligned} $$
(13a)

while

$$ \begin{aligned}\varphi _{3} \left( {r_{1} ,r_{2} ,r_{3} ,r_{4} } \right){\text{ }}&= \frac{{\left( {z^{\prime } } \right)^{{\frac{3}{2}}} }}{{\sqrt \pi }}\exp \left( { - z^{\prime } r_{1} } \right)R_{{nl}} \left({z^{{\prime \prime }} ,r_{2} } \right)Y_{{lm}} \left( {\theta _{2},\varphi _{2} } \right)\\&\quad {\text{ }}R_{{nl}} \left( {z^{{\prime \prime }} ,r_{3} }\right)Y_{{lm}} \left( {\theta _{3} ,\varphi _{3} } \right)R_{{nl}}\left( {\kappa ,r_{4} } \right)Y_{{lm}} \left( {\theta _{4} ,\varphi _{4} } \right) \end{aligned} $$
(13b)

and

$$ \begin{aligned}\varphi _{4} \left( {r_{1} ,r_{2} ,r_{3} ,r_{4} } \right) &=\frac{{\left( {z^{\prime } } \right)^{{\frac{3}{2}}} }}{{\sqrt \pi }}\exp \left( { - z^{\prime } r_{1} } \right)R_{{nl}} \left({z^{{\prime \prime }} ,r_{2} } \right)Y_{{lm}} \left( {\theta _{2},\varphi _{2} } \right)\\&\quad {\text{ }}R_{{nl}} \left( {k,r_{3} } \right)Y_{{lm}} \left({\theta _{3} ,\varphi _{3} } \right)R_{{nl}} \left( {\kappa ,r_{4} }\right)Y_{{lm}} \left( {\theta _{4} ,\varphi _{4} } \right)\end{aligned} $$
(13c)

are the corresponding functions for the core-excited states 1s2s23s and 1s2s3s2, respectively. The spatial wave functions with variational parameters (\({z}^{{\prime}{\prime}}\) and \(\kappa \)) for each state are given in Table 1.

Table 1 The spatial wave functions with variational parameters (\({z}^{{\prime}{\prime}} \)and \(\kappa \))

In Eq. (8), \(f\left( {r_{ij} } \right)\) is the Jastrow correlation function given by

$$ f \left( {r_{ij} } \right) = \exp \left[ {\frac{{r_{ij} }}{{n\left( {1 + \mu r_{ij} } \right)}}} \right] $$
(14)

where \( n = \left\{ {\begin{array}{*{20}l} 2 \hfill & {{\text{for}}\;{\text{unlike}}\;{\text{spins}}} \hfill \\ 4 \hfill & {{\text{for}}\;{\text{like}}\;{\text{spins}}} \hfill \\ \end{array} } \right. \), which makes this function satisfy the cusp conditions. The four variational parameters \( z^{\prime}, z^{\prime\prime}\), \(\kappa\) and \(\mu\) are varied in order to obtain the best fit to the energy eigenvalues of the beryllium atom and its isoelectronic ions by using the VMC method.

In the presence of magnetic field, the trial wave function could be constructed using Eq. (8) as

$$ \Psi_{1Mag} = \psi \left( {r_{1} ,r_{2} ,r_{3} ,r_{4} } \right) \exp \left( { - \eta^{2} \mathop \sum \limits_{i = 1}^{4} \rho_{i}^{2} } \right), $$
(15)

where \(\mathrm{exp}\left(-{\upeta }^{2}\sum_{\mathrm{i}=1}^{4}{\uprho }_{\mathrm{i}}^{2}\right)\) is the lowest Landau orbital wave function with \(\eta \) as a variational parameter.

4.2 The beryllium ions Be+ and Be2+

For Be+ ion, the used trial wave function in the presence of magnetic field is taken in the form

$$ \Psi_{{2_{Mag} }} = A\left[ {\varphi \left( {r_{1} ,r_{2} ,r_{3} } \right) \chi \left( {1,2,3} \right)\mathop \prod \limits_{i < j} f\left( {r_{ij} } \right)} \right]\exp \left( { - \eta^{2} \mathop \sum \limits_{i = 1}^{3} \rho_{i}^{2} } \right) $$
(16)

where \(A\) is the three-particle antisymmetrizer

$$ A = I - \hat{P}_{12} - \hat{P}_{13} - \hat{P}_{23} + \hat{P}_{123} + \hat{P}_{132} $$
(17)

and

$$ \varphi \left( {r_{1} ,r_{2} ,r_{3} } \right) = \psi_{{Z^{\prime}}} \left( {r_{1} } \right) \psi_{{Z^{\prime}}} \left( {r_{2} } \right) R_{nl} \left( {z^{\prime\prime},r_{3} ) Y_{lm} \left( {\theta_{3} ,\varphi_{3} } \right)} \right) = \frac{{z^{{^{\prime 3} }} z^{{\prime \prime \frac{3}{2}}} }}{{2\pi \sqrt {2\pi } }} = e^{{ - z^{\prime}\left( {r_{1} + r_{2} } \right) - z^{\prime\prime}\left( {\frac{{r_{3} }}{2}} \right)}} \left( {1 - \frac{{z^{\prime\prime}r_{3} }}{2}} \right) $$
(18)

Also, the spin function \(\chi \left(\mathrm{1,2},3\right)\) is given by

$$ \chi \left( {1,2,3} \right) = \alpha \left( 1 \right)\beta \left( 2 \right)\alpha \left( 3 \right) - \beta \left( 1 \right) \alpha \left( 2 \right)\alpha \left( 3 \right) $$
(19)

For the Be++ ion, the used trial wave function is

$$ \Psi_{{3_{{{\text{Mag}}}} }} = \left[ {\psi \left( {r_{1} ,r_{2} } \right) \chi \left( {1,2} \right)\mathop \prod \limits_{i < j} f\left( {r_{ij} } \right)} \right]\exp \left( { - \eta^{2} \mathop \sum \limits_{i = 1}^{2} \rho_{i}^{2} } \right) $$
(20)

where \(\uppsi \left({\mathrm{r}}_{1},{\mathrm{r}}_{2}\right)\) is constructed as

$$ \psi \left( {r_{1} ,r_{2} } \right) = \psi_{{Z^{\prime}}} \left( {r_{1} } \right) \psi_{{Z^{\prime}}} \left( {r_{2} } \right) = \frac{{Z^{^{\prime}3} }}{\pi }e^{{ - Z^{\prime}\left( {r_{1} + r_{2} } \right)}} $$
(21)

and

$$ \chi \left( {1,2} \right) = \frac{1}{\sqrt 2 }\left( {\alpha \left( 1 \right)\beta \left( 2 \right) - \beta \left( 1 \right)\alpha \left( 2 \right)} \right) $$
(22)

5 Results and discussion

In the present paper, the VMC method was applied to the ground and excited states of beryllium atom in addition to the beryllium iso-electronic ions with 107 Monte Carlo integration points. For an atom under the effect of magnetic field strength, there are four regimes of interaction for an excited electron. The electron moves initially through the core region of the atom and emerges into a region where the Coulomb potential dominates, and the diamagnetic potential is negligible. It then enters a region where both fields are of comparable strength and finally, reaches the asymptotic region where the cylindrically symmetric magnetic field potential dominates.

5.1 The ground state of the beryllium atom and iso-electronic ions

The ground state energy eigenvalues of the beryllium atom and its isoelectronic ions B+ and C2+ were evaluated using the VMC. The calculations were made without the influence of magnetic fields using the trial wave functions of Eq. (8) and in the presence of magnetic field using Eq. (15). Our computational program enables us to vary the variational parameters successively in loops until the minimum energy eigenvalue is obtained. The comparison of the obtained results of the ground state of beryllium atom in magnetic field with the available previous results is shown in Table 2. These results show good agreement with the other results. At the weak magnetic field strength region, 0 \(<{\varvec{\upgamma}}\) \(\le \) 1, the Coulomb potential dominates till the intermediate filed strength region starts to occur at \(2\le {\varvec{\upgamma}}<5\). By increasing the strength of magnetic field, the spherical symmetry is clearly broken and the cylindrically symmetric magnetic field potential dominates.

Table 2 Energy of the beryllium atom in a homogeneous magnetic field as function of the field strength \(\gamma \), in a. u

For iso-electronic ions (B+ and C2+), the obtained results are shown in Table 3. In this table, the results of [24] for B+ are without correlation energy as in column 3. So, the correlation energy was provided for this case. It is shown that for B+ at \({\varvec{\upgamma}}\ge 2\), the energy starts to increase and then, enters the region of broken spherical symmetry, but this happen for C2+ at \({\varvec{\upgamma}}\ge \) 5 due to the increase in nuclear charges which makes the Coulomb potential be more dominated and needs stronger magnetic field to break the spherical symmetry. The results of C2+ were evaluated by optimizing the variational parameters to obtain the best values, and there is no other published work to compare with.

Table 3 Energies of iso-electronic ions in a homogeneous magnetic field as function of the field strength \(\gamma \), in a. u. The correlation energy of (B+) is also provided

5.2 The excited states of beryllium atom

The calculations were made here for the singlet and triplet excited states of beryllium atom (1s22s2p, 1s22s3s and 1s22s3p) and core states (1s2s23s and 1s2s3s2) using the total trial wave function of Eq. (15) including Eqs. (13a),(13b) and (13c) as spatial parts, respectively. Also, the two spin wave functions of Eqs. (10) and (11) were used for the singlet and the triplet states, respectively. The results of the 1s22s2p state are shown in Table 4 in comparison with the results of [14] for the singlet and triplet states at different values of magnetic field strength. The values of the other states are shown in Tables 5 and 6 for the singlet and triplet states, respectively. Also, the results were plotted as a function of \({\varvec{\upgamma}}\) as in Figs. 1 and 2.

Table 4 Energies of the singlet and triplet states of 1s22s2p as function of the field strength \(\gamma \) in a. u. compared with the results of [14]
Table 5 Energies of the singlet excited states as function of the field strength \(\gamma \) in a. u
Table 6 Energies of the triplet excited states as function of the field strength \(\gamma \) in a. u
Fig. 1
figure 1

Energies of singlet excited states at different values of magnetic field strength \(\gamma \)

Fig. 2
figure 2

Energies of triplet excited states at different values of magnetic field strength \(\gamma \)

For singlet states, where the diamagnetic term \(\frac{{\varvec{\upgamma}}{\mathbf{L}}_{\mathbf{z}}}{2}\) and Zeeman term \({\varvec{\upgamma}}{\mathbf{S}}_{\mathbf{z}}\) were vanished as \({\mathbf{L}}_{\mathbf{z}}=0\) and \({\mathbf{S}}_{\mathbf{z}}=0\), there are crossovers between the low lying singlet excited states (1s22s2p, 1s22s3s and 1s22s3p) and the ground state of beryllium atom as shown in Fig. 1. At weak field strength, the beryllium atom is still in ground state 1s22s2 at the Coulomb region till increasing the field strength slightly and then, the crossover occurs between 1s22s2 and 1s22s2p at \({\varvec{\upgamma}}\)= 0.2167. Then, the ground state configuration becomes 1s22s3s at \({\varvec{\upgamma}}\)= 0.3247 and at \({\varvec{\upgamma}}\) = 0.3447 the ground state is 1s22s3p. There are no crossovers occurred between the ground state and the core singlet excited states (1s2s23s and 1s2s3s2).

For triplet states as shown in Fig. 2, the crossovers between the low-lying excited states (1s22s2p, 1s22s3s and 1s22s3p) occurred at \({\varvec{\upgamma}}<\) 0.3. At \({\varvec{\upgamma}}\)= 0.14935, the configuration of the ground state becomes 1s22s2p.Then, by increasing the filed till \({\varvec{\upgamma}}\)= 0.27035 the ground state is 1s22s3s and at \({\varvec{\upgamma}}\)= 0.2918 the ground state is 1s22s3p. Unlike the singlet core excited states, the crossovers between the core triplet states and the ground state of beryllium atom1s22s2 occurred at \({\varvec{\upgamma}}\)= 2.62849 for 1s2s23s state and at \({\varvec{\upgamma}}\)= 2.84446 for 1s2s3s2 state where the diamagnetic and Zeeman terms were considered.

5.3 The beryllium ions (Be+ and Be2+)

The VMC was applied here using Eq. (16) of four parameters and Eq. (20) of three parameters for the beryllium ions (Be+ and Be2+), respectively. The results were compared with those of [14] and show agreement with them as in Table 7. Also, the results were plotted together with the ground state of beryllium atom at different values of magnetic strength and crossovers occurred between them as in Fig. 3. At \(\gamma\)= 0.2979, Be+ becomes the ground state and by increasing the field till \(\gamma\)= 0.64165 the ground state is Be2+.

Table 7 Energies of the beryllium ions (Be+ and Be2+) as functions of the magnetic field strength \(\gamma \) in a. u. compared with the results of [14]
Fig. 3
figure 3

Energies of the beryllium ions (Be + and Be2+) at different values of magnetic field strength \(\gamma \)

6 Conclusions

In the present paper, we applied the VMC method to study several problems concerning the beryllium atom, ions and iso-electronic ions. To achieve these goals, we used suitable trial wave functions which are based on hydrogenic wave functions multiplied by Jastrow correlation functions, which represent the electron–electron interactions, and the spin functions for singlet and triplet states.

In the first part of the present paper, we calculated the ground state energy and the energies of the iso-electronic ions using trial wave functions of four variational parameters as free states and under the influence of magnetic field. In the second part of this work, we investigated some new singlet and triplet excited states using trial wave functions of five variational parameters. Eventually, the beryllium ions were studied using two different trial wave functions with different two spin functions.

The energies were plotted as functions of the magnetic field strengths to show graphically the effect of the magnetic field on the behavior of the total energy. The results showed good agreement with other works, and this implies that the VMC method can be considered as an efficient tool to study many electron systems under the influence of magnetic field.