class_docstr: Test that using the QNode with JAX integrates with the PennyLane
  stack
class_docstr_tok: ["Test","that","using","the","QNode","with","JAX","integrates","with","the","PennyLane","stack"]
docstr: Test that the jax interface works correctly
  with a matrix parameter
docstr_tok: ["Test","that","the","jax","interface","works","correctly","with","a","matrix","parameter"]
code: def test_matrix_parameter(
      self, dev_name, diff_method, grad_on_execution, interface, tol
  ):
      """Test that the jax interface works correctly
      with a matrix parameter"""
      U = jax.numpy.array([[0, 1], [1, 0]])
      a = jax.numpy.array(0.1)
  
      num_wires = 2
  
      if diff_method == "hadamard":
          num_wires = 3
  
      dev = qml.device(dev_name, wires=num_wires)
  
      @qnode(
          dev,
          diff_method=diff_method,
          interface=interface,
          grad_on_execution=grad_on_execution,
      )
      def circuit(U, a):
          qml.QubitUnitary(U, wires=0)
          qml.RY(a, wires=0)
          return qml.expval(qml.PauliZ(0))
  
      res = jax.grad(circuit, argnums=1)(U, a)
      assert np.allclose(res, np.sin(a), atol=tol, rtol=0)
  
      if diff_method == "finite-diff":
          assert circuit.qtape.trainable_params == [1]
  
imports: import pytest
  import pennylane
  from pennylane import numpy
  from pennylane import qnode
  from pennylane.tape import QuantumScript
label_desc: Use image node_id 4 for calling the TestQNode obj's underlying member method code with example usage: obj.test_matrix_parameter(dev_name, diff_method, grad_on_execution, interface, tol) and returns: qml