code: def commuting_sets_trivial(pauli_sum):
      
      if not isinstance(pauli_sum, (PauliTerm, PauliSum)):
          raise TypeError("This method can only group PauliTerm or PauliSum objects")
  
      if isinstance(pauli_sum, PauliTerm):
          pauli_sum = PauliSum([pauli_sum])
  
      commuting_terms = []
      for term in pauli_sum:
          # find the group that it trivially commutes with
          for term_group in commuting_terms:
              if check_trivial_commutation(term_group, term):
                  term_group.append(term)
                  break
          else:
              commuting_terms.append([term])
  
      return commuting_terms
docs: Group a pauli term into commuting sets using trivial check
  
      :param pauli_sum: PauliSum term
      :return: list of lists containing individual Pauli Terms