lcmd-epfl / Q-stack

Stack of codes for dedicated pre- and post-processing tasks for Quantum Machine Learning (QML)
MIT License
13 stars 5 forks source link

Fix SAD-guess representation for open-shell systems #32

Closed YAY-C closed 2 months ago

YAY-C commented 2 months ago

Generating SPAHMs fails when using the SAD-guess with open-shell systems. The Hcore matrix is returned as 'closed-shell' and the Veff computed from spherically averaged atomicHF densities is open-shell (tuple with alpha/beta matrices); adding them up return a fock matrix as tuple (2, Nbas, Nbas); which can not be handled by the solver.

Careful code in branch has been modified to print more details and exits before computing the representations

Run test_SAD.py to get traceback error:

pytest tests/test_SAD.py
YAY-C commented 2 months ago

The issue should be solved, I think ...

Just not sure about whether the alpha and beta component of the Veff could be different, so I added a warning just in case.

YAY-C commented 2 months ago

@briling take a look, and if it seems fine to you we can merge!

briling commented 2 months ago

@YAY-C looks good, could you please make a PR?