solprop.backends.numpy_ref.tdse#

Assemble independently projected TDSE polarisation and current sources.

The native closure’s gated, edge-free source (SEP 26) multiplies the remainder current S by its gate g before the transform and subtracts the edge term DFT[g' S] / (i omega) on the active bins, so that the current is held after the window instead of switched off.

Module Attributes

FFT_ERROR_CONSTANT

Constant c_F of the forward FFT's normwise relative bound c_F eps log2 N.

Functions

atomic_edge_source(result, problem, bundle)

Form a gated source's edge array g' S, scaled exactly as its current.

atomic_sources(fields, result, problem, bundle)

Subtract discrete shadows and apply the declared density and scales once.

project_atomic_sources(polarisation, ...[, edge])

Project both sources and reuse atomic rows for an embedded radial indicator.

solprop.backends.numpy_ref.tdse.FFT_ERROR_CONSTANT = 8.0#

Constant c_F of the forward FFT’s normwise relative bound c_F eps log2 N.

Higham (2002), Theorem 24.2: a radix-2 Cooley-Tukey transform with twiddles accurate to mu has ||y - fl(y)|| / ||y|| <= log2(N) eta / (1 - log2(N) eta), eta = mu + gamma_4 (sqrt 2 + mu), about 3.4 eps per level with correctly rounded twiddles. A radix-3 or radix-5 butterfly does more operations per level, but spans log2 3 or log2 5 levels of log2 N; 8 covers the 2-, 3- and 5-smooth sizes solprop’s lattices use (SEP 26 section 4.5). The SEP 26 T3 test measures the constant at a power-of-two and at a 2^a 3^b 5^c size; any other size is flagged in the diagnostic as unqualified. doi:10.1137/1.9780898718027

solprop.backends.numpy_ref.tdse.atomic_edge_source(result, problem, bundle)[source]#

Form a gated source’s edge array g' S, scaled exactly as its current.

S = J - j_1 is the same unscaled remainder atomic_sources() gates (the gated filter admits tdse_native only), g' the analytic derivative of the same gate (SEP 26 section 4.2), and density and remainder_scale enter once, as for the current. Nothing here is differentiated numerically.

Parameters:
resultTDSEResult

Owning microscopic SI histories, already matched to this configuration.

problemKernelProblem

Compiled optical and atomic scientific specification.

bundleStageScalars

Density and other scalars at this evaluation’s absolute position.

Returns:
numpy.ndarray or None

rho s g'(t) S(t) in A/(m² s), shape (n_nodes, 1, n_to), for a gated (native) source; None for a cubic replacement, which has no gate.

Raises:
BackendError

If the descriptor is absent, the result is not this configuration’s, or the array is not finite.

solprop.backends.numpy_ref.tdse.atomic_sources(fields, result, problem, bundle)[source]#

Subtract discrete shadows and apply the declared density and scales once.

Parameters:
fieldsnumpy.ndarray

Chronological real physical fields in V/m, shape (n_nodes, n_to).

resultTDSEResult

Owning microscopic SI histories for these exact inputs.

problemKernelProblem

Compiled optical and atomic scientific specification.

bundleStageScalars

Density and other scalars at this evaluation’s absolute position.

Returns:
tuple of numpy.ndarray

Polarisation in C/m² and current in A/m², each with a scalar component axis. These new arrays never alias or mutate the provider’s histories.

Raises:
BackendError

If an identity, shape or required observable does not match the model.

solprop.backends.numpy_ref.tdse.project_atomic_sources(polarisation, current, result, problem, bundle, prefactor, *, edge=None)[source]#

Project both sources and reuse atomic rows for an embedded radial indicator.

For a gated (native) source the current’s spectrum is the edge-free X - E / (i omega) on the active bins (SEP 26 section 4.4), X and E the raw transforms of the projected gated current and edge array, before the current factor; 1/(i omega) is never formed at the zero or inactive bins, where the current factor is zero anyway.

Parameters:
polarisationnumpy.ndarray

Already calibrated macroscopic polarisation in C/m², shape (n_nodes, 1, n_to).

currentnumpy.ndarray

Already scaled macroscopic remainder current in A/m², same shape.

resultTDSEResult

Unscaled microscopic operands used to derive an absolute cancellation floor.

problemKernelProblem

Resolved modal maps, crop, spectral collar and independent current numerator.

bundleStageScalars

Stage position in m, density in m⁻³ and modal taper scale.

prefactornumpy.ndarray

Stage polarisation factor, including the crop scale and effective index, shape (n_modes, 1, n_omega).

edgenumpy.ndarray or None, optional

atomic_edge_source()’s g' S, same shape as current. Required for a gated (native) source and refused for an ungated one.

Returns:
sourcenumpy.ndarray

Complete spectral derivative before the spectral collar and interaction propagator, shape (n_modes, 1, n_omega). The caller applies these once.

diagnosticsdict

JSON-compatible complete-source and remainder-source norms after the spectral collar, in the same raw FFT modal derivative units. Each reports the embedded discrepancy, an absolute floating-point floor, and no relative score when the fine source is floor dominated. available=False means there is no distinct embedded map. This same-row indicator is not the independent 17-versus-33-node qualification screen. A gated source adds the edge entry of SEP 26 section 5, on the fine projection.

Raises:
BackendError

If a required descriptor, map or source shape is absent or nonfinite.