class_docstr: Test ``qml.qjit`` with Catalyst's grad operations
class_docstr_tok: ["Test","``","qml.qjit","``","with","Catalyst","'s","grad","operations"]
docstr: Test the grad transformation with multiple QNodes with their own differentiation methods.
docstr_tok: ["Test","the","grad","transformation","with","multiple","QNodes","with","their","own","differentiation","methods","."]
code: def test_grad_with_multiple_qnodes(self):
      """Test the grad transformation with multiple QNodes with their own differentiation methods."""
      dev = qml.device("lightning.qubit", wires=1)
  
      @qml.qjit
      def workflow(theta):
          @qml.qnode(dev, diff_method="parameter-shift")
          def circuit_A(params):
              qml.RX(
                  jnp.exp(params[0] ** 2) / jnp.cos(params[1] / 4),
                  wires=0,
              )
              return qml.probs()
  
          @qml.qnode(dev, diff_method="adjoint")
          def circuit_B(params):
              qml.RX(
                  jnp.exp(params[1] ** 2) / jnp.cos(params[0] / 4),
                  wires=0,
              )
              return qml.expval(qml.PauliZ(wires=0))
  
          def loss(params):
              return jnp.prod(circuit_A(params)) + circuit_B(params)
  
          return qml.grad(loss)(theta)
  
      result = workflow(jnp.array([1.0, 2.0]))
      reference = jnp.array([0.57367285, 44.4911605])
  
      assert jnp.allclose(result, reference)
  
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 3 for calling the TestCatalystGrad obj's underlying member method code with example usage: obj.test_grad_with_multiple_qnodes() and returns: qml, qml, qml, unknown