Spectrum import error


I am trying to follow this use case for TDDFT - TDSCF: Time-dependent Hartree–Fock and density-functional theory

I have managed to get the TDDFT working by obtaining the dev version of psi4, but this calculation produces no output using the conda version.

The other issue I have identified running this tutorial is that on both the dev and conda installations the command:

from psi4.driver.p4util import spectrum

always produces the following error:

ImportError: cannot import name ‘spectrum’ from ‘psi4.driver.p4util’

Do you know of any solutions to these problems?

Many Thanks,

Do you mean the example in Plotting one-photon absorption and electronic circular dichroism spectra

The output is redirected to moxy.out: `psi4.core.set_output_file(“moxy.out”)

Can you tell us the exact version you have. Sometimes conda is stuck on an old developer version due to dependencies.
psi4 --version


Exactly - That is the tutorial I am trying to reproduce.

The output I obtain is in the file below. My version of psi4 is 1.3.2.

moxy.dat (10.1 KB)

You need the developer version to run TD-DFT, it is not yet fully implemented in the official 1.3.2 release.
But you mentioned you had a dev version.
You can get one with
conda install psi4 -c psi4/label/dev (best in a new conda environment)

The example works except for this issue: TD-DFT spectrum example not working · Issue #2108 · psi4/psi4 · GitHub (I reported that just now while trying out the example).

OK great! I will give this a try. Thanks