torch_harmonics.filter_basis.FourierBesselFilterBasis#

class torch_harmonics.filter_basis.FourierBesselFilterBasis(kernel_shape)[source]#

Bases: FilterBasis

Fourier-Bessel (Disk Harmonic) filter basis on the unit disk.

Basis functions are the Dirichlet Laplacian eigenfunctions on the disk:

\[\psi_{m,n,c}(r, \phi) = J_m(\alpha_{m,n} \cdot r/r_cutoff) \cdot \{cos(m\phi), sin(m\phi)\}\]

where \(\alpha_{m,n}\) is the n-th positive zero of \(J_m\), so \(\psi = 0\) on the boundary \(r = r_{cutoff}\).

The basis is ordered by eigenvalue \(\lambda = \alpha_{m,n}^2 / r_{cutoff}^2\), from lowest to highest. For m > 0 each (m, n) pair yields two basis functions (cosine and sine), while m = 0 yields one (cosine only, i.e., purely radial).

kernel_shapeint or tuple of two ints (n_radial, n_angular)

If int: same value for both (\(n_{radial}\), \(n_{angular}\)) = (\(kernel_{shape}\), \(kernel_{shape}\)). If tuple of length 2: (\(n_{radial}\), \(n_{angular}\)). \(n_{radial}\) controls the radial degree (number of zeros of \(J_0\) used to set \(\alpha_{max}\)). n_angular is the max azimuthal order \(m\).

Parameters:

kernel_shape (int | Tuple[int] | Tuple[int, int])

compute_l2_norms(
r_cutoff=1.0,
nr=50,
nphi=200,
)[source]#

Analytic L2 norms of the Fourier-Bessel basis on a disk of radius r_cutoff.

nr and nphi are accepted for signature compatibility with the base class.

Radial: integral_0^R J_m(alpha r/R)^2 r dr = R^2 * J_{m+1}(alpha)^2 / 2. Angular: integral_0^{2pi} cos^2(m phi) dphi = 2pi (m=0) or pi (m>0).

Parameters:
Return type:

Tensor

compute_support_vals(r, phi, r_cutoff)[source]#

Returns (iidx, vals) matching the convention of the other FilterBasis classes.

iidx : LongTensor [nnz, 3] – (kernel_idx, row, col) vals : FloatTensor [nnz]

Parameters:
Return type:

Tuple[Tensor, Tensor]