class_docstr: Test ``qml.qjit`` with Catalyst's control-flow operations
class_docstr_tok: ["Test","``","qml.qjit","``","with","Catalyst","'s","control-flow","operations"]
docstr: Test nested for loops.
docstr_tok: ["Test","nested","for","loops","."]
code: def test_nested_for_loops(self):
      """Test nested for loops."""
      dev = qml.device("lightning.qubit", wires=4)
  
      @qml.qjit
      @qml.qnode(dev)
      def circuit(n):
          # Input state: equal superposition
          @qml.for_loop(0, n, 1)
          def init(i):
              qml.Hadamard(wires=i)
  
          # QFT
          @qml.for_loop(0, n, 1)
          def qft(i):
              qml.Hadamard(wires=i)
  
              @qml.for_loop(i + 1, n, 1)
              def inner(j):
                  qml.ControlledPhaseShift(
                      np.pi / 2 ** (n - j + 1), [i, j]
                  )
  
              inner()
  
          init()
          qft()
  
          # Expected output: |100...>
          return qml.state()
  
      assert jnp.allclose(circuit(4), jnp.eye(2**4)[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 4 for calling the TestCatalystControlFlow obj's underlying member method code with example usage: obj.test_nested_for_loops() and returns: qml