code: def while_loop(cond_fn):
      """A :func:`~.qjit` compatible while-loop for PennyLane programs.
  
      .. note::
  
          This function only supports the Catalyst compiler. See
          :func:`catalyst.while_loop` for more details.
  
          Please see the Catalyst :doc:`quickstart guide <catalyst:dev/quick_start>`,
          as well as the :doc:`sharp bits and debugging tips <catalyst:dev/sharp_bits>`
          page for an overview of the differences between Catalyst and PennyLane.
  
      This decorator provides a functional version of the traditional while
      loop, similar to `jax.lax.while_loop <https://jax.readthedocs.io/en/latest/_autosummary/jax.lax.while_loop.html>`__.
      That is, any variables that are modified across iterations need to be provided as
      inputs and outputs to the loop body function:
  
      - Input arguments contain the value of a variable at the start of an
        iteration
  
      - Output arguments contain the value at the end of the iteration. The
        outputs are then fed back as inputs to the next iteration.
  
      The final iteration values are also returned from the
      transformed function.
  
      The semantics of ``while_loop`` are given by the following Python pseudo-code:
  
      .. code-block:: python
  
          def while_loop(cond_fn, body_fn, *args):
              while cond_fn(*args):
                  args = body_fn(*args)
              return args
  
      Args:
          cond_fn (Callable): the condition function in the while loop
  
      Returns:
          Callable: A wrapper around the while-loop function.
  
      Raises:
          CompileError: if the compiler is not installed
  
      .. seealso:: :func:`~.for_loop`, :func:`~.qjit`
  
      **Example**
  
      .. code-block:: python
  
          dev = qml.device("lightning.qubit", wires=1)
  
          @qml.qjit
          @qml.qnode(dev)
          def circuit(x: float):
  
              @qml.while_loop(lambda x: x < 2.0)
              def loop_rx(x):
                  # perform some work and update (some of) the arguments
                  qml.RX(x, wires=0)
                  return x ** 2
  
              # apply the while loop
              final_x = loop_rx(x)
  
              return qml.expval(qml.PauliZ(0)), final_x
  
      >>> circuit(1.6)
      (array(-0.02919952), array(2.56))
      """
  
      if active_jit := active_compiler():
          compilers = AvailableCompilers.names_entrypoints
          ops_loader = compilers[active_jit]["ops"].load()
          return ops_loader.while_loop(cond_fn)
  
      raise CompileError("There is no active compiler package.")
  
label_desc: Use image node_id 2 for calling a global function with example usage: while_loop(cond_fn) and returns: ops_loader