solprop.modes.capillary#
Marcatili modes of a gas-filled hollow capillary, with analytic derivatives.
MarcatiliMode is Marcatili and Schmeltzer’s asymptotic mode of a hollow
dielectric tube much wider than the wavelength (Bell Syst. Tech. J. 43,
1783-1809, 1964), in the "full" and "reduced" models (MarcatiliModel)
and the HE, TE and TM families (ModeKind). It forms n_eff - 1 directly
rather than through unity, and differentiates both models in closed form in frequency
and along z. Position reaches the index only through the core radius a(z) and the
number density rho(z), so everything frequency-dependent is a
MarcatiliTerms, sampled once (sampled_terms) and evaluated per position
(neff_from_terms); shared_sampling() lets a translation reading the same
modes at many z share that sampling. bessel_zero(),
cladding_term_and_derivative() and core_susceptibility_at() are the
model’s ingredients.
A positive imaginary part of n_eff is loss (docs/dev/conventions.md section
5), so the reduced model’s loss term enters with a plus sign; one arithmetic kernel
serves every path. The model, the rationalised refractivity, the derivatives and the
factorisation are in docs/guide/waveguides/capillary-model.md; the coherent wall
operator that couples these modes is solprop.modes.wall.
Module Attributes
Which family a capillary mode belongs to: hybrid, transverse electric or magnetic. |
|
Whether to use the square-root expression or its leading-order expansion. |
Functions
|
Return the |
|
Return the Marcatili cladding term and its frequency derivative. |
|
Return the core susceptibility of a fill at one position. |
Sample each mode's frequency-only terms once per frequency vector in a scope. |
Classes
|
A Marcatili mode of a gas-filled hollow capillary. |
|
Everything in a Marcatili effective index that depends only on frequency. |
- class solprop.modes.capillary.MarcatiliMode(radius, gas=None, pressure=0.0, *, kind='HE', n=1, m=1, phi=0.0, model='full', alpha=None, loss_scale=1.0, cladding=None, temperature=None, susceptibility=None, mixture=None)[source]#
Bases:
GasFillMixinA Marcatili mode of a gas-filled hollow capillary.
Like every
Mode, it takes strictly positive frequencies: a hollow capillary has no mode at zero frequency – the waveguide term(u c / (omega a))^2diverges – so a zero raises. The linear operator evaluates modes on the active band, which excludes the DC bin.Both
radiusandpressureaccept a number or aZProfile, which is what makes a taper and a pressure gradient ordinary cases rather than special ones.- Attributes:
- radiusfloat or ZProfile
Core radius in m, > 0. A number becomes a
Constant.- gasGas or str or None
The fill species, or
Nonefor an evacuated capillary.- pressurefloat or ZProfile
Absolute pressure in bar, >= 0 (
docs/dev/conventions.mdsection 1).- kindstr
"HE"(hybrid),"TE"or"TM". The transverse families requiren == 0; hybrids requiren != 0.- nint
Azimuthal index. May be negative for a hybrid mode.
- mint
Radial index, >= 1: which zero of the Bessel function.
- phifloat
Rotation of the mode about the axis in rad, positive from
xtowardsy. It turns the whole transverse pattern: the Cartesian components of a hybrid mode are(cos((n - 1) theta - n phi), -sin((n - 1) theta - n phi))timesJ_{n-1}(u r / a). ForHE_1mthe pattern is uniform, sophiis the polarisation angle measured from thexaxis:phi = 0is x-polarised andphi = pi / 2is y-polarised. Forn >= 2an obliquephiis a rotated pattern and not a polarisation angle – the field points in different directions at differenttheta– and the degenerate partner ofphi = 0is the quarter turnphi = pi / (2 n), whichorthogonal_polarisationreturns.- modelstr
"full"for the square root,"reduced"for its leading-order expansion.- alphafloat or callable or None
An absolute power attenuation coefficient in 1/m that replaces the model’s loss: a finite non-negative number, or a callable
alpha(omega)taking and returning arrays of shape(n_omega,)– measured fibre loss, say. OnlyIm n_eff = c alpha / (2 omega)is replaced; the real part, and with itbetaandbeta_1, stays the model’s. A callable that carries aderivativeattribute gets an analyticd(Im n_eff)/d(omega); otherwise that one term is differenced, and the constructor says so.alphais the caller’s and is not clamped.None(the default) keeps the model’s loss.- loss_scalefloat
Multiplies the model’s own loss:
1.0(the default) is the model,0.0lossless, anything else a fitting knob on the model. Finite and non-negative; refused beside analpha, which replaces the loss it would scale. The model’s own loss is never negative: where the square root lands on the branch that reads as gain – a cladding index below unity, outside Marcatili’s regime – it is clamped at zero and the mode logs the fact once.- claddingGlassIndex or complex or None
The cladding index.
Noneusesfused_silica(); a plain complex number is a constant index, which is what a comparison against a published or symbolic result needs.- temperaturefloat, ZProfile or None
Temperature of the fill in K, > 0, or a path of it along z in m, which the density follows (
DensityPath); a constant path is stored as its number.None(the default) is 293.15 K for a gas and the mixture’s own beside mixture, which carries its temperature: a different one given beside it is refused by name. Resolved at construction, so the field is neverNoneafterwards.- susceptibilityGasSusceptibility or None
The gas susceptibility per unit number density.
Nonetakes the built-in gas’s, optmat’s, which is what a run normally wants. Passing one is the gas-side counterpart of a constant or tabulated cladding: it replaces the refractive data while leaving the equation of state alone, so gas is still what sets the density along z. A comparison against a published result or another code whose gas model differs can give the mode the other model’s susceptibility and isolate what it is actually comparing.- mixtureMixture or None
Labelled populations with their own density paths. Supplies temperature and optical data; do not also pass gas, pressure or susceptibility.
Examples
>>> import numpy as np >>> from solprop.modes import MarcatiliMode >>> mode = MarcatiliMode(125e-6, "He", 1.0, model="reduced") >>> omega = np.array([2.356e15]) >>> f"{complex(mode.neff(omega)[0]):.9f}" '1.000028936+0.000000009j' >>> f"{float(mode.aeff()):.4e}" '2.3393e-08'
- aeff(z=0.0)[source]#
Return the effective area of the mode.
- Parameters:
- zfloat, optional
Position along the waveguide, m.
- Returns:
- float
A_eff = (int |e|^2 dA)^2 / int |e|^4 dAin m^2, in closed form: the transverse profile is a Bessel function ofr / a, so the whole radius dependence is the prefactora^2.
Examples
>>> from solprop.modes import MarcatiliMode >>> f"{MarcatiliMode(75e-6, 'He', 1.0).aeff():.6e}" '8.421575e-09'
- at_parameters(values)[source]#
Return the same mode with the named paths frozen at the given values.
The effective index reaches
zonly through the two paths, so replacing the two paths by constants gives a mode that is exactly this one at every position where the paths take those values. That is what letssolprop.linear.dispersion_operator()be evaluated at parameter values, and so what lets the cumulative operator be expanded in the parameters rather than tabulated along z (docs/guide/numerics/linear-operator.md).The copy shares the parent’s derived frequency-only quantities – the Bessel zero, the cladding index, the effective-area factor – so freezing costs nothing per evaluation. Its radius field follows core_radius; its pressure field still records the parent’s declaration, because the density is given directly here and the equation of state is not inverted. Nothing reads pressure after construction; density is the path that is evaluated.
- Parameters:
- valuescollections.abc.Mapping
Any subset of
{"core_radius": a in m, "density": rho in m^-3}. A name left out keeps its path.
- Returns:
- MarcatiliMode
A copy reporting
z_constant.
- Raises:
- ModeError
If a name is not a declared path, the core radius is not positive, or the density is negative.
Examples
>>> import numpy as np >>> from solprop.modes import MarcatiliMode >>> from solprop.profiles import PressureGradient >>> fill = PressureGradient.two_point(1.0, 5.0, 1.0) >>> mode = MarcatiliMode(125e-6, "He", fill) >>> frozen = mode.at_parameters( ... { ... name: float(path(np.array([0.3]))[0]) ... for name, path in mode.parameter_paths.items() ... } ... ) >>> frozen.z_constant True >>> omega = np.array([2.356e15]) >>> bool(np.array_equal(frozen.neff(omega), mode.neff(omega, 0.3))) True
- property azimuthal_order: int[source]#
Highest azimuthal harmonic in the Cartesian field components.
|n - 1|for a hybrid mode and 1 for a transverse one. The signedn - 1would be negative forHE_{-1,m}and would then understate the theta rule a cubic product needs.
- property channel_label: ChannelLabel[source]#
Family, the two indices and which polarisation partner this is.
parityisNonefor a transverse family, which has no degenerate polarisation partner. For a hybrid mode it follows the one definition inChannelLabel: theevenmember is thecos((n - 1) theta)pattern about the x axis, which here is the unrotated modephi = 0– at that angle the transverse components are(cos((n - 1) theta), -sin((n - 1) theta)), the same pattern the exact step-indexevenmember carries, and forHE_1mit is the x-polarised state. The quarter turnphi = pi / (2 n)is therefore theoddmember, y-polarised forHE_1m. Any other rotation is a gauge rather than a parity: its parity isNoneand its display label carries the angle, so that two rotated copies of one mode are still told apart.A negative azimuthal index is the
EHfamily, and the label says so: the label’s ownazimuthal_orderis the non-negative total azimuthal order|n|and the family is"EH", which is how an exactStepIndexModeof the same physical channel labels itself, so anEHcapillary mode can be put in aModeCollection.Examples
>>> from solprop.modes import MarcatiliMode >>> mode = MarcatiliMode(125e-6, "He", 1.0) >>> mode.channel_label.display_label, mode.principal_component() ('HE1,1:even', 'x') >>> partner = mode.orthogonal_polarisation >>> partner.channel_label.display_label, partner.principal_component() ('HE1,1:odd', 'y') >>> MarcatiliMode(125e-6, "He", 1.0, n=-1).channel_label.display_label 'EH1,1:even'
- cladding: GlassIndex | complex | None = None#
- cladding_index: GlassIndex | complex#
- core_index_minus_one(omega, z=0.0)[source]#
Return the filled core’s
n_core - 1formed without cancellation.n_core = sqrt(1 + chi)withchithe fill’s susceptibility at the position’s density, andn_core - 1is formed aschi / (sqrt(1 + chi) + 1), whose denominator is near two, so it carries the relative rounding ofchiitself rather than the absolute rounding of unity. Its difference withneff_minus_one()isn_core - n_effto the rounding of two numbers of orderchi, where formingk - betafrom the two wavenumbers would carry the rounding ofk.- Parameters:
- omeganumpy.ndarray
Angular frequencies, rad/s, shape
(n_omega,), strictly positive.- zfloat, optional
Position along the waveguide, m.
- Returns:
- numpy.ndarray
n_core - 1, complex, shape(n_omega,); zero for an evacuated core.
Examples
>>> import numpy as np >>> from solprop.modes import MarcatiliMode >>> mode = MarcatiliMode(125e-6, "He", 1.0) >>> omega = np.array([2.356e15]) >>> core = mode.core_index_minus_one(omega) >>> bool(core.real[0] > mode.neff_minus_one(omega).real[0] > 0.0) True
- dimlimits(z=0.0)[source]#
Return the cross-section parametrisation and the integration limits.
- Parameters:
- zfloat, optional
Position along the waveguide, m.
- Returns:
- tuple
("polar", (0, 0), (a(z), 2 pi))in m and rad.
Examples
>>> from solprop.modes import MarcatiliMode >>> MarcatiliMode(125e-6, 'He', 1.0).dimlimits()[0] 'polar'
- dneff_domega(omega, z=0.0)[source]#
Return the analytic frequency derivative of the effective index.
Both models are differentiated in closed form, chaining through the analytic derivative of the gas susceptibility and of the cladding index (ADR-006). The only term that may be differenced is the imaginary part when the loss is given as a callable without its own derivative.
- Parameters:
- omeganumpy.ndarray
Angular frequencies, rad/s, shape
(n_omega,), strictly positive.- zfloat, optional
Position along the waveguide, m.
- Returns:
- numpy.ndarray
dn_eff/domegain s/rad, complex, shape(n_omega,).
Examples
>>> import numpy as np >>> from solprop.modes import MarcatiliMode >>> mode = MarcatiliMode(125e-6, "He", 1.0) >>> f"{mode.dneff_domega(np.array([2.356e15]))[0].real:.4e}" '2.6423e-21'
- dneff_domega_from_terms(terms, radius, density)[source]#
Return the analytic
dn_eff/domegafrom pre-sampled terms.- Parameters:
- termsMarcatiliTerms
The sampled frequency-dependent quantities.
- radiusfloat
Core radius in m, > 0.
- densityfloat
Number density of the fill in m^-3, >= 0.
- Returns:
- numpy.ndarray
dn_eff/domegain s/rad, complex.
Examples
>>> import numpy as np >>> from solprop.modes import MarcatiliMode >>> mode = MarcatiliMode(125e-6, "He", 1.0, model="reduced") >>> terms = mode.sampled_terms(np.array([2.356e15])) >>> f"{mode.dneff_domega_from_terms(terms, 125e-6, 2.46e25).real[0]:.4e}" '2.6420e-21'
- dneff_dz(omega, z=0.0)[source]#
Return the analytic derivative of the effective index along the capillary.
zreaches the index through exactly two scalars, the core radius and the fill’s number density, sodn/dz = (dn/da) a' + sum_s (dn/drho_s) rho_s'with the declared profiles’ own analytic slopes. For the full modeln^2 = 1 + chi - Wwithchi = sum_s gamma_s rho_sandW = (u s)^2 (1 - i v s)^2,s = c/(omega a), so thatdW/da = -(2 u^2 s^2/a)(1 - i v s)(1 - 2 i v s)anddn/dz = (sum_s gamma_s rho_s' - (dW/da) a')/(2 n); the reduced model differentiates its own polynomial. The loss specification acts on the imaginary part exactly as it does on the index:Falsedrops it, a float scales it, a measured curvealpha(omega)does not depend onzand contributes nothing, where the no-gain clamp binds the imaginary part’s slope is zero, and where the evanescent floor binds the whole slope is zero, asdneff_domega()’s is. What the coherent wall route reads is the real part, the slope of the power weightw = Re n_eff.- Parameters:
- omeganumpy.ndarray
Angular frequencies, rad/s, shape
(n_omega,), strictly positive.- zfloat, optional
Position along the waveguide, m.
- Returns:
- numpy.ndarray
dn_eff/dzin 1/m, complex, shape(n_omega,).
- Raises:
- ModeError
If the mode is a subclass that computes its index another way – a structured cladding or a tabulated index, whose
zderivative is not this one – or a declared profile reports no analytic derivative.
Examples
>>> import numpy as np >>> from solprop.modes import MarcatiliMode >>> from solprop.profiles import Linear >>> mode = MarcatiliMode(Linear(50e-6, 40e-6, 1e-3), "He", 1.0) >>> bool(mode.dneff_dz(np.array([2.356e15]), 5e-4)[0].real < 0.0) True
- field(points, z=0.0)[source]#
Return the transverse field components at points of the cross-section.
- Parameters:
- pointsnumpy.ndarray
Shape
(n_points, 2):(r, theta)in m and rad.- zfloat, optional
Position along the waveguide, m.
- Returns:
- numpy.ndarray
(E_x, E_y)of the unnormalised profile, shape(n_points, 2), real. A hybrid mode has magnitudeJ_{n-1}(u r/a)independent of theta and azimuthal order|n - 1|in its Cartesian components; atphi = 0those components are(cos((n-1) theta), -sin((n-1) theta)), theevenpattern of every family, soHE_{11}is uniformly polarised alongxthere.
Examples
>>> import numpy as np >>> from solprop.modes import MarcatiliMode >>> mode = MarcatiliMode(125e-6, 'He', 1.0) >>> mode.field(np.array([[0.0, 0.0]])).round(6) array([[1., 0.]])
- neff(omega, z=0.0)[source]#
Return the complex effective index.
- Parameters:
- omeganumpy.ndarray
Angular frequencies, rad/s, shape
(n_omega,), strictly positive.- zfloat, optional
Position along the waveguide, m.
- Returns:
- numpy.ndarray
n_eff(omega, z), complex, shape(n_omega,);Im n_eff > 0is loss.
Examples
>>> import numpy as np >>> from solprop.modes import MarcatiliMode >>> mode = MarcatiliMode(125e-6, "He", 1.0) >>> bool(mode.neff(np.array([2.356e15]))[0].imag > 0.0) True
- neff_from_terms(terms, radius, density)[source]#
Return the effective index from pre-sampled terms and two scalars.
- Parameters:
- termsMarcatiliTerms
The sampled frequency-dependent quantities, from
sampled_terms().- radiusfloat
Core radius in m at the position of interest, > 0.
- densityfloat
Number density of the fill in m^-3, >= 0.
- Returns:
- numpy.ndarray
n_eff, complex, shape(n_omega,);Im n_eff > 0is loss.
Examples
>>> import numpy as np >>> from solprop.modes import MarcatiliMode >>> mode = MarcatiliMode(125e-6, "He", 1.0) >>> terms = mode.sampled_terms(np.array([2.356e15])) >>> value = mode.neff_from_terms(terms, 125e-6, 2.46e25) >>> bool(value.imag[0] > 0.0) True
- neff_minus_one(omega, z=0.0)[source]#
Return
n_eff - 1formed without cancellation.- Parameters:
- omeganumpy.ndarray
Angular frequencies, rad/s, shape
(n_omega,), strictly positive.- zfloat, optional
Position along the waveguide, m.
- Returns:
- numpy.ndarray
n_eff - 1, complex, exact to rounding for a gas-filled capillary.
Examples
>>> import numpy as np >>> from solprop.modes import MarcatiliMode >>> mode = MarcatiliMode(125e-6, "He", 1.0) >>> f"{mode.neff_minus_one(np.array([2.356e15]))[0].real:.4e}" '2.8935e-05'
- normalisation(z=0.0)[source]#
Return the power carried by the unnormalised transverse profile.
- Parameters:
- zfloat, optional
Position along the waveguide, m.
- Returns:
- float
N = (1/2) sqrt(eps_0/mu_0) int |e|^2 dAin W, in closed form(pi/2) a^2 J_{n'}(u)^2 sqrt(eps_0/mu_0)withn' = nfor a hybrid mode and 2 for a transverse one. The vacuum-normalised basis gives monochromatic powerRe(n_eff) * abs(a)**2for internal amplitudea(docs/dev/conventions.mdsection 4).
Examples
>>> from solprop.modes import MarcatiliMode >>> f"{MarcatiliMode(125e-6, 'He', 1.0).normalisation():.6e}" '1.755864e-11'
- property orthogonal_polarisation: MarcatiliMode | None[source]#
Degenerate partner of a hybrid mode, or
None.The same mode turned by
pi / (2 n), which turns the pattern a further quarter turn fromxtowardsyand so exchanges the two Cartesian components: forHE_11that is the y-polarised partner of the x-polarised default, and so theoddmember of the pair (channel_label).Nonefor a transverse family, whose members are not degenerate in polarisation –TE_0mandTM_0mare different modes, not two states of one.Examples
>>> from solprop.modes import MarcatiliMode >>> partner = MarcatiliMode(125e-6, "He", 1.0).orthogonal_polarisation >>> f"{partner.phi:.6f}" '1.570796' >>> MarcatiliMode(125e-6, kind="TE", n=0).orthogonal_polarisation is None True
- property parameter_paths: Mapping[str, ZProfile][source]#
Scalar paths that carry the whole z dependence.
Radius and the material paths, including constant ones. One component retains
density; a shared fill uses totalpressurein bar; independent populations usedensity:<label>in m^-3. Seesolprop.modes.protocol.ParameterisedMode.Examples
>>> from solprop.modes import MarcatiliMode >>> sorted(MarcatiliMode(125e-6, "He", 1.0).parameter_paths) ['core_radius', 'density']
- principal_component(z=0.0)[source]#
Return the sole nonzero Cartesian component, or None for a vector profile.
- Parameters:
- zfloat, optional
Position along the waveguide, m; the polarisation is independent of it.
- Returns:
- {‘x’, ‘y’} or None
An axis-aligned HE_1m component, or
Nonewhen both components are nonzero.phi = 0is x (ADR-031) and the quarter turn is y. Angles are classified exactly modulo pi, without a tolerance that would erase a small physical component.
- property radius_is_constant: bool[source]#
Whether the transverse profile is the same at every z.
Truewhen the core radius does not vary, so the synthesis and projection matrices of the multimode transform may be built once. A pressure gradient changes the effective index but not the field profile.
- refractivity_from_terms(terms, radius, density)[source]#
Return
n_eff - 1from pre-sampled terms and two scalars.- Parameters:
- termsMarcatiliTerms
The sampled frequency-dependent quantities.
- radiusfloat
Core radius in m, > 0.
- densityfloat
Number density of the fill in m^-3, >= 0.
- Returns:
- numpy.ndarray
n_eff - 1, complex, formed without cancellation.
Examples
>>> import numpy as np >>> from solprop.modes import MarcatiliMode >>> mode = MarcatiliMode(125e-6, "He", 1.0, model="reduced") >>> terms = mode.sampled_terms(np.array([2.356e15])) >>> f"{complex(mode.refractivity_from_terms(terms, 125e-6, 2.46e25)[0]):.3e}" '2.881e-05+9.000e-09j'
- rotated(phi)[source]#
Return the same mode turned about the axis.
- Parameters:
- phifloat
The new rotation angle in rad, in the sense of
phi: positive fromxtowardsy, so forHE_1mit is the polarisation angle measured from thexaxis.
- Returns:
- MarcatiliMode
A copy with the new angle; everything else is unchanged.
Examples
>>> import math >>> from solprop.modes import MarcatiliMode >>> MarcatiliMode(125e-6, "He", 1.0).rotated(math.pi / 2).phi 1.5707963267948966
- sampled_terms(omega)[source]#
Sample everything in the effective index that does not depend on z.
- Parameters:
- omeganumpy.ndarray
Angular frequencies in rad/s, shape
(n_omega,), > 0.
- Returns:
- MarcatiliTerms
The gas susceptibility, the cladding term and their derivatives, ready to be combined with a radius and a density at any position.
- Raises:
- ModeError
If any frequency is not strictly positive or not finite.
Examples
>>> import numpy as np >>> from solprop.modes import MarcatiliMode >>> terms = MarcatiliMode(125e-6, "He", 1.0).sampled_terms(np.array([2.4e15])) >>> terms.cladding_term.shape (1,)
- property scale_invariant: bool[source]#
Whether the profile scales exactly with the core radius.
Always
True: the field depends onronly throughr / aand the normalisation goes asa^2, so a taper rescales the transform matrices by two scalars.
- susceptibility: GasSusceptibility | None = None#
- property z_constant: bool[source]#
Whether nothing about the mode varies along z.
Truewhen neither the core radius nor the density varies. The multimode transform cares only about the radius, whichradius_is_constantreports separately.
- solprop.modes.capillary.MarcatiliModel#
Whether to use the square-root expression or its leading-order expansion.
alias of
Literal[‘full’, ‘reduced’]
- class solprop.modes.capillary.MarcatiliTerms(omega, u_nm, core_susceptibility, dcore_susceptibility_domega, cladding_term, dcladding_term_domega)[source]#
Bases:
objectEverything in a Marcatili effective index that depends only on frequency.
zenters a capillary mode through exactly two scalars, the core radius and the number density, so the frequency-dependent pieces can be sampled once and reused at every position (docs/dev/architecture.mdsection 6.5). Building this is the expensive part: it calls the gas model and the cladding model.The frequency is typed as inexact rather than real on purpose. The effective index is a holomorphic function of
omega– powers, a square root and a rational cladding term – so sampling these terms at a complex frequency lets the analytic derivative be checked against Cauchy’s integral formula, which is free of the subtractive cancellation that limits any finite difference. Nothing in the public API does that;MarcatiliMode.sampled_terms()requires a real, positive frequency.- Attributes:
- omeganumpy.ndarray
Angular frequencies in rad/s, shape
(n_omega,), > 0 in every use except the contour check described above.- u_nmfloat
The Bessel zero of the mode, dimensionless.
- core_susceptibilitynumpy.ndarray
Per-particle susceptibility
gamma(omega)in m^3, so thatchi = gamma * rho. Mixtures carry shape(n_species, n_omega); the existing single-gas spelling retains its frequency vector. Values are real for transparent built-in gases and complex for absorbing custom species.- dcore_susceptibility_domeganumpy.ndarray
Its analytic frequency derivative in m^3 s/rad.
- cladding_termnumpy.ndarray
The complex
v_n(omega)of the mode’s family.- dcladding_term_domeganumpy.ndarray
Its analytic frequency derivative in s/rad.
- cladding_term: Complex[ndarray, 'n_clad']#
- core_susceptibility: Inexact[ndarray, '*species n_terms']#
- dcladding_term_domega: Complex[ndarray, 'n_clad']#
- dcore_susceptibility_domega: Inexact[ndarray, '*species n_terms']#
- omega: Inexact[ndarray, 'n_omega']#
- solprop.modes.capillary.ModeKind#
Which family a capillary mode belongs to: hybrid, transverse electric or magnetic.
alias of
Literal[‘HE’, ‘TE’, ‘TM’]
- solprop.modes.capillary.bessel_zero(order, index)[source]#
Return the
index-th positive zero of the Bessel function of the first kind.- Parameters:
- orderint
Order of the Bessel function. Negative orders are folded onto positive ones, since
J_-p = (-1)^p J_pfor integerpand the zeros coincide.- indexint
Which zero, counting from 1.
- Returns:
- float
The zero
j_{order, index}, dimensionless.
- Raises:
- ModeError
If index is not a positive integer.
Examples
>>> from solprop.modes.capillary import bessel_zero >>> f"{bessel_zero(0, 1):.10f}" '2.4048255577' >>> bessel_zero(-2, 1) == bessel_zero(2, 1) True
- solprop.modes.capillary.cladding_term_and_derivative(permittivity, dpermittivity, kind)[source]#
Return the Marcatili cladding term and its frequency derivative.
With
ethe cladding permittivity the three families givev_HE = (e + 1) / (2 sqrt(e - 1)),v_TE = 1 / sqrt(e - 1)andv_TM = e / sqrt(e - 1). The root is taken in the complex plane, so a cladding withRe e < 1– a metal, or silica in the extreme ultraviolet – is handled rather than producing a NaN.- Parameters:
- permittivitynumpy.ndarray
The cladding’s relative permittivity, complex, shape (n_omega,).
- dpermittivitynumpy.ndarray
Its analytic frequency derivative in s/rad, same shape.
- kind{“HE”, “TE”, “TM”}
The mode family.
- Returns:
- tuple of numpy.ndarray
v_n(omega), dimensionless, anddv_n/domegain s/rad.
Examples
>>> import numpy as np >>> from solprop.modes.capillary import cladding_term_and_derivative >>> term, _ = cladding_term_and_derivative( ... np.array([5.0 + 0j]), np.array([0j]), "TE" ... ) >>> term.tolist() [(0.5+0j)]
- solprop.modes.capillary.core_susceptibility_at(terms, density)[source]#
Return the core susceptibility of a fill at one position.
- Parameters:
- termsMarcatiliTerms
A mode’s frequency-only terms, whose per-particle susceptibility is one row or one row per sampled species.
- densityfloat or numpy.ndarray
Number density in m^-3, scalar or one entry per sampled species.
- Returns:
- numpy.ndarray
The dimensionless susceptibility, complex, shape (n_omega,).
Sample each mode’s frequency-only terms once per frequency vector in a scope.
MarcatiliTermsdo not depend onz, yet a varying coherent wall readsneff,dneff_dzand the block at about a hundred positions for each channel, and each read samples the gas and the cladding models again, which dominates the translation cost. Inside this scopeMarcatiliMode.sampled_terms()returns the terms it already built for the same mode and the same frequencies: the same function of the same inputs, so every array built from them is bitwise what it was. The shared arrays are made read-only, so a caller that wrote into one would fail loudly rather than change what the next caller reads.A scope opened inside another is the enclosing one.
- Yields:
- None
Nothing; the scope ends when the block exits.
Examples
>>> import numpy as np >>> from solprop.modes.capillary import MarcatiliMode, shared_sampling >>> mode = MarcatiliMode(125e-6, "He", 1.0) >>> omega = np.array([2.0e15, 2.5e15]) >>> with shared_sampling(): ... same = mode.sampled_terms(omega) is mode.sampled_terms(omega) >>> same True