Optimization

Briareus.Evaluation — Type
Evaluation

Result of evaluate: the setup beams, the effective beams after the scenario's laser–plasma model, their deposition, and flux — incident x-ray flux on the scenario's observed elements (TW/mm²; nothing without radiation). Deposition fractions are relative to effective (post-LPI) power. The flux is computed when first read; flux_moments and flux_ylm do not need it.

source
Briareus.GroupPointing — Type
GroupPointing(beams; by = :group, fields = (:z, :r, :defocus), mirror = true)

Maps a parameter vector to beams. Beams are grouped by by (:group — e.g. cone —, :quad, :beam, or a function beam -> key); each group gets one value per field:

  • :z — axial aim coordinate (mm). With mirror, beams from the lower hemisphere (port z < 0) aim at -z, so one value describes a top/bottom-symmetric cone.
  • :r — radial aim offset (mm) toward the beam's own port azimuth.
  • :phi — tangential aim offset (mm), counterclockwise about z.
  • :defocus — focal-plane offset along the beam (mm, see Beam).
  • :power — power per beam (TW).
  • :spot — multiplier on the best-focus spot semi-axes.
  • :dlambda — wavelength detuning (Å), used by laser–plasma models.

Fields not listed keep each beam's template value.

source
Briareus.Scenario — Type
Scenario(target, beams; observe = nothing, radiation = true, time = 0.0,
         albedo = nothing, parameterization = GroupPointing(beams), lpi = nothing,
         deposition_kw = (;), viewfactor_kw = (;))

Everything precomputed for fast repeated evaluation of a pointing design: the DepositionOperator, and — when radiation and observe (component names whose incident x-ray flux is the figure of merit, e.g. :capsule) are given — the view factors and the linear flux response of the observed elements. lpi is a laser–plasma model (Backscatter, CalibratedTransfer, CBET, or a tuple of them) applied at time between the setup beams and deposition.

The flux response is linear in the laser source at fixed albedos: the materials' at time (temperature-dependent ones at their reference temperatures, thin foils intact), or an explicit per-element albedo, such as the converged sol.albedo of a solution at the design point (e.g. a drive history's peak, windows burned through).

