Psi4/numpy reading orbital symmetreis

I would like to read the symmetries of my orbitals directly into python.

Currently I can read them from the output file from the orbital energies section. For example, my minimal working example this would be:

Orbital Energies [Eh]
---------------------

Doubly Occupied:

   1A1   -18.778020     2A1    -0.919256     1B2    -0.469174
   3A1    -0.290095     1B1    -0.223928

Virtual:

   4A1     0.031256     2B2     0.119008     3B2     0.761069
   5A1     0.814854     2B1     0.835654     6A1     0.907745
   4B2     1.009055     7A1     1.370628

Where A1, A2, B1, B2 is what I am interested in.

In psi4numpy I can read the orbital energies directly using epsilon_a/b, like so:

import psi4

xyz = '0 1 \n \
O    0.00000000            0.00000000           -0.06990256 \n \
H    0.00000000            0.75753241            0.51843495 \n \
H    0.00000000           -0.75753241            0.51843495'
xyz = psi4.geometry(xyz)

psi4.set_output_file('water.out')
e, wfn = psi4.energy('blyp/6-31g', molecule=xyz, return_wfn=True)
print(wfn.epsilon_a().to_array(dense=True))

returns - [-18.77802027 -0.91925642 -0.29009532 0.03125553 0.8148535
0.90774458 1.37062773 -0.22392789 0.83565377 -0.46917404
0.11900769 0.76106868 1.00905526]

Is there a way for me to access the symmetry information without appealing to the output file?

So far the closest option I have found is nsopi().to_tuple()

When you say, “read the symmetries of my orbitals,” do you mean “access the orbital energies by symmetry”? If so, wfn.epsilon_a() is indeed the function to call. You just don’t want the to_array function. Use .nph instead.

I see. So:

print(wfn.epsilon_a().nph)

returns - (array([-18.77802027, -0.91925642, -0.29009532, 0.03125553,
0.8148535 , 0.90774458, 1.37062773]), array([], dtype=float64), array([-0.22392789, 0.83565377]), array([-0.46917404, 0.11900769, 0.76106868, 1.00905526]))

where the array is an array of orbitals with symmetries (A1, A2, B1, B2). This should get me what I want is short order. Thank you!


When you say, “read the symmetries of my orbitals,” do you mean “access the orbital energies by symmetry”?

  • More or less. I was hoping for a side-by-side list or list of tuples, i.e.

[-18.778, -0.919, -0.469, …]
[A1, A1, B2, …]

or

[(-18.778, A1), (-0.919, A1), (-0.469, A1), …]

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