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

Update occ_num in qp_convert_output_to_ezfio

This commit is contained in:
Anthony Scemama 2021-10-12 15:55:44 +02:00
parent 6d4e7dd714
commit 23e8789df6

View File

@ -289,12 +289,17 @@ def write_ezfio(res, filename):
for i in range(mo_num): for i in range(mo_num):
energies.append(MOs[i].eigenvalue) energies.append(MOs[i].eigenvalue)
OccNum = []
if res.occ_num is not None: if res.occ_num is not None:
OccNum = []
for i in MOindices: for i in MOindices:
OccNum.append(res.occ_num[MO_type][i]) OccNum.append(res.occ_num[MO_type][i])
else:
for i in range(res.num_beta):
OccNum.append(2.)
for i in range(res.num_beta,res.num_alpha):
OccNum.append(1.)
while len(OccNum) < mo_num: while len(OccNum) < mo_num:
OccNum.append(0.) OccNum.append(0.)
MoMatrix = [] MoMatrix = []
@ -317,8 +322,9 @@ def write_ezfio(res, filename):
# ~#~#~#~#~ # # ~#~#~#~#~ #
ezfio.set_mo_basis_mo_num(mo_num) ezfio.set_mo_basis_mo_num(mo_num)
ezfio.set_mo_basis_mo_occ(OccNum)
ezfio.set_mo_basis_mo_coef(MoMatrix) ezfio.set_mo_basis_mo_coef(MoMatrix)
ezfio.set_mo_basis_mo_occ(OccNum)
print("OK") print("OK")