class_docstr: Arithmetic operator representing the scalar product of an
  operator with the given scalar.
  
  Args:
      scalar (float or complex): the scale factor being multiplied to the operator.
      base (~.operation.Operator): the operator which will get scaled.
  
  Keyword Args:
      id (str or None): id for the scalar product operator. Default is None.
  
  .. note::
      Currently this operator can not be queued in a circuit as an operation, only measured terminally.
  
  .. seealso:: :func:`~.ops.op_math.s_prod`
  
  **Example**
  
  >>> sprod_op = SProd(1.23, qml.PauliX(0))
  >>> sprod_op
  1.23*(PauliX(wires=[0]))
  >>> qml.matrix(sprod_op)
  array([[0.  , 1.23],
         [1.23, 0.  ]])
  >>> sprod_op.terms()
  ([1.23], [PauliX(wires=[0]])
  
  .. details::
      :title: Usage Details
  
      The SProd operation can also be measured inside a qnode as an observable.
      If the circuit is parameterized, then we can also differentiate through the observable.
  
      .. code-block:: python
  
          dev = qml.device("default.qubit", wires=1)
  
          @qml.qnode(dev, diff_method="best")
          def circuit(scalar, theta):
              qml.RX(theta, wires=0)
              return qml.expval(qml.s_prod(scalar, qml.Hadamard(wires=0)))
  
      >>> scalar, theta = (1.2, 3.4)
      >>> qml.grad(circuit, argnum=[0,1])(scalar, theta)
      (array(-0.68362956), array(0.21683382))
class_docstr_tok: ["Arithmetic","operator","representing","the","scalar","product","of","an","operator","with","the","given","scalar",".","Args",":","scalar","(","float","or","complex",")",":","the","scale","factor","being","multiplied","to","the","operator",".","base","(","~.operation.Operator",")",":","the","operator","which","will","get","scaled",".","Keyword","Args",":","id","(","str","or","None",")",":","id","for","the","scalar","product","operator",".","Default","is","None",".","..","note",":",":","Currently","this","operator","can","not","be","queued","in","a","circuit","as","an","operation",",","only","measured","terminally",".","..","seealso",":",":",":","func",":","`","~.ops.op_math.s_prod","`","*","*","Example","*","*",">",">",">","sprod_op","=","SProd","(","1.23",",","qml.PauliX","(","0",")",")",">",">",">","sprod_op","1.23","*","(","PauliX","(","wires=","[","0","]",")",")",">",">",">","qml.matrix","(","sprod_op",")","array","(","[","[","0.",",","1.23","]",",","[","1.23",",","0",".","]","]",")",">",">",">","sprod_op.terms","(",")","(","[","1.23","]",",","[","PauliX","(","wires=","[","0","]","]",")","..","details",":",":",":","title",":","Usage","Details","The","SProd","operation","can","also","be","measured","inside","a","qnode","as","an","observable",".","If","the","circuit","is","parameterized",",","then","we","can","also","differentiate","through","the","observable",".","..","code-block",":",":","python","dev","=","qml.device","(","``","default.qubit","''",",","wires=1",")","@","qml.qnode","(","dev",",","diff_method=","''","best","''",")","def","circuit","(","scalar",",","theta",")",":","qml.RX","(","theta",",","wires=0",")","return","qml.expval","(","qml.s_prod","(","scalar",",","qml.Hadamard","(","wires=0",")",")",")",">",">",">","scalar",",","theta","=","(","1.2",",","3.4",")",">",">",">","qml.grad","(","circuit",",","argnum=","[","0,1","]",")","(","scalar",",","theta",")","(","array","(","-0.68362956",")",",","array","(","0.21683382",")",")"]
docstr: Representation of the operator as a linear combination of other operators.
  
  .. math:: O = \sum_i c_i O_i
  
  A ``TermsUndefinedError`` is raised if no representation by terms is defined.
  
  Returns:
      tuple[list[tensor_like or float], list[.Operation]]: list of coefficients :math:`c_i`
      and list of operations :math:`O_i`
docstr_tok: ["Representation","of","the","operator","as","a","linear","combination","of","other","operators",".","..","math",":",":","O","=","\\sum_i","c_i","O_i","A","``","TermsUndefinedError","``","is","raised","if","no","representation","by","terms","is","defined",".","Returns",":","tuple","[","list","[","tensor_like","or","float","]",",","list","[",".Operation","]","]",":","list","of","coefficients",":","math",":","`","c_i","`","and","list","of","operations",":","math",":","`","O_i","`"]
code: def terms(self):  # is this method necessary for this class?
      r"""Representation of the operator as a linear combination of other operators.
  
      .. math:: O = \sum_i c_i O_i
  
      A ``TermsUndefinedError`` is raised if no representation by terms is defined.
  
      Returns:
          tuple[list[tensor_like or float], list[.Operation]]: list of coefficients :math:`c_i`
          and list of operations :math:`O_i`
      """
      return [self.scalar], [self.base]
  
imports: from typing import Union
  from copy import copy
  import pennylane
  import pennylane.math
  from pennylane.operation import Operator, convert_to_opmath
  from pennylane.ops.op_math.pow import Pow
  from pennylane.ops.op_math.sum import Sum
  from pennylane.queuing import QueuingManager
  from .symbolicop import ScalarSymbolicOp
label_desc: Use image node_id 7 for calling the SProd obj's underlying member method code with example usage: obj.terms() and returns: list,  list