-
Notifications
You must be signed in to change notification settings - Fork 467
Description
Run:
molecule h2o {
0 1
o
h 1 0.958
h 1 0.958 2 104.4776
}
wfn = energy('scf/cc-pvdz', return_wfn=True)[1]
print(wfn.Fa_subset("MO").nph)
The result MO basis Fock matrix is not diagonal, as expected.
The correct way to transform the SO basis Fock matrix into the MO basis matrix is contraction against the C coefficient matrices. This is not what the Fa_subset
function does. It instead goes through a series of matrix mulitplications involving the overlap matrix. This is the correct transformation rule for the density matrix. Not-so-coincidentally, Da_subset
goes through exactly the same function, where this behavior is correct. If you try to use the same logic for both helpers, you're going to get one of them wrong, guaranteed.
While the mechanism of the bug is clear to me, I'm not sure what the best fix should be. Perhaps we should intercept "MO" as a special case in Fa_subset
so it never sees the matrix_subset_helper
? Under the hood, the code would return Fa_->transform(Ca_)
.