# Implementation

## `index_rt` {#sec:index_rt}

The `index_rt` is a unique index assigned to each combination of beam
propagation mode and number of passes into the plasma.
Initially `index_rt` is 1 for the ordinary mode or 2 for the extraordinary
mode. Due to the mode mixing, on subsequent passes each beam splits into two
modes and the `index_rt` is updated as:

```fortran
  index_rt = 2*index_rt + 1  ! for the O mode
  index_rt = 2*index_rt + 2  ! for the X mode
```

It follows that ordinary(extraordinary) modes respectively have odd(even)
indices and the number of passes is given by $\lfloor \log₂(1 + \tt index\_rt)
\rfloor$. For example, an `index_rt`=19 denotes the following chain:

$$
  \begin{aligned}
    \text{mode:}           && O &→ X → O → O  \\
    \text{\tt index\_rt:}  && 1 &→ 4 → 9 → 19
  \end{aligned}
$$