pnps.geometry#

The beam layouts: where the input holes are, and where the signal appears.

Two layouts share the propagation and the chi3 response; only the input differs.

  • "tg", transient grating: the four-hole boxcar. Holes at (+-d, +-d) with d = (mask_spacing + mask_diam) / 2; gate 1 at (+d, +d), gate 2 at (+d, -d) and the delayed test arm at (-d, +d), so the signal k_test - k_g1 + k_g2 appears in the fourth corner, (-d, -d).

  • "sd", self-diffraction: two holes on the x axis, s = mask_spacing + mask_diam apart centre to centre. The probe E sits at (-s/2, 0) and the delayed gate G at (+s/2, 0); the signal 2 k_E - k_G appears one slot further out, at (-3s/2, 0). The layout is symmetric about the axis so that both beams are cut from the same part of the illumination: the signal is E^2 G*, and an energy imbalance between the two would not cancel. The gate, which appears once and conjugated, carries the delay.

Positions are in the mask plane, in the stored transverse axes (a mask-plane position x is the stored wavevector kx = x omega / (c f_foc)). The input former takes the layout as three arms, gate 1, gate 2 and the test arm (pnps.form_input.ARMS), with a weight each: self-diffraction puts the probe in the gate-1 slot, the gate in the test slot and gives gate 2 no weight.

The signal region is what i_omega_full sums, the un-windowed signal against which the windows’ collection efficiency is measured (SignalRegion): for TG the quadrant kx, ky < 0 (the same at every frequency), for SD the half-plane beyond the bisector between the signal and the probe, mask-plane x < -s, which moves with frequency, inside air’s light cone.

Module Attributes

Geometry

The beam layouts: "tg" (four-hole boxcar) and "sd" (self-diffraction).

Functions

check_geometry(geometry)

Refuse an unknown layout.

input_layout(geometry, mask_diam, mask_spacing)

Return the input holes of a layout.

region_mask(region, ky, kx)

Return a signal region as a mask of the state, for the NumPy references.

signal_centre(geometry, mask_diam, mask_spacing)

Return where the signal appears in the mask plane, where the windows go.

signal_half_plane(geometry, f_foc, ...)

Return the SD signal region as a mask-plane edge, or None for TG.

signal_region(geometry, omega, f_foc, ...)

Return the momentum region of the signal, what i_omega_full sums.

Classes

Layout(holes, weights)

The input holes of a layout, in the former's arm order.

SignalRegion(kx_max, ky_max, kperp2_max)

The momentum region of the signal, what i_omega_full sums.

pnps.geometry.Geometry#

The beam layouts: "tg" (four-hole boxcar) and "sd" (self-diffraction).

alias of Literal[‘tg’, ‘sd’]

class pnps.geometry.Layout(holes, weights)[source]#

Bases: NamedTuple

The input holes of a layout, in the former’s arm order.

Attributes:
holesnumpy.ndarray

Hole centres (3, 2) in the mask plane, m, for gate 1, gate 2 and the test arm.

weightsnumpy.ndarray

Arm weights (3,), each 1.0 or 0.0: an arm of weight zero is not part of the layout.

holes: Float[ndarray, 'n_arms 2']#

Alias for field number 0

weights: Float[ndarray, 'n_arms']#

Alias for field number 1

class pnps.geometry.SignalRegion(kx_max, ky_max, kperp2_max)[source]#

Bases: NamedTuple

The momentum region of the signal, what i_omega_full sums.

{kx < kx_max(omega), ky < ky_max(omega), kx^2 + ky^2 < kperp2_max(omega)}.

Attributes:
kx_max, ky_maxnumpy.ndarray

Exclusive upper bounds on the stored wavevectors per frequency bin, (n_omega,), rad/m; -inf excludes a bin, +inf leaves an axis free.

kperp2_maxnumpy.ndarray

Exclusive upper bound on kx^2 + ky^2 per bin, (n_omega,), rad^2/m^2; +inf for none.

kx_max: Float[ndarray, 'n_omega']#

Alias for field number 0

ky_max: Float[ndarray, 'n_omega']#

Alias for field number 1

kperp2_max: Float[ndarray, 'n_omega']#

Alias for field number 2

pnps.geometry.check_geometry(geometry)[source]#

Refuse an unknown layout.

Parameters:
geometrystr

The layout’s name.

Raises:
ConfigError

If geometry is not one of Geometry.

pnps.geometry.input_layout(geometry, mask_diam, mask_spacing)[source]#

Return the input holes of a layout.

Parameters:
geometry{“tg”, “sd”}

The layout.

mask_diam, mask_spacingfloat

Hole diameter and edge-to-edge spacing, m.

Returns:
Layout

The hole centres and arm weights.

Raises:
ConfigError

For an unknown layout.

Examples

>>> from pnps.geometry import input_layout
>>> layout = input_layout("sd", 1e-3, 1e-3)
>>> layout.holes.tolist(), layout.weights.tolist()
([[-0.001, 0.0], [-0.001, 0.0], [0.001, 0.0]], [1.0, 0.0, 1.0])
pnps.geometry.region_mask(region, ky, kx)[source]#

Return a signal region as a mask of the state, for the NumPy references.

Parameters:
regionSignalRegion

The region.

ky, kxnumpy.ndarray

The stored momentum axes, rad/m.

Returns:
numpy.ndarray

True inside the region, (n_y, n_x, n_omega).

pnps.geometry.signal_centre(geometry, mask_diam, mask_spacing)[source]#

Return where the signal appears in the mask plane, where the windows go.

Parameters:
geometry{“tg”, “sd”}

The layout.

mask_diam, mask_spacingfloat

Hole diameter and edge-to-edge spacing, m.

Returns:
tuple of float

(x, y) in m: (-d, -d) for TG, (-3s/2, 0) for SD.

Raises:
ConfigError

For an unknown layout.

Examples

>>> from pnps.geometry import signal_centre
>>> signal_centre("tg", 1e-3, 1e-3), signal_centre("sd", 1e-3, 1e-3)
((-0.001, -0.001), (-0.003, 0.0))
pnps.geometry.signal_half_plane(geometry, f_foc, mask_diam, mask_spacing)[source]#

Return the SD signal region as a mask-plane edge, or None for TG.

The SD region is the half of the mask beyond the gate-side edge x = s in solprop’s physical axes (this package’s stored kx < -s omega / (c f_foc), negated), at the input mapping’s distance f_foc: a half_plane_x_ge row of a solprop aperture set. The TG quadrant is a fixed momentum box instead.

Parameters:
geometry{“tg”, “sd”}

The layout.

f_focfloat

Focal length of the input mapping, m.

mask_diam, mask_spacingfloat

Hole diameter and edge-to-edge spacing, m.

Returns:
tuple of float or None

(edge, distance) in m, or None for TG.

Raises:
ConfigError

For an unknown layout.

Examples

>>> signal_half_plane("sd", 0.1, 1e-3, 1e-3)
(0.002, 0.1)
>>> signal_half_plane("tg", 0.1, 1e-3, 1e-3) is None
True
pnps.geometry.signal_region(geometry, omega, f_foc, mask_diam, mask_spacing)[source]#

Return the momentum region of the signal, what i_omega_full sums.

Parameters:
geometry{“tg”, “sd”}

The layout.

omeganumpy.ndarray

Absolute angular frequency, FFT-ordered, rad/s.

f_focfloat

Focal length of the input mapping, m.

mask_diam, mask_spacingfloat

Hole diameter and edge-to-edge spacing, m.

Returns:
SignalRegion

TG: the quadrant kx, ky < 0 at every bin, the second half of each FFT-ordered axis. SD: kx < -s omega / (c f_foc) at positive frequencies, any ky, inside air’s light cone kx^2 + ky^2 < (omega / c)^2, and nothing at the other frequencies, where the mapping diverges. The SD region is a half-plane of the mask, which only light that can leave the slab into air reaches; it is solprop’s half-plane aperture (signal_half_plane()), which reaches the same columns.

Raises:
ConfigError

For an unknown layout.