10
1
mirror of https://github.com/pfloos/quack synced 2025-05-06 07:05:33 +02:00

fixed geom and printcRG0W0

This commit is contained in:
Loris Burth 2025-03-25 13:38:10 +01:00
parent 8c7b3ad994
commit 39a06a137d
10 changed files with 29 additions and 16 deletions

View File

@ -207,11 +207,15 @@ if args.use_cap:
f.close()
num_atoms = int(lines[0].strip())
atoms = [line.strip() for line in lines[2:2+num_atoms]]
if unit == 'Bohr':
bohr_coordinates = 'true'
else:
bohr_coordinates = 'false'
sys_dict = {
"molecule": "inline",
"geometry": "\n".join(atoms), # XYZ format as a string
"basis_file": create_psi4_basis(basis_dict),
"bohr_coordinates": unit == 'Bohr'
"bohr_coordinates": bohr_coordinates
}
cap_system = pyopencap.System(sys_dict)
if not(cap_system.check_overlap_mat(ovlp, "pyscf")):
@ -223,10 +227,9 @@ if args.use_cap:
"cap_z": onset_z,
"Radial_precision": "16",
"angular_points": "590",
"thresh": 10}
"thresh": 15}
pc = pyopencap.CAP(cap_system, cap_dict, norb)
# Get AO and convert from eV to Hartree
cap_ao = pc.get_ao_cap(ordering="pyscf")/27.211386245981
cap_ao = pc.get_ao_cap(ordering="pyscf")
def write_matrix_to_file(matrix, size, file, cutoff=1e-15):

2
cap_data/H2 Normal file
View File

@ -0,0 +1,2 @@
onset_x onset_y onset_z eta_opt
2.76 2.76 4.88 0.0015

View File

@ -1 +1,2 @@
2.76 2.76 4.88
onset_x onset_y onset_z eta_opt
2.76 2.76 4.88 0.0015

View File

@ -1,2 +1,2 @@
onset_x onset_y onset_z eta_opt
2.76 2.76 4.88 0.0015
2.76 2.76 4.88 0.0015

View File

@ -1,4 +1,4 @@
2
C 0.0000 0.0000 0.0000
O 0.0000 0.0000 1.1335
C 0.0000 0.0000 -0.5639970709977953
O 0.0000 0.0000 0.5639970709977953

View File

@ -1,5 +1,5 @@
3
C 0.0000 0.0000 0.0000
O 0.0000 0.0000 1.1335
X 0.0000 0.0000 0.56675
C 0.0000 0.0000 -0.5639970709977953
O 0.0000 0.0000 0.5639970709977953
X 0.0000 0.0000 0.0000

View File

@ -1,4 +1,4 @@
2
N 0.0000 0.0000 -0.5475132
N 0.0000 0.0000 0.5475132
N 0.0000 0.0000 -0.5487567673341279
N 0.0000 0.0000 0.5487567673341279

View File

@ -1,5 +1,5 @@
3
N 0.0000 0.0000 -0.5475132
N 0.0000 0.0000 0.5475132
N 0.0000 0.0000 -0.5487567673341279
N 0.0000 0.0000 0.5487567673341279
X 0.0000 0.0000 0.000000

View File

@ -27,7 +27,7 @@ subroutine print_cRG0W0(nBas,nO,eHF,ENuc,ERHF,Re_SigC,Im_SigC,Re_Z,Im_Z,Re_eGW,I
index_homo = maxloc(Re_eGW(1:nO),1)
Re_eHOMO = Re_eGW(index_homo)
Im_eHOMO = Im_eGW(index_homo)
index_lumo = minloc(Re_eGW(nO+1:nBas),1)
index_lumo = minloc(Re_eGW(nO+1:nBas),1) + nO
Re_eLUMO = Re_eGW(index_lumo)
Im_eLUMO = Im_eGW(index_lumo)
Re_Gap = Re_eLUMO-Re_eHOMO

View File

@ -47,6 +47,13 @@ subroutine complex_DIIS_extrapolation(rcond,n_err,n_e,n_diis,error,e,error_in,e_
! Solve linear system
call complex_linear_solve(n_diis+1,A,b,w,rcond)
! Check condition number
if (rcond < 1.0d-10) then
write(*,*) "!!! DIIS system ill-conditioned: rcond = ", rcond, " - Skipping DIIS update !!!"
else
! Perform extrapolation only if the system is well-conditioned
e_inout(:) = matmul(w(1:n_diis),transpose(e(:,1:n_diis)))
end if
! Extrapolate