|
def occupations_from_pyscf_mol(mol: pyscf.gto.Mole, C: DirtyMocoeffs) -> "Occupations": |
|
norb = fix_mocoeffs_shape(C).shape[-1] |
|
nocc_a, nocc_b = mol.nelec |
|
nvirt_a, nvirt_b = norb - nocc_a, norb - nocc_b |
|
return nocc_a, nvirt_a, nocc_b, nvirt_b |
It runs fix_mocoeffs_shape on the coefficients and then doesn't even return them, which is wasteful.
- In the short term, figure out how to get
norb from mol.
- In the long term, maybe there should be a class that handles MO coefficients, MO energies, occupations, and the program's molecule/wavefunction/etc. object together. The functional composition right now is nice but I keep repeating the same things over and over again.
pymolresponse/pymolresponse/interfaces/pyscf/utils.py
Lines 12 to 16 in e3a7875
It runs
fix_mocoeffs_shapeon the coefficients and then doesn't even return them, which is wasteful.norbfrommol.