class_docstr: Tests for the helper method _split_evol_ops that samples a splitting time and splits up
  a ParametrizedEvolution operation at the sampled time, inserting a Pauli rotation about the
  provided Pauli word with angles +- pi/2.
class_docstr_tok: ["Tests","for","the","helper","method","_split_evol_ops","that","samples","a","splitting","time","and","splits","up","a","ParametrizedEvolution","operation","at","the","sampled","time",",","inserting","a","Pauli","rotation","about","the","provided","Pauli","word","with","angles","+-","pi\/2","."]
docstr: Test that _split_evol_ops returns the right ops with correct
  relations to the input operation for a Pauli word as ``ob``.
docstr_tok: ["Test","that","_split_evol_ops","returns","the","right","ops","with","correct","relations","to","the","input","operation","for","a","Pauli","word","as","``","ob","``","."]
code: def test_with_pauliword(self, ham, params, time, ob, word):
      """Test that _split_evol_ops returns the right ops with correct
      relations to the input operation for a Pauli word as ``ob``."""
  
      import jax
  
      ham = ham(None)
      key = jax.random.PRNGKey(5324)
      op = qml.evolve(ham)(params, time)
      op_copy = copy.deepcopy(op)
      exp_time = [0, time] if qml.math.ndim(time) == 0 else time
      # Cross-check instantiation of evolution time
      assert qml.math.allclose(op.t, exp_time)
  
      # Sample splitting time
      tau = (
          jax.random.uniform(key) * (exp_time[1] - exp_time[0])
          + exp_time[0]
      )
      ops, coeffs = _split_evol_ops(op, ob, tau)
      eigvals = qml.eigvals(ob)
      prefactor = np.max(eigvals)
      exp_coeffs = [prefactor, -prefactor]
      exp_shifts = [np.pi / 2, -np.pi / 2]
  
      # Check coefficients
      assert qml.math.allclose(coeffs, exp_coeffs)
  
      # Check that the original operation was not altered
      assert qml.equal(op, op_copy)
  
      assert isinstance(ops, tuple) and len(ops) == len(exp_shifts)
  
      for exp_shift, _ops in zip(exp_shifts, ops):
          assert isinstance(_ops, list) and len(_ops) == 3
          # Check that the split-up time evolution is correct
          assert qml.math.allclose(_ops[0].t, [op.t[0], tau])
          # Patch _ops[0] to have the same time as op, so that it should become the same as op
          _ops[0].t = op.t
          assert qml.equal(_ops[0], op)
  
          assert qml.math.allclose(_ops[2].t, [tau, op.t[-1]])
          # Patch _ops[2] to have the same time as op, so that it should become the same as op
          _ops[2].t = op.t
          assert qml.equal(_ops[2], op)
  
          # Check that the inserted exponential is correct
          assert qml.equal(
              qml.PauliRot(exp_shift, word, wires=ob.wires), _ops[1]
          )
  
imports: import warnings
  import copy
  import pytest
  import numpy
  import pennylane
  from pennylane.gradients.general_shift_rules import eigvals_to_frequencies, generate_shift_rule
  from pennylane.gradients.pulse_gradient import _parshift_and_integrate, _split_evol_ops, _split_evol_tape, stoch_pulse_grad
label_desc: Use image node_id 1 for calling the TestSplitEvolOps obj's underlying member method code with example usage: obj.test_with_pauliword(ham, params, time, ob, word) without return types