CCEOM can find root energies by irrep in C2v but not in Cs

Psi4 version : 1.9.1

I’m trying to request CCEOM roots for each irrep in the C2v and Cs point groups for H2O+. This works fine in C2v, searching for roots belonging to the irreps A1, A2, B1, and B2

# example showing EOM-CCSD calculation in the C2v point group

molecule H2OX {
    1  2
    symmetry C2v
    units ang

    O
    H   1 R
    H   1 R 2 angle

    R = 1.1
    angle = 108.8

}

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

# -- EOM-CCSD
set eom_reference rohf
set roots_per_irrep [ 2, 2, 2, 2 ]
nRootsPerIrrep = 2

energy(f"eom-ccsd")

for n in range(0, nRootsPerIrrep):

  E_A1 = variable(f"CCSD ROOT {n} (IN A1) TOTAL ENERGY")
  E_A2 = variable(f"CCSD ROOT {n} (IN A2) TOTAL ENERGY")
  E_B1 = variable(f"CCSD ROOT {n} (IN B1) TOTAL ENERGY")
  E_B2 = variable(f"CCSD ROOT {n} (IN B2) TOTAL ENERGY")

  print(f"Root {n} in each irrep")
  print(f"----------------------")
  print(f"A1 energy: {E_A1}")
  print(f"A2 energy: {E_A2}")
  print(f"B1 energy: {E_B1}")
  print(f"B2 energy: {E_B2}")
  print()

but fails in Cs looking for roots belonging to A’ (Ap) and A’’ (App)

# example showing EOM-CCSD calculation in the Cs point group

molecule H2OX {
    1  2
    symmetry Cs
    units ang

    O
    H   1 R
    H   1 R 2 angle

    R = 1.1
    angle = 108.8

}

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

# -- EOM-CCSD
set eom_reference rohf
set roots_per_irrep [ 2, 2 ]
nRootsPerIrrep = 2

energy(f"eom-ccsd")

for n in range(0, nRootsPerIrrep):

  E_Ap = variable(f"CCSD ROOT {n} (IN Ap) TOTAL ENERGY")
  E_App = variable(f"CCSD ROOT {n} (IN App) TOTAL ENERGY")

  print(f"Root {n} in each irrep")
  print(f"----------------------")
  print(f"Ap energy: {E_Ap}")
  print(f"App energy: {E_App}")
  print()

The error I get is as follows

Traceback (most recent call last):
  File "/home/josh/Workspace/ResearchCodes/Psi4/bin/psi4", line 387, in <module>
    exec(content)
  File "<string>", line 40, in <module>
  File "/home/josh/Workspace/ResearchCodes/Psi4/lib/python3.11/site-packages/psi4/driver/p4util/python_helpers.py", line 1121, in _core_variable
    raise KeyError(f"psi4.core.variable: Requested variable '{key}' was not set!\n")

KeyError: "psi4.core.variable: Requested variable 'CCSD ROOT 0 (IN Ap) TOTAL ENERGY' was not set!\n"

Printing out the relevant lines from the Psithon --> Python processed input file:
    nRootsPerIrrep = 2
    fileAp  = open("Ap.pec.dat", "w")
    fileApp  = open("App.pec.dat", "w")
    energy(f"eom-ccsd")
    for n in range(0, nRootsPerIrrep):
-->   E_Ap = variable(f"CCSD ROOT {n} (IN Ap) TOTAL ENERGY")
      E_App = variable(f"CCSD ROOT {n} (IN App) TOTAL ENERGY")
      print(f"Root {n} in each irrep")
      print(f"----------------------")
      print(f"Ap energy: {E_Ap}")
      print(f"App energy: {E_App}")


!----------------------------------------------------------------------------------!
!                                                                                  !
!  "psi4.core.variable: Requested variable 'CCSD ROOT 0 (IN Ap) TOTAL ENERGY' was  !
!     not set!\n"                                                                  !
!                                                                                  !
!----------------------------------------------------------------------------------!

I’m not sure what’s going on here. Am I not targeting the right variables, or is something preventing what I expect to be the right variables from being set ? I’ve already tried different capitalizations of “Ap” and “App” and have distorted the molecule to where the full point group is Cs and not C2v — just in case this was somehow an issue — but am getting the same error.

If you put print_variables() in your input file, then you can look in the output file and see the set variables. I did this and saw the following, e.g.,

CCSD ROOT 0 (App) TOTAL ENERGY" => -75.871989937239

You may need to do some trial and error to make sure what is going on, but this particular output was from an A’’ excitation from an A" ground state to an A’ excited state. It is possible that the reduction to the subgroup is not being done consistently, but a little trial and error testing one root at a time should settle it.

1 Like

Thanks for the suggestion. It seems like the requested variables are indeed being set, so I can go ahead and look at them in detail, as I wanted to.

  "CCSD ROOT 1 (IN Ap) TOTAL ENERGY"                =>     -75.669494329198
...
  "CCSD ROOT 1 (IN App) TOTAL ENERGY"               =>     -75.466484178811

However, I still can’t access these variables with variable(). The following lines

  E_Ap = variable("CCSD ROOT 1 (IN Ap) TOTAL ENERGY")
  E_App = variable("CCSD ROOT 1 (IN App) TOTAL ENERGY")

return the same error as before, but continue to function in a C2v calculation (with the appropriate irreps). This partially solves the issue for me, but I still wonder why my call to variable() isn’t working.

I don’t know the cause of this. Perhaps variables obtained by subgrouping are hidden to prevent misleading conflicts with the full group. But someone who understands the core variable better than I will have to answer.