quasi-2D calculations with Pyscf

94 views
Skip to first unread message

Kayahan Saritas

unread,
Apr 18, 2020, 8:49:28 PM4/18/20
to qmcpack
Hi, 

We have been trying to calculate vacuum convergence on 2D GaSe with qmcpack. 
Trial wavefunction is generated using PYSCF. 
The vacuum converges at around 10 A in DFT. 
However, in VMC with 2-body jastrows the vacuum does not seem to converge. 
Jastrow parameters were optimized on the cell with smallest vacuum and then reused on the other cells. 

Vacuum (A)Energy (Ha)
10.74-23.082837+/-0.001358
13-22.941112+/-0.001928
19-22.882884+/-0.001426
25-22.848418+/-0.001485
28-22.836112+/-0.001735
31-22.828162+/-0.001714
34-22.822691+/-0.001523
37-22.815175+/-0.001723
40-22.810566+/-0.001804

We have used LR_dim_cutoff of 20 and boundary='ppn'. 
For the systems with vacuum length longer than 19 A, default LR_handler option failed to pass ion-ion energy test even when the LR_dim_cutoff parameter was increased up to 50. 
Based on Jaron's suggestion in this forum (https://groups.google.com/forum/#!topic/qmcpack/3Hkt5sWY_e4) we used LR_handler=ewald for the longer cells. 
After using the new long range handler, the ion-ion energy test passed, but we obtained the vacuum vs energy results above. 

We tried using vacuum parameter in the simulationcell block, but the ion-ion energy test failed bad even when we used a small vacuum value such as 1.1. 

Thanks,
Kayahan


Jaron Krogel

unread,
Apr 20, 2020, 9:11:01 AM4/20/20
to Kayahan Saritas, qmcpack
Hi Kayahan,

Can you report on the same table the ion-ion energy from QMCPACK and also from Quantum Espresso?  The two should agree.

~Jaron

--
You received this message because you are subscribed to the Google Groups "qmcpack" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qmcpack+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/qmcpack/ec165093-d8fa-4391-b0e0-f237ba266c23%40googlegroups.com.

Kayahan Saritas

unread,
Apr 20, 2020, 12:59:26 PM4/20/20
to Jaron Krogel, qmcpack
Hi Jaron, 

We had generated wavefunctions using Pyscf. I think you are right, let me post the results. 

vacuum (A)ABCD
13-2.6718773-23.175685-2.6718773-2.671853
1932.2170612-23.17568432.217061229.996052
2571.4555241-23.17568471.455524171.45558
2891.8320383-23.17568491.832038391.832112
31112.51798-23.175684112.51798112.518061
34133.431441-23.175684133.431441133.431531
37154.51708-23.175684154.51708154.517179
40175.736157-23.175684175.736157175.736264

A: Nuclear repulsion energy of the twist
grep_last */nscf-1-9-1*/nscf.out "nuclear repulsion”
(grep_last greps the last occurence)
B: Total energy of the twist
grep_last */nscf-1-9-1*/nscf.out "energy"
C: Nuclear repulsion energy of the converged SCF calculation
grep_last */scf-*/scf.out "nuclear repulsion”
D: QMCpack ion-ion repulsion energies
qmca -q ii */vmc/*scalar.dat

The results above were calculated with cell.dimension=3 and gaussian density fitting. 

Then, on the same system with different vacuum values I tested PYSCF with cell.dimension=2. For the calculations below lengths of the lattices in z-direction are 11.81, 16.81, 21.81, 26.81 and 31.81 A. Thickness of the layer is 4.81 A.  

PYSCF results:
cell.dimension=2
grep_last scf-bfd-vdz-*/scf.out energy
scf-bfd-vdz-11_81/scf.out SCF energy = -151.467435077443
scf-bfd-vdz-16_81/scf.out converged SCF energy = -23.1069539258172
scf-bfd-vdz-21_81/scf.out converged SCF energy = -23.146747839115
scf-bfd-vdz-26_81/scf.out converged SCF energy = -23.1467528451104
scf-bfd-vdz-31_81/scf.out converged SCF energy = -23.1467528459707

grep repulsion */scf.out
scf-bfd-vdz-11_81/scf.out:nuclear repulsion = -126.592599474847
scf-bfd-vdz-16_81/scf.out:nuclear repulsion = -126.592599658569
scf-bfd-vdz-21_81/scf.out:nuclear repulsion = -126.592599475009
scf-bfd-vdz-26_81/scf.out:nuclear repulsion = -126.592599475
scf-bfd-vdz-31_81/scf.out:nuclear repulsion = -126.592599475012

with cell.dimension=2, the nuclear repulsion energies seem consistent, but for some reason they are negative. 

cell.dimension=3 
grep_last scf-bfd-vdz-*/scf.out energy
scf-bfd-vdz-11_81/scf.out converged SCF energy = -23.1467413478879
scf-bfd-vdz-16_81/scf.out converged SCF energy = -23.1467527192448
scf-bfd-vdz-21_81/scf.out converged SCF energy = -23.1467527972999
scf-bfd-vdz-26_81/scf.out converged SCF energy = -23.1467528127675

grep repulsion scf-bfd-vdz-*/scf.out
scf-bfd-vdz-11_81/scf.out:nuclear repulsion = -8.49734100093103
scf-bfd-vdz-16_81/scf.out:nuclear repulsion = 18.73296157142
scf-bfd-vdz-21_81/scf.out:nuclear repulsion = 50.2709709955986
scf-bfd-vdz-26_81/scf.out:nuclear repulsion = 83.7065412613107

QMCPACK results:
Here, I am using trial wavefunctions generated with cell.dimension=2 in pyscf. Despite that, qmcpack ion repulsion is weird. 

qmca -q ii  opt*/*scalar.dat
opt-J2-11_81-1/opt  series 0  IonIon                =  -8.497727 +/- 0.000000
opt-J2-16_81-1/opt  series 0  IonIon                =  18.732568 +/- 0.000000
opt-J2-21_81-1/opt  series 0  IonIon                =  50.270599 +/- 0.000000
opt-J2-26_81-1/opt  series 0  IonIon                =  83.706164 +/- 0.000000
opt-J2-31_81-1/opt  series 0  IonIon                =  118.144499 +/- 0.000000

Here I have attached the DFT and VMC input files for you to see as well. 

Thanks,
Kayahan

nscf.py
opt.in.xml
scf.py

Jaron Krogel

unread,
Apr 20, 2020, 1:18:09 PM4/20/20
to Kayahan Saritas, qmcpack
OK, so it looks like Pyscf and QMCPACK agree on the ion-ion energy to high precision for all cases except for vacuum=19.  For vacuum=19, I would suggest running the same system in Quantum Espresso to see which of Pyscf and QMCPACK is correct in this case.

This leaves the question of the convergence of the total energy with fully periodic BC's (which QMCPACK always uses).  Can you rerun Pyscf with Hartree-Fock and then QMCPACK w/o a Jastrow?  These energies should strictly agree and we should be able to compare component for component.  Suspect at this point is the electron-electron energy.  Would you mind performing the runs with VDZ and VTZ?  The VTZ-VDZ energy differences in VMC and HF might be revealing.

~Jaron 

Kayahan Saritas

unread,
Apr 21, 2020, 5:51:42 AM4/21/20
to Jaron Krogel, qmcpack
On the vacuum=19 example we found that there was a mistake in the qmcpack input. When we corrected that we had the identical results as in pyscf. That’s why we didn’t make any QE calculations. 

I ran HF with pyscf and qmcpack as below. QMCPACK elec-elec energies seem to get worse with the increased vacuum. VTZ energies seem to agree a bit better than VDZ. 

QMCPACK-HF
vacuum (A)Ion-Ion vdz (Ha)Ion-ion vtz (Ha)elec elec vdz (Ha)elec elec vtz (Ha)
7-8.497727 +/- 0.000000-8.497727 +/- 0.0000008.315249 +/- 0.0024308.428465 +/- 0.002130
1218.732568 +/- 0.00000018.732568 +/- 0.00000034.178370 +/- 0.00317934.373371 +/- 0.003246
1750.270599 +/- 0.00000050.270599 +/- 0.00000064.964210 +/- 0.00364965.262805 +/- 0.003755
2283.706164 +/- 0.00000083.706164 +/- 0.00000097.932497 +/- 0.00428198.208464 +/- 0.004128
27118.144499 +/- 0.000000118.144499 +/- 0.000000132.045820 +/- 0.004425132.339694 +/- 0.004445
PYSCF-HF
vacuum (A)Ion-Ion vdzIon-ion vtzelec elec vdzelec elec vtz
7-8.497341001-8.4973410018.342503798.4387373
1218.7329614718.7329614734.227247434.3834357
1750.27097150.27097165.036566765.2283107
2283.7065412683.7065412698.015200998.2241431
27118.1448779118.1448779132.140229132.363113

Kayahan

Jaron Krogel

unread,
Apr 21, 2020, 8:20:42 AM4/21/20
to Kayahan Saritas, qmcpack
Please can you report the kinetic energies also?  This will help distinguish errors in the Ewald sum from errors in the wavefunction/sampling.

What happens to the vacuum = 27 A case (elec-elec/kinetic, vdz/vtz) as you increase LR_dim_cutoff?

~Jaron

Kayahan Saritas

unread,
Apr 21, 2020, 10:56:44 AM4/21/20
to Jaron Krogel, qmcpack
Kinetic energies seem to agree well:

QMCPACK-HF
vacuum (A)ke vdzke vtz
78.795789+/-0.0016788.720367+/-0.001793
128.828948+/-0.0016838.751894+/-0.00159
178.846801+/-0.0015198.764547+/-0.001566
228.861261+/-0.00158.781187+/-0.001556
278.869303+/-0.0017418.793042+/-0.001579
PYSCF-HF
vacuum (A)
78.7963974418.721157829
128.8295506698.753122673
178.8483477928.764505588
228.8604459698.782874408
278.8688812728.790988019

I used the following to get kinetic energies from PYSCF (single kpt):

import numpy as np
from pyscf import lib
t = lib.asarray(cell.pbc_intor('int1e_kin', 1, 1, kpts)) #kinetic operator
dm = mf.make_rdm1() # density matrix
Ekin = np.einsum('kij,kji', dm, t)
print("Ekin=", Ekin.real)

Below are the tests I made for LR_dim_cutoff=30 and 40
QMCPACK-HFIon-ione-e
LRvdzvtzvdzvtz
20118.144874118.144874
132.045820 +/- 0.004425132.339694 +/- 0.004445
30118.144874118.144874132.030508 +/- 0.008190132.340403 +/- 0.007262
40118.144874
132.040300 +/- 0.008162
PYSCF-HF118.1448779118.1448779132.140229132.363113

Kayahan

Jaron Krogel

unread,
Apr 21, 2020, 12:02:37 PM4/21/20
to Kayahan Saritas, qmcpack
I'm unsure at this point of the most likely cause for the error.  Clearly there is a bias in the electron-electron energy but not the kinetic energy or the ion-ion energy.  The Ewald sum should become exact in the limit of increasing LR_dim_cutoff, and no change is seen for ion-ion or elec-elec at cutoffs greater than 20, which indicates that the Ewald sum is converged. 

The two suspects (still) are the Ewald sum and/or the trial wavefunction. A possible route to check the Ewald sum would be to implement an "estimator" that ran the Ewald reference code at every step and checked against what QMCPACK is producing.  Switching to another orbital representation (planewave/b-spline) would be the ideal way to check for errors arising from the trial wavefunction.  This however would require Coulomb matrix elements, and I don't know if these are readily available at the moment.

~Jaron

Jaron T. Krogel

unread,
May 13, 2020, 9:47:11 AM5/13/20
to qmcpack
Kayahan, have you made any progress on this issue?
Reply all
Reply to author
Forward
0 new messages