class_docstr: Test that the template is compatible with all interfaces, including the computation
  of gradients.
class_docstr_tok: ["Test","that","the","template","is","compatible","with","all","interfaces",",","including","the","computation","of","gradients","."]
docstr: Test the jax interface.
docstr_tok: ["Test","the","jax","interface","."]
code: def test_jax(self, tol):
      """Test the jax interface."""
  
      import jax
      import jax.numpy as jnp
  
      weights = jnp.array(np.random.random(size=6))
  
      dev = qml.device("default.qubit", wires=4)
  
      circuit = qml.QNode(circuit_template, dev)
      circuit2 = qml.QNode(circuit_decomposed, dev)
  
      res = circuit(weights)
      res2 = circuit2(weights)
      assert qml.math.allclose(res, res2, atol=tol, rtol=0)
  
      grad_fn = jax.grad(circuit)
      grads = grad_fn(weights)
  
      grad_fn2 = jax.grad(circuit2)
      grads2 = grad_fn2(weights)
  
      assert np.allclose(grads[0], grads2[0], atol=tol, rtol=0)
  
imports: import pytest
  from pennylane import numpy
  import pennylane
label_desc: Use image node_id 3 for calling the TestInterfaces obj's underlying member method code with example usage: obj.test_jax(tol) without return types