openfermion.utils.trivially_double_commutes_dual_basis_using_term_info

Return whether [op_a, [op_b, op_a_prime]] is trivially zero.

Assumes all the operators are FermionOperators from the dual basis Hamiltonian, broken into the form i^j^ i j + c_i(i^ i) + c_j(j^ j) or i^ j + j^ i, where i and j are modes and c is a constant. For the full dual basis Hamiltonian, i^ i and j^ j can have distinct coefficients c_i and c_j: for jellium they are necessarily the same. If this is the case, jellium_only should be set to True.

The operators are determined by the indices they act on and by whether they are hopping operators (i^ j + j^ i) or number operators (i^ j^ i j + c_i(i^ i) + c_j(j^ j)). a, b, and a_prime are shorthands for alpha, beta, and alpha_prime.

indices_alpha (set): The indices term_alpha acts on. indices_beta (set): The indices term_beta acts on. indices_alpha_prime (set): The indices term_alpha_prime acts on. is_hopping_operator_alpha (bool): Whether term_alpha is a hopping operator. is_hopping_operator_beta (bool): Whether term_beta is a hopping operator. is_hopping_operator_alpha_prime (bool): Whether term_alpha_prime is a hopping operator. jellium_only (bool): Whether the terms are only from the jellium Hamiltonian, i.e. if c_i = c for all number operators i^ i or if it depends on i.

Whether or not the double commutator is trivially zero.