class_docstr: Class to test the integration of argnums (Jax) and the hadamard grad transform.
class_docstr_tok: ["Class","to","test","the","integration","of","argnums","(","Jax",")","and","the","hadamard","grad","transform","."]
docstr: Test that giving argnum to Jax, raises an error.
code: def test_argnum_error(self, argnums, interface):
      """Test that giving argnum to Jax, raises an error."""
      import jax
  
      dev = qml.device("default.qubit", wires=3)
  
      @qml.qnode(dev, interface=interface)
      def circuit(x, y):
          qml.RX(x[0], wires=[0])
          qml.RY(y, wires=[1])
          qml.CNOT(wires=[0, 1])
          return qml.expval(qml.PauliZ(0) @ qml.PauliX(1))
  
      x = jax.numpy.array([0.543, 0.2])
      y = jax.numpy.array(-0.654)
  
      with pytest.raises(
          qml.QuantumFunctionError,
          match="argnum does not work with the Jax interface. You should use argnums instead.",
      ):
          qml.gradients.hadamard_grad(circuit, argnum=argnums)(x, y)
  
imports: import pytest
  import pennylane
  from pennylane import numpy
label_desc: Use image node_id 1 for calling the TestJaxArgnums obj's underlying member method code with example usage: obj.test_argnum_error(argnums, interface) and returns: qml