class_docstr: Dictionary representing a linear combination of Pauli words, with the keys
  as :class:`~pennylane.pauli.PauliWord` instances and the values correspond to coefficients.
  
  .. note::
  
      An empty :class:`~.PauliSentence` will be treated as the additive
      identity (i.e 0 * Identity on all wires).
  
  **Examples**
  
  >>> ps = PauliSentence({
          PauliWord({0:'X', 1:'Y'}): 1.23,
          PauliWord({2:'Z', 0:'Y'}): -0.45j
      })
  >>> ps
  1.23 * X(0) @ Y(1)
  + (-0-0.45j) * Z(2) @ Y(0)
  
  Combining Pauli words automatically results in Pauli sentences that can be used to construct more complicated operators.
  
  >>> w1 = PauliWord({0:"X", 1:"Y"})
  >>> w2 = PauliWord({1:"X", 2:"Z"})
  >>> ps = 0.5 * w1 - 1.5 * w2 + 2
  >>> ps + PauliWord({3:"Z"}) - 1
  0.5 * X(0) @ Y(1)
  + -1.5 * X(1) @ Z(2)
  + 1 * I
  + 1.0 * Z(3)
class_docstr_tok: ["Dictionary","representing","a","linear","combination","of","Pauli","words",",","with","the","keys","as",":","class",":","`","~pennylane.pauli.PauliWord","`","instances","and","the","values","correspond","to","coefficients",".","..","note",":",":","An","empty",":","class",":","`","~.PauliSentence","`","will","be","treated","as","the","additive","identity","(","i.e","0","*","Identity","on","all","wires",")",".","*","*","Examples","*","*",">",">",">","ps","=","PauliSentence","(","{","PauliWord","(","{","0",":","'","X","'",",","1",":","'","Y","'","}",")",":","1.23",",","PauliWord","(","{","2",":","'","Z","'",",","0",":","'","Y","'","}",")",":","-0.45j","}",")",">",">",">","ps","1.23","*","X","(","0",")","@","Y","(","1",")","+","(","-0-0.45j",")","*","Z","(","2",")","@","Y","(","0",")","Combining","Pauli","words","automatically","results","in","Pauli","sentences","that","can","be","used","to","construct","more","complicated","operators",".",">",">",">","w1","=","PauliWord","(","{","0",":","''","X","''",",","1",":","''","Y","''","}",")",">",">",">","w2","=","PauliWord","(","{","1",":","''","X","''",",","2",":","''","Z","''","}",")",">",">",">","ps","=","0.5","*","w1","-","1.5","*","w2","+","2",">",">",">","ps","+","PauliWord","(","{","3",":","''","Z","''","}",")","-","1","0.5","*","X","(","0",")","@","Y","(","1",")","+","-1.5","*","X","(","1",")","@","Z","(","2",")","+","1","*","I","+","1.0","*","Z","(","3",")"]
docstr: Multiply a PauliWord by a scalar
  
  Args:
      other (Scalar): The scalar to multiply the PauliWord with
  
  Returns:
      PauliSentence
docstr_tok: ["Multiply","a","PauliWord","by","a","scalar","Args",":","other","(","Scalar",")",":","The","scalar","to","multiply","the","PauliWord","with","Returns",":","PauliSentence"]
code: def __mul__(self, other):
      """Multiply a PauliWord by a scalar
  
      Args:
          other (Scalar): The scalar to multiply the PauliWord with
  
      Returns:
          PauliSentence
      """
      if isinstance(other, PauliSentence):
          # this is legacy support and will be removed after a deprecation cycle
          warnings.warn(
              "Matrix/Tensor multiplication using the * operator on PauliWords and PauliSentences is deprecated, use @ instead.",
              qml.PennyLaneDeprecationWarning,
          )
          return self @ other
  
      if isinstance(other, TensorLike):
          if not qml.math.ndim(other) == 0:
              raise ValueError(
                  f"Attempting to multiply a PauliSentence with an array of dimension {qml.math.ndim(other)}"
              )
  
          return PauliSentence(
              {key: other * value for key, value in self.items()}
          )
  
      raise TypeError(
          f"PauliSentence can only be multiplied by numerical data. Attempting to multiply by {other} of type {type(other)}"
      )
  
imports: import warnings
  from copy import copy
  from functools import reduce, lru_cache
  from typing import Iterable
  import numpy
  from scipy import sparse
  import pennylane
  from pennylane import math
  from pennylane.typing import TensorLike
  from pennylane.wires import Wires
  from pennylane.operation import Tensor
  from pennylane.ops import Hamiltonian, Identity, PauliX, PauliY, PauliZ, prod, s_prod
label_desc: Use image node_id 9 for calling the PauliSentence obj's underlying member method code with example usage: obj.__mul__(other) and returns: unknown, PauliSentence