class_docstr: Test that differentiating edge case tapes with ``pulse_odegen`` works.
class_docstr_tok: ["Test","that","differentiating","edge","case","tapes","with","``","pulse_odegen","``","works","."]
docstr: Make sure an error is raised for a tape that returns a state.
docstr_tok: ["Make","sure","an","error","is","raised","for","a","tape","that","returns","a","state","."]
code: def test_raises_with_state_return(self):
      """Make sure an error is raised for a tape that returns a state."""
      tape = qml.tape.QuantumScript(measurements=[qml.state()])
      _match = "circuits that return the state with the pulse generator parameter-shift gradient"
      with pytest.raises(ValueError, match=_match):
          pulse_odegen(tape)
  
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 TestPulseOdegenEdgeCases obj's underlying member method code with example usage: obj.test_raises_with_state_return() without return types