Modes.jl

Amalthea.Modes.ToSpaceMethod
ToSpace(ms; components=:xy)

Construct a ToSpace for high performance conversion between modal fields and real space.

Arguments

  • ms::Tuple: a tuple of modes
  • components::Symbol: which polarisation components to return: :x, :y, :xy
source
Amalthea.Modes.AeffMethod
Aeff(m::AbstractMode; z=0.0)

Get effective area of mode m and longitudinal position z.

This is the brute-force implementation valid for any mode.

source
Amalthea.Modes.ExyMethod
Exy(m::AbstractMode, xs; z=0.0)

Get the normalised field components at position xs, z.

source
Amalthea.Modes.NMethod
N(m::AbstractMode; z=0.0)

Get mode normalization constant of mode m at longitudinal position z.

source
Amalthea.Modes.arbitraryMethod
arbitrary(kwargs...)

Create an arbitrary mode, which takes its methods from given functions.

The functions given should have the same signature as defined Amalthea.Modes, except that the first argument (the AbstractMode) is omitted, e.g. for neff the function should be of the form n(ω; z) = ...

To define neff with functions for α and β, create the neff function using neff_from_αβ.

source
Amalthea.Modes.dB_per_mMethod
dB_per_m(m::AbstractMode, ω; z=0.0)

Calculate the attenuation in dB/m for the mode m at frequency ω and longitudinal position z.

source
Amalthea.Modes.delegatedMethod
delegated(mode, kwargs...)

Create a delegated mode, which takes its methods from an existing mode except for those which are overwritten

Arguments:

  • mode::AbstractMode: The wrapped mode to which non-specified methods are delegated
  • kwargs: functions that override: neff, field, dimlimits, Aeff, or N.

The functions given should have the same signature as the mode methods, i.e. take an AbstractMode as their first argument, even if they do not do anything with it. This is to ensure that the delegated functions can access the data of the wrapped mode if necessary.

To override neff with functions for α and β, create the neff function using neff_from_αβ.

source
Amalthea.Modes.fieldMethod
field(m::AbstractMode; z=0)

Create function of coords that returns (xs) -> (Ex, Ey) for the mode m.

source
Amalthea.Modes.losslengthMethod
losslength(m::AbstractMode, ω; z=0.0)

Calculate the losslength ($1/α$) for the mode m at frequency ω and longitudinal position z.

source
Amalthea.Modes.neffFunction
neff(m::AbstractMode, ω; z=0.0)

Get the full complex refractive index of mode m at frequency ω and longitudinal position z.

source
Amalthea.Modes.overlapMethod
overlap(m::AbstractMode, r, E; dim)

Calculate mode overlap between radially symmetric field and radially symmetric mode.

Examples

julia> a = 100e-6;
julia> m = Capillary.MarcatiliMode(a, :He, 1.0);
julia> unm = approx_besselroots(0, 1)[end]
julia> r = collect(range(0, a, length=512));
julia> Er = besselj.(0, unm*r/a);

julia> η = Modes.overlap(m, r, Er; dim=1);
julia> abs2(η[1]) ≈ 1
true
source
Amalthea.Modes.overlapMethod
overlap(m::AbstractMode, E)

Calculate mode overlap between (analytic) 2D field E and mode m. The field function E(xs) should return the normalised cartesian vector components of the field (Ex, Ey) as an SVector as a function of polar coordinates xs = (r,θ). ```

source
Amalthea.Modes.overlapMethod
overlap(modes::ModeCollection, newgrid, oldgrid, r, Eωr)

Decompose the spatio-spectral field Eωr, sampled on radial coordinate r and time-grid oldgrid, into the given modes and resample onto newgrid via cubic interpolation.

source
Amalthea.Modes.to_space!Method
to_space!(Erω, Emω, xs, ts::ToSpace; z=0.0)

Convert from modal fields to real space using provided ToSpace struct.

Arguments

  • Erω::Array{ComplexF64}: a dimension nω x npol array where the real space frequency domain field will be written to
  • Emω::Array{ComplexF64}: a dimension nω x nmodes array containing the frequency domain modal fields
  • xs:Tuple: the transverse coordinates, x,y for cartesian, r,θ for polar
  • ts::ToSpace: the corresponding ToSpace struct
  • z::Real: the axial position
source
Amalthea.Modes.to_spaceMethod
to_space(Emω, xs, ts::ToSpace; z=0.0)

Convert from modal fields to real space using provided ToSpace struct.

Arguments

  • Emω::Array{ComplexF64}: a dimension nω x nmodes array containing the frequency domain modal fields
  • xs:Tuple: the transverse coordinates, x,y for cartesian, r,θ for polar
  • ts::ToSpace: the corresponding ToSpace struct
  • z::Real: the axial position
source
Amalthea.Modes.to_spaceMethod
to_space(Emω, xs, ms; components=:xy, z=0.0)

Convert from modal fields to real space.

Arguments

  • Emω::Array{ComplexF64}: a dimension nω x nmodes array containing the frequency domain modal fields
  • xs:Tuple: the transverse coordinates, x,y for cartesian, r,θ for polar
  • ms::Tuple: a tuple of modes
  • components::Symbol: which polarisation components to return: :x, :y, :xy
  • z::Real: the axial position
source
Amalthea.Modes.transmissionMethod
transmission(m::AbstractMode, ω, L)

Calculate the power transmission after propagation through length L in the mode m for radiation at the frequency ω.

source
Amalthea.Modes.zdwMethod
zdw(m::AbstractMode, λ0; z=0.0, rtol=1e-4)

Calculate the zero-dispersion wavelength (ZDW) of mode m with an initial guess of λ0.

This method is faster than the bounded version if the ZDW is known to be close to λ0.

source
Amalthea.Modes.zdwMethod
zdw(m::AbstractMode; λmin=100e-9, λmax=3000e-9, z=0.0)

Calculate the zero-dispersion wavelength (ZDW) of mode m within the range ub to lb.

source
Amalthea.Modes.αMethod
α(m::AbstractMode, ω; z=0.0)

Calculate the attenuation constant $α$ for the mode m at frequency ω and longitudinal position z.

source
Amalthea.Modes.βMethod
β(m::AbstractMode, ω; z=0.0)

Calculate the propagation constant $β$ for the mode m at frequency ω and longitudinal position z.

source
Amalthea.Modes.β_retMethod
β_ret(m::AbstractMode, ω; z=0, λ0)

Calculate the propagation constant $β$ for mode m transformed into a frame which moves with the group and phase velocity of m at wavelength λ0.

source