openfermion.transforms.jordan_wigner_one_body

Map the term a^\dagger_p a_q + h.c. to QubitOperator.

Note that the diagonal terms are divided by a factor of 2 because they are equal to their own Hermitian conjugate.