When using most molecular electron structure codes that use GTOs for the density or wavefunction, it is possible to project the first-order density matrix onto 'natural orbitals' with MOs expressed using GTOs.
What open-source codes are currently available to fit (presumably in a least-squares sense) MOs expressed using GTOs to:
- An arbitrary 3-D gridded density (with either vacuum or 3-D periodic boundary conditions)
- Wavefunction/density representations (plane waves, e.g. Quantum Espresso; Augmented plane waves, e.g. EXCITEing, etc.). In the latter case, presumably the 'augmented' part involves GTOs that could be used as at least a starting point for fitting to a 'GTOs only' representation.
Additional background: I want to be able to accurately determine the topology of an arbitrary 3-D distribution of electron density rho(r), together with all the first and second partial derivatives with respect to the spatial coordinates. I also need an accurate quantum stress tensor, also at arbitrary points. Though gridded data introduces a discretization error, e.g. plane waves also introduce such a error as one uses a finite set of g-vectors from the FFT grid. Software I want to use expects GTOs, but if code exists to get the quantities above by other means with minimal spurious effects, then that's OK. And yes, everyone, no matter their chosen representation, is fighting against numerical noise and effects caused by the electronic structure algorithm producing the density. 'Best effort' is what I am going for.
Pointers to code repos gratefully received!
UPDATE: some progress - Frank Jensen below has kindly pointed out his recent work projecting onto GTOs, of which I was previously aware. The author of MultiWFN confirmed that this code can directly use wavefunctions from CP2K, and it seems that 'projwfc' from the Quantum-Espresso suite generates GTOs as an intermediate step to get Lowdin population analysis numbers from a plane-wave wavefunction, though it is currently not clear exactly how to get these GTOs out in Molden/WFX/other useable form. No significant progress on the 'fitting GTOs to an arbitrary 3-D density grid' yet, though.