Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

slight modification to function generate_hamiltonian ? #856

Open
michaelkaicher opened this issue Jan 8, 2024 · 0 comments
Open

slight modification to function generate_hamiltonian ? #856

michaelkaicher opened this issue Jan 8, 2024 · 0 comments

Comments

@michaelkaicher
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants