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: Computes the matrix-vector product of the Pauli sentence with a state vector.
  See pauli_sparse_matrices.md for the technical details.
docstr_tok: ["Computes","the","matrix-vector","product","of","the","Pauli","sentence","with","a","state","vector",".","See","pauli_sparse_matrices.md","for","the","technical","details","."]
code: def dot(self, vector, wire_order=None):
      """Computes the matrix-vector product of the Pauli sentence with a state vector.
      See pauli_sparse_matrices.md for the technical details."""
      wire_order = (
          self.wires if wire_order is None else Wires(wire_order)
      )
      if not wire_order.contains_wires(self.wires):
          raise ValueError(
              "Can't get the matrix for the specified wire order because it "
              f"does not contain all the Pauli sentence's wires {self.wires}"
          )
      pauli_words = list(self)  # Ensure consistent ordering
      op_sparse_idx = _ps_to_sparse_index(pauli_words, wire_order)
      _, unique_sparse_structures, unique_invs = np.unique(
          op_sparse_idx, axis=0, return_index=True, return_inverse=True
      )
      pw_sparse_structures = unique_sparse_structures[unique_invs]
  
      dtype = (
          np.complex64
          if vector.dtype in (np.float32, np.complex64)
          else np.complex128
      )
      if vector.ndim == 1:
          vector = vector.reshape(1, -1)
      mv = np.zeros_like(vector, dtype=dtype)
      for sparse_structure in unique_sparse_structures:
          indices, *_ = np.nonzero(
              pw_sparse_structures == sparse_structure
          )
          entries, data = self._get_same_structure_csr(
              [pauli_words[i] for i in indices], wire_order
          )
          mv += vector[:, entries] * data.reshape(1, -1)
      return mv.reshape(vector.shape)
  
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 16 for calling the PauliSentence obj's underlying member method code with example usage: obj.dot(vector, wire_order) and returns: mv