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
Constant |
Functions
|
Form a gated source's edge array |
|
Subtract discrete shadows and apply the declared density and scales once. |
|
Project both sources and reuse atomic rows for an embedded radial indicator. |
- solprop.backends.numpy_ref.tdse.FFT_ERROR_CONSTANT = 8.0#
Constant
c_Fof the forward FFT’s normwise relative boundc_F eps log2 N.Higham (2002), Theorem 24.2: a radix-2 Cooley-Tukey transform with twiddles accurate to
muhas||y - fl(y)|| / ||y|| <= log2(N) eta / (1 - log2(N) eta),eta = mu + gamma_4 (sqrt 2 + mu), about3.4 epsper level with correctly rounded twiddles. A radix-3 or radix-5 butterfly does more operations per level, but spanslog2 3orlog2 5levels oflog2 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 a2^a 3^b 5^csize; 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_1is the same unscaled remainderatomic_sources()gates (the gated filter admitstdse_nativeonly),g'the analytic derivative of the same gate (SEP 26 section 4.2), and density andremainder_scaleenter 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),XandEthe 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()’sg' S, same shape ascurrent. 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=Falsemeans there is no distinct embedded map. This same-row indicator is not the independent 17-versus-33-node qualification screen. A gated source adds theedgeentry of SEP 26 section 5, on the fine projection.
- Raises:
- BackendError
If a required descriptor, map or source shape is absent or nonfinite.