# Undefined CCEOM variables

I’m trying to calculate excited states of H2O+ and print out their energies within each irrep (eom-ccsd). I can print out the total energy of each root by accessing the CCSD ROOT n TOTAL ENERGY variable, but trying the other variables that are proposed fails. The following variables
CCSD ROOT n (IN h) TOTAL ENERGY
CCSD ROOT n (h) TOTAL ENERGY
CCSD ROOT n TOTAL ENERGY - h TRANSITION
are not set, for example.

Am I missing something to set these variables, or is there a better way to go about doing this ?

``````set puream true
set print_MOs true

molecule H2OX {
1  2
symmetry C2v
units ang

# no_com        # do not adjust centre of mass
# no_reorient   # do not adjust orientation of the molecule

O
H   1 R
H   1 R 2 angle

R = 1.01
angle = 108.8

}

# -- HF
set basis cc-pVTZ
set reference rohf
set maxiter 100

# -- EOM-CC2
set eom_reference rohf
set roots_per_irrep [ 1, 1, 1, 1 ]
nRoots = 4
# nRoots = 20

from multiprocessing import cpu_count
nproc = cpu_count()

nθ = 2
θi = 60
θf = 61
dθ = (θf - θi) / (nθ - 1)

angles = [ θi + i * dθ for i in range(0,nθ)  ]

for θ in angles:

H2OX.angle = θ

energy('eom-ccsd')

print(str(θ)+" " ,end="")

# for n in range(0,nRoots) :
for n in range(0,5) :
for h in range(1,5) :

var="CCSD ROOT " + str(n) + " TOTAL ENERGY"
# var="CCSD ROOT " + str(n) + " (IN " + str(h) + ") TOTAL ENERGY"
# var="CCSD ROOT " + str(n) + " TOTAL ENERGY - " + str(h) + " TRANSITION"

print(str(variable(var))+" ", end="")

print("")

``````

Running the above code with the line

``````var="CCSD ROOT " + str(n) + " TOTAL ENERGY"
``````

works fine, but crashes when either of the two lines below

``````# var="CCSD ROOT " + str(n) + " (IN " + str(h) + ") TOTAL ENERGY"
# var="CCSD ROOT " + str(n) + " TOTAL ENERGY - " + str(h) + " TRANSITION"
``````

are uncommented because of the unset variables.

Any help is appreciated.

Variables referenced from the PSI Variables by Alpha page
https://psicode.org/psi4manual/master/glossary_psivariables.html

There are a few things wrong in your input file.

1. h is an irrep’s name, not its index. For this molecule, you want `for h in ["A1", "A2", "B1", "B2"]`
2. n means something different in the last two call patterns. The first call pattern is the n’th root in irrep h. The second call pattern is the n’th root overall, which just so happens to be in irrep h. Specifying the irrep is redundant for this call pattern, and it functions as a sanity-check. Inconsistent information results in an error. Your intent isn’t clear enough for me to say what the correct fix is here, but this is a problem in your input file.
1 Like

Thanks for the feedback.

1. h is an irrep’s name, not its index. For this molecule, you want `for h in ["A1", "A2", "B1", "B2"]`

Problem solved. I had convinced myself that irreps were identified by integers, not by name.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.