xtb-python icon indicating copy to clipboard operation
xtb-python copied to clipboard

atomic spin populations

Open jackwebersdgr opened this issue 3 years ago • 7 comments

Is your feature request related to a problem? Please describe.

I would like to (quantitatively) analyze xTB atomic spin populations for radical chemistry

Describe the solution you'd like

In the same way that Result.get_charges() returns a numpy array of atomic charges, Result.get_spin_pops() would return two numpy arrays of alpha and beta atomic spin populations

Describe alternatives you've considered

The alternative is reading in the orbital coefficients and occupations, and performing the analysis externally. Seeing as the code for generating mulliken/CM5 charge populations exists internally, this will likely require just a slight modification to existing code.

Additional context

jackwebersdgr avatar Jun 28 '22 14:06 jackwebersdgr

Note that xtb currently does not support spin-polarized calculations, all calculations are performed using a restricted open-shell formalism.

However, we are working on a spin-polarization expression for GFN2-xTB (cc @haneug).

awvwgk avatar Jun 28 '22 15:06 awvwgk

Good to know - even within an RO framework it would be useful to have an atomic spin population API!

jackwebersdgr avatar Jun 28 '22 16:06 jackwebersdgr

Alternatively, if someone could point me to some way to get the AO overlap matrix (or even just the basis set parameters) in a given xTB implementation that would be very helpful.

jackwebersdgr avatar Jun 30 '22 21:06 jackwebersdgr

Probably something along this lines: https://github.com/grimme-lab/xtb/discussions/478#discussioncomment-2789695

awvwgk avatar Jun 30 '22 21:06 awvwgk

That looks promising, although I'm running into version issues with tblite for my existing code (examples run with incorrect energies and as a result do not converge). Does a similar API exist in this codebase?

jackwebersdgr avatar Jul 05 '22 18:07 jackwebersdgr

I'm running into version issues with tblite for my existing code

Not sure if I understand what this is supposed to mean, if you suspect a bug I'd appreciate it getting reported.

awvwgk avatar Jul 05 '22 18:07 awvwgk

When I install tblite with a fresh install of python the examples given work fine, but when trying to install tblite in the environment for an existing code base I'm working with (where we currently call this python api), it runs incorrectly, making me believe there are some version incompatibilities (that also are not getting picked up by pip, which I used to install tblite in both instances). I'm not sure what exactly is failing though, so I'd hesitate to report it as a bug.

jackwebersdgr avatar Jul 05 '22 19:07 jackwebersdgr