I am new to Psi4, and I have just installed the 1.3.2 version. I was wondering if it is possible to retrieve the two-particle density matrix (in AOs) from a CC calculation. From the manual I have understood that there is a get_tpdm() method for the CIWavefunction, but I did not manage to find something similar for the CCWavefunction. In the CCDENSITY module seems to be available a kind of twopdm() function that calculate the two-particle density matrix contributions, but I don’t know how to use it.
Thank you very much, I appreciate every kind of help!
thank you for you help! I need the TPDM because I want to compare the results with the one calculated by means of the HF method. I managed to recover the OPDM in different ways, such with the following input that I adapted from this forum:
After looking over the code, I cannot find an easy way to do this. This gets stored in some files, but I don’t know an easy way to convert those into the numpy arrays you’re looking for.
While I could figure it out with enough time, I don’t have the time right now. Some work in the code may be needed. If you need this badly enough that you’d be willing to work with the C++ code, I can see if I can get you in touch with somebody who’d be better able to help.
@jmisiewicz I think I have enough time to work with the C++ code, even if I am not very used to this language. Surely some help will be useful, but still it would be really demanding.
However the python code of @crawdad seems to be the optimal choice, since I only need to read the twopdm without any further manipulation. If you could give me access to the script it would be amazing. Can I ask you with which level of CC the script is able to generate the twopdm? It would be very interesting if I manage to calculate the twopdm with all the level of CC implemented in Psi4 (such as CC2, CCSD, CC3 and so on), or if I can extend the code in order to do that.