Algorithms

This page gives a brief overview of the computational methods used inside tracketch. For full API details see API Reference.

Simulation pipeline

A TrackSimulator runs three stages:

  1. Dose map – For each depth step along the ion path, the radial dose distribution (RDD) is evaluated using a model from libamtrack (e.g. Cucinotta). SRIM stopping-power tables provide LET and residual energy at each depth, so the RDD changes as the ion slows down.

  2. Etch-rate map – The calibrated EtchRateModel converts local dose D to a local etch velocity V(D) via monotonic PCHIP interpolation in log-dose space. Undamaged material etches at the constant bulk rate V_bulk.

  3. Arrival-time map – Starting from the detector surface (z = 0), the etchant front is propagated through the spatially varying speed field. This is a shortest-path / wavefront problem solved by one of the backends below.

Arrival-time solvers

The etch-rate map defines a speed at every grid point. The arrival time at each cell is the minimum travel time from the surface through any path, weighted by inverse speed:

\[T(\mathbf{x}) = \min_{\text{paths}} \int_0^{\mathbf{x}} \frac{\mathrm{d}s}{V(s)}\]

tracketch provides two solver families.

Fast Marching Method (FMM)

The scikit-fmm library solves the Eikonal equation on a uniform grid. Since the native radial grid is log-spaced, tracketch interpolates the speed map onto a uniform grid, runs FMM, then interpolates back.

FMM supports tilted tracks (theta_deg > 0), where the wavefront starts along a diagonal rather than a flat surface. Dijkstra does not yet support tilting.

Etch-rate model

EtchRateModel represents V(D) as a monotonic PCHIP (Piecewise Cubic Hermite Interpolating Polynomial) spline through a set of dose-velocity anchor points. Key design choices:

  • Anchor velocities are stored as cumulative increments to enforce monotonicity by construction.

  • A synthetic low-dose anchor at 10-3 Gy is prepended so that the spline smoothly converges to V_bulk at low doses.

  • Extrapolation beyond the highest anchor uses the last-segment slope (PCHIP mode) or clamps to the last value.

The model can be serialised to JSON and shared across simulations.