def check_trivial_commutation(pauli_list, single_pauli_term):
    """
    Check if a PauliTerm trivially commutes with a list of other terms.

    :param list pauli_list: A list of PauliTerm objects
    :param PauliTerm single_pauli_term: A PauliTerm object
    :returns: True if pauli_two object commutes with pauli_list, False otherwise
    :rtype: bool
    """
    if not isinstance(pauli_list, list):
        raise TypeError("pauli_list should be a list")

    for term in pauli_list:
        if not _commutes(term, single_pauli_term):
            return False
    return True
def check_trivial_commutation ( pauli_list , single_pauli_term ) : if not isinstance ( pauli_list , list ) : raise TypeError ( "pauli_list should be a list" ) for term in pauli_list : if not _commutes ( term , single_pauli_term ) : return False return True
Check if a PauliTerm trivially commutes with a list of other terms.

    :param list pauli_list: A list of PauliTerm objects
    :param PauliTerm single_pauli_term: A PauliTerm object
    :returns: True if pauli_two object commutes with pauli_list, False otherwise
    :rtype: bool