class_docstr: Immutable dictionary used to represent a Pauli Word,
  associating wires with their respective operators.
  Can be constructed from a standard dictionary.
  
  .. note::
  
      An empty :class:`~.PauliWord` will be treated as the multiplicative
      identity (i.e identity on all wires).
  
  **Examples**
  
  Initializing a Pauli word:
  
  >>> w = PauliWord({"a": 'X', 2: 'Y', 3: 'Z'})
  >>> w
  X(a) @ Y(2) @ Z(3)
  
  When multiplying Pauli words together we obtain the resulting word and the scalar coefficient.
  
  >>> w1 = PauliWord({0:"X", 1:"Y"})
  >>> w2 = PauliWord({1:"X", 2:"Z"})
  >>> w1 @ w2
  (Z(1) @ Z(2) @ X(0), -1j)
  
  We can multiply scalars to Pauli words or add/subtract them, resulting in a :class:`~PauliSentence` instance.
  
  >>> 0.5 * w1 - 1.5 * w2 + 2
  0.5 * X(0) @ Y(1)
  + -1.5 * X(1) @ Z(2)
  + 2 * I
class_docstr_tok: ["Immutable","dictionary","used","to","represent","a","Pauli","Word",",","associating","wires","with","their","respective","operators",".","Can","be","constructed","from","a","standard","dictionary",".","..","note",":",":","An","empty",":","class",":","`","~.PauliWord","`","will","be","treated","as","the","multiplicative","identity","(","i.e","identity","on","all","wires",")",".","*","*","Examples","*","*","Initializing","a","Pauli","word",":",">",">",">","w","=","PauliWord","(","{","``","a","''",":","'","X","'",",","2",":","'","Y","'",",","3",":","'","Z","'","}",")",">",">",">","w","X","(","a",")","@","Y","(","2",")","@","Z","(","3",")","When","multiplying","Pauli","words","together","we","obtain","the","resulting","word","and","the","scalar","coefficient",".",">",">",">","w1","=","PauliWord","(","{","0",":","''","X","''",",","1",":","''","Y","''","}",")",">",">",">","w2","=","PauliWord","(","{","1",":","''","X","''",",","2",":","''","Z","''","}",")",">",">",">","w1","@","w2","(","Z","(","1",")","@","Z","(","2",")","@","X","(","0",")",",","-1j",")","We","can","multiply","scalars","to","Pauli","words","or","add\/subtract","them",",","resulting","in","a",":","class",":","`","~PauliSentence","`","instance",".",">",">",">","0.5","*","w1","-","1.5","*","w2","+","2","0.5","*","X","(","0",")","@","Y","(","1",")","+","-1.5","*","X","(","1",")","@","Z","(","2",")","+","2","*","I"]
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, PauliWord):
          # 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 PauliWord with an array of dimension {qml.math.ndim(other)}"
              )
  
          return PauliSentence({self: other})
      raise TypeError(
          f"PauliWord 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 10 for calling the PauliWord obj's underlying member method code with example usage: obj.__mul__(other) and returns: unknown, PauliSentence