![]() |
QPMS
Electromagnetic multiple scattering library and toolkit.
|
Plane-wave expansion <-> spherical wave expansion transformation kernels. More...


Go to the source code of this file.
Data Structures | |
| struct | qpms_cpitau_t |
| Complex-argument pitau triple (same y-indexing as qpms_pitau_t). More... | |
| struct | qpms_incfield_layered_args_t |
| Arguments of the layered plane-wave initial-field expansion. More... | |
Typedefs | |
| typedef struct qpms_cpitau_t | qpms_cpitau_t |
| Complex-argument pitau triple (same y-indexing as qpms_pitau_t). | |
| typedef struct qpms_incfield_layered_args_t | qpms_incfield_layered_args_t |
| Arguments of the layered plane-wave initial-field expansion. | |
Functions | |
| qpms_cpitau_t | qpms_cpitau_get (_Complex double ct, _Complex double st, qpms_l_t lMax, int csphase) |
| Evaluate the complex-argument pitau triple for all l ≤ lMax, m ∈ [−l, l]. | |
| void | qpms_cpitau_free (qpms_cpitau_t pt) |
| Free a qpms_cpitau_t obtained from qpms_cpitau_get(). | |
| _Complex double | qpms_pwe_transcoeff_recomb (qpms_vswf_type_t t, qpms_l_t l, qpms_m_t m, int pol, const qpms_cpitau_t *pt, int csphase) |
| SVWF ↔ PVWF transformation ("B") coefficient, recombination direction. | |
| _Complex double | qpms_pwe_transcoeff_decomp (qpms_vswf_type_t t, qpms_l_t l, qpms_m_t m, int pol, const qpms_cpitau_t *pt, int csphase) |
| SVWF ↔ PVWF transformation ("B") coefficient, decomposition direction. | |
| qpms_errno_t | qpms_pwe_planewave_coeffs (_Complex double *target, const qpms_vswf_set_spec_t *bspec, csph_t k, csphvec_t E, const cart3_t *origin, bool add) |
| Regular VSWF expansion coefficients of a single plane wave (complex k capable). | |
| qpms_errno_t | qpms_incfield_planewave_layered_coeffs (_Complex double *target, const qpms_vswf_set_spec_t *bspec, const qpms_incfield_layered_args_t *args) |
| Regular VSWF coefficients of a plane wave in a layered background. | |
Plane-wave expansion <-> spherical wave expansion transformation kernels.
This is the M0 foundation of the layered-media support: the SVWF↔PVWF transformation ("B") coefficients in the QPMS VSWF conventions (QPMS_NORMALISATION_DEFAULT, i.e. Kristensson power normalisation with Condon–Shortley phase), valid for general complex spectral arguments.
Conventions: e^{−iωt}, spatial factor e^{ik·r}, loss = Im n > 0, and the out-of-plane wavenumber branch Im kz ≥ 0. The transversal polarisation slots of a plane wave with wavevector direction (θ_k, φ_k) are TE (pol 0): the azimuthal unit vector (φ-component of the geographical frame of k), and TM (pol 1): the meridional direction with E_z = −sinθ_k (the θ-component).
The coefficients have been derived and verified against SMUTHI (v2.2.4) and against the real-argument QPMS machinery (qpms_planewave2vswf_fill_sph); see ai_notes/07_layered_media.md, Appendix A.
Normalisation support: only QPMS_NORMALISATION_DEFAULT is currently implemented (the layered-media machinery uses it machinery-wide).
| typedef struct qpms_cpitau_t qpms_cpitau_t |
Complex-argument pitau triple (same y-indexing as qpms_pitau_t).
The normalised Legendre function is defined as
\[ \mathrm{leg} = \frac{\tilde P_l^m(\mathrm{ct})}{\sqrt{l(l+1)}}, \]
where \(\tilde P_l^m\) is the GSL spharm-normalised Ferrers function (including the Condon–Shortley phase iff csphase is −1) analytically continued to complex ct, st with \( \mathrm{ct}^2 + \mathrm{st}^2 = 1 \). Furthermore \(\pi = (m/\mathrm{st})\,\mathrm{leg}\) (signed m) and \(\tau = -\mathrm{st}\, d\tilde P/d\mathrm{ct} / \sqrt{l(l+1)} = d\tilde P/d\theta / \sqrt{l(l+1)}\).
The values reduce to those of qpms_pitau_get() for real arguments; the negative-m entries follow DLMF 14.9.3, i.e. leg(−m) = (−1)^m leg(+m), π(−m) = (−1)^{m+1} π(+m), τ(−m) = (−1)^m τ(+m).
| typedef struct qpms_incfield_layered_args_t qpms_incfield_layered_args_t |
Arguments of the layered plane-wave initial-field expansion.
Describes a plane wave incident on a planarly layered stack, propagating in layer inc_layer (its wave number must satisfy |k0.r| = |n_inc|·ω/c within tolerance), and a particle embedded in part_layer. The incident wave is either TE (pol 0, electric field along the azimuthal unit vector of k0) or TM (pol 1, field in the meridional plane); planar interfaces never mix polarisations, so the response has at most one non-vanishing polarisation slot per channel.
| qpms_cpitau_t qpms_cpitau_get | ( | _Complex double | ct, |
| _Complex double | st, | ||
| qpms_l_t | lMax, | ||
| int | csphase | ||
| ) |
Evaluate the complex-argument pitau triple for all l ≤ lMax, m ∈ [−l, l].
Arrays are indexed by qpms_mn2y(m, l); the y = 0 slot is unused (like in qpms_pitau_t). Free with qpms_cpitau_free().
The implementation uses the recurrences of SMUTHI's legendre_normalized (complex-safe, stable at the poles |ct| = 1), seeded to reproduce the GSL spharm + csphase convention.
| ct | cosθ, complex |
| st | sinθ, complex; must satisfy st² + ct² = 1 |
| csphase | +1 to exclude, −1 to include the Condon–Shortley phase (as in GSL) |
| qpms_errno_t qpms_incfield_planewave_layered_coeffs | ( | _Complex double * | target, |
| const qpms_vswf_set_spec_t * | bspec, | ||
| const qpms_incfield_layered_args_t * | args | ||
| ) |
Regular VSWF coefficients of a plane wave in a layered background.
Computes the total (direct + layer-response) initial field of the incident wave described by args at the particle position, expanded into regular VSWFs about the particle, ordered according to bspec->ilist (overwrite mode). The result is the sum over the two (up-/down-going) channels of the particle's layer:
with (E_pol0,dir) = L(pol0; dir, col_exc)·A_iP — A_iP being the incident amplitude propagated to the incident layer's reference plane — plus the direct excitation added to the co-directional channel when inc_layer == part_layer. This replaces the documented-incorrect qpms_incfield_planewave() path for layered (and, via the same kernel, complex-k) backgrounds; see ai_notes/07_layered_media.md, M3 appendix.
Only QPMS_NORMALISATION_DEFAULT is supported.
| target | output, length bspec->n |
| qpms_errno_t qpms_pwe_planewave_coeffs | ( | _Complex double * | target, |
| const qpms_vswf_set_spec_t * | bspec, | ||
| csph_t | k, | ||
| csphvec_t | E, | ||
| const cart3_t * | origin, | ||
| bool | add | ||
| ) |
Regular VSWF expansion coefficients of a single plane wave (complex k capable).
Computes a(τ,l,m) = Σ_pol E_pol·B†(τ,l,m,pol)·e^{−imφ_k} and stores them ordered according to bspec->ilist (multiplied by e^{i k·origin} if origin is non-NULL; the caller can also apply the phase itself).
k is the (possibly complex) wave vector in spherical coordinates (r = k, θ, φ) and E the amplitude in the geographical frame of k (thetac = TM amplitude, phic = TE amplitude). The amplitude must be transversal (E·k̂ = 0); the longitudinal part is currently ignored.
Only QPMS_NORMALISATION_DEFAULT is supported.
| target | output, length bspec->n |
| origin | optional phase reference point (may be NULL) |
| add | add to target instead of overwriting |
| _Complex double qpms_pwe_transcoeff_decomp | ( | qpms_vswf_type_t | t, |
| qpms_l_t | l, | ||
| qpms_m_t | m, | ||
| int | pol, | ||
| const qpms_cpitau_t * | pt, | ||
| int | csphase | ||
| ) |
SVWF ↔ PVWF transformation ("B") coefficient, decomposition direction.
Expands an outgoing SVWF into the up/down-going plane-wave spectrum; the "dagger=False" counterpart of qpms_pwe_transcoeff_recomb(), with the normalisation matching the layer-mediated coupling kernel of ai_notes/07_layered_media.md (Appendix A.4).
| _Complex double qpms_pwe_transcoeff_recomb | ( | qpms_vswf_type_t | t, |
| qpms_l_t | l, | ||
| qpms_m_t | m, | ||
| int | pol, | ||
| const qpms_cpitau_t * | pt, | ||
| int | csphase | ||
| ) |
SVWF ↔ PVWF transformation ("B") coefficient, recombination direction.
Expands a unit-amplitude discrete plane wave (polarisation pol, wavevector direction with cosine/sine ct, st and azimuth α = 0) into regular VSWFs; equivalently the PVWF → SVWF recombination kernel used in the Sommerfeld-type layer-mediated coupling integrals.
The α ≠ 0 case is obtained by multiplying with e^{−imα}.
For real arguments this reproduces the coefficients of qpms_planewave2vswf_fill_sph() exactly.
| t | VSWF polarisation (MAGNETIC / ELECTRIC) |
| pol | plane wave polarisation: 0 = TE, 1 = TM |
| pt | pitau values at the desired (ct, st) |
| csphase | must match the csphase used in pt |