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

WRAP_COUPLING_LIMIT

The largest wrap coupling (wrap_coupling()) a delay point may have beyond three quarters of time_headroom.

Functions

band_edges(tgrid, gamma_max)

Return the band edges' amplitude rate, the spectral absorber less the lap budget.

group_walkoff(tgrid, thickness)

Return each frequency's group-delay walk-off over the slab, s.

lap_free_band(tgrid, gamma_lap)

Return the wavelengths between which the lap budget absorbs nothing.

lap_loss_share(lost, kept, omega, band)

Return the share of a band's energy that the lap budget removed.

lap_lost(beam, z, gamma_omega, gamma_lap)

Return the energy per bin the lap budget removed between the save planes.

required_trange(tgrid, thickness, time_headroom)

Return the shortest time window whose lap budget absorbs nothing in band.

spectral_absorber(tgrid, thickness[, ...])

Build the spectral absorber: band-edge ramps and the group-delay lap budget.

transverse_rate(kx, strength[, fraction])

Return the transverse-wavevector safety ramp's power rate on the grid.

transverse_strength(tgrid, sgrid, fraction)

Return the safety ramp's peak power rate, as solprop designs it.

wrap_attenuation(tgrid, thickness, ...)

Return the least attenuation of any light by the time it has walked a distance.

wrap_coupling(tgrid, thickness, gamma_omega, ...)

Bound the nonlinear polarization wrapped light can drive at a delay point.

Classes

SpectralRates(gamma_omega, gamma_lap, gd_band)

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 of time_headroom. Light radiated by a nonlinear polarization of 1e-5 of the input’s peak is at most 1e-5 of the signal’s peak amplitude, so its interference moves a trace by at most 2e-5 of the trace’s peak, inside the 3e-5 of 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: NamedTuple

The spectral absorber, whole and by part.

Attributes:
gamma_omeganumpy.ndarray

The amplitude rate the operator applies, 1/m, (nt,): the band edges’ rate plus gamma_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 to gamma_max over [omega_min/2, omega_min] and [omega_max, 1.1 omega_max], and gamma_max beyond. 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| * thickness relative to the co-moving frame, with beta1 by a symmetric finite difference of beta = 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.

pnps.absorber.lap_loss_share(lost, kept, omega, band)[source]#

Return the share of a band’s energy that the lap budget removed.

lost / (lost + kept) summed over the band’s bins, with lost the energy per bin the lap budget removed over the slab (lap_lost of pnps.simulate.run_delay_point()) and kept the whole beam’s spectrum at the exit (i_omega_beam at 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 S obeys dS/dz = G - alpha S, with alpha = 2 gamma_omega the spectral absorber’s power rate and G whatever else feeds or drains the bin (the nonlinear generation, the transverse ramp). Taking G constant across the interval, the two planes’ values fix it, and the absorber removed G dz - (S1 - S0): exact for a bin that only decays, and for one fed at a steady rate. A trapezoid of alpha S is 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 about alpha dz / 2. The lap budget’s part is its share gamma_lap / gamma_omega of 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 of beam.

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 more time_headroom. So a window of 3 time_headroom plus 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_omega is the pointwise maximum of two criteria:

  • band edges: zero on the physical band [omega_min, omega_max], ramping to gamma_max over [omega_min/2, omega_min] and [omega_max, 1.1 omega_max], gamma_max beyond;

  • 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 twice time_headroom (the protected half-width around t = 0 holding the pulse and the delay scan) – are therefore absorbed, ramping to full strength over one further time_headroom of 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 – enlarge trange rather than trusting the run.

gamma_max is 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 is group_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 is strength P(rho), P zero up to rho = 1 - fraction and 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 strength transverse_strength() gives. It damps content that reaches the outer band of a grid too small for its products; on a grid sized by pnps.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 by exp(-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 + 2 nepers (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 wavenumbers Re n(omega) omega / c over 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 w over the slab moves w / thickness per metre relative to the co-moving frame (group_walkoff()), so to walk x it must cross x thickness / w of slab. Over that it loses gamma x thickness / w amplitude e-folds to the spectral absorber, with gamma the whole rate (the band edges and the lap budget). Only a bin with w >= x walks x inside the slab, so the least attenuation of light that has walked x is the smallest of that over those bins: infinite when none walks so far, zero for x <= 0 (no walk at all). It is non-decreasing in x.

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 length T. Light leaving one pulse at time t_s (relative to that pulse) reaches time t_t of the other through the wrap once it has walked T - |tau| -+ (t_t - t_s), depending on which way it walks; the shorter way is x = T - |tau| - |t_t - t_s|, and by then it has lost at least wrap_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 is

C = max over t_s, t_t of sqrt(P(t_s)) P(t_t) exp(-A(x)),

with P the 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.