class_docstr: Test the jax interface execute function
  integrates well for both forward and backward execution
class_docstr_tok: ["Test","the","jax","interface","execute","function","integrates","well","for","both","forward","and","backward","execution"]
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, execute_kwargs, tol):
      """Test that the jax interface works correctly
      with a matrix parameter"""
      a = jax.numpy.array(0.1)
      U = jax.numpy.array([[0, 1], [1, 0]])
  
      def cost(a, U, device):
          with qml.queuing.AnnotatedQueue() as q:
              qml.QubitUnitary(U, wires=0)
              qml.RY(a, wires=0)
              qml.expval(qml.PauliZ(0))
  
          tape = qml.tape.QuantumScript.from_queue(q)
          tape.trainable_params = [0]
          return execute([tape], device, **execute_kwargs)[0]
  
      dev = qml.device("default.qubit.legacy", wires=2)
      res = cost(a, U, device=dev)
      assert np.allclose(res, -np.cos(a), atol=tol, rtol=0)
  
      jac_fn = jax.grad(cost, argnums=0)
      res = jac_fn(a, U, device=dev)
      assert np.allclose(res, np.sin(a), atol=tol, rtol=0)
  
imports: import pytest
  import numpy
  import pennylane
  from pennylane.gradients import param_shift
  from pennylane import execute
label_desc: Use image node_id 8 for calling the TestJaxExecuteIntegration obj's underlying member method code with example usage: obj.test_matrix_parameter(execute_kwargs, tol) and returns: execute