Been trying to learn the PsiAPI to calculate polarizabilities, building off of the Psithon example scripts. Thank you in advance!
QUESTION 1: How to retrieve the polarizability after running a calculation? I’m hoping to get a clean programmatic method instead of having to write a custom text output parser to parse the log.
I converted this Psithon script to the following, which runs:
import psi4 #needed a fresh restart; there is no .clean_options() function
psi4.set_options({'reference': 'uhf'})
molecule = psi4.geometry(
"""
1 2
O
H 1 1.0
H 1 1.0 2 104.5""")
psi4.set_options({'basis': '6-31g*',
'reference': 'uhf'})
psi4.energy('b3lyp', molecule=molecule)
energy, wfn = psi4.properties(
'b3lyp', molecule=molecule , return_wfn=True,
properties=["DIPOLE_POLARIZABILITIES", "DIPOLE"])
However, calling wfn.variables()
does not show DIPOLE_POLARIZABILITIES, even though it’s printed in the output!
(note, the CCSD and CC2 calculations seem to have the polarizability tensor saved and accessible; it’s the SCF calculations that I’m running into issues with)
QUESTION 2:
How do I clean the options? The tutorial mentions a .clean_options()
method, but when I inspect psi4
I do not see this method. For example, right now, if I’m in a single notebook, if I set_options
to uhf
, I find that I can’t set it back to rhf
, even with set_options
, and the only way is to restart my kernel.
I am on psi4==1.9.1
QUESTION 3: Having trouble converting the code from this previous post, using finite differencing to evaluate the polarizability for mp2, into PsiAPI. In this case, I’m also having trouble running it in psithon, getting the following error:
Using `MP2 DIPOLE X` instead of `MP2 DIPOLE` is obsolete as of 1.6.