mirror of
https://github.com/QuantumPackage/qp2.git
synced 2025-04-27 18:54:42 +02:00
adding mo 2e ints
This commit is contained in:
parent
4893703e9c
commit
e63c95c9ed
@ -248,7 +248,6 @@ def convert_kpts_cd(filename,qph5path,qmcpack=True):
|
|||||||
|
|
||||||
# should this be in ao_basis? ao_two_e_ints?
|
# should this be in ao_basis? ao_two_e_ints?
|
||||||
with h5py.File(qph5path,'r') as qph5:
|
with h5py.File(qph5path,'r') as qph5:
|
||||||
qph5[]
|
|
||||||
nchol_per_kpt = qph5['Hamiltonian']['NCholPerKP'][:]
|
nchol_per_kpt = qph5['Hamiltonian']['NCholPerKP'][:]
|
||||||
nchol_per_kpt = nchol_per_kpt[nchol_per_kpt != 0]
|
nchol_per_kpt = nchol_per_kpt[nchol_per_kpt != 0]
|
||||||
nchol_per_kpt_max = max(nchol_per_kpt)
|
nchol_per_kpt_max = max(nchol_per_kpt)
|
||||||
@ -288,7 +287,6 @@ def convert_kpts_cd(filename,qph5path,qmcpack=True):
|
|||||||
ezfio.set_ao_two_e_ints_io_df_ao_integrals('Read')
|
ezfio.set_ao_two_e_ints_io_df_ao_integrals('Read')
|
||||||
"""
|
"""
|
||||||
else:
|
else:
|
||||||
ezfio.set_io_chol_mo_integrals('Read')
|
|
||||||
"""
|
"""
|
||||||
ezfio.set_io_chol_mo_integrals('Read')
|
ezfio.set_io_chol_mo_integrals('Read')
|
||||||
df_num = qph5['ao_two_e_ints'].attrs['df_num']
|
df_num = qph5['ao_two_e_ints'].attrs['df_num']
|
||||||
@ -296,8 +294,30 @@ def convert_kpts_cd(filename,qph5path,qmcpack=True):
|
|||||||
dfmo_reim=qph5['mo_two_e_ints/df_mo_integrals'][()].tolist()
|
dfmo_reim=qph5['mo_two_e_ints/df_mo_integrals'][()].tolist()
|
||||||
ezfio.set_mo_two_e_ints_df_mo_integrals_complex(dfmo_reim)
|
ezfio.set_mo_two_e_ints_df_mo_integrals_complex(dfmo_reim)
|
||||||
ezfio.set_mo_two_e_ints_io_df_mo_integrals('Read')
|
ezfio.set_mo_two_e_ints_io_df_mo_integrals('Read')
|
||||||
"""
|
"""
|
||||||
return
|
mo_num_per_kpt = ao_num//kpt_num
|
||||||
|
ezfio.set_io_chol_mo_integrals('Read')
|
||||||
|
#ao_chol_two_e_ints = np.zeros((2, ao_num_per_kpt, ao_num_per_kpt, nchol_per_kpt_max, kpt_num, len(nchol_per_kpt)))
|
||||||
|
L_list = []
|
||||||
|
for i in len(nchol_per_kpt):
|
||||||
|
L = qph5['Hamiltonian']['KPFactorized'][f'L{i}'][:]
|
||||||
|
L.reshape(kpt_num, mo_num_per_kpt, mo_num_per_kpt, nchol_per_kpt[i], 2)
|
||||||
|
L = np.einsum("ijklm->ilkjm", A, B)
|
||||||
|
L_list.append(L)
|
||||||
|
|
||||||
|
#(6, 5184, 2)
|
||||||
|
"""
|
||||||
|
for cmplx in range(2):
|
||||||
|
for ao_idx_i in range(ao_num_per_kpt):
|
||||||
|
for ao_idx_j in range(ao_num_per_kpt):
|
||||||
|
for chol_idx in range(nchol_per_kpt[i]):
|
||||||
|
for kpt_idx in range(kpt_num):
|
||||||
|
ao_chol_two_e_ints[cmplx][ao_idx_i][ao_idx_j][chol_idx][kpt_idx][i] = L[kpt_idx][ao_idx_i][ao_idx_j][chol_idx][cmplx]
|
||||||
|
"""
|
||||||
|
mo_chol_two_e_ints = np.vstack(L_list)
|
||||||
|
mo_chol_two_e_ints = mo_chol_two_e_ints.transpose()
|
||||||
|
ezfio.set_chol_mo_integrals_complex(mo_chol_two_e_ints)
|
||||||
|
return
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -827,4 +847,3 @@ if __name__ == '__main__':
|
|||||||
#
|
#
|
||||||
#to be sure your MOs will be orthogonal, which is not the case when
|
#to be sure your MOs will be orthogonal, which is not the case when
|
||||||
#the MOs are read from output files (not enough precision in output).""")
|
#the MOs are read from output files (not enough precision in output).""")
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user