{'fraction_non_alphanumeric': 0.03774633653360283, 'fraction_numerical': 0.0074785245073269325, 'mean_word_length': 4.232945531464833, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 1, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Momentum-space finite-size corrections for Quantum-Monte-Carlo calculations

Extended solids are frequently simulated as finite systems with periodic boundary conditions, which due to the long-range nature of the Coulomb interaction may lead to slowly decaying finite- size errors. In the case of Quantum-Monte-Carlo simulations, which are based on real space, both real-space and momentum-space solutions to this problem exist. Here, we describe a hybrid method which using real-space data models the spherically averaged structure factor in momentum space. We show that (i) by integration our hybrid method exactly maps onto the real-space model periodic Coulomb-interaction (MPC) method and (ii) therefore our method combines the best of both worlds (real-space and momentum-space). One can use known momentum-resolved behavior to improve convergence where MPC fails (e.g., at surface-like systems). In contrast to pure momentum-space methods, our method only deals with a simple single-valued function and, hence, better lends itself to interpolation with exact small-momentum data as no directional information is needed. By virtue of integration, the resulting finite-size corrections can be written as an addition to MPC.


I. INTRODUCTION
The issue of finite-size corrections in Quantum-Monte-Carlo (QMC) calculations has recently been attracting considerable attention. [1][2][3][4][5] As QMC calculations of solids need to be carried out within a supercell, the Coulomb interaction is typically replaced by the so-called Ewald interaction that is compatible with the supercell geometry. 6 This, in turn, is equivalent to dealing with an infinite system with a periodically repeated exchange-correlation (xc) hole. In other words, using the Ewald interaction includes the spurious effective interaction of an electron with its periodically repeated xc hole. One solution to this drawback -the real-space solution -is to use QMC data at length scales smaller than the supercell size where QMC is expected to be accurate and substitute the missing terms implicitly or explicitly. E.g., the Model Periodic Coulomb-interaction (MPC) method 1 deals with the periodically repeated xc hole by using the bare Coulomb term within the supercell and assuming that beyond the supercell an electron only feels the Hartree potential with no further correlations. This represents a good approximation in a bulk solid, where the xc hole decays rapidly. In contrast, Chiesa al. 2 traced the Ewald error back to an integration error and then added back the missing contribution, yielding a momentum-space solution.
In a recent paper, 4 the spherically-averaged structure factor S k was introduced in order to analyze and reduce Coulomb finite-size effects. This (S k ) represents a natural quantity to study finite size errors: On the one hand, it is a simple one-dimensional function which via integration yields the interaction energy and, on the other hand, it naturally orders the QMC data according to length scale. Although QMC can, in principle, model correlations well at short length scales, it is bound to fail at larger scales due to the fact that finite simulation cells must be used.
So far we have only touched on the issue of finite-size corrections for the interaction energy. The information to evaluate this is contained in the spherical average of the diagonal terms of the two-particle density matrix (the two particle density) and hence S k , which contains the same information, suffices. However, other quantities may be computed using QMC which also suffer from finite-size errors. E.g. Chiesa al. 2 also deal with corrections to the finite-size errors in the kinetic energy but since the kinetic energy needs information that goes beyond the diagonal terms of the density matrix such an analysis is beyond the scope of this paper which is based solely on the information in S k . Similarly, finite-size corrections to the momentum distribution 3 cannot readily be done using just S k .
The aim of this paper is to show that modelling S k with the MPC ansatz yields a momentum-resolved MPC. This allows for an intuitive analysis of finite-size errors and for an improvement of MPC whenever MPC fails, such as in surface-like systems. First of all, in Section II we discuss S k in the context of QMC and apply the MPC ansatz, thereby showing that via integration over k our method exactly maps onto MPC. In Section III, we first look at a non-interacting uniform electron gas in order to (i) see how MPC breaks down in this case and (ii) learn how to overcome the limitation of MPC by using our hybrid analysis. We also report Diffusion Monte Carlo (DMC) calculations of the structure factor of an interacting uniform electron gas, which yields an intuitive understand-ing of the MPC in interacting systems. This then leads us to an easy way to understand the existing difficulties that arise in the case of a slab geometry, 7,8 and we propose a simple method to address this difficult problem. We round off the paper with a summary and conclusions. We use atomic units throughout (h = e 2 = m e = 1).

A. The interaction energy
The interaction energy U int of an arbitrary system of many interacting electrons can be expressed as follows where U H represents the Hartree energy (which in the case of an infinite jellium model is exactly cancelled by the presence of the positive background) and U xc represents the so-called xc interaction energy corresponding to the attractive interaction between each electron and its own xc hole: Here, n(r) is the electron density and n xc (r, r ′ ) represents the xc-hole density of an electron at r. For brevity, we shall also define a reduced electron density n red (r, r ′ ), which represents the electron density at r ′ seen by a given electron at r in the presence of (hence, reduced by) its xc hole: n red (r, r ′ ) = n(r ′ ) + n xc (r, r ′ ) = n 2 (r, r ′ ) n(r) , where n 2 (r, r ′ ) is the so-called two-particle density. 9 Note that n xc (r, r ′ ) < 0.

B. Model periodic Coulomb interaction (MPC)
The only periodic solution of Poisson's equation for a periodic array of charges is the so-called Ewald interaction, which is of the Coulomb form 1/r only in the limit of an infinitely large simulation cell. However, while the Hartree energy is given correctly by this Ewald interaction, the part of the electron-electron energy coming from the interaction of electrons with their own xc hole yields a spurious contribution that is due to the interaction of an electron with its periodically repeated xc hole. This drawback was solved in Ref. The reduced electron density n red (r, r ′ ) seen by an electron at r, as a function of u = |r−r ′ |. In the absence of exchange and correlation, this would equal the electron density n(r ′ ) (thin solid line) which in the case of a uniform electron gas would be constant. In the presence of exchange and correlation, the true reduced electron density n red (r, r ′ ) is of the form represented by the thick line marked "TRUE", which for a supercell geometry (of linear dimension L) becomes the reduced Ewald density represented by the thick dotted line marked "EWALD". The MPC interaction energy U int is obtained by using a cutoff reduced electron density (thick solid line marked "MPC") that coincides with (i) the reduced Ewald electron density within the simulation cell and (ii) the electron density n(r ′ ) beyond the simulation cell.
the sum of two terms: The Hartree energy U H calculated with the Ewald interaction, and the beyond-Hartree xcenergy U xc calculated with a cutoff Coulomb interaction using the minimum image convention, i.e., translating coordinates of electron pairs such that r − r ′ lies within the simulation cell. Hence, the MPC interaction energy U int is obtained by simply replacing the true reduced electron density n red (r, r ′ ) of Eq. (4) by the MPC reduced electron density n MP C red (r, r ′ ) of the form displayed in Fig. 1 by the thick solid line marked "MPC".
C. Spherically averaged structure factor S k Starting with the xc-hole density n xc (r, r ′ ) at r ′ around an electron at r, one finds the following momentumresolved form of the xc interaction energy of Eq. (3): 10 where S k is the spherical average of the diagonal structure factor S k,k ′ : 4 and u = |r − r ′ |. Equation (5) represents a general expression for the xc interaction energy, which is formally exact not only for homogeneous media but also for an arbitrary inhomogeneous many-electron system.

D. Monte-Carlo (MC) sampling of the structure factor
When performing MC sampling on a function f (r, r ′ ) such as the Coulomb potential 1/|r − r ′ |, what we are actually calculating is where the minimum image convention is used. In conjunction with Eq. (4), this yields the MC sampling of the spherically averaged structure factor of Eq. (6): here S H k being the Hartree contribution: where again the minimum image convention is being employed, i.e., the integrals are carried out over the simulation cell (SC). The densities n(r) here are standard MC electron densities.

E. MPC from S k
If one applies the MPC ansatz in the calculation of the spherically averaged structure factor S k , by simply assuming (as in Fig. 1) that beyond the supercell correlations are only due to variations in the density, then Eq. (5)  The MPC ansatz implies a finite extent of the xc hole, which in turn results in a quadratic behavior of S k as k → 0. In the case of finite systems (e.g., atoms, molecules, and clusters) and bulk solids, this quadratic behavior of the structure factor is qualitatively correct because of the short range of the xc hole in those systems. Hence, in those systems, as long as the simulation cell is sufficiently large for the spherically averaged structure factor at the cutoff momentum k c ∼ 1/L to already be in or close to the asymptotic low-k behavior, the MPC ansatz yields accurate results: Since in those systems the true S k is an essentially quadratic function as k → 0, constrained by S k=0 = 0, and the same constraints hold for S MP C k , only higher-order terms contribute to any residual error.
There are some caveats, however. The non-interacting uniform electron gas as well as semi-infinite systems contain a linear contribution to S k at k → 0 (due to the presence of a xc hole that is not negligible even at large distances), which causes the failure of the MPC scheme. Nevertheless, in the framework of our momentum-resolved approach there is room for improvement over MPC, since one has flexibility to go beyond the MPC ansatz by replacing the low-k structure factor S MP C k by its known correct value.

III. THE MPC STRUCTURE FACTOR IN PRACTICE
A. The non-interacting uniform electron gas The non-interacting (Hartree-Fock) uniform electron gas was dealt with extensively in Ref. 4. Here we briefly discuss this system, with the aim of now introducing a correction term. The exact Hartree-Fock (HF) structure factor S k of a uniform electron gas, which is easily derived analytically, 11 is shown in Fig. 2 (dashed-dotted red line) together with the result we obtain by using the MPC ansatz (solid black line). This figure clearly shows that the MPC result is in qualitative error at low k, due to the fact that the actual HF structure factor does not exhibit a quadratic behavior in the limit as k → 0 but a linear behavior instead. Our momentum-resolved technique, however, has room for improvement, by going beyond the MPC ansatz.
Beyond a system-size dependent momentum cutoff k c (i.e., at k > k c ), the QMC electron correlation and hence structure factor are expected to be accurate. The momentum cutoff k c should be of the order of the inverse of the characteristic length L of the supercell. A simple way to model a correction proceeds as follows: After choosing an appropriate cutoff k c (vertical line of Fig. 2), we model the corrected HF structure factor as a straight line between S k=0 = 0 and S MP C kc and the MPC structure factor as a quadratic curve between the same points. The correction to MPC is then given by the area between these two curves. The dotted blue line and the dashed green line of Fig. 2 illustrate this modelling. More realistic models are of course feasible. E.g., one could take into account derivatives of S k at k = 0 or k = k c , etc.
Hence, as long as we are interested in the xc interaction energy U xc , there is no need to actually evaluate the spherically averaged structure factor for all k. In fact, if we assume that k c is already in the asymptotic regime one can base the entire correction on the value of k c and the asymptotic form of the structure factor. Let us assume the MPC structure factor below k c is of the form while the true functional dependence (in the asymptotic region) ought to be α coming from the linear term in the HF S k . 11 At the cutoff, both should of course coincide: as should their derivatives: which yields β = 2α/k c and γ = −α/k 2 c . In this model, the corrected structure factor S k only differs from the MPC structure factor at momenta between zero and k c , so the correction in U xc can easily be evaluated using Eq. (5); it turns out to be: With k c ∼ 1/L, we immediately get that the MPC error scales as ∼ 1/L 2 ∼ 1/V 2/3 . We now also see how limiting the constraint of a finite cutoff when using an MPC like analysis actually is: The quadratic model HF structure factor of Eq. (10) (see the dashed green line of Fig. 2) and the actual MPC HF structure factor (solid black lines of Fig. 2) are nearly identical and quite different from the exact HF structure factor (dashed-dotted red line and dotted blue line of Fig. 2). This is despite the model MPC HF structure factor only using the asymptotic quadratic shape and  N =18, 54, 102, and 178, N being the number of electrons), at the MPC level. The thick dotted blue line marked "asymptotic" represents the true structure factor of a uniform electron gas at k → 0: S k = k 2 /2ωp. 13 The vertical lines represent the cutoff kc = 1/L for N =18, 54, 102, and 178.
the value of the MPC HF structure factor at the cutoff where it ought to coincide with the exact HF structure factor.
As pointed out above, so far this represents a crude way of devising the finite-size correction to the MPC result. More complex functional forms can be chosen, by using the structure factor or even its derivatives at k = 0 or k = 0 to estimate the corresponding parameters. Analytic integration would then yield a more accurate correction term.

B. The interacting uniform electron gas
In Ref. 4, Variational Monte Carlo (VMC) calculations of the structure factor S k and the xc interaction energy U xc of an interacting uniform electron gas were reported. Here we report DMC calculations of these quantities, as obtained by following the Hellmann-Feynman sampling introduced in Ref. 12. Figure 3 exhibits the DMC structure factor S k of an interacting uniform electron gas of r s = 1, as obtained by following the MPC ansatz for various values of N (the number of electrons in the simulation cell). As pointed out in Ref. 4, the true interacting structure factor S k is quadratic at k → 0. 13 Fig. 3 shows that our MPC DMC structure factor nicely reproduces this low-k limit (thick dotted blue line marked "asymptotic"). The MPC DMC structure factor of Fig. 3 could be improved by using at low wavevectors the structure factor that one can obtain numerically in the random-phase approximation (RPA), which is known to be accurate in the low-k regime.

C. Semi-infinite electron gas
It is well known that in the case of a semi-infinite electron gas the correct behavior of the structure factor S k at low k consists of a linear term accounting for the surface contribution that is augmented by the usual quadratic bulk term. For a finite simulation cell of width L z and surface area A, one finds (in the long-wavelength limit k → 0): 14 where now and Here, β represents the usual bulk term, 13 and α follows from Eqs. (2.13) and (3.34) of Ref. 14, ω s = ω p / √ 2 being the surface-plasmon energy. As the system gets larger (L z → ∞) the relative surface contribution shrinks, as expected. Nonetheless, surface energies, which have no contribution from the bulk part of the structure factor, are entirely dominated by the linear surface-contribution αk.
The MPC ansatz will never yield the linear term of Eq. (15). In order to solve this shortcoming, one can perform a simple analysis similar to the one leading to Eq. (14), now employing the linear surface term of Eq. (16). This would yield an MPC error that scales as ∼ 1/V . However, for this to make sense one needs a well defined cutoff k c below which the quadratic MPC behavior should be replaced by the correct linear behavior of Eq. (15) and above which the MPC structure factor is essentially exact. Nevertheless, in the case of realistic calculations 8 of surface energies where the surface area needs to be varied for a fixed slab width and vice versa, finding a well-defined cutoff k c might not be possible, so that one would need to explore more complex functional forms of the structure factor involving the MPC structure factor itself and possibly its derivatives at one or more values of k, such as k = k c . In conjunction with the known surface contribution α of Eq. (16), such schemes could correct significantly the existing MPC surface calculations.

D. Implicit correction to the Coulomb kernel
An interesting observation is that any correction to the structure factor implies a correction ∆V c to the Coulomb potential V C = 1/u: For 0 < k < k c , S MP C k is given by evaluating the kernel sin(ku)/ku entering Eq. (6). Instead, sampling the quantity gives S cor. k , the finite-size corrected structure factor. This will differ from S MP C k only between k = 0 and k = k c ; the fraction in Eq. (18) is therefore well-defined. But the integral of the kernel, (2/π) kc 0 sin(ku)/ku = 1/u, is precisely the implied Coulomb potential V C . Changing the kernel thus changes the implicit Coulomb potential: This is a short-range correction in the sense that when performing the MC run u is effectively restricted to within the simulation cell. On the other hand, the k in the integral is smaller than k c , which is inversely proportional to the simulation-cell size, and so ku entering the sin function in Eq. (19) is generally below 1.
In the case of the model of Eqs. (10) and (11) we get, for example, S H k must then also be evaluated using ∆V C , as it is used in S k via n xc . In contrast, U H continues to be the standard Ewald Hartree energy.

IV. SUMMARY AND CONCLUSIONS
First of all, we have demonstrated that modelling the spherically averaged structure factor S k with the MPC ansatz (momentum-resolved MPC) yields exactly, after integration, the MPC interaction energy of Ref. 1. This allows us to see explicitly that in the case of solids and finite systems MPC improves convergence considerably (over the more traditional Ewald scheme), due to the fact that for such systems MPC yields the correct quadratic behavior of S k as k → 0. We also see explicitly how the MPC ansatz breaks down in the case of the noninteracting uniform electron gas and, in general, in the case of all systems exhibiting a similar pathology, i.e., an extended xc hole (at surfaces, for example), where the leading term of S k at k = 0 is proportional to k.
As the explicit k dependence of S k at low wave vectors can usually be known, one can look at QMC systems at different length scales separately enabling us to analyze the xc interaction energy at different length scales and to derive a correction term. On integration, this term yields a correction to QMC calculations that are based on the model periodic-Coulomb interaction MPC.