class_docstr: Test that stoch_pulse_grad integrates correctly with QNodes and ML interfaces.
class_docstr_tok: ["Test","that","stoch_pulse_grad","integrates","correctly","with","QNodes","and","ML","interfaces","."]
docstr: Test that a simple qnode can be differentiated with stoch_pulse_grad.
docstr_tok: ["Test","that","a","simple","qnode","can","be","differentiated","with","stoch_pulse_grad","."]
code: def test_simple_qnode_jit(
      self, dev_name, num_split_times, time_interface
  ):
      """Test that a simple qnode can be differentiated with stoch_pulse_grad."""
      import jax
      import jax.numpy as jnp
  
      jax.config.update("jax_enable_x64", True)
      dev = qml.device(dev_name, wires=1)
      T = {
          "python": 0.2,
          "numpy": np.array(0.2),
          "jax": jnp.array(0.2),
      }[time_interface]
      ham_single_q_const = qml.pulse.constant * qml.PauliY(0)
  
      @qml.qnode(
          dev,
          interface="jax",
          diff_method=stoch_pulse_grad,
          num_split_times=num_split_times,
      )
      def circuit(params, T=None):
          qml.evolve(ham_single_q_const)(params, T)
          return qml.expval(qml.PauliZ(0))
  
      params = [jnp.array(0.4)]
      p = params[0] * T
      exp_grad = -2 * jnp.sin(2 * p) * T
      jit_grad = jax.jit(jax.grad(circuit))(params, T=T)
      assert qml.math.isclose(jit_grad, exp_grad)
      jax.clear_caches()
  
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 5 for calling the TestStochPulseGradIntegration obj's underlying member method code with example usage: obj.test_simple_qnode_jit(dev_name, num_split_times, time_interface) and returns: qml