What is the syntax for the Da function?


I have a wavefunction from an energy calculation with return_wfn=True. There is a Da function in the wavefunction class that returns the alpha density matrix. If I write
dm = wfn.Da()
dm = np.array(wfn.Da())
I expect to get the density matrix as a Psi4 matrix or numpy array. However either seems to be silently executed with a null result. What is the correct syntax?


Da returns a psi4 Matrix class. If this matrix has irreps, simple np.array() conversion does not work.

Then you can use the general way:
dm = wfn.Da().to_array()



Thank you; I don’t want it separated into irreps, but using “symmetry C1” gives me what I want.

closed #4

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