Expand description
Cartesian spherical and cylindrical vector waves, field sums and field operators.
field sums a mode expansion at sample points, and operator builds the
matrix that maps mode coefficients to those fields; both have analytic gradients.
The waves use Cartesian components built from solid harmonics, so they stay finite on the z axis and at the expansion centre, where polar coordinates are singular.
Upstream: treams.efield and the vector waves treams.special.vsw_* and vcw_*.
Structsยง
- Accumulator ๐
- Partial sums of a field pullback over a chunk of consecutive samples. Point gradients are written in place, one per sample.
- Field
Gradient - Input gradients of a field or operator pullback, under the convention
dL = Re sum(conj(g) dx). - Field
Residual - What
fieldsaves for its pullback: the wave set, the points and the coefficients. Its size grows with the samples plus the modes, not their product. - Geometry
Tangent ๐ - A direction in field geometry, shared by field sums and operators. Local wave derivatives are contracted immediately, without constructing a global Jacobian.
- Operator
Residual - What
operatorsaves for its pullback: the wave set and the points, without the matrix. - Sample
Cache ๐ - Work shared by the waves of one sample point: scaled radial functions per
(position, wavenumber, order), and the last spherical parts or cylindrical
components, which the adjacent polarization of the same mode reuses.
Every entry is keyed by all of its inputs, so any mode order is
evaluated exactly as without the cache.
Nis the derivative level (VALUES,SPATIAL_AND_KorWITH_AXIAL). - Vector
Wave - A spherical or cylindrical electric vector wave with its analytic derivatives with
respect to the evaluation point and the medium wavenumber
k. - WaveSet ๐
- Evaluates the waves of a multipole basis at any point, for one pair of medium wavenumbers, polarization convention and radial kind.
Constantsยง
- SPATIAL_
AND_ ๐K - Derivative level: values, point derivatives (jet variables 0 to 2) and the wavenumber derivative (variable 3).
- VALUES ๐
- Derivative level of a wave evaluation: values only. Each level is the jet size of the cylindrical path; the spherical path evaluates derivatives above this level.
- WITH_
AXIAL ๐ - Derivative level:
SPATIAL_AND_Kplus the axial-wavenumber derivative of cylindrical waves (variable 4).
Functionsยง
- combine ๐
- The wave
normalization (weight_n N + weight_m M)of the value and requested derivatives. The partmfromspherical_partsis-M, so it enters with a minus sign. - cross ๐
- cylindrical_
components ๐ - The M and N components of a cylindrical wave, which do not depend on its
polarization. Jet variables are the position (0..3),
k(3) andkz(4). - cylindrical_
wave - Cartesian cylindrical vector wave and its point and wavenumber derivatives. Adjacent scalar harmonics remove all polar-coordinate divisions at the axis.
- field
- Evaluate weighted electric fields in parallel over samples: one Cartesian field vector per point.
- normalization ๐
- Normalization
i sqrt((2l + 1) / (4 pi l (l + 1))) sqrt((l - m)! / (l + m)!)of the spherical wave(l, m); it depends on neither point nork. - operator
- Matrix mapping multipole amplitudes to Cartesian samples. Rows pack (sample, component). The residual keeps the basis, wavenumbers and points, without the output or any derivative matrix.
- pack_
cylindrical ๐ - The value, point derivatives (jet variables 0 to 2) and wavenumber derivative (variable 3) of a cylindrical wave; jets without derivatives give zeros.
- read_
sampled_ ๐state - Check the complete byte size from the allocation-free header before decoding any arrays. Both residual layouts share the same sampled-wave prefix.
- sampled_
waves ๐ - The waves of
basisand the sample points, checked in this order: basis, points, wavenumbers. - scaled_
radial ๐ - spherical_
arguments ๐ - A common length unit bounds solid-harmonic coordinates by one and bounds the wavenumber in the regular origin series. Hold this scale fixed when taking derivatives: the wave is unchanged by any common change of length units.
- spherical_
parts ๐ - The unnormalized parts
[n, m]of a spherical wave of degreel, which every polarization combines with its ownweights. - spherical_
wave - Evaluate a vector spherical wave in treams normalization.
Parity polarization 0 is M, 1 is N; helicity is
(N + (2pol-1) M)/sqrt(2). - spherical_
wave_ ๐impl spherical_wavewith the point and wavenumber derivatives only ifDERIVATIVES.- validate_
coefficients ๐ - validate_
points ๐ - weights ๐
- Weights
[weight_n, weight_m]of the N and M parts of polarizationpol: parity polarization 1 is N and 0 is M; helicity polarizationpolis(N + (2 pol - 1) M) / sqrt(2), as intreams.special.vsw_A. - write_
sampled_ ๐state
Type Aliasesยง
- Components
Key ๐ - Position index, wavenumber index, order and axial-wavenumber bits of cylindrical components.
- Parts
Key ๐ - Position index, wavenumber index, degree and order of spherical parts.