class_docstr: Test that pulse_odegen integrates correctly with QNodes.
class_docstr_tok: ["Test","that","pulse_odegen","integrates","correctly","with","QNodes","."]
docstr: Test that an error is raised when applying ``stoch_pulse_grad``
  to a QNode directly.
docstr_tok: ["Test","that","an","error","is","raised","when","applying","``","stoch_pulse_grad","``","to","a","QNode","directly","."]
code: def test_raises_for_application_to_qnodes(self, dev_name):
      """Test that an error is raised when applying ``stoch_pulse_grad``
      to a QNode directly."""
  
      dev = qml.device(dev_name, wires=1)
      ham_single_q_const = qml.pulse.constant * qml.PauliY(0)
  
      @qml.qnode(dev, interface="jax")
      def circuit(params):
          qml.evolve(ham_single_q_const)([params], 0.2)
          return qml.expval(qml.PauliZ(0))
  
      _match = "pulse generator parameter-shift gradient transform to a QNode directly"
      with pytest.raises(NotImplementedError, match=_match):
          pulse_odegen(circuit)
  
imports: import copy
  import pytest
  import numpy
  import pennylane
  from pennylane import numpy
  from pennylane.ops.qubit.special_unitary import pauli_basis_matrices, pauli_basis_strings
  from pennylane.math import expand_matrix
  from pennylane.gradients.pulse_gradient_odegen import _generate_tapes_and_coeffs, pulse_odegen, _insert_op, _nonzero_coeffs_and_words, _one_parameter_generators, _one_parameter_paulirot_coeffs, _parshift_and_contract
label_desc: Use image node_id 1 for calling the TestPulseOdegenQNode obj's underlying member method code with example usage: obj.test_raises_for_application_to_qnodes(dev_name) and returns: qml