piecuch-group / ccpy

Coupled-cluster package written in Python.
https://piecuch-group.github.io/ccpy/
GNU General Public License v3.0
27 stars 2 forks source link

natural orbitals in AO basis #10

Open RagnarB83 opened 3 months ago

RagnarB83 commented 3 months ago

Hi, very nice project. Very nice to be able to try out the adaptive CC(P;Q) method and others in an easy way.

I was curious whether it would be possible to get the CC natural orbitals in the AO basis, for the sake of visualization (e.g. by writing them to a Molden file)? I found the transform_to_natorbs function which presumably has them in the MO basis. To get the NO's in AO basis it should in principle just be a simple dot-product of read-in MO-coefficients (I'm using pyscf) but presumably there has been reordering of integrals along the way so that this is no longer valid.

kgururangan commented 3 months ago

Hi! Glad to hear that you were able to use CCpy without much trouble.

Yes, so the transform_to_natorbs functions converts the one- and two-electron integrals from the MO basis to the NO basis only via occupied-occupied and virtual-virtual rotations. This was done just to ensure that the canonical CC methods would produce invariant energies, although we can relax this in principle. This routine, however, might not be the best one for what you are looking for. The transform_to_natorbs routine constructs the NO basis in order of increasing occupation number within each point group irrep, so it is reordered relative to the MO basis. Instead, you could just build the 1-RDM in the MO basis (driver.run_rdm1()), diagonalize it, and then multiply the resulting eigenvectors with the MO coefficients from PySCF in order to get the NO-to-AO transformation. This could then be written to a Molden file along with Gaussian basis set information for visualization. This would have to be done by hand at the moment because I have not added this functionality in CCpy yet. I could add it in since it is of interest, so thank you for your comment!

As a side note, it would be very interesting to view orbitals of non-traditional ground-state CC theories, such as active-space CCSDt, or more generic CC(P) theories based on adaptive or other types of CC(P;Q) algorithms. If the above Molden writer exists, then one could build 1-RDMs of these CC(P) theories with the help of the ccpy.utilities.utilities.convert_t3_from_pspace routine. This converts the 1D array of P-space T3 amplitudes to a full 6-dimensional array, which can then be used by the run_rdm1 command to build CCSDT-like RDMs.

RagnarB83 commented 3 months ago

Excellent, thanks for the help. I thought I had already tried to diagonalize the rdm from driver.run_rdm1 and multiplied by the MO coeffs from pyscf but apparently not correctly since I got the correct numbers this time around. The Molden-writing should not be too difficult, pyscf has a Molden writer in fact. I'll report back.

And thanks for the note about building 1-RDMS of non-traditional CC methods. That indeed interests me. I'm studying molecules where we have found non-negligible triples effects on the density.