class_docstr: Test the Hadamard gradient transform and edge cases such as non diff parameters, auxiliary wires, etc...
class_docstr_tok: ["Test","the","Hadamard","gradient","transform","and","edge","cases","such","as","non","diff","parameters",",","auxiliary","wires",",","etc","..."]
docstr: Test error raised if attempting to differentiate with
  respect to a state
code: def test_state_non_differentiable_error(self):
      """Test error raised if attempting to differentiate with
      respect to a state"""
  
      with qml.queuing.AnnotatedQueue() as q:
          qml.RX(0.543, wires=[0])
          qml.RY(-0.654, wires=[1])
          qml.state()
  
      tape = qml.tape.QuantumScript.from_queue(q)
      _match = (
          r"return the state with the Hadamard test gradient transform"
      )
      with pytest.raises(ValueError, match=_match):
          qml.gradients.hadamard_grad(tape)
  
imports: import pytest
  import pennylane
  from pennylane import numpy
label_desc: Use image node_id 8 for calling the TestHadamardGradEdgeCases obj's underlying member method code with example usage: obj.test_state_non_differentiable_error() without return types