openfermion.circuits.trotter.trotter_error.trivially_double_commutes

Check if the double commutator [term_a, [term_b, term_c]] is zero.

term_a, term_b, term_c: Single-term QubitOperators.

Notes:

If the sets of qubits which term_b and term_c act on, or if the intersection of term_a's qubits with (term_b's qubits U term_c's qubits) is empty, then the double commutator is trivially zero.