Nonlinear.jl
Amalthea.Nonlinear.PlasmaCumtrapz — Type
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).
Amalthea.Nonlinear.PlasmaCumtrapz — Method
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.
Amalthea.Nonlinear.PlasmaCumtrapz — Method
Handle plasma polarisation routing to PlasmaVector or PlasmaScalar.
Amalthea.Nonlinear.RamanPolar — Type
Raman polarisation response type
Amalthea.Nonlinear.RamanPolar — Method
Calculate Raman polarisation for field/envelope Et
Amalthea.Nonlinear.RamanPolarEnv — Type
Raman polarisation response type for an envelope
h/E2/P are real (Tt, same type as the padded response buffer) and hω/Eω2/Pω are their half-length complex spectra (Tω) — 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.
Amalthea.Nonlinear.RamanPolarEnv — Method
RamanPolarEnv(t, ht)Construct Raman polarisation response for an envelope on time grid t using response function r.
Amalthea.Nonlinear.RamanPolarField — Type
Raman polarisation response type for a carrier resolved field
Amalthea.Nonlinear.RamanPolarField — Method
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.
Amalthea.Nonlinear.RustRamanHandle — Type
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.
Amalthea.Nonlinear.Kerr_env — Method
Kerr response for envelope
Amalthea.Nonlinear.Kerr_field — Method
Kerr response for real field
Amalthea.Nonlinear.Kerr_field_nothg — Method
Kerr response for real field but without THG
Amalthea.Nonlinear.PlasmaScalar! — Method
The plasma response for a scalar electric field
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.
Amalthea.Nonlinear._make_rust_raman_handle — Method
_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.
Amalthea.Nonlinear.kerr_γ3 — Method
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.
Amalthea.Nonlinear.sqr! — Method
Square the field or envelope