class_docstr: Test ``qml.qjit`` with Catalyst's grad operations
class_docstr_tok: ["Test","``","qml.qjit","``","with","Catalyst","'s","grad","operations"]
docstr: Test that the correct JVP is returned with QJIT.
docstr_tok: ["Test","that","the","correct","JVP","is","returned","with","QJIT","."]
code: def test_jvp(self):
      """Test that the correct JVP is returned with QJIT."""
  
      @qml.qjit
      def jvp(params, tangent):
          def f(x):
              y = [jnp.sin(x[0]), x[1] ** 2, x[0] * x[1]]
              return jnp.stack(y)
  
          return qml.jvp(f, [params], [tangent])
  
      x = jnp.array([0.1, 0.2])
      tangent = jnp.array([0.3, 0.6])
      res = jvp(x, tangent)
      assert len(res) == 2
      assert jnp.allclose(res[0], jnp.array([0.09983342, 0.04, 0.02]))
      assert jnp.allclose(
          res[1], jnp.array([0.29850125, 0.24000006, 0.12])
      )
  
imports: from unittest.mock import patch
  import pytest
  import pennylane
  from pennylane.compiler.compiler import CompileError
  from pennylane import numpy
  from jax import numpy
  from jax.core import ShapedArray
label_desc: Use image node_id 8 for calling the TestCatalystGrad obj's underlying member method code with example usage: obj.test_jvp() and returns: qml, jnp