Modes.jl

Luna.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
Luna.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
Luna.Modes.ExyMethod
Exy(m::AbstractMode, xs; z=0.0)

Get the normalised field components at position xs, z.

source
Luna.Modes.ExyMethod
Exy(m::AbstractMode; z=0.0)

Create function that returns normalised (xs) -> (Ex, Ey)

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

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

source
Luna.Modes.absEMethod
absE(m::AbstractMode, xs; z=0.0)

Get the field norm $|E|$ at position xs, z

source
Luna.Modes.absEMethod
absE(m::AbstractMode; z=0.0)

Create function that returns normalised (xs) -> $|E|$.

source
Luna.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 Luna.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
Luna.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
Luna.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
Luna.Modes.dimlimitsFunction
dimlimits(m::AbstractMode; z=0.0)

Maximum dimensional limits of validity for mode m at position z.

source
Luna.Modes.dispersionMethod
dispersion_func(m::AbstractMode, order; z=0.0)

Calculate the dispersion of a given order at frequency ω.

source
Luna.Modes.dispersion_funcMethod
dispersion_func(m::AbstractMode, order; z=0.0)

Get a function βn(ω) which returns the dispersion of a given order at frequency ω.

source
Luna.Modes.fieldFunction
field(m::AbstractMode, xs; z=0.0)

Get the field components (Ex, Ey)at positionxs,z`

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

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

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

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

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

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

source
Luna.Modes.orthogonalMethod
orthogonal(mode1, mode2)

Test whether the AbstractModes mode1 and mode2 are orthogonal to each other.

source
Luna.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
Luna.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
Luna.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
Luna.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
Luna.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
Luna.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
Luna.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
Luna.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
Luna.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
Luna.Modes.αMethod
α(m::AbstractMode, ω; z=0.0)

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

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

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

source
Luna.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