You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when playing with some active space Hamiltonians with pyscf and generating them as FermionOperator objects (or rather InteractionOperator objects), I found that the resulting Hamiltonian included a lot of unnecessary terms: namely, operators such as
h_{kklm} a_k^dag a_k^dag a_l a_m,
where h_{kklm} was different than zero and the operator thus included (but the operator a_k^dag a_k^dag a_l a_m is zero, so one should just set h_{kklm} to zero right away (k,l,m are here spinorbital indices).
Hi,
when playing with some active space Hamiltonians with pyscf and generating them as FermionOperator objects (or rather InteractionOperator objects), I found that the resulting Hamiltonian included a lot of unnecessary terms: namely, operators such as
h_{kklm} a_k^dag a_k^dag a_l a_m,
where h_{kklm} was different than zero and the operator thus included (but the operator a_k^dag a_k^dag a_l a_m is zero, so one should just set h_{kklm} to zero right away (k,l,m are here spinorbital indices).
Maybe this problem could be solved by just adding:
if not (p==q or r==s):
before
# Same spin two_body_coefficients[2 * p, 2 * q, 2 * r, 2 * s] = (two_body_integrals[p, q, r, s] / 2.) two_body_coefficients[2 * p + 1, 2 * q + 1, 2 * r + 1, 2 * s + 1] = (two_body_integrals[p, q, r, s] / 2.)
in line 272 of https://github.com/quantumlib/OpenFermion/blob/v1.6.0/src/openfermion/hamiltonians/hartree_fock.py#L245-L291
Would this cause any problems?
Cheers,
Michael.
The text was updated successfully, but these errors were encountered: