Nonlinear.jl

Amalthea.Nonlinear.PlasmaCumtrapzType

Response type for cumtrapz-based plasma polarisation, adapted from: M. Geissler, G. Tempea, A. Scrinzi, M. Schnürer, F. Krausz, and T. Brabec, Physical Review Letters 83, 2930 (1999).

source
Amalthea.Nonlinear.PlasmaCumtrapzMethod
PlasmaCumtrapz(t, E, ratefunc, ionpot)

Construct the Plasma polarisation response for a field on time grid t with example electric field like E, an ionization rate callable ratefunc and ionization potential ionpot.

source
Amalthea.Nonlinear.RamanPolarEnvType

Raman polarisation response type for an envelope

h/E2/P are real (Tt, same type as the padded response buffer) and /Eω2/ are their half-length complex spectra () — an r2c/c2r pair (FT = plan_rfft), not the full c2c this type used before (Phase J.3, docs/dev/BACKLOG.md, MATH.md §8.4): both the padded 0.5·|E|² intensity and the impulse response h are mathematically real, so a Hermitian r2c/c2r transform computes the identical convolution at roughly half the FFT cost (measured 1.8-2.8x on the isolated forward+multiply+inverse step, see amalthea/benches/raman_fft_r2c_bench.rs and the native SiO2 kernel's PORT_LOG entry — this mirrors that change exactly, keeping both Raman FFT-conv paths on the same method so equivalence stays r2c-vs-r2c rather than becoming a cross-method comparison). Pout stays complex (Tp) since it is ρ·E·P with E the complex envelope field — the one place this type still differs from RamanPolarField, whose real carrier field keeps Pout real too.

source
Amalthea.Nonlinear.RamanPolarFieldMethod
RamanPolarField(t, ht; thg=true)

Construct Raman polarisation response for a field on time grid t using response function r. If thg=false then exclude the third harmonic generation component of the response.

source
Amalthea.Nonlinear.RustRamanHandleType

Mutable wrapper around a heap-allocated TimeDomainRamanSolver in the Rust shared library. A GC finalizer calls free_raman_solver when the handle is no longer reachable, so the Rust heap allocation is always reclaimed.

source
Amalthea.Nonlinear.PlasmaVector!Method

The plasma response for a vector electric field.

We take the magnitude of the electric field to calculate the ionization rate and fraction, and then solve the plasma polarisation component-wise for the vector field.

A similar approach was used in: C Tailliez et al 2020 New J. Phys. 22 103038.

source
Amalthea.Nonlinear._make_rust_raman_handleMethod
_make_rust_raman_handle(omegas, gammas, couplings, dt) -> Union{Nothing, RustRamanHandle}

Build a Rust-side TimeDomainRamanSolver from already-extracted oscillator parameters. Called from Interface.jl (which can see Raman types) after eligibility has been verified. Returns nothing when the toggle is off, the lib is missing, or init fails.

source
Amalthea.Nonlinear.kerr_γ3Method
kerr_γ3(resp)

Extract the γ3 nonlinear-Kerr coefficient captured by a plain Kerr_field/Kerr_env closure (below), scanning resp — an iterable of response objects, e.g. a TransModeAvg/TransRadial/TransModal/ TransFree's .resp tuple — for the first entry whose closure-generated struct has a field named with a γ3 substring, and returning its value. Continues scanning past a response whose extracted value is exactly 0.0 (same "keep looking for a nonzero one" behavior as the code this replaces). Returns 0.0 if no response has a γ3-named field at all (e.g. resp contains only Raman/plasma responses).

Centralizes what was 4 duplicated inline reflective loops across RK45.jl's native-stepper construction paths (docs/dev/BACKLOG.md S4 item 3; suggestion 8's "explicit accessor seams"). Note this does not distinguish Kerr_field/Kerr_env (a single-field closure) from Kerr_field_nothg/Kerr_env_thg (which also capture a γ3 field, plus one more) — that distinction is a separate eligibility question (RK45._is_plain_kerr_resp), checked elsewhere before the extracted value here is actually used.

source