class_docstr: Tests for the state function
class_docstr_tok: ["Tests","for","the","state","function"]
docstr: Test if an error is raised if the jacobian method is called via qml.grad
docstr_tok: ["Test","if","an","error","is","raised","if","the","jacobian","method","is","called","via","qml.grad"]
code: def test_jacobian_not_supported(self):
      """Test if an error is raised if the jacobian method is called via qml.grad"""
      dev = qml.device("default.qubit.legacy", wires=4)
  
      @qml.qnode(dev, diff_method="parameter-shift")
      def func(x):
          for i in range(4):
              qml.RX(x, wires=i)
          return state()
  
      d_func = qml.jacobian(func)
  
      with pytest.raises(
          ValueError,
          match=(
              "Computing the gradient of circuits that return the state with the "
              "parameter-shift rule gradient transform is not supported"
          ),
      ):
          d_func(pnp.array(0.1, requires_grad=True))
  
imports: import numpy
  import pytest
  import pennylane
  from pennylane import numpy
  from pennylane.devices import DefaultQubitLegacy
  from pennylane.measurements import State, Shots, density_matrix, expval, state
label_desc: Use image node_id 8 for calling the TestState obj's underlying member method code with example usage: obj.test_jacobian_not_supported() and returns: state