foscat.BkBase#
Classes#
Module Contents#
- class foscat.BkBase.BackendBase(name, mpi_rank=0, all_type='float64', gpupos=0, silent=False)[source]#
- BACKEND#
- mpi_rank = 0#
- all_type = 'float64'#
- gpupos = 0#
- silent = False#
- calc_iso_orient3(norient)[source]#
Build the averaging matrix for 3-orientation isotropic reduction (S4).
S4 has shape […, L1, L2, L3]. Under a global rotation by δ the three orientation indices shift together: l_k → (l_k + δ) mod L. The only rotationally-invariant quantities are the two relative angles
Δl12 = (l2 - l1) mod L Δl13 = (l3 - l1) mod L
The forward matrix (shape [L^3, L^2]) maps the flat (l1, l2, l3) index to the flat (Δl12, Δl13) index with weight 1/L:
output[Δl12, Δl13] = (1/L) Σ_{l1} input[l1, (l1+Δl12)%L, (l1+Δl13)%L]
The transpose matrix (shape [L^2, L^3], weight L·tmpᵀ) is the pseudo- inverse used by the
repeat=Truepath to reconstruct a full […, L, L, L] tensor from the […, L, L] isotropic representation.
- calc_fft_ang_orient(norient, nharm, imaginary)[source]#
Build projection matrices for the angular-FFT reduction of S3/S4.
Unlike the tensor-product
_fft_2_orient/_fft_3_orientmatrices (which apply independent 1-D FFTs on each orientation axis), these matrices first reindex (l1, l2) → (Δl, l1) and then project the l1 axis onto the Fourier basis, keeping the Δl (relative-orientation) axis intact.Results#
- _fft_ang2_orient[(norient, nharm, imaginary)]shape [L*L, L*nout]
Maps S3[l1, l2] (flat [L²]) → out[Δl, k] (flat [L*nout]) where Δl = (l2-l1) % L and k indexes the Fourier basis on l1.
- _fft_ang3_orient[(norient, nharm, imaginary)]shape [L*L*L, L*L*nout]
Maps S4[l1, l2, l3] (flat [L³]) → out[Δl12, Δl13, k] (flat [L²*nout]) where Δl12 = (l2-l1)%L, Δl13 = (l3-l1)%L.