yasfpy.coupling.cpu_dense#

CPU implementation of the dense coupling matvec.

This module implements yasfpy.coupling.ops.DenseCouplingOps using the CPU Numba kernels in yasfpy.functions.cpu_numba. It is used when numerics.gpu is disabled but a dense coupling backend is selected.

Notes

The underlying coupling operator follows a VSWF translation formulation commonly used in multiple-scattering approaches [Waterman, 1971] and in CELES [Egel et al., 2017].

Classes#

CpuDenseCouplingOps

CPU dense coupling linear operator.

Module Contents#

class yasfpy.coupling.cpu_dense.CpuDenseCouplingOps(sim)#

Bases: yasfpy.coupling.ops.DenseCouplingOps

CPU dense coupling linear operator.

This class provides the dense coupling matvec W @ x using CPU Numba kernels.

Parameters:

sim – Simulation instance providing precomputed pairwise lookup tables.

Notes

The Numba kernels are sensitive to memory layout; contiguous lookup table buffers are stored for the lifetime of this instance.

matvec(x, idx=None)#

Compute the dense coupling matvec.

Parameters:
  • x – Input array. For multi-wavelength usage, the trailing dimension is the wavelength/channel axis.

  • idx – Optional wavelength/channel index. When provided, the computation is restricted to a single channel.

Returns:

The product W @ x. If idx is not None, the result is squeezed to drop the singleton channel axis.

Return type:

numpy.ndarray