code: def for_loop(lower_bound, upper_bound, step):
      """A :func:`~.qjit` compatible for-loop for PennyLane programs.
  
      .. note::
  
          This function only supports the Catalyst compiler. See
          :func:`catalyst.for_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
      for-loop, similar to `jax.cond.fori_loop <https://jax.readthedocs.io/en/latest/_autosummary/jax.lax.fori_loop.html>`__.
      That is, any variables that are modified across iterations need to be provided
      as inputs/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 ``for_loop`` are given by the following Python pseudo-code:
  
      .. code-block:: python
  
          def for_loop(lower_bound, upper_bound, step, loop_fn, *args):
              for i in range(lower_bound, upper_bound, step):
                  args = loop_fn(i, *args)
              return args
  
      Unlike ``jax.cond.fori_loop``, the step can be negative if it is known at tracing time
      (i.e., constant). If a non-constant negative step is used, the loop will produce no iterations.
  
      Args:
          lower_bound (int): starting value of the iteration index
          upper_bound (int): (exclusive) upper bound of the iteration index
          step (int): increment applied to the iteration index at the end of each iteration
  
      Returns:
          Callable[[int, ...], ...]: A wrapper around the loop body function.
          Note that the loop body function must always have the iteration index as its first
          argument, which can be used arbitrarily inside the loop body. As the value of the index
          across iterations is handled automatically by the provided loop bounds, it must not be
          returned from the function.
  
      Raises:
          CompileError: if the compiler is not installed
  
      .. seealso:: :func:`~.while_loop`, :func:`~.qjit`
  
      **Example**
  
  
      .. code-block:: python
  
          dev = qml.device("lightning.qubit", wires=1)
  
          @qml.qjit
          @qml.qnode(dev)
          def circuit(n: int, x: float):
  
              @qml.for_loop(0, n, 1)
              def loop_rx(i, x):
                  # perform some work and update (some of) the arguments
                  qml.RX(x, wires=0)
  
                  # update the value of x for the next iteration
                  return jnp.sin(x)
  
              # apply the for loop
              final_x = loop_rx(x)
  
              return qml.expval(qml.PauliZ(0)), final_x
  
      >>> circuit(7, 1.6)
      (array(0.97926626), array(0.55395718))
      """
  
      if active_jit := active_compiler():
          compilers = AvailableCompilers.names_entrypoints
          ops_loader = compilers[active_jit]["ops"].load()
          return ops_loader.for_loop(lower_bound, upper_bound, step)
  
      raise CompileError("There is no active compiler package.")
  
label_desc: Use image node_id 3 for calling a global function with example usage: for_loop(lower_bound, upper_bound, step) and returns: ops_loader