\leftarrow t + \Delta t$.

5.  If $\mathit{flag}$ is $\mathit{false}$, return to step 2. Otherwise, generate a mark $\omega \in \Omega$ according to the probability measure $\mu_{\omega}$, and set ${\lvert {\widetilde{\Phi}}_{\Xi}(t)\rangle}\leftarrow {\widetilde{A}}(t,\omega) {\lvert {\widetilde{\Phi}}_{\Xi}(t)\rangle}$. Generate a new uniformly distributed random variable $Y \in [0,1]$ and return to step 2.

In the above algorithm, $\tilde{\eta}$ records the value of $\eta$ at the last mark, and step 3 uses the property to determine the time of the next mark. When a mark is set at the current time step, the boolean variable $\mathit{flag}$ is set to be true, and in step 5, a mark is picked from the mark space. By doing this, the whole process $\Xi$ is generated mark by mark. At the same time, the value of $\eta(t)$ at the trajectory ${\lvert {\widetilde{\Phi}}_{\Xi}(t)\rangle}$ is obtained at all discrete times, and thus $\ket{\Phi_{\Xi}(t)}$ can be evaluated by $\ket{\Phi_{\Xi}(t)} = \mathrm{e}^{\eta(t)} {\lvert {\widetilde{\Phi}}_{\Xi}(t)\rangle}$. Regarding the computational cost, it can be seen that at each time step for a single trajectory, we need to evaluate the integral over $\Omega$ for $O(1)$ times (depends on the Runge-Kutta method used), apply $H_{\mathrm{easy}}$ for $O(1)$ times, and apply ${\widetilde{A}}(t,\omega)$ at most once.

This section gives a 