quantumlib / OpenFermion

The electronic structure package for quantum computers.
Apache License 2.0
1.51k stars 372 forks source link

Symmetry in low rank Hamiltonian factorization #720

Closed PabloAMC closed 3 years ago

PabloAMC commented 3 years ago

I am using the function low_rank_two_body_decomposition (https://github.com/quantumlib/OpenFermion/blob/deeaad5fea69ceadfad9f5befeea9249516cb761/src/openfermion/circuits/low_rank.py#L76) to get a low-rank factorization of the Hamiltonian, and want to recover the Hamiltonian in the form of :math:\sum_{pqrs} V_{pqrs} a^\dagger_p a_q a^\dagger_r a_s from equation 7 in https://quantum-journal.org/papers/q-2019-12-02-208/. However, if I use

eri = np.einsum('l,lpq,lrs->pqrs',lambda_ls, one_body_squares, one_body_squares)

I do not get the symmetries stated in equation 5 of the same paper (except pq <--> rs), mostly because one_body_squares = g_{pql} is not symmetric in p and q. Probably there is some theory point I am missing here, but what is it? Thanks in advance!

PabloAMC commented 3 years ago

Actually the g_{pql} are symmetric within the precision of the calculation, so I am just using (g + g.T)/2 for each value of l and that works.