Skip to content

Remove MO coefficient dependence from occupations_from_pyscf_mol #224

@berquist

Description

@berquist

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.

  1. In the short term, figure out how to get norb from mol.
  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions