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 simple while loop.
docstr_tok: ["Test","simple","while","loop","."]
code: def test_alternating_while_loop(self):
      """Test simple while loop."""
      dev = qml.device("lightning.qubit", wires=1)
  
      @qml.qjit
      @qml.qnode(dev)
      def circuit(n):
          @qml.while_loop(lambda v: v[0] < v[1])
          def loop(v):
              qml.PauliX(wires=0)
              return v[0] + 1, v[1]
  
          loop((0, n))
          return qml.expval(qml.PauliZ(0))
  
      assert jnp.allclose(circuit(1), -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 1 for calling the TestCatalystControlFlow obj's underlying member method code with example usage: obj.test_alternating_while_loop() and returns: qml, unknown,  v