solprop.backends.numba_cpu.planar#

Execute the hybrid planar transform’s compiled passes.

Kernel schema 15’s "slab" kind on numba_cpu: slab modes in x on the transform’s own synthesis and projection, an FFT in y, the state’s columns (p, k_y) with the channel index fastest (docs/dev/kernel-contract.md section 4). What is here is what the kind has and free space has not:

  • the exact longitudinal operator with each channel’s complex wall term kappa_sq, evaluated per element by the shared body define_bodies()’s slab_element for the propagator, the noise phase and the stage’s prefactor, never tabulated;

  • the y transform: one in-place FFTW pair over the first axis of the (n_y, n_p * n_pol, n_omega) column volume, and, when the in-stage absorber is on, a second half of the same buffer that carries the absorber’s rows through the same forward transform;

  • the stage’s finish, which forms (prefactor * window * material + mask * absorbed) * exp(-dPhi) per column in the reference’s order (the reference backend’s _nonlinear_slab).

The temporal transforms, the response column, the Raman convolution, the envelope plasma and the accumulation are the backend’s own, shared with every other route: a (p, y) row is a modal amplitude whose time signal is a real field’s, so only n_p * n_y rows are taken to time and back, and the x synthesis and projection are real GEMMs in time, one per y row.

Functions

build_slab_plans(shape, *, absorber, flag, ...)

Plan the in-place y transforms of the planar column volume, before any state.

make_kernels(*, parallel)

Compile the planar stage operations, serial or across independent columns.

slab_data(problem)

Pack the separable leaf of a hybrid planar problem as its kernels take it.

write_phase(data, z, phase)

Evaluate the unitary noise phase z Im D of every column.

Classes

PlanarKernels(write_propagator, finish_stage)

Group the hybrid planar kind's wide stage operations.

SlabPlans(spectrum, rows, absorbed, inverse, ...)

Own the planar column volume and its y transforms.

class solprop.backends.numba_cpu.planar.PlanarKernels(write_propagator, finish_stage)[source]#

Bases: NamedTuple

Group the hybrid planar kind’s wide stage operations.

Attributes:
write_propagator, finish_stagecallable

Traversals over independent columns, serial or parallel.

finish_stage: Any#

Alias for field number 1

write_propagator: Any#

Alias for field number 0

class solprop.backends.numba_cpu.planar.SlabPlans(spectrum, rows, absorbed, inverse, forward, forward_all, plan_heap_growth, planning_seconds)[source]#

Bases: object

Own the planar column volume and its y transforms.

Attributes:
spectrumnumpy.ndarray

Aligned complex scratch (n_halves, n_y, n_p * n_pol, n_omega): the material half and, when the in-stage absorber is on, the absorber’s half.

rows, absorbednumpy.ndarray

The two halves as (n_columns, n_omega) views; absorbed is the first half again when there is no second one, and is then never read.

inverse, forwardpyfftw.FFTW

Unnormalised in-place y transforms of the material half.

forward_allpyfftw.FFTW

The forward y transform of both halves together, or forward.

plan_heap_growthint

Process allocator net growth during planning in bytes, including opaque FFTW work areas; a measured count, not a bound.

planning_secondsfloat

Time spent planning, in seconds.

absorbed: Any#
forward: Any#
forward_all: Any#
inverse: Any#
plan_heap_growth: int#
planning_seconds: float#
rows: Any#
spectrum: Any#
solprop.backends.numba_cpu.planar.build_slab_plans(shape, *, absorber, flag, threads)[source]#

Plan the in-place y transforms of the planar column volume, before any state.

Parameters:
shapetuple of int

(n_y, n_p * n_pol, n_omega), all positive.

absorberbool

Whether to allocate the absorber’s half and transform it with the material.

flagstr

A key of solprop.backends.numba_cpu.fft.PLAN_FLAGS.

threadsint

FFTW’s pool for these plans, positive.

Returns:
SlabPlans

The volume, its views and its three plans.

Raises:
BackendError

If the planning flag is not one of the supported ones.

solprop.backends.numba_cpu.planar.make_kernels(*, parallel)[source]#

Compile the planar stage operations, serial or across independent columns.

Parameters:
parallelbool

Whether the column loop is a prange. Each column’s arithmetic is the same either way, so the two variants agree to the last bit.

Returns:
PlanarKernels

The compiled operations.

solprop.backends.numba_cpu.planar.slab_data(problem)[source]#

Pack the separable leaf of a hybrid planar problem as its kernels take it.

Parameters:
problemsolprop.translate.problem.KernelProblem

A validated problem whose geometry is "slab".

Returns:
tuple

The free-space record’s arrays with kappa_sq after the transverse residual, then the evanescent rate, the state’s polarisation count and the channel count.

solprop.backends.numba_cpu.planar.write_phase(data, z, phase)[source]#

Evaluate the unitary noise phase z Im D of every column.

Parameters:
datatuple

slab_data()’s record.

zfloat

Absolute propagation position in m.

phasenumpy.ndarray

Real phase buffer (n_columns, n_omega), overwritten in radians.