I seem to be facing the same issue as described in this post a while ago:
i.e. that I get an “Auxiliary basis is required for ESP computations.” error when trying to write ESP cube files from a wavefunction, although I am running 1.3.2. I noticed that I can write those files when I have just computed the wavefunction, but that this error occurs when I loaded the wavefunction from file.
Example:
import psi4
xyz_str = """
8
C -0.756352 -0.078834 0.019827
C 0.749569 0.011173 -0.076652
H -1.192742 -0.817993 -0.659960
H -1.139596 0.947289 -0.214959
H -1.043422 -0.352756 1.052083
H 1.071472 0.622253 -0.951047
H 1.059241 0.618515 0.822155
H 1.251830 -0.949648 0.008553
"""
psi4.set_options({"basis": "6-31G*"})
p4mol = psi4.core.Molecule.from_string(xyz_str, dtype="xyz+", fix_com=True)
E, wfn = psi4.energy("b3lyp", return_wfn=True, molecule=p4mol)
psi4.set_options(
{
"cubeprop_tasks": ["ESP"],
"cubeprop_filepath": ".",
"cubic_grid_spacing": [1, 1, 1,],
},
)
psi4.cubeprop(wfn)
# --> writes ESP.cube to current directory as expected
wfn.to_file(filename="./saved_wfn.npy")
wfn_loaded = psi4.core.Wavefunction.from_file("./saved_wfn.npy")
psi4.cubeprop(wfn_loaded)
# --> Fatal Error: Auxiliary basis is required for ESP computations.
# Error occurred in file: /Users/github/builds/conda-builds/psi4-multiout_1557977521159/work/psi4/src/psi4/libcubeprop/csg.cc on line: 319
# The most recent 5 function calls were: (<<nothing follows>>)
Adding something like "DF_BASIS_SCF": "6-31G*" to psi4.set_options does not seem to help.
Any ideas on how to fix this would be appreciated.
Thanks for taking the time to write this up. Here I got the error
Validation Error: Orbital basis argument must not be empty.
which I assume relates to the third argument, as psi4.core.get_option("SCF", "DF_BASIS_SCF") returns an empty string (so does psi4.core.get_global_option("BASIS")) as I apparently have not set global options for PSI4. Can I infer those from the wavefunction object, or pass those along as arguments to the function which should convert a wavefunction file from disk to a cube-file containing the ESP?