class_docstr: Test ``qml.qjit`` with Catalyst
class_docstr_tok: ["Test","``","qml.qjit","``","with","Catalyst"]
docstr: Test `qml.compiler.active` inside a simple circuit
docstr_tok: ["Test","`","qml.compiler.active","`","inside","a","simple","circuit"]
code: def test_active(self):
      """Test `qml.compiler.active` inside a simple circuit"""
      dev = qml.device("lightning.qubit", wires=2)
  
      @qml.qnode(dev)
      def circuit(phi, theta):
          if qml.compiler.active():
              qml.RX(phi, wires=0)
          qml.CNOT(wires=[0, 1])
          qml.PhaseShift(theta, wires=0)
          return qml.expval(qml.PauliZ(0))
  
      assert jnp.allclose(circuit(jnp.pi, jnp.pi / 2), 1.0)
      assert jnp.allclose(qml.qjit(circuit)(jnp.pi, jnp.pi / 2), -1.0)
  
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 TestCatalyst obj's underlying member method code with example usage: obj.test_active() and returns: qml