10
0
mirror of https://github.com/QuantumPackage/qp2.git synced 2024-12-22 12:23:43 +01:00

starting separate function with dummy atom

This commit is contained in:
amandadumi 2022-05-03 12:23:51 -04:00 committed by Kevin Gasperich
parent 7ce27f6ce8
commit 618df9eed5

View File

@ -9,6 +9,7 @@ Options:
-o --output=EZFIO_DIR Produced directory
by default is FILE.ezfio
--noqmc don't include basis, cell, etc. for QMCPACK
-cd h5 contains cholesky decomposition informatin, these h5 result from RMG and the pyscf AFQMC converter of QMCPACK.
"""
from ezfio import ezfio
@ -138,6 +139,17 @@ def convert_mol(filename,qph5path):
return
def convert_kpts_cd(filename,qph5path,qmcpack=True):
ezfio.set_file(filename)
ezfio.set_nuclei_is_complex(True)
# Dummy atom since AFQMC h5 has no atom information
nucl_num = 1
ezfio.set_nuclei_nucl_num(nucl_num)
ezfio.set_nuclei_nucl_charge([0.]*nucl_num)
ezfio.set_nuclei_nucl_coord( [ [0.], [0.], [0.] ]*nucl_num )
ezfio.set_nuclei_nucl_label( ['He'] * nucl_num )
def convert_kpts(filename,qph5path,qmcpack=True):
ezfio.set_file(filename)
ezfio.set_nuclei_is_complex(True)
@ -640,10 +652,16 @@ if __name__ == '__main__':
if ARGUMENTS["--noqmc"]:
qmcpack = False
if ARGUMENTS["--rmg"]:
rmg = True
with h5py.File(FILE,'r') as qph5:
do_kpts = ('kconserv' in qph5['nuclei'].keys())
if (do_kpts):
print("converting HDF5 to EZFIO for periodic system")
if cd:
print("Using RMG and AFQMC h5")
convert_kpts_cd(EZFIO_FILE,FILE,qmcpack)
else:
convert_kpts(EZFIO_FILE,FILE,qmcpack)
else:
print("converting HDF5 to EZFIO for molecular system")