I have been trying to implement the frequency function into my code but the goal is to have the frequency be part of the optimization function parameters if that is possible. However, in python, I have followed a similar style for inputs as psi4.energy and psi4.optimize functions but my frequency function is not working after around 2 hours of trying to fix it. Thank you for the help.
import numpy as np
import pandas as pd
import psi4
import matplotlib.pyplot as plt
import qcelemental as qcel
psi4.set_memory(1.267e11)
psi4.set_num_threads(32)
psi4.set_output_file('BenzeneFreq.dat', True)
psi4.set_options({
'geom_maxiter': 100
})
benzene = psi4.geometry("""
0 1
C -3.2575983 1.7216438 0.0000000
C -3.2985531 0.3232005 0.0000000
C -2.0260332 2.3853977 -0.0000000
C -0.8354231 1.6507079 -0.0000000
C -0.8763782 0.2522646 -0.0000000
C -2.1079431 -0.4114892 0.0000000
H -4.1786881 2.2900201 0.0000000
H -4.2513263 -0.1902984 0.0000000
H -1.9943487 3.4672729 -0.0000000
H 0.1173503 2.1642064 -0.0000000
H 0.0447112 -0.3161121 -0.0000000
H -2.1396273 -1.4933642 0.0000000
units angstrom
""")
psi4.core.set_global_option('cubeprop_tasks',['frontier_orbitals'])
E, wfn = psi4.optimize("B3LYP-D3/6-31G(d,p)", molecule = benzene, return_wfn=True)
psi4.frequency("B3LYP-D3/6-31G(d,p)", molecule = benzene)
psi4.cubeprop(wfn)
Output:
Optimizer: Optimization complete!
---------------------------------------------------------------------------
SystemError Traceback (most recent call last)
in
1 psi4.core.set_global_option('cubeprop_tasks',['frontier_orbitals'])
2 psi4.optimize("B3LYP-D3/6-31G(d,p)", molecule = polymer, return_wfn=True)
----> 3 b3lyp_e, b3lyp_wfn = psi4.frequency("B3LYP-D3/6-31G(d,p)", molecule = polymer)
4 psi4.wfn.frequencies.get(0)
5 ##E, wfn = psi4.frequencies("B3LYP-D3/6-31G(d,p)", molecule = polymer, return_efn = True)
~/miniconda3/envs/research/lib/python3.7/site-packages/psi4/driver/driver.py in frequency(name, **kwargs)
1462
1463 # Compute the hessian
-> 1464 H, wfn = hessian(name, return_wfn=True, molecule=molecule, **kwargs)
1465
1466 # Project final frequencies?
~/miniconda3/envs/research/lib/python3.7/site-packages/psi4/driver/driver.py in hessian(name, **kwargs)
1204 # Check if this is a CBS extrapolation
1205 elif gradient_type == "cbs_gufunc":
-> 1206 return driver_cbs._cbs_gufunc(hessian, name.lower(), **kwargs, ptype="hessian")
1207 elif gradient_type == "cbs_wrapper":
1208 return driver_cbs.cbs(hessian, "cbs", **kwargs, ptype="hessian")
~/miniconda3/envs/research/lib/python3.7/site-packages/psi4/driver/driver_cbs.py in _cbs_gufunc(func, total_method_name, **kwargs)
1947 optstash = p4util.OptionsState(['BASIS'])
1948 core.set_global_option('BASIS', basis)
-> 1949 ptype_value, wfn = func(method_name, return_wfn=True, molecule=molecule, **kwargs)
1950 core.clean()
1951
~/miniconda3/envs/research/lib/python3.7/site-packages/psi4/driver/driver.py in hessian(name, **kwargs)
1283
1284 # Obtain list of displacements
-> 1285 findif_meta_dict = driver_findif.hessian_from_gradient_geometries(molecule, irrep)
1286
1287 # Record undisplaced symmetry for projection of displaced point groups
~/miniconda3/envs/research/lib/python3.7/site-packages/psi4/driver/driver_findif.py in hessian_from_gradient_geometries(molecule, irrep)
889 Dictionary of finite difference data, specified in _geom_generator docstring.
890 """
--> 891 return _geom_generator(molecule, irrep, "2_1")
892
893
~/miniconda3/envs/research/lib/python3.7/site-packages/psi4/driver/driver_findif.py in _geom_generator(mol, freq_irrep_only, mode)
338 mol = core.Molecule.from_dict(mol.to_dict())
339
--> 340 data = _initialize_findif(mol, freq_irrep_only, mode, init_string, 1)
341
342 # We can finally start generating displacements.
~/miniconda3/envs/research/lib/python3.7/site-packages/psi4/driver/driver_findif.py in _initialize_findif(mol, freq_irrep_only, mode, initialize_string, verbose)
168
169 # Populate salc_indices_pi for all irreps.
--> 170 for i, salc in enumerate(salc_list):
171 salc_indices_pi[salc.irrep_index()].append(i)
172
SystemError: returned NULL without setting an error