solprop.hankel#

Transform an axisymmetric field with the raw order-zero QDHT.

The forward transform is H(k) = integral r*f(r)*J0(k*r) dr; its inverse integrates k*H(k)*J0(k*r). Angular frequencies are in rad/m and no 2*pi is hidden in either transform. The integration weights include the azimuthal integral. See docs/guide/free-space/hankel.md for the scalings and finite-transform error.

Classes

QDHT(radius, n_r)

Construct the raw order-zero quasi-discrete Hankel transform.

class solprop.hankel.QDHT(radius, n_r)[source]#

Bases: object

Construct the raw order-zero quasi-discrete Hankel transform.

The matrix is symmetric and approximately self-inverse. Its finite truncation error is distinct from roundoff; it is never replaced by an orthogonal matrix.

Attributes:
radiusfloat

Outer Dirichlet boundary in m, finite and positive.

n_rint

Number of interior radial samples, at least 2.

rnumpy.ndarray

Interior radial samples in m, shape (n_r,); zero is not a sample.

k_rnumpy.ndarray

Transverse angular frequencies in rad/m, shape (n_r,).

zerosnumpy.ndarray

First n_r + 1 positive zeros of J0, dimensionless.

j1numpy.ndarray

Absolute J1 values at the first n_r zeros, dimensionless.

matrixnumpy.ndarray

Symmetric, dimensionless QDHT matrix, shape (n_r, n_r).

radial_weightsnumpy.ndarray

Weights of the area integral 2*pi*r*dr, in m^2, shape (n_r,).

spectral_weightsnumpy.ndarray

Weights of 2*pi*k_r*dk_r, in m^-2, shape (n_r,).

forward_scalefloat

Common forward scaling radius**2 / zeros[-1], in m^2.

inverse_scalefloat

Common inverse scaling zeros[-1] / radius**2, in m^-2.

Raises:
GridError

If the size, radius or resulting floating-point scales are invalid.

References

M. Guizar-Sicairos and J. C. Gutiérrez-Vega, JOSA A 21, 53-58 (2004), doi:10.1364/JOSAA.21.000053.

Examples

>>> from solprop.hankel import QDHT
>>> transform = QDHT(1e-3, 32)
>>> transform.r.shape, transform.matrix.shape
((32,), (32, 32))
forward(values)[source]#

Transform radial samples to a Hankel spectrum along the last axis.

Parameters:
valuesarray_like

Finite real or complex field samples, shape (..., n_r), in V/m.

Returns:
numpy.ndarray

Spectrum of the same shape, in V m; float64 or complex128.

Raises:
GridError

If the last axis has the wrong length or the values are nonfinite.

forward_scale: float#
inverse(values)[source]#

Reconstruct radial samples from a Hankel spectrum along the last axis.

Parameters:
valuesarray_like

Finite real or complex spectra, shape (..., n_r), in V m.

Returns:
numpy.ndarray

Field of the same shape, in V/m; float64 or complex128.

Raises:
GridError

If the last axis has the wrong length or the values are nonfinite.

inverse_scale: float#
j1: Float[ndarray, 'n_r']#
k_r: Float[ndarray, 'n_r']#
matrix: Float[ndarray, 'n_r n_r']#
n_r: int#
r: Float[ndarray, 'n_r']#
radial_weights: Float[ndarray, 'n_r']#
radius: float#
spectral_weights: Float[ndarray, 'n_r']#
zeros: Float[ndarray, 'n_zeros']#