class_docstr: Utils class used for grouping sum summands together.
docstr: Add operator to the summands dictionary.
  
  If the operator hash is already in the dictionary, the coefficient is increased instead.
  
  Args:
      summand (Operator): operator to add to the summands dictionary
      coeff (int, optional): Coefficient of the operator. Defaults to 1.
      op_hash (int, optional): Hash of the operator. Defaults to None.
docstr_tok: ["Add","operator","to","the","summands","dictionary",".","If","the","operator","hash","is","already","in","the","dictionary",",","the","coefficient","is","increased","instead",".","Args",":","summand","(","Operator",")",":","operator","to","add","to","the","summands","dictionary","coeff","(","int",",","optional",")",":","Coefficient","of","the","operator",".","Defaults","to","1.","op_hash","(","int",",","optional",")",":","Hash","of","the","operator",".","Defaults","to","None","."]
code: def add(self, summand: Operator, coeff=1, op_hash=None):
      """Add operator to the summands dictionary.
  
      If the operator hash is already in the dictionary, the coefficient is increased instead.
  
      Args:
          summand (Operator): operator to add to the summands dictionary
          coeff (int, optional): Coefficient of the operator. Defaults to 1.
          op_hash (int, optional): Hash of the operator. Defaults to None.
      """
      if isinstance(
          summand, qml.ops.SProd
      ):  # pylint: disable=no-member
          coeff = (
              summand.scalar if coeff == 1 else summand.scalar * coeff
          )
          self.add(summand=summand.base, coeff=coeff)
      else:
          op_hash = summand.hash if op_hash is None else op_hash
          if op_hash in self.queue:
              self.queue[op_hash][0] += coeff
          else:
              self.queue[op_hash] = [copy(coeff), summand]
  
imports: import itertools
  from copy import copy
  from typing import List
  import numpy
  import pennylane
  from pennylane import math
  from pennylane.operation import Operator
  from pennylane.ops.qubit import Hamiltonian
  from pennylane.queuing import QueuingManager
  from .composite import CompositeOp
label_desc: Use image node_id 2 for calling the _SumSummandsGrouping obj's underlying member method code with example usage: obj.add(summand, coeff, op_hash) without return types