Capillary.jl
Amalthea.Capillary.GradedCoreIndex — Type
GradedCoreIndex(γ, densf, pfun, dspl)Callable core-index profile coren(ω; z) = sqrt(1 + γ(λ_μm(ω))·densf(z)) for a graded (pressure-gradient) gas fill, as built by gradient. A distinct, concrete type (rather than an anonymous closure) so that the native-Rust resident path (RustNativeStepper, Phase 7) can detect — via dispatch on MarcatiliMode{<:Number, GradedCoreIndex, ...} in the make_linop method below — that εco(ω;z)-1 is separable into a fixed per-ω γ array and a scalar densf(z), and build a cheap resident z-dependent linop instead of falling back to the (non-native) per-stage Julia callback path. pfun is the pressure profile p(z) — a TwoPointGradient for the simple two-point gradient method, or a MultiPointGradient for the general multi-point gradient (both natively eligible as of docs/dev/BACKLOG.md Phase F item 3). dspl is PhysData.densityspline's density-of-pressure spline (densf(z) = dspl(pfun(z))) exposed directly so the native path can transfer its (x,y,D) to Rust rather than re-fitting a different spline through sampled values — real-gas density (via CoolProp) is not perfectly smooth at the scale a from-scratch refit would need to resolve, so re-fitting doesn't converge; transferring the identical piecewise-cubic sidesteps this entirely (see docs/dev/native-port/MATH.md §3.5). Purely additive: calling a GradedCoreIndex gives byte-identical results to the old anonymous-closure coren.
Amalthea.Capillary.MarcatiliMode — Type
MarcatiliModeType representing a mode of a hollow capillary as presented in:
Marcatili, E. & Schmeltzer, R. "Hollow metallic and dielectric waveguides for long distance optical transmission and lasers (Long distance optical transmission in hollow dielectric and metal circular waveguides, examining normal mode propagation)." Bell System Technical Journal 43, 1783–1809 (1964).
Amalthea.Capillary.MarcatiliMode — Method
MarcatiliMode(a, gas, P, cladn; kwargs...)Create a MarcatiliMode for a capillary made of a cladding material defined by the refractive index cladn(ω; z) with a core radius a which is filled with gas to pressure P.
Amalthea.Capillary.MarcatiliMode — Method
MarcatiliMode(a, n, m, kind, ϕ, coren, cladn; model=:full, loss=true)Create a MarcatiliMode.
Arguments
a: Either aNumberfor constant core radius, or a functiona(z)for variable radius.n::Int: Azimuthal mode index (number of nodes in the field along azimuthal angle).m::Int: Radial mode index (number of nodes in the field along radial coordinate).kind::Symbol::TEfor transverse electric,:TMfor transverse magnetic,:HEfor hybrid mode.ϕ::Float: Azimuthal offset angle (for linearly polarised modes, this is the angle between the mode polarisation and the:yaxis)coren: Callablecoren(ω; z)which returns the refractive index of the corecladn: Callablecladn(ω; z)which returns the refractive index of the claddingmodel::Symbol=:full: If:full, use the complete Marcatili model which takes into account the dispersive influence of the cladding refractive index. If:reduced, use the simplified model common in the literatureloss::Bool=true: Whether to include loss.
Amalthea.Capillary.MarcatiliMode — Method
MarcatiliMode(a, gas, P; kwargs...)Create a MarcatiliMode for a capillary with radius a which is filled with gas to pressure P.
Amalthea.Capillary.MarcatiliMode — Method
MarcatiliMode(a, coren; kwargs...)Create a MarcatiliMode for a capillary with radius a with z-dependent gas fill determined by coren(ω; z).
Amalthea.Capillary.MarcatiliMode — Method
MarcatiliMode(a; kwargs...)Create a MarcatiliMode for a capillary with radius a and no gas fill.
Amalthea.Capillary.MultiPointGradient — Type
MultiPointGradient(Z, P)Callable pressure profile p(z) for the general multi-point piecewise gradient fill built by gradient(gas,Z,P) — a distinct, concrete type (rather than an anonymous closure), mirroring TwoPointGradient, so the native-Rust resident path (docs/dev/BACKLOG.md Phase F item 3) can detect this closed-form z→pressure map and port it exactly (the same per-segment sqrt-interpolation formula, no extra interpolation error, ensure_linop_at selects the segment containing z). Z must be sorted ascending; P[i] is the pressure at Z[i], with sqrt(P[i]^2 + t*(P[i+1]^2-P[i]^2)) (t the fractional position within [Z[i],Z[i+1]]) between breakpoints, flat-clamped outside [Z[1],Z[end]]. A two-point gradient is just the Z=[0,L] special case; TwoPointGradient is kept as its own type rather than folded into this one purely for backward compatibility with existing serialized/constructed values.
Amalthea.Capillary.TwoPointGradient — Type
TwoPointGradient(L, p0, p1)Callable pressure profile p(z) for the simple two-point gradient fill built by gradient(gas,L,p0,p1) — a distinct, concrete type (rather than an anonymous closure) so the native-Rust resident path (Phase 7) can detect this specific closed-form z→pressure map and port it exactly (elementary sqrt arithmetic, no interpolation error), as opposed to the general multi-point gradient(gas,Z,P) profile (out of Phase 7 scope — falls back to the non-native path). See docs/dev/native-port/MATH.md §3.5.
Amalthea.Capillary.ZDepLinopMarcatili — Type
ZDepLinopMarcatili{F, DF}Wraps a z-dependent linop!(out, z) closure for a constant-radius, graded-core MarcatiliMode (see gradient) together with the precomputed density-spline knots and β1(z) constants RustNativeStepper's native path needs to reconstruct the same closure in Rust without re-fitting or re-differentiating anything. Callable as (w::ZDepLinopMarcatili)(out, z), so it behaves identically to the plain linop! closure everywhere a z-dependent linop is used.
Amalthea.Capillary.gradient — Method
gradient(gas, L, p0, p1; T=roomtemp)Convenience function to create density and core index profiles for simple two-point gradient fills defined by the waveguide length L and the pressures at z=0 and z=L.
Amalthea.Capillary.gradient — Method
gradient(gas, Z, P; T=roomtemp)Convenience function to create density and core index profiles for multi-point gradient fills defined by positions Z and pressures P.
Amalthea.Capillary.transmission — Method
transmission(a, λ, L; kind=:HE, n=1, m=1)Calculate the transmission through a capillary with core radius a and length L at the wavelength λ when propagating the MarcatiliMode defined by kind, n and m.
Amalthea.LinearOps.make_linop — Method
make_linop(grid::Grid.RealGrid, mode::MarcatiliMode{<:Number,<:GradedCoreIndex,...}, λ0)Specialized z-dependent linop for a constant-radius, graded-core (pressure-gradient, gradient) MarcatiliMode. Builds the ordinary linop!/βfun! pair exactly as the generic LinearOps.make_linop method would. For a recognized gradient profile (mode.coren.pfun isa Union{TwoPointGradient, MultiPointGradient}), additionally wraps linop! in ZDepLinopMarcatili carrying the extra metadata the native-Rust resident path needs (docs/dev/BACKLOG.md Phase F items 3 and the original Phase 7); for any other pfun (e.g. a user-supplied custom profile), returns the plain linop!/βfun! unwrapped, so RustNativeStepper's native path is simply not attempted. Behaviourally identical to the generic method for every existing caller either way (the wrapper is directly callable as linop!(out,z)) — only RustNativeStepper inspects the wrapper type.
Amalthea.LinearOps.make_linop — Method
make_linop(grid::Grid.RealGrid, modes, λ0; ref_mode=1, taper_lut_N=2^12)Specialized z-dependent linop for a collection of MarcatiliModes that all share the same tapered (Function-valued) core radius a(z) — Phase E.2. Falls back to the generic LinearOps.make_linop(grid,modes,λ0) (a plain linop! closure, always Julia — out of native scope) for any other radius type (per-mode differing a, or Number-valued — use make_const_linop).
Amalthea.Modes.neff — Method
neff(m::MarcatiliMode, ω; z=0)Calculate the complex effective index of Marcatili mode with dielectric core and arbitrary (metal or dielectric) cladding.
Adapted from:
Marcatili, E. & Schmeltzer, R. "Hollow metallic and dielectric waveguides for long distance optical transmission and lasers (Long distance optical transmission in hollow dielectric and metal circular waveguides, examining normal mode propagation)." Bell System Technical Journal 43, 1783–1809 (1964).