QPMS
Electromagnetic multiple scattering library and toolkit.
Loading...
Searching...
No Matches
Data Structures | Functions
qpms.fields Namespace Reference

Data Structures

class  GaussianBeam
 
class  IncFieldFromField
 
class  PointDipole
 

Functions

 planewave_full (ss, k, E0)
 
 sigma_convention_B (ss, ssw, a, f)
 
 incident_field_vector (ss, field)
 
 _sphere_grid (theta_grid)
 

Detailed Description

Driving-field library for the QPMS Python bindings.

Provides incoming-field objects usable with
``ScatteringSystem.incident_field_vector``:

* :func:`planewave_full` — one-shot plane-wave coefficient vector;
* :class:`IncFieldFromField` — **custom incoming field from a Python
  function**: the user supplies a callable returning the electric field
  phasor at points; the VSWF coefficients are obtained by a weighted
  least-squares projection of the field samples onto the regular VSWF
  basis over a spherical quadrature surface around each particle
  (exact for fields that are source-free in the neighbourhood of
  every particle);
* :class:`PointDipole` — oscillating electric point dipole (analytic
  dyadic Green function + the generic projection);
* :class:`GaussianBeam` — beam via plane-wave angular-spectrum
  quadrature over a focusing cone;
* :func:`sigma_convention_B` — cross sections per the frozen
  Convention B (``ai_notes/simspec_draft.md`` §7).

All positions and wavenumbers are SI (metres, rad/s). Complex k is
supported where meaningful (quadrature projection, dipole); the beam
spectrum uses real propagation directions.

Function Documentation

◆ _sphere_grid()

qpms.fields._sphere_grid (   theta_grid)
protected
Tensor grid on the unit sphere from (cosθ Gauss–Legendre, φ count).

theta_grid: list of (cosθ, weight) pairs from leggauss mapped onto a
polar range; returns (points (n,3), weights (n,)) with Σw = 4π for a
full sphere.

◆ incident_field_vector()

qpms.fields.incident_field_vector (   ss,
  field 
)
Full-basis driving vector for ``ss`` from a field specification.

field: a cywaves IncField/PlaneWave instance, or any object exposing
``coeffs(bspec, pos)`` / ``as_incfield()`` (e.g. the classes below).

◆ planewave_full()

qpms.fields.planewave_full (   ss,
  k,
  E0 
)
Full-basis coefficient vector of a plane wave in system ``ss``.

k: cartesian wave vector (including the magnitude, k = n ω/c);
E0: cartesian electric-field phasor at the origin.

◆ sigma_convention_B()

qpms.fields.sigma_convention_B (   ss,
  ssw,
  a,
  f 
)
Cross sections per frozen Convention B (finite systems).

σ_ext = −Re⟨a, f⟩/k², σ_scat = Re⟨f, (I + W_h+) f⟩/k² with the
translation-corrected scattered flux (plain Σ|f|²/k² is valid only
for single-particle systems), σ_abs = σ_ext − σ_scat.
Returns (sigma_ext, sigma_scat, sigma_abs).