1 Introduction

The fundamental relevance and concrete applications of the confined quantum systems have been established since the early days of quantum physics [13, 28, 41], up to the present day [23, 35, 39, 40]. Simple confined physical systems have a very long tradition in physics because of their importance as basic theoretical problems [4, 7, 24,25,26,27], and as prototypes to gain insights in semiconductor physics (quantum dots [8, 33], quantum wires and quantum wells [17, 30]). Atoms imprisoned in zeolite traps, clusters and fullerene cages provide good examples of confined systems in atomic physics and inorganic chemistry [6, 10, 18, 42].

Many of these studies on the physical–chemical properties of confined systems focus on systems with a small number of electrons: for example, species with small molecules containing hydrogen, helium and lithium. Furthermore, confinement is produced by means of an infinite potential well with different geometries, in order to produce analogies with different real systems without considering their details.

In recent years, our group has developed a very simple and versatile methodology to study this kind of systems [24,25,26,27]. It is a modification of the diffusion Monte Carlo (DMC) method: since the number of electrons is low, no variance reduction technique requesting a trial wavefunction is employed; instead, some efficient solutions to accelerate calculations and reduce noise are employed. Thanks to this method, it is possible to study different systems, with different orientations, and even quickly change the geometry of the potential well, from spherical to elliptical, from cylindrical to cubical, using Cartesian coordinates and implementing few modifications to the starting code.

Our previous works [24,25,26,27] focused on the effects of various confinement geometries on the excited states of monoelectronic systems, such as H and \(\hbox {H}_{\mathrm {2}}^{\mathrm {+}}\). In this paper, we show the application of the method to the ground state of two-electron systems (\(\hbox {H}_{\mathrm {2}}\) and \(\hbox {H}_{\mathrm {3}}^{\mathrm {+}})\) with non-trivial confinement geometries.

An exhaustive report on the many-electron confined system can be found in the work by Jaskólski [19]: Different methods of analysis and description of spatial confinement effects are reviewed, with a particular attention to their importance in semiconductor structures.

Free \(\hbox {H}_{\mathrm {2}}\) is one of the simplest molecular systems, and its electronic properties represent a keypoint in understanding larger molecular systems; therefore, its confinement has received much attention during the last decades. The molecular hydrogen confined in a rigid spheroidal box, with fixed and not fixed nuclear positions, was studied with variational calculations and quantum Monte Carlo techniques [9, 14, 15, 21, 22, 31], also with Monte Carlo methods beyond the Born–Oppenheimer approximation [37].

Many studies concerning the ground state and the potential energy surfaces of the \(\hbox {H}_{3}^{+}\) can be found in the literature ([1, 11, 20, 29, 32, 34]; to cite a few), but almost no information is available about the quantum confinement of this interesting molecular system. Quantum calculations based on diffusion method for the study of the free \(\hbox {H}_{3}^{+}\) in equilateral triangle configuration trace back to the works by Anderson [2, 3].

In this paper, we present the first results concerning the confined \(\hbox {H}_{2}\) inside a six-negative-charge cage and the collinear \(\hbox {H}_{3}^{+}\) enclosed in a nanotube. All results are obtained by diffusion Monte Carlo method.

2 Method

Quantum Monte Carlo (QMC) is a class of computer algorithm that is able to simulate quantum systems and to compute the electronic ground state of atoms, molecules and solids.

Among several quantum Monte Carlo methods available [16], the diffusion Monte Carlo (DMC) method offers the possibility to consider confining walls of any geometry while retaining the use of Cartesian coordinates and to include any distribution of positive charge within the cavity. Basically, DMC is a stochastic projector method that makes use of the similarity between the imaginary time Schrödinger equation and a generalized diffusion equation, which can be solved using stochastic calculus and simulating a random walk. The diffusion process of numerous “walkers” in the phase space is simulated. A walker is a mobile mathematical point in a set \(\left\{ {\mathbf {R}}_{i} \right\} \) of phase coordinates R in a 3N-dimensional space, where N is the number of physical electrons in the system, different from the number of walkers M, which is an integer numerical variable, \(M\sim {10}^{3}\). An evolution is performed by repeated application of the short-time diffusion–reaction propagator

$$\begin{aligned} G\left( {\mathbf {R}}\leftarrow {\mathbf {R}}^{'},\tau \right)\approx & {} \left( 2\pi \tau \right) ^{\frac{-3N}{2}}\hbox {exp}\left[ \frac{-\left( {\mathbf {R}}-{\mathbf {R}}^{'} \right) ^{2}}{2\tau } \right] \nonumber \\&\hbox {exp}\left[ \frac{-\tau \left( V\left( {\mathbf {R}} \right) -V\left( {\mathbf {R}}^{'} \right) -2E_{T} \right) }{2} \right] \nonumber \\ \end{aligned}$$
(1)

where \(\tau \) is a numerical step, and \(E_{T}\) is the so-called energy offset that controls the walker total population. The kinetic energy term of the wave equation is connected with the diffusion process (the first exponential term of Eq. (1), including the normalizing constant), while the potential energy term (the second exponential term) controls the so-called birth–death algorithm, that is the destruction or the multiplication of walkers [16]. According to this second factor, a walker may randomly disappear, or duplicate itself, in a numerical time step \(\tau \).

Each walker, say the i-th one, changes its state randomly at each calculation step: in the code, these coordinates are represented by vectors \(x(i,j), j=1,\ldots ,D\), so that even the change in dimensionality D is immediate. The micro-propagator of Eq. (1) is the product of two factors: the first one

$$\begin{aligned} {P_{1}= \left( 2\pi \tau \right) }^{\frac{-3N}{2}}\hbox {exp} \left[ \frac{-\left( {\mathbf {R}}-{\mathbf {R}}^{'} \right) ^{2}}{2\tau } \right] \end{aligned}$$
(2)

represents a diffusion process. To implement Eq. (2), we use a special technique: the central limit theorem of probability theory guarantees that, in the repeated application of random displacements, a Gaussian distribution like \(P_{1}\) is obtained anyway. Consequently, our programs do not use computationally expensive Gaussian random generators, but shift each coordinate according to a uniform probability distribution with the same variance as \(P_{1}\):

$$\begin{aligned} x\left( i,j \right) \leftarrow x\left( i,j \right) +3^{{1/2}}\tau (2\eta -1) \end{aligned}$$
(3)

where \(\eta \) is random number from a uniform distribution, \(0<\eta <1\). This amounts to replacing the first factor of the propagator with an equivalent expression, as far as quantum diffusion computations are concerned. This simple trick allows to obtain considerable code accelerations.

As for the non-conservative factor \(\hbox {P}_{2}\):

$$\begin{aligned} P_{2}= \hbox {exp}\left[ \frac{-\tau \left( V\left( {\mathbf {R}} \right) -V\left( {\mathbf {R}}^{'} \right) -2E_{T} \right) }{2} \right] \end{aligned}$$
(4)

if \(P_{2}<1\), a random number is generated to continue the evolution of the i-th walker with probability \(P_{2}\). If this walker disappears, a flag variable \(\xi (i)\) is set to zero. If \(P_{2}> 1\), a new walker is produced at the same position with probability \(P_{2}-1\). In such case, the new walker is placed at the tail of the list of walkers. At the end of each complete update of the x’s, the list of walkers is shortened by removing those with \(\xi \left( i \right) =0\).

During the simulation, \(E_{T}\) is constantly adjusted so that the average number of walkers is approximately constant [43]:

$$\begin{aligned} E_{T_{i}}=E_{T_{i-1}}+\alpha ln\left( \frac{M_{i-1}}{M_{i}} \right) \end{aligned}$$
(5)

where \(\alpha \) is a small positive parameter, and \(E_{T_{i}}\), \(E_{T_{i-1}}\), \(M_{i}\) and \(M_{i-1}\) are the energy values and number of walkers at time step iand \(i-\)1. In order to better improve the \(E_{T}\) calculation in the code, we adjusted Eq. (5) by considering an average number of walkers \(M_{av,i}\) (at time step i) in the numerator of the logarithmic term:

$$\begin{aligned} E_{T_{i}}=E_{T_{i-1}}+\alpha ln\left( \frac{M_{av,i}}{M_{i}} \right) \end{aligned}$$
(6)

By doing so, the natural oscillations of the Monte Carlo method are further reduced. At the numerical steady state, \(E_{T}\) becomes the estimate of the energy eigenvalue.

The method always provides the energy of the ground state of the system, with a very limited number of numerical parameters to be optimized (typically: energy offset \(E_{T}\), time step \(\tau \), number of walkers M). We assume \(\alpha \) equal to \( \tau \) to reduce the number of numerical parameters.

In order to reduce energy fluctuations and statistical deviations (typical of the DMC method), we implemented a sort of restart of the walker cloud, for each point of the potential energy curve. In a first simulation, the walker population is roughly initialized in a hypercubic subset of the phase space. The walker ensemble then diffuses according to Eq. (1), and the energy offset is adjusted according to Eq. (6). At the end of this simulation, a new and more realistic configuration of the walker cloud is obtained. This new configuration represents a sort of “guiding wavefunction,” and it is used as a starting point for a second simulation, which then gives a more precise energy eigenvalue.

In contrast with recent Monte Carlo calculations [36, 38], our programs do not employ an analytic expression of a guess wavefunctions to reduce variance. Instead, it performs long imaginary time evolutions, in the course of which averages are collected.

This is the reason we name it “unbiased”: it is essentially the most primitive form of the algorithm [2] but with some significant improvements. The first one is the aforementioned replacement of the expression of the propagator (Eq. (2)) with a different one, computationally equivalent, but less computationally expensive. The second improvement consists in using the walker cloud distribution obtained in a previous calculation and the related eigenvalue estimate as starting points for a calculation with a slightly different value of the nuclear positions: in this way, the previous calculation works as an estimate of the assumption to be obtained in the new calculation.

While this technique leads to somewhat larger oscillations and fluctuations compared to the employ of analytical guesses, it has the advantage to be applicable to different confinement geometries with minimal variations, without having to change the expression of the guess wavefunction, since no such guess is used.

DMC can handle only positive distributions, so many problems arise when we want to deal with a many-electron wavefunction. The DMC method can address low excited states (whose wavefunctions are not always positive) with distinct symmetries as well, by adding nodal surfaces that reproduce the excited state symmetry.

However, in the case of two-electron systems, an unrestricted, six-dimensional wavefunction \(\psi ({\mathbf {r}}_{{\mathbf {1}}},{\mathbf {r}}_{{\mathbf {2}}})\) for the ground state can be calculated directly. This means that the electron correlation is accounted exactly, with a remarkably low analytical fatigue: no expansion of the wavefunction \(\psi \) is needed, and no function database needs to be included, at least in the unbiased approach.

In this work, we are dealing with such two-electron wavefunctions. Our native codes are therefore updated to simulate two-electron confined systems thanks to the aforementioned features. All equations that govern the diffusion and branching algorithms can be changed accordingly without abandoning Cartesian coordinates. As a consequence, we can apply the DMC method to confined systems, like \(\hbox {H}_{2}\) and \(\hbox {H}_{3}^{+}\), with great freedom concerning confinement geometry, by simulating the six-dimensional system directly with the additional constraint that no six-dimensional walker can cross the confining surfaces. In the following sections, we consider two test cases (cylindrical confined \(\hbox {H}_{3}^{+}\) and crystal-field confined \(\hbox {H}_{2})\) to show the versatility of the method.

3 Cylindrical confined \(\hbox {H}_{3}^{+}\)

In this section of the work, we show results in the case of \(\hbox {H}_{3}^{+}\): this ion is the simplest triatomic species with only two electrons, so it is a system of considerable interest from a fundamental point of view.

The confinement by cylindrically symmetrical potential surfaces represents a good model for the chemical confinement of small molecules within nanotubes, such as carbon nanotubes. A quantum computation allows us to determine the potential energy surface of these species in the confined state. The potential energy surface can then be used to make structural studies, in particular to determine the equilibrium position of the nuclei, and dynamic studies, that lead to predictions of infrared and Raman spectroscopy.

In light of the increasing importance of studies related to the confinement of hydrogen-based species, in various kinds of materials specially designed to store large quantities of hydrogen (i.e., carbon nanotubes) [12] , it is important to undertake some first confinement studies of hydrogen-based species in nanotubes.

The cylindrical confinement of hydrogen species has been occasionally studied in the past, for example, in the case of H atoms [44], and \(\hbox {H}_{2}^{+}\) and \(\hbox {H}_{2}\) molecules [38], but no result has ever been reported in the literature for the \(\hbox {H}_{3}^{+}\) ion under such a confinement.

Since these are the first calculations for this confined system, we have considerably reduced the complexity of the problem: in particular, we are assuming that the molecule ion is collinear, with the molecular axis placed on the nanotube axis. We also assume that the two internuclear distances, from the central nucleus to the two terminal nuclei, are equal to each other and are indicated by d: the full system keeps therefore a \(D_{\infty h}\) symmetry (Fig. 1). This limitation is assumed only to reduce the number of independent parameters, the code can treat any other symmetry without modification. The cylinder radius, c, is the confinement characteristic length.

This system is implemented by introducing an appropriate expression for potential energy, i.e.:

$$\begin{aligned} V\left( {\mathbf {r}}_{1},{\mathbf {r}}_{2} \right)= & {} -\frac{1}{\left| {\mathbf {r}}_{1}-{\mathbf {k}}d \right| } -\frac{1}{\left| {\mathbf {r}}_{1}+{\mathbf {k}}d \right| }-\frac{1}{\left| {\mathbf {r}}_{2}-{\mathbf {k}}d \right| }\nonumber \\&-\frac{1}{\left| {\mathbf {r}}_{2}+{\mathbf {k}}d \right| }-\frac{1}{r_{1}}-\frac{1}{r_{2}}\nonumber \\&+\frac{1}{\left| {\mathbf {r}}_{1}-{\mathbf {r}}_{2} \right| }+\frac{5}{2d} \end{aligned}$$
(7)

where k is z-axis unit vector, and inserting the boundary conditions (see Fig. 1)

$$\begin{aligned} \psi \left( {\mathbf {r}}_{1},{\mathbf {r}}_{2} \right) =0\quad \hbox {if}\quad \left\{ {\begin{array}{l} x_{1}^{2}+y_{1}^{2}>c^{2}\quad \hbox {or} \\ x_{2}^{2}+y_{2}^{2}>c^{2} \\ \end{array}} \right. \end{aligned}$$
(8)
Fig. 1
figure 1

Collinear \(\hbox {H}_{3}^{+}\) (d is the internuclear distance) confined in a cylindrical nanotube with \(D_{\infty h}\) symmetry. c represents the confinement dimension. The internuclear distances, d, are equal

The boundary conditions are implemented by removing walkers that enter the “forbidden” region specified by Eq. (8). The results in Figs. 2 and 3 show what can be obtained using the DMC method in its primitive form, without the use of test functions. Note that the excellent reproduction of the state-of-the-art potential energy surface of \(\hbox {H}_{3}^{+}\) (Fig. 2) amounts to a validation of the method.

Fig. 2
figure 2

Free collinear \(\hbox {H}_{3}^{+}\): validation of our potential energy curve (blue line) with state-of-the-art data (orange dots) from a recent database courtesy Dr. Esposito, CNR-ISTP. The two internuclear distances, d, are equal

Fig. 3
figure 3

Collinear \(\hbox {H}_{3}^{+}\) potential energy curves, with different confinement dimensions: free and cylindrical confined \(\hbox {H}_{3}^{+}\). c represents the confinement dimension. The two internuclear distances, d, are equal

In Fig. 2, the comparison with the best available results, in the case of the unconfined system, shows how a very simple DMC code algorithm is able to obtain a satisfactory prediction with small deviations from the reference points in most cases. By inspecting the figure, it is also clear that the trend of the calculated solution is satisfactory: therefore, in a future application to ab initio molecular dynamics, the method may be exploited to produce a reliable interpolated potential energy surface. The potential energy curve is actually reproduced with sufficient accuracy to perform, for example, a posteriori calculations of vibrational states. This is not a calculation that can be done with our computational code (furthermore, it is out of the domain of the DMC method studied here), because the free collinear geometry is not stable in a vibration (the geometry of the free \(\hbox {H}_{3}^{+}\) ion is \(D_{3h}).\)

At this point, thanks to the versatility of the algorithm, it is possible to introduce readily the cylindrical infinite potential barrier illustrated in Fig. 1. Figure 3 shows the results of the compression of the electron cloud of the ion molecule by a cylindrical barrier with decreasing radius: the reduction of the available volume leads to a general lifting of the potential curve. The most important result is the shift toward smaller values of the equilibrium distance: this means that the molecule contracts due to the increase in the density of the electron cloud. Although similar results were reported for \(\hbox {H}_{2}\) under analogous confinement conditions [38], our point here is that the more complex system \(\hbox {H}_{3}^{+}\), with two electrons, can be studied with little difficulty with the unbiased DMC method, by avoiding the formulation of a suitable trial function. Only Eq. (7) needs to be changed. A substantial increase in the binding energy (compared to dissociation) is also observed: This is another effect due to the compression of the electron cloud.

We underline that while we have studied the collinear geometry of \(\hbox {H}_{3}^{+}\), nothing in the code prevents the consideration of any nuclear geometry, since the code high flexibility with regard to the changing of geometry.

4 Crystal-field confined \(\hbox {H}_{2}\)

In the previous section, we have shown the effect of a confinement by an infinite potential surface and with a geometric section: this is essentially a mathematical abstraction of more complex chemical problems. Actually, this approach (potential well confinement) was followed by the vast majority of the literature on confined hydrogen species.

With our algorithm, however, it is also possible to study a somewhat more realistic confinement mechanism, closer to the chemical reality of some systems. The mechanism, inspired by the premises of Bethe’s crystalline field theory [5], is based on the idea of using point electric charges in realistic geometric configurations of a crystal lattice, and which therefore produce a static potential surface. This acts on the charged species inside the molecule, in particular on the electrons.

Although this test case is not a strict geometrical confinement, it is clear that the electrostatic potentials due to the shell of negative charges act as a confining potential well for the electrons of the enclosed molecule.

Additionally, we expect a modulation of the potential energy surface, when the species included in the crystalline field are molecular species.

As a preliminary check, we have run the code in the case of the ground state of \(\hbox {H}_{2}\). At the equilibrium internuclear distance of 1.40 a.u., with a \(10^{3}\) walkers and 50,000 times steps at \(\tau = 0.002\), our code provides a ground energy of \(-1.171\) a.u., to be compared with the exact value given by \(-1.1744\) a.u. The accuracy can be further improved with a higher computational cost.

Figure 4 shows a sketch of the \(\hbox {H}_{2}\) molecule confined in a six-negative-charge cage: the hydrogen molecule has a molecular axis directed toward two of the opposite charges of the octahedron, and its center of mass coincides with the center of mass of the octahedron. We therefore have a \(D_{4h}\) symmetry.

Fig. 4
figure 4

\(\hbox {H}_{2}\) confined by a system of six-negative-point charges, with the hydrogen molecule-point charges system in a configuration of \(D_{4h}\) symmetry (although the octahedron is assumed to remain geometrically perfect, the symmetry is broken by the molecule)

Fig. 5
figure 5

Potential energy curves (on the right: close-up with extended x-axis) of one \(\hbox {H}_{\mathrm {2}}\) molecule confined by a system of six-negative-point charges (equal to -e). The variable lrepresents the distance of each point-charge from the center of symmetry

In Fig. 5, the energies of a confinement as from Fig. 4 are reported for several distances l of the point charges from the center of the octahedron. Each point is the result of the average of ten runs; increasing l brings to a larger standard deviation, which means that the method works even better for the strongly confined systems which are the target of our studies.

Figure 5 shows some of the results that can be obtained with our code: as the point charges approach, even in this case an effect of general energy increase is observed, due to the Coulomb repulsion, and the trend of the potential energy surface is significantly modified.

Unlike the previous case study, however, a significant shift in the minimum of the potential energy curve is not observed as the confinement strength increases. In the case of very narrow confinements, however, the state becomes progressively less bound and ultimately repulsive (Fig. 5). It is also probable that the minimum energy geometry of the molecule is not the one used for this preliminary study, but rather one close to a \(D_{3d}\) symmetry. These aspects can be investigated with more detailed calculations.

5 Conclusions

In conclusion, in the context of a new emerging class of problems, our proposal of the unbiased diffusion Monte Carlo calculation technique is based on the contrast between analytical fatigue and computational cost. The variance reduction techniques used for Monte Carlo methods require the formulation of fully correlated tentative wavefunctions: this formulation is not immediate in the case of confined systems, and it is not immediately transportable from one confinement geometry to another. On the other hand, the accuracy of the unbiased Monte Carlo method can be increased by accurate statistical analysis and simple solutions. Nowadays, the large availability of fast computing resources, even portable ones, might lead a researcher to favor an approach that allows to develop native, short and readable programs and, at the same time, to explore different confinement geometries with minimal modifications. Even with the limits due to statistical fluctuations, such algorithm takes the correlations between electrons into full account. Furthermore, our technique, despite being in the spirit of the primitive one, includes improvements of straightforward implementation, such as the faster propagator and the method of restarting the walker cloud. Ultimately, our experience suggests that a simpler technique, employing no analytic functions of significant complexity, can be a resource in the exploration of the wide range of possibilities that has been opened up by the recent reconsideration of confined quantum systems.