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: Computes the sparse matrix data of the Pauli word times a coefficient, given a wire order.
docstr_tok: ["Computes","the","sparse","matrix","data","of","the","Pauli","word","times","a","coefficient",",","given","a","wire","order","."]
code: def _get_csr_data(self, wire_order, coeff):
      """Computes the sparse matrix data of the Pauli word times a coefficient, given a wire order."""
      full_word = [self[wire] for wire in wire_order]
  
      matrix_size = 2 ** len(wire_order)
      data = np.empty(
          matrix_size, dtype=np.complex128
      )  # Non-zero values
      current_size = 2
      data[:current_size], _ = _cached_sparse_data(full_word[-1])
      data[
          :current_size
      ] *= coeff  # Multiply initial term better than the full matrix
      for s in full_word[-2::-1]:
          if s == "I":
              data[current_size : 2 * current_size] = data[
                  :current_size
              ]
          elif s == "X":
              data[current_size : 2 * current_size] = data[
                  :current_size
              ]
          elif s == "Y":
              data[current_size : 2 * current_size] = (
                  1j * data[:current_size]
              )
              data[:current_size] *= -1j
          elif s == "Z":
              data[current_size : 2 * current_size] = -data[
                  :current_size
              ]
          current_size *= 2
      return data
  
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 21 for calling the PauliWord obj's underlying member method code with example usage: obj._get_csr_data(wire_order, coeff) and returns: data