pnps.absorber#
The spectral absorber: band-edge ramps and the group-delay lap budget.
All dissipation is inside the exact linear operator. This module tabulates its
spectral part, gamma_omega, once per configuration (pnps.setup.build_setup());
solprop applies it as its absorber’s spectral rate (pnps.bridge), and the NumPy
reference model (pnps.reference) applies the same table. The lap budget’s share,
gamma_lap, is kept apart, so that what it removes is reported apart from the band
edges (lap_free_band(), required_trange(), lap_loss_share()).
wrap_coupling() reads the same table to bound what light that wraps the window
can do at a delay point (pnps.simulate.run_delay_point() refuses a delay where it
could do too much).
Module Attributes
The largest wrap coupling ( |
Functions
|
Return the band edges' amplitude rate, the spectral absorber less the lap budget. |
|
Return each frequency's group-delay walk-off over the slab, s. |
|
Return the wavelengths between which the lap budget absorbs nothing. |
|
Return the share of a band's energy that the lap budget removed. |
|
Return the energy per bin the lap budget removed between the save planes. |
|
Return the shortest time window whose lap budget absorbs nothing in band. |
|
Build the spectral absorber: band-edge ramps and the group-delay lap budget. |
|
Return the transverse-wavevector safety ramp's power rate on the grid. |
|
Return the safety ramp's peak power rate, as solprop designs it. |
|
Return the least attenuation of any light by the time it has walked a distance. |
|
Bound the nonlinear polarization wrapped light can drive at a delay point. |
Classes
|
The spectral absorber, whole and by part. |
- pnps.absorber.WRAP_COUPLING_LIMIT = 1e-05#
The largest wrap coupling (
wrap_coupling()) a delay point may have beyond three quarters oftime_headroom. Light radiated by a nonlinear polarization of1e-5of the input’s peak is at most1e-5of the signal’s peak amplitude, so its interference moves a trace by at most2e-5of the trace’s peak, inside the3e-5of the peak that the production step and windows are chosen for (Accuracy: control, verification, and limits).
- class pnps.absorber.SpectralRates(gamma_omega, gamma_lap, gd_band)[source]#
Bases:
NamedTupleThe spectral absorber, whole and by part.
- Attributes:
- gamma_omeganumpy.ndarray
The amplitude rate the operator applies, 1/m,
(nt,): the band edges’ rate plusgamma_lap.- gamma_lapnumpy.ndarray
The lap budget’s share of it, 1/m,
(nt,): what it adds above the band edges’ ramps.- gd_bandnumpy.ndarray
The 0/1 indicator of the bins the lap budget absorbs,
(nt,).
- gamma_omega: Float[ndarray, 'n_omega']#
Alias for field number 0
- gamma_lap: Float[ndarray, 'n_omega']#
Alias for field number 1
- gd_band: Float[ndarray, 'n_omega']#
Alias for field number 2
- pnps.absorber.band_edges(tgrid, gamma_max)[source]#
Return the band edges’ amplitude rate, the spectral absorber less the lap budget.
Zero on the physical band
[omega_min, omega_max], rising as a raised cosine togamma_maxover[omega_min/2, omega_min]and[omega_max, 1.1 omega_max], andgamma_maxbeyond.spectral_absorber()and the bridge both take it from here, so solprop’s sum of it and the lap budget’s share is this package’s rate bit for bit.- Parameters:
- tgridTimeGrid
The temporal grid.
- gamma_maxfloat
The peak amplitude rate, 1/m.
- Returns:
- numpy.ndarray
The rate, 1/m,
(nt,).
- pnps.absorber.group_walkoff(tgrid, thickness)[source]#
Return each frequency’s group-delay walk-off over the slab, s.
|beta1(omega) - beta1_ref| * thicknessrelative to the co-moving frame, withbeta1by a symmetric finite difference ofbeta = Re n(omega) omega / c(truncation about 1e-12). Evaluated on the active band only: the bins outside it are held by the band-edge ramps, and read zero.- Parameters:
- tgridTimeGrid
The temporal grid.
- thicknessfloat
The slab’s thickness, m.
- Returns:
- numpy.ndarray
The walk-off, s,
(nt,).
- pnps.absorber.lap_free_band(tgrid, gamma_lap)[source]#
Return the wavelengths between which the lap budget absorbs nothing.
The bins of the requested band
[omega_min, omega_max]that the lap budget leaves alone, taken outward from the carrier until the first it absorbs.- Parameters:
- tgridTimeGrid
The temporal grid.
- gamma_lapnumpy.ndarray
The lap budget’s rate (
SpectralRates.gamma_lap),(nt,).
- Returns:
- tuple of float
(lam_short, lam_long)in m: the shortest and longest wavelengths of the untouched band. They equal the requested limits’ bins when the lap budget absorbs nothing in band.
Return the share of a band’s energy that the lap budget removed.
lost / (lost + kept)summed over the band’s bins, withlostthe energy per bin the lap budget removed over the slab (lap_lostofpnps.simulate.run_delay_point()) andkeptthe whole beam’s spectrum at the exit (i_omega_beamat the last plane), both in the same units.- Parameters:
- lost, keptnumpy.ndarray
Spectra over the frequency axis, with any leading delay axes.
- omeganumpy.ndarray
The absolute angular frequency of each bin, rad/s.
- bandtuple of float
The band’s wavelength limits, m, in either order.
- Returns:
- numpy.ndarray
The share in
[0, 1], of the leading shape; NaN where the band holds no energy.
Examples
>>> import numpy as np >>> from scipy.constants import c >>> omega = 2 * np.pi * c / np.array([150e-9, 200e-9, 300e-9]) >>> lap_loss_share(np.array([1.0, 0.0, 0.0]), np.array([3.0, 4.0, 4.0]), omega, ... (140e-9, 210e-9)).round(3).item() 0.125
- pnps.absorber.lap_lost(beam, z, gamma_omega, gamma_lap)[source]#
Return the energy per bin the lap budget removed between the save planes.
Between two planes a bin’s spectrum
SobeysdS/dz = G - alpha S, withalpha = 2 gamma_omegathe spectral absorber’s power rate andGwhatever else feeds or drains the bin (the nonlinear generation, the transverse ramp). TakingGconstant across the interval, the two planes’ values fix it, and the absorber removedG dz - (S1 - S0): exact for a bin that only decays, and for one fed at a steady rate. A trapezoid ofalpha Sis not: light the absorber takes in a fraction of a micrometre, such as the input’s own share of an absorbed bin, would be overcounted by aboutalpha dz / 2. The lap budget’s part is its sharegamma_lap / gamma_omegaof the bin’s loss; a negative interval (a bin drained faster than its absorber explains) counts zero.- Parameters:
- beamnumpy.ndarray
The whole beam’s spectrum at each plane,
(n_z, nt)(i_omega_beam).- znumpy.ndarray
The planes, m, increasing.
- gamma_omega, gamma_lapnumpy.ndarray
The spectral absorber’s amplitude rate and the lap budget’s share, 1/m.
- Returns:
- numpy.ndarray
The removed energy per bin,
(nt,), in the units ofbeam.
Examples
>>> import numpy as np >>> z = np.array([0.0, 1e-6]) >>> rate = np.array([1e6]) >>> beam = np.array([[1.0], [np.exp(-2.0)]]) # decaying at 2 x 1e6 /m, no source >>> lap_lost(beam, z, rate, rate).round(12).tolist() [0.864664716763]
- pnps.absorber.required_trange(tgrid, thickness, time_headroom)[source]#
Return the shortest time window whose lap budget absorbs nothing in band.
The lap budget starts to absorb a frequency once its walk-off exceeds the window less twice
time_headroom, and ramps to full strength over one moretime_headroom. So a window of3 time_headroomplus the largest walk-off over the requested band[omega_min, omega_max], limits included, absorbs nothing the spectrometer would see. The walk-off does not depend on the window, so any grid of the configuration gives the same answer.- Parameters:
- tgridTimeGrid
A temporal grid of the configuration, for its band and frequencies.
- thicknessfloat
The slab’s thickness, m.
- time_headroomfloat
The protected half-width around t = 0, s.
- Returns:
- float
The window length
trange, s.
- pnps.absorber.spectral_absorber(tgrid, thickness, gamma_max=5000000.0, time_headroom=4e-14)[source]#
Build the spectral absorber: band-edge ramps and the group-delay lap budget.
The absorber
gamma_omegais the pointwise maximum of two criteria:band edges: zero on the physical band
[omega_min, omega_max], ramping togamma_maxover[omega_min/2, omega_min]and[omega_max, 1.1 omega_max],gamma_maxbeyond;group-delay (lap) budget: on a periodic time window, walked-off light is represented exactly and harmlessly (the Kerr response is local in time, the observables are per-frequency) until it wraps a full period and lands back on the pulse. Frequencies whose walk-off relative to the co-moving frame,
|beta1(omega) - beta1_ref| * thickness, exceeds the lap budget – the full window length minus twicetime_headroom(the protected half-width around t = 0 holding the pulse and the delay scan) – are therefore absorbed, ramping to full strength over one furthertime_headroomof walk-off. In silica this bites only the extreme-DUV band edge, where the group index rises steeply. The fraction of field power sitting in the absorbed bins is reported per save (gd_band_power): if it is not small, the time window is too short for full spectral fidelity – enlargetrangerather than trusting the run.
gamma_maxis a property of the configured ODE – deliberately not derived from the step size, so that step-size studies converge to one answer. The walk-off isgroup_walkoff(). The lap budget’s share is the rate it adds above the band edges, so the whole is the edges’ rate plus that share, bit for bit as solprop sums its collar and a custom rate (solprop.boundaries.custom_absorber()).- Parameters:
- tgridTimeGrid
The temporal grid.
- thicknessfloat
Total propagation distance in m (sets the group-delay budget).
- gamma_maxfloat
Peak amplitude absorption rate of the edge absorbers in 1/m.
- time_headroomfloat
Protected half-width around t = 0 (pulse support plus the delay scan), in s.
- Returns:
- SpectralRates
The amplitude rate in 1/m, the lap budget’s share of it and the 0/1 indicator of the bins the lap budget absorbs, each
(nt,).
- Raises:
- ConfigError
If the time window is too small to leave any lap budget.
- pnps.absorber.transverse_rate(kx, strength, fraction=0.1)[source]#
Return the transverse-wavevector safety ramp’s power rate on the grid.
With
rho = max(|k_x| / max|k_x|, |k_y| / max|k_y|)the rate isstrength P(rho),Pzero up torho = 1 - fractionand rising as a raised cosine to one at the grid’s largest wavenumber: solprop’s safety ramp (its SEP 40), re-derived here for the reference model, with the strengthtransverse_strength()gives. It damps content that reaches the outer band of a grid too small for its products; on a grid sized bypnps.grids.optimal_spatial_grid()it does no measurable work.- Parameters:
- kxnumpy.ndarray
The stored momentum axis (the same on both axes), rad/m.
- strengthfloat
The power rate at the grid’s edge, 1/m; 0 for none.
- fractionfloat, optional
The ramp’s width as a fraction of the largest wavenumber, in (0, 1).
- Returns:
- numpy.ndarray
The power rate,
(n_y, n_x), 1/m; a field decays byexp(-rate z / 2).
- pnps.absorber.transverse_strength(tgrid, sgrid, fraction)[source]#
Return the safety ramp’s peak power rate, as solprop designs it.
solprop does not take the ramp’s strength from the caller: it designs it so that content in the ramp’s upper half is attenuated by
Gamma_min + 2nepers (log(5e3) + 2, about 10.5) over the grid’s half-width, the distance in which it would cross the grid and come back (solprop.spatial_absorber.safety_ramp_strength()). This evaluates that rule on this package’s own grids and index: the medium’s wavenumbersRe n(omega) omega / cover the requested band[omega_min, omega_max], and the ramp’s midpoint(1 - fraction / 2)of the largest|k_x|.- Parameters:
- tgridTimeGrid
The temporal grid, for the requested band.
- sgridSpaceGrid
The transverse grid, for its momentum axis and half-width.
- fractionfloat
The ramp’s width as a fraction of the largest wavenumber, in (0, 1).
- Returns:
- float
The ramp’s power rate at the grid’s edge, 1/m.
- pnps.absorber.wrap_attenuation(tgrid, thickness, gamma_omega, walk)[source]#
Return the least attenuation of any light by the time it has walked a distance.
Light of a bin with walk-off
wover the slab movesw / thicknessper metre relative to the co-moving frame (group_walkoff()), so to walkxit must crossx thickness / wof slab. Over that it losesgamma x thickness / wamplitude e-folds to the spectral absorber, withgammathe whole rate (the band edges and the lap budget). Only a bin withw >= xwalksxinside the slab, so the least attenuation of light that has walkedxis the smallest of that over those bins: infinite when none walks so far, zero forx <= 0(no walk at all). It is non-decreasing inx.- Parameters:
- tgridTimeGrid
The temporal grid.
- thicknessfloat
The slab’s thickness, m.
- gamma_omeganumpy.ndarray
The spectral absorber’s amplitude rate, 1/m,
(nt,)(SpectralRates.gamma_omega).- walknumpy.ndarray
The walked distances, s, any shape.
- Returns:
- numpy.ndarray
The attenuation in amplitude e-folds (nepers), the shape of
walk.
- pnps.absorber.wrap_coupling(tgrid, thickness, gamma_omega, e_omega, tau)[source]#
Bound the nonlinear polarization wrapped light can drive at a delay point.
A delay point holds two pulse positions, the delay-free arms and the delayed one,
|tau|apart on the periodic window of lengthT. Light leaving one pulse at timet_s(relative to that pulse) reaches timet_tof the other through the wrap once it has walkedT - |tau| -+ (t_t - t_s), depending on which way it walks; the shorter way isx = T - |tau| - |t_t - t_s|, and by then it has lost at leastwrap_attenuation()A(x). On an infinite line it would never meet that pulse. Where it lands, it drives a Kerr polarization of at most its field times the intensity there, so in units of the input’s peak polarization the coupling isC = max over t_s, t_t of sqrt(P(t_s)) P(t_t) exp(-A(x)),with
Pthe input’s temporal power profile over its peak. Its field and its intensity both count: a pulse’s own wings carry light, and its wings and core both drive. The profile is that of the 1-D input spectrum every arm carries (the pulse, its chirp, or an injected field); the chromatic holes, real filters per transverse sample, are not part of it. Light generated in the slab is covered too: it is born where the pulses are, at most as strong as they, and loses the same e-folds as it walks. The bound is the same for every layout and window, and makes no use of which arms a signal needs.- Parameters:
- tgridTimeGrid
The temporal grid.
- thicknessfloat
The slab’s thickness, m.
- gamma_omeganumpy.ndarray
The spectral absorber’s amplitude rate, 1/m,
(nt,).- e_omeganumpy.ndarray
The 1-D input spectrum,
(nt,), in this package’s storage convention (pnps.setup.Setup.e_omega_input): its inverse DFT is the field on the centred time axis.- taufloat
The delay, s.
- Returns:
- float
The coupling
C, in [0, 1]; 1 when the pulses meet through the wrap without walking at all.