boss_bench

boss_bench.design

Contents

boss_bench.design#

Inverse-design benchmark: score a set of evaluated designs.

boss_bench.design.design_metrics(loss_fraction, mirror_ratio, mirror_target, aspect_ratio, aspect_target)[source]#

Score designs that have been evaluated with VMEC and particle tracing.

Each design is evaluated as in the paper: its boundary is rescaled to ARIES-CS size (minor radius 1.7 m, volume-averaged field 5.86 T) and its VMEC equilibrium is computed. Its mirror ratio is \(\max |B| / \min |B|\) on a 15 × 41 × 41 grid in \((s, \theta, \phi)\), and its loss fraction is that of 5,000 alpha particles born on \(s = 0.1\), traced for 0.1 s.

For \(n\) designs with loss fractions \(f_j\), mirror ratios \(R_j\), aspect ratios \(A_j\), and targets \(R^*_j\) and \(A^*_j\), the scores in percent are

\[ \begin{align}\begin{aligned}\text{low-loss rate}_c = \frac{100}{n} \sum_j \mathbb{1}[f_j \le c], \quad c = 0.10, 0.15,\\\text{mirror constraint}_k = \frac{100}{n} \sum_j \mathbb{1}[R_j \le k R^*_j], \quad k = 1, 1.1,\\\text{aspect error} = 100\, \operatorname{median}_j \frac{|A_j - A^*_j|}{A^*_j}.\end{aligned}\end{align} \]
Parameters:
  • loss_fraction (array_like) – loss fraction of each design, shape (n,).

  • mirror_ratio (array_like) – mirror ratio of each design, shape (n,).

  • mirror_target (array_like) – target mirror ratio of each design, shape (n,).

  • aspect_ratio (array_like) – aspect ratio of each design, shape (n,).

  • aspect_target (array_like) – target aspect ratio of each design, shape (n,).

Returns:

low_loss_rate_10, low_loss_rate_15, mirror_constraint, mirror_constraint_1.1, aspect_error_median, the scores above, for \(c = 0.10, 0.15\) and \(k = 1, 1.1\).

Return type:

dict

Raises:

ValueError – if an input contains NaN or inf.