qmcpack
qmcpack copied to clipboard
Better Guards Needed for Bad SPOSet Construction.
Describe the bug
To Reproduce
We'll use QMCPACK/tests/solids/diamondC_1x1x1-Gaussian_pp_Tw_cplx/ system as test.
1.) Replace C_diamond-twist-third.wfj.xml with the attached XML
<?xml version="1.0"?>
<!-- This file was modified from tests/solids/diamondC_1x1x1-Gaussian_pp_Tw_cplx/C_diamond-twist-third.structure.xml
to allow both occupied and virtual orbitals to be read into QMCPACk which are used by the unit test test_pyscf_complex_MO.cpp -->
<qmcsystem>
<wavefunction name="psi0" target="e">
<determinantset type="MolecularOrbital" name="LCAOBSet" source="ion0" transform="yes" twist="0.3101394529 0.3101394529 0.3101394529" href="dft-inputs/C_diamond-twist-third.h5" PBCimages="12 12 12">
<sposet basisset="LCAOBSet" name="spo-up" size="26">
<occupation mode="ground"/>
<coefficient size="26" spindataset="0"/>
</sposet>
<sposet basisset="LCAOBSet" name="spo-dn" size="26">
<occupation mode="ground"/>
<coefficient size="26" spindataset="0"/>
</sposet>
<slaterdeterminant>
<determinant id="updet" group="u" sposet="spo_ud" size="4" />
<determinant id="downdet" group="d" sposet="spo_ud" size="4" />
</slaterdeterminant>
</determinantset>
</wavefunction>
</qmcsystem>
2.) Run. Should see that QMCPACK makes it all the way to VMC before segfaulting.
Expected behavior Referencing a non-registered SPOSet should be detected at parse time and the code should abort. Instead, it gives no errors and actually makes it through a few SPOSet evaluate calls before segfaulting. The numbers coming out are also wrong.
System:
- Intel Xeon, RHEL 7.9
- gcc/9.2.0, openmpi/1.10.1, cmake/3.19.1, hdf5/1.10.4, git/2.10.1
Do we /can we require the slaterdeterminants to be after the sposet definition?
We still support that. I need help updating all the tests before disallowing sposet inside determinantset