Objectives need only the moments of the observed flux, so the scenario keeps the response contracted with the Legendre (lmax = 12) and real-harmonic (lmax = 6) weights: per evaluation a 13 × n and a 49 × n product, and a 62-column solve at setup. The full observed × n response scenario.response (and an evaluation's flux) is computed when first read.

source
Briareus.apply — Method
apply(p::GroupPointing, x) -> Vector{Beam}

Beams for parameter vector x (element type follows x, so this is differentiable).

source
Briareus.asymmetry_objective — Method
asymmetry_objective(; modes = (1 => 1.0, 2 => 1.0, 3 => 1.0, 4 => 1.0), components = (),
                    clip = 10.0, missed = 10.0, direct = 10.0, direct_names = (:capsule,),
                    drive = nothing, drive_weight = 1.0, keepout = nothing,
                    reference = nothing, uncertainty = nothing)

Objective for three-dimensional drive symmetry. For each l => w in modes it adds w × relative_mode_power(c, l) — the rotation-invariant power of all 2l+1 real harmonics of degree l over the mean ((aₗ/a₀)²/(2l+1) for an axisymmetric field) — and for each (l, m) => w in components adds w × (c_lm/c_00)², so a particular azimuthal mode (e.g. the l = 1, m = ±1 drift of a dropped bundle) can be weighted separately. Penalties for clipping, missing and direct capsule illumination and the drive target and keepout are as in symmetry_objective, with drive compared to the mean flux c_00/√(4π).

With reference (a coefficient vector from flux_ylm, e.g. of a tuned design before a change to the target or the beams), the modes and components measure the departure of c_lm/c_00 from the reference's c_lm/c_00 instead of from zero, so the objective restores a known-good drive shape.

With uncertainty = (; pointing, power) the mode and component terms are their expected values over independent beam errors of those rms sizes (linearized; see mode_uncertainty and symmetry_objective): a robust design.

source
Briareus.bounds — Function
bounds(p::GroupPointing, x0; z = 1.0, r = 1.0, phi = 1.0, defocus = 2.0,
       power = 0.5, spot = 0.5, dlambda = 2.0, power_min = 0.0,
       power_max = Inf) -> (lower, upper)

Box bounds around x0: ±z, ±r, ±phi, ±defocus mm, relative ±power, ±spot fractions, and ±dlambda Å. Power bounds are further clipped to the absolute limits power_min ≤ P ≤ power_max (TW per beam, e.g. a facility's per-quad capability).

source
Briareus.flux_moments — Method
flux_moments(ev; lmax = 8, axis = ẑ, center = 0) -> Vector

Legendre moments aₗ of the observed incident flux (index l+1).

source
Briareus.flux_ylm — Method
flux_ylm(ev; lmax = 6) -> Vector

Real spherical-harmonic coefficients of the observed incident flux in the flat mode_index order (polar axis ẑ, azimuth from +x about TCC), from the scenario's cached ylm_weights. Use ylm_matrix(c, lmax) for the C[l+1, lmax+1+m] layout.

source
Briareus.influence_matrix — Method
influence_matrix(scenario, beams; lmax = 6) -> Matrix

Mode response of the observed flux to each beam: column b is the real-harmonic coefficient vector (mode_index order) produced by beam b alone at 1 TW, with the beam's pointing, spot and focus. Without a laser–plasma model the flux is linear in beam powers, so the coefficients of any power assignment P are M * P — the basis of power-rebalancing solves and of tables of what losing each beam costs.

source
Briareus.initial_parameters — Method
initial_parameters(p::GroupPointing) -> Vector{Float64}

Parameters reproducing the template beams (group means where members differ).

source
Briareus.irradiance_objective — Method
irradiance_objective(name; center, radius, intensity = nothing, uniformity = 1.0,
                     spill = 1.0, intensity_weight = 1.0, side = 1)

Objective for a laser-irradiated foil (e.g. a backlighter): RMS nonuniformity of the absorbed laser intensity over the elements of component name within radius of center (on side side: 1 front, -1 back), plus spill × the squared fraction of delivered power landing outside that region, plus — if intensity (TW/mm²) is given — intensity_weight × (mean/intensity - 1)².

source
Briareus.optimize_pointing — Method
optimize_pointing(scenario, objective; x0, lower, upper, iterations = 200,
                  evaluations = 20 * iterations, show_trace = false, g_tol = 1e-8,
                  callback = nothing) -> NamedTuple

Minimize objective(evaluate(scenario, x)) within box bounds by L-BFGS-B with forward-mode automatic-differentiation gradients. Returns (; x, beams, value, initial_value, iterations, evaluations, stopped, reason, result).

The run ends after iterations L-BFGS-B iterations or evaluations objective evaluations (each gradient counts one), whichever comes first: a line search may take many evaluations in one iteration, on a kinked objective (keep-out hinges, a coarse mesh) dozens, so the iteration limit alone does not bound the run time. reason is :converged (projected gradient below g_tol, or no further progress), :iterations, :evaluations or :callback. On :evaluations and :callback the result is the best design evaluated so far, with stopped = true and result = nothing; iterations is the number of iterations completed in every case.

callback, if given, is called after every (non-derivative) objective evaluation with (; evaluations, iteration, value, best_value, best_x); returning true stops the optimization. Use it for progress reports and cancellation.

source
Briareus.report — Method
report(ev; lmax = 6) -> nothing

Print a power accounting and flux-moment summary of an evaluation.

source
Briareus.subset — Method
subset(scenario, keep; parameterization = GroupPointing(kept beams; same fields))

Scenario for the beams keep (indices into the scenario's beams) — e.g. after dropping a bundle — reusing the view factors, flux response and mode weights; only the deposition operator is restricted. The kept beams' template values (pointing, power) come from the scenario's parameterization; the default new parameterization keeps its fields and mirroring and groups by group (pass one to group by quad or beam).

source
Briareus.symmetry_objective — Method
symmetry_objective(; modes = (2 => 1.0, 4 => 1.0), odd = 1.0, lmax = 6,
                   clip = 10.0, missed = 10.0, direct = 10.0, direct_names = (:capsule,),
                   drive = nothing, drive_weight = 1.0, center = 0, keepout = nothing,
                   uncertainty = nothing)

Objective for indirect-drive symmetry: Σ wₗ (aₗ/a₀)² over modes, plus odd × the sum of squared odd moments (top/bottom imbalance), plus clip, missed and direct times the squared fractions of laser power clipped on the outside of the target, missing it, or hitting direct_names (e.g. the capsule) directly. When drive (TW/mm²) is given, adds drive_weight × (a₀/drive - 1)². A keepout (an ApertureKeepOut for the entrance-hole rims, a SphereKeepOut for the capsule, or a tuple of them) adds its penalty on the beams' worst-case clearance. The direct penalty only sees power already on the capsule; keep a margin with a SphereKeepOut.

With uncertainty = (; pointing, power) (rms beam-to-beam pointing in mm and relative power, as in mode_uncertainty) the mode terms are their expected values over those errors, linearized: each (aₗ/a₀)² gains the variance the errors give it, so the optimum also makes the drive shape insensitive to them (robust design). This costs about three gradients per evaluation.

source
Briareus.mode_sensitivity — Method
mode_sensitivity(scenario, beams; lmax = 4) -> NamedTuple

Sensitivity of the observed flux's real spherical-harmonic shape c_lm/c_00 (mode_index order, through lmax ≤ 6) to each beam's own errors: a pointing displacement of its aim transverse to the beam (mm, along the spot's a and b axes) and a relative power error. Returns (; J, c, names): J is (lmax+1)² × 3nb, column 3(b-1) + k the derivative with respect to error k of beam b (k = 1, 2 the two transverse directions, 3 the relative power), c the nominal c_lm/c_00, and names the column labels.

Each beam's deposition depends on its own errors only, so the derivatives come from one forward-mode pass per beam with three dual partials: exact (to round-off), and about the cost of one gradient of an objective. The beams are the scenario's setup beams; a laser–plasma model is applied before the errors (the errors are in the delivered beams). Errors move the aim; the beam direction (the port) is fixed.

source
Briareus.mode_uncertainty — Method
mode_uncertainty(scenario, beams; pointing = 0.05, power = 0.0, lmax = 4) -> NamedTuple

Expected spread of the observed drive shape from independent beam-to-beam errors, by linear propagation through mode_sensitivity: each beam's aim is displaced at random transverse to the beam with rms pointing mm (the rms of the displacement's length, pointing/√2 along each axis; NIF specifies 50 µm), and its power by an rms fraction power. Returns (; c, sigma, covariance, rms_mode, J): the nominal c_lm/c_00, the rms of each coefficient, their covariance, and for each degree l = 1:lmax the rms of the mode's amplitude over the errors, √E[Σ_m (δc_lm/c_00)²] (the expected mode-l budget the errors use: compare mode_amplitude, which is √(2l+1) times the nominal one). Linear in the errors: check large errors with sample_modes.

source
Briareus.sample_modes — Method
sample_modes(scenario, beams; pointing = 0.05, power = 0.0, n = 100,
             rng = Random.default_rng(), lmax = 4) -> Matrix

Monte Carlo of the drive shape under the errors of mode_uncertainty: n samples of c_lm/c_00 (columns), each from a full evaluation with every beam's aim displaced along its spot axes by normal errors of rms pointing/√2 each and its power by a normal fraction of rms power. The independent check of the linear propagation, and the answer when errors are large enough for the drive to respond nonlinearly.

source