code: def apply_pauliz(
      op: qml.PauliZ,
      state,
      is_state_batched: bool = False,
      debugger=None,
  ):
      """Apply pauliz to state."""
  
      axis = op.wires[0] + is_state_batched
      n_dim = math.ndim(state)
  
      if n_dim >= 9 and math.get_interface(state) == "tensorflow":
          return apply_operation_tensordot(
              op, state, is_state_batched=is_state_batched
          )
  
      sl_0 = _get_slice(0, axis, n_dim)
      sl_1 = _get_slice(1, axis, n_dim)
  
      # must be first state and then -1 because it breaks otherwise
      state1 = math.multiply(state[sl_1], -1)
      return math.stack([state[sl_0], state1], axis=axis)
  
imports: from functools import singledispatch
  from string import ascii_letters
  import numpy
  import pennylane
  from pennylane import math
label_desc: Use image node_id 9 for calling a global function with example usage: apply_pauliz(op, state, is_state_batched, debugger) and returns: math, apply_operation_tensordot