|View source on GitHub|
Compute the commutator of two-body operators provided that both are normal-ordered and that the first only has diagonal Coulomb interactions.
openfermion.transforms.commutator_ordered_diagonal_coulomb_with_two_body_operator( operator_a, operator_b, prior_terms=None )
|The commutator, or the commutator added to prior_terms if provided.|
|The function could be readily extended to the case of arbitrary two-body operator_a given that operator_b has the desired form; however, the extra check slows it down without desirable added utility.|