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

skipping cap-calculation, if no cap data is provided

This commit is contained in:
lburth 2025-05-02 16:02:32 +02:00
parent 9063eb7a77
commit 34e872d0cc

View File

@ -191,6 +191,7 @@ def create_psi4_basis(basis_dict):
# CAP definition # CAP definition
if use_cap: if use_cap:
try:
f = open(working_dir+'/cap_data/'+args.xyz, 'r') f = open(working_dir+'/cap_data/'+args.xyz, 'r')
lines = f.read().splitlines() lines = f.read().splitlines()
line = lines[1] line = lines[1]
@ -204,6 +205,7 @@ if use_cap:
f.write(" {} ".format(str(eta_opt))) f.write(" {} ".format(str(eta_opt)))
f.close() f.close()
print(f"CAP eta = {eta_opt}") print(f"CAP eta = {eta_opt}")
# xyz file # xyz file
with open(working_dir + "/mol/" + xyz, "r") as f: with open(working_dir + "/mol/" + xyz, "r") as f:
lines = f.readlines() lines = f.readlines()
@ -233,7 +235,9 @@ if use_cap:
"thresh": 15} "thresh": 15}
pc = pyopencap.CAP(cap_system, cap_dict, norb) pc = pyopencap.CAP(cap_system, cap_dict, norb)
cap_ao = pc.get_ao_cap(ordering="pyscf") cap_ao = pc.get_ao_cap(ordering="pyscf")
except Exception:
print("No CAP-data provided for this molecule. Skipping CAP calculation...")
use_cap = False
def write_matrix_to_file(matrix, size, file, cutoff=1e-15): def write_matrix_to_file(matrix, size, file, cutoff=1e-15):
f = open(file, 'w') f = open(file, 'w')