![]() |
Map the term a^\dagger_p a_q + h.c. to QubitOperator.
openfermion.transforms.jordan_wigner_one_body(
p, q, coefficient=1.0
)
Note that the diagonal terms are divided by a factor of 2 because they are equal to their own Hermitian conjugate.