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
292 stars 135 forks source link

Hybrid representation does not support or detect overlapping muffin tins #4381

Open prckent opened 1 year ago

prckent commented 1 year ago

Describe the bug

The evaluation of the hybrid representation does not seem to support overlapping muffin tins. The code should either abort if any overlap or the code should be extended to support this case. Given the physical motivation behind the representation, the first seems easiest and should cover nearly all use cases.

To Reproduce

Non-variational energies can be found in VMC with large rcut

Expected behavior Abort or consistent energies

ye-luo commented 1 year ago

Muffin tins are constructed with the effect of all the surroundings. I think evaluating orbitals based on the nearest center is solid.

kayahans commented 1 year ago

Here are the tests we ran on bilayer graphene and bilayer hBN. In the lmax convergence tests r_i is set to 1.4 for every species and in rcut tests lmax is set to 5. The graphs have error bars, but they are mostly barely visible.

C-C bond length is 1.42 A, which would make r>1.34 Bohrs to get overlapping spheres. VMC energies in graphene become non-variational beyond rcut = 1.4 Bohrs. Similarly B-N bond length is 1.44 A that is where VMC energies become non-variational in BN as well.

image image image
kayahans commented 1 year ago

In bilayer graphene, I have looked at the portion of the data specifically to trace the origin of the error. Using mf-1.0 and lmax=5 data, I have plotted the kinetic energy and total energy as a function of rcut. Both energies are referenced to zero at rcut=0.6 Bohrs. image

ye-luo commented 1 year ago

Non-variantional energy is a separate issue/feature. When the smooth scheme fails to make second derivative continuous, you do see energy kinks. Users needs to pick a proper imax and rcut to make the hybrid beneficial without hurting accuracy.

jtkrogel commented 1 year ago

What we are seeing is not due to the smoothing scheme. The choice of nearest center in the case of overlapping spheres introduces step discontinuities in the wavefunction at the surfaces of the Voronoi polyhedra between the atomic centers.

In order to have variational energies, this discontinuity must be avoided. The simplest way to avoid it is to abort with a message in the event of overlapping hybrid spheres.

ye-luo commented 1 year ago

For a given point in the overlapping area, the muffing tin of both sides are constructed based on the PW orbitals value. If you can accept the value discrepancy between one side muffin tin and PW, one should also accept the value discrepancy on the other side. Then the discrepancy between two muffin tins can be tolerated.

There is already discrepancy between muffin and intestinal area already. The data you provided cannot rule out the possibly that the discrepancy between muffin and intestinal area caused the issue. This can be rule out by stretching the lattice and see how the rcut behaves.

ye-luo commented 1 year ago

There is correlation between rcut and Lmax as well. A large rcut requires large lmax.

jtkrogel commented 1 year ago

We have two cases at least that demonstrate the onset of the error in the energy occurs at the point the spheres begin to overlap. In the case of truly overlapping spheres, there is no smoothing at the boundary between them and true discontinuities are introduced.

ye-luo commented 1 year ago

We have two cases at least that demonstrate the onset of the error in the energy occurs at the point the spheres begin to overlap. In the case of truly overlapping spheres, there is no smoothing at the boundary between them and true discontinuities are introduced.

Did you mean the figures above? There is a possibility that with rcut = 1.4 the discrepancy between discrepancy between muffin and intestinal area, already messed up the energy before even to worry about overlapping.

jtkrogel commented 1 year ago

@kayahans would you repost below the three energy vs rcut figures above (for C, B, and N) with a vertical line added at the point of sphere overlap? This should clarify the issue.

kayahans commented 1 year ago

@jtkrogel I have added the plots showing sphere overlaps at dashed lines. For BN the dashed lines show r{B-N} - 1.4 bohrs because the second specie rcut is set to 1.4 in the tests, but r{B-N} is about 2.72 bohrs so it is not too far off from the center. Graphite is single species so spheres overlap at the center of the bonds.

graphite hBN-v hBN-e

kayahans commented 1 year ago

It looks like discontinuities start when the inner spheres touch each other, beyond the dashed lines. I had used the default of 0.3 bohrs for the interstitial region.

ye-luo commented 1 year ago

It looks like discontinuities start when the inner spheres touch each other, beyond the dashed lines. I had used the default of 0.3 bohrs for the interstitial region.

What you show only explains energy jumps happen at rcut around half of the bound length but it is a not a direct proof of overlapping being the root cause.

  1. Could you try graphite with lattice parameters doubled and see where energy jumps happen?
  2. Use spo_scanner to scan the orbital values from one center to its nearest neighbor.
    Usage:
    add the following block at the end of determinantset block.
    <spo_scanner source="i">
      <path name="a" from_atom="0" to_atom="1" nknots="41"/>
      <path name="b" from_pos="0.0 0.0 0.0" to_pos="6.74632230 6.74632230 6.74632230" nknots="61"/>
    </spo_scanner>
jtkrogel commented 1 year ago

How about testing with fixed bond length and independently changing the B and N rmax's in hBN? This way we could see if the energy jumps track the sphere overlap point (which would vary along the bond) or not.

This would also have the advantage of not having to generate fresh orbitals, perform jastrow opt, etc.