QMCPACK / qmcpack

Main repository for QMCPACK, an open-source production level many-body ab initio Quantum Monte Carlo code for computing the electronic structure of atoms, molecules, and solids with full performance portable GPU support
http://www.qmcpack.org
Other
284 stars 135 forks source link

Error in VMC force evaluation from bspline-wavefunctions of heterogenous systems #1996

Open tiihonej opened 4 years ago

tiihonej commented 4 years ago

Error is found in the self-consistency assessment of VMC forces (ACForce) of CO in bpsline basis.

The bspline-wavefunction is very straightforward in terms of the ZVZB estimator, because its derivatives w.r.t. ionic coordinates are zero, that is, Fzvzb = Fhf. The account of implicit change of coefficients is more involved, but the self-consistency (correctness of the implementation) can be easily checked by fixing the wavefunction at eqm. and using it for all separations ("noJfix").

The trials were generated with QE (PBE0) with ccECP (aug-VTZ). No Jastrows were used, because they contain problems of their own (#1944 ).

The forces per ion should be equal to the energy derivative (i.e. F_1 = -F_2 = -dE/dR, where 1 and 2 refer to ions and R to their separation), but they are actually off by a large fraction. However, the errors are same in magnitude, leading to (F_1 - F_2)/2 = -dE/dR. This could be caused by a simple sign error in one of the force components.

CO_PW_forces_total

Candidates for the bug can be narrowed down by a lot, because homogenous dimers (e.g. H2 and O2) do not show it.

rcclay commented 4 years ago

I'm looking into this. There seems to be a potential memory initialization issue, since this example crashes when boundary conditions are changed from "n n n" to "p p p".

rcclay commented 4 years ago

My old PBC Na2 sodium runs crash as well. After this is fixed, I'll put in short stochastic test to catch such breakages.

rcclay commented 4 years ago

@tiihonej Can you break up the ZVZB force into the ion-ion, local, and nonlocal pieces? I don't know if your error bars are small enough to allow you to fit the non-local and localECP energies to polynomials and differentiate them directly, but that would be the most direct and unambiguous test of which force component (if not all of them) are wonky in this system.

tiihonej commented 4 years ago

I'll email you about breaking down the force into local/non-local components. I did some tests, but drawing conclusions can be a bit involved.

I'm starting to think this one might also not be a bug, after all. According to recent tests, this only happens with frozen wavefunctions (wavefunction fixed, ions moved). Might there be something wrong with that test and bsplines? It does work for LCAO, though.