Diffusion Monte Carlo¶
Diffusion Monte Carlo is implemented in the casino.dmc.DMC class. It projects out
the ground state from a trial wave function by evolving an ensemble of walkers (electron
configurations) in imaginary time:
where \(E_T\) is the reference (trial) energy. With importance sampling the walkers are distributed according to the mixed distribution \(f(\mathbf{r}, t) = \Psi(\mathbf{r})\Phi(\mathbf{r}, t)\), which satisfies the Fokker–Planck-like equation with drift, diffusion and branching terms. For fermions the nodal surface of \(\Phi\) is constrained to that of \(\Psi\) (the fixed-node approximation [17]): moves that change the sign of \(\Psi\) are rejected.
For a short time step \(\tau\) the importance-sampled Green’s function factorizes into a drift-diffusion part and a branching part:
where \(\mathbf{v} = \nabla \ln \Psi\) is the drift velocity and \(S\) is the branching energy. One DMC step consists of a drift-diffusion move for every walker, a branching (birth/death) step, and a T-move step if nonlocal pseudopotentials are present.
Summary of Methods¶
DMC class has the following methods:
Method |
Description |
|---|---|
perform a number of DMC steps, return the history of \(E_{best}\) |
|
one DMC step: drift-diffusion, branching, T-move, update of \(E_T\) |
|
EBES (method 1) or CBCS (method 2) drift-diffusion move of all walkers |
|
drift velocity with UNR limiting applied |
|
position-dependent limiting parameter \(a(\mathbf{r}_i)\) |
|
ZSGMA-limited branching energy \(S(\mathbf{r})\) |
|
stochastic birth/death of walkers according to their weights |
|
Casula T-move for nonlocal pseudopotentials |
|
redistribute walkers evenly across MPI ranks |
drift_diffusion¶
Each walker is propagated by the Langevin step
where \(\bar{\mathbf{v}}\) is the limited drift velocity. The short-time Green’s function is not exact, so a Metropolis accept/reject step enforces detailed balance:
Moves crossing the nodal surface (\(\mathrm{sign}\,\Psi(\mathbf{r}') \neq \mathrm{sign}\,\Psi(\mathbf{r})\)) are rejected. To prevent persistent (stuck) walkers, the acceptance probability of a walker that has not moved for more than 50 steps (CBCS) or 20 steps (EBES) is multiplied by \(1.1^{\text{age}}\).
Two sampling modes are implemented:
CBCS (
dmc_method : 2) — all electrons are moved at once, single accept/reject.EBES (
dmc_method : 1) — electrons are moved one at a time, each with its own accept/reject.
Rejected moves slow the diffusion down, which is accounted for by the effective time step used in branching [18]:
where \(\Delta \mathbf{r}\) is the diffusive part of a proposed electron displacement, that is the displacement measured from the drifted position, and the averages run over the proposals for all electrons of all walkers, including those rejected at the nodal surface.
Modifications for bare nuclei (nucleus_gf_mods : T, all-electron systems only [18]):
the drift of an electron at distance \(z\) from the nearest nucleus is decomposed
into components parallel and perpendicular to \(\hat{\mathbf{z}}\), the unit vector
from the nucleus to the electron. The drifted position is
so that the drift never carries an electron through the nucleus. The new position is then sampled from a mixture of a Gaussian centred at \(\mathbf{r}_{drift}\) and an exponential centred at the nucleus:
which mimics the cusp in the Green’s function near the nucleus.
limiting_velocity¶
Close to the nodal surface the drift velocity diverges, causing large time-step errors. The velocity is smoothly limited following Umrigar, Nightingale and Runge [18]:
where \(v_i^2 = |\mathbf{v}_i|^2\) is the squared drift of electron \(i\): every
electron is limited by its own velocity, not by that of the whole configuration. For all-electron
systems with nucleus_gf_mods : T the parameter \(a\) is position-dependent
(alimit_vector):
with \(z_i\) the distance to the nearest nucleus; otherwise the constant alimit
keyword (default 0.5) is used.
branching_energy¶
The branching energy of a walker is
where the ratio of the limited to the unlimited drift velocity suppresses branching near the nodal surface [18], and the deviation of the local energy from the current best estimate is limited according to Zen, Sorella, Gillan, Michaelides and Alfè [19]:
This scheme makes the time-step error size-consistent: the energy cutoff grows with the number of electrons \(N_e\).
branching¶
After the drift-diffusion move each walker carries the weight
the reweighting factor of UNR [18] averaged over accepting and rejecting the proposed move. Averaging the exponent rather than applying \(\exp[\tau_{eff}(S(\mathbf{r}) + S(\mathbf{r}'))/2]\) to accepted moves and \(\exp[\tau_{eff} S(\mathbf{r})]\) to rejected ones gives the same \(\tau \to 0\) limit with a smaller time-step error, but it needs the local energy at \(\mathbf{r}'\) even when the move is rejected. A move rejected at the nodal surface has \(p = 0\) and the expression reduces to \(W = \exp[\tau_{eff} S(\mathbf{r})]\). In EBES every electron carries its own acceptance probability and the walker has no single \(p\), so there the symmetric average \(W = \exp[\tau_{eff}(S(\mathbf{r}) + S(\mathbf{r}'))/2]\) over the whole electron sweep is used instead. The walker is then replaced by \(M = \lfloor W + u \rfloor\) copies, where \(u\) is a uniform random number on \([0, 1]\); walkers with \(M = 0\) are killed.
The reference energy \(E_T\) is updated after every step to keep the total walker
population close to the target (dmc_target_weight) [18]:
where \(E_{best}\) is the population average of the local energy over all MPI ranks.
t_move¶
The nonlocal pseudopotential energy is evaluated with the localization approximation,
which makes the DMC energy non-variational and sensitive to the quality of \(\Psi\).
The T-move scheme of Casula [20] (use_tmove : T) restores the upper-bound property by
turning the sign-problem-free part of the nonlocal operator into an additional walker move:
after branching, each electron of each walker is offered a heat-bath move to one of the
angular quadrature points \(\mathbf{r}_q\) (see nonlocal_potential)
with probability proportional to
restricted to the points where this quantity is positive; with the complementary probability the walker stays in place. Electrons are processed one after another (the size-consistent version of the algorithm [21]).
load_balancing¶
Branching makes the walker population fluctuate independently on every MPI rank. Every 500 steps the walkers are redistributed pairwise between ranks so that each rank carries the same number of walkers. The load-balancing efficiency
is accumulated and reported at the end of the run.
random_step¶
One DMC step chains the stages described above:
drift_diffusion — propagate and accept/reject every walker;
branching — duplicate/kill walkers according to their weights;
t_move — T-move for pseudopotential systems;
update \(E_{best}\), \(\tau_{eff}\) and \(E_T\) (MPI-reduced over all ranks).
random_walk¶
Runs steps DMC steps, calling load_balancing every 500 steps,
and returns the per-step history of \(E_{best}\) from which the DMC energy and its
statistical error are estimated by the reblocking analysis.