Skip to content

Spectra and reflection

The noise model describes mean-mode policy, complex symbols, boundary conditions, bounded intensity conventions and regularity.

exponax_spde.noise.Matern

Normalised Whittle–Matérn spectrum \(q_k=(1+\ell^2|k|^2)^{-\alpha}\).

Parameters:

Name Type Description Default
alpha float

Non-negative exponent. The power decays with exponent \(2\alpha\).

required
length_scale float

Positive physical correlation scale \(\ell\).

1.0

exponax_spde.noise.Band

Unit power on a closed shell of physical wavenumbers.

The interval endpoints are included up to floating-point rounding on \(|k|^2\).

Parameters:

Name Type Description Default
k_min float

Lower physical wavenumber.

required
k_max float

Upper physical wavenumber.

required

exponax_spde.noise.Conservative

Spectrum \(q_k=|k|^2q_k^{\rm inner}\) of a random flux divergence.

The constant mode has zero power. The decay exponent is the inner exponent minus two.

Parameters:

Name Type Description Default
inner Matern | Band

Matérn or band spectrum of the isotropic flux.

required

exponax_spde.noise.Modes

Power on explicit integer wave indices and their sign reflections.

In periodic coefficient space, every sign combination has the same weight. On bounded grids, use non-negative indices for Neumann conditions and positive indices for Dirichlet conditions.

Parameters:

Name Type Description Default
indices Iterable[tuple[int, ...]]

Integer tuples of equal dimension.

required
weights Array | None

Non-negative power per tuple. Defaults to unit powers.

None

exponax_spde.symmetry.extend

extend(u_half: Array, parity: Parity) -> Array

Reflect an endpoint-inclusive half-grid field onto a periodic grid.

Half-grid endpoints occur once per axis. Odd reflection sets them to zero.

Parameters:

Name Type Description Default
u_half Array

Channel-first field, including both spatial endpoints.

required
parity Parity

Even or odd reflection on every spatial axis.

required

Returns:

Type Description
Array

Channel-first periodic field with twice the number of grid intervals.

exponax_spde.symmetry.restrict

restrict(u_full: Array, parity: Parity) -> Array

Take the endpoint-inclusive half of an even-sized periodic grid.

Parameters:

Name Type Description Default
u_full Array

Channel-first periodic field.

required
parity Parity

Even keeps the endpoints, and odd sets them to zero.

required

Returns:

Type Description
Array

Channel-first half-grid field.

exponax_spde.symmetry.project

project(u: Array, parity: Parity) -> Array

Project a periodic field onto the requested reflection parity.

Parameters:

Name Type Description Default
u Array

Channel-first field on the full grid.

required
parity Parity

Even for reflection without a sign change, or odd for a sign change.

required

Returns:

Type Description
Array

Field of the same shape, projected on each spatial axis.

exponax_spde.NoiseRegularityWarning

The finite-grid noise is too rough for the classical continuum model.

Types

exponax_spde.noise.Spectrum module-attribute

Spectrum = Matern | Band | Conservative | Modes

exponax_spde.symmetry.Parity module-attribute

Parity = Literal['even', 'odd']