so3_cross_correlation#

de_ebsd.index.spherical.so3_cross_correlation(master_coeffs, pattern_coeffs, bandwidth, wigner_d_cached=None)[source]#

Cross-correlation of two harmonic spectra over all of SO(3), via SOFT.

Parameters:
master_coeffstorch.Tensor

Master spectrum a_lm, shape (..., (L+1)**2) (packed c = l*l + l + m, the harmonics convention). May carry leading batch dims that broadcast against pattern_coeffs.

pattern_coeffstorch.Tensor

Pattern spectrum b_lm, shape (..., (L+1)**2). The leading dims are the batch of patterns (many indexed at once).

bandwidthint

The band limit L; both spectra must have (L+1)**2 slots.

wigner_d_cachedtorch.Tensor, optional

A precomputed Wigner-d block wigner_d(L, beta) for this bandwidth’s SOFT beta grid, shape (N, L+1, 2L+1, 2L+1) with N = 2L + 2 (see de_ebsd.index.spherical.wigner.wigner_d()). This O(L^4) block is otherwise rebuilt on every call; pass it to reuse one block across a mini-batched scan (SphericalIndexer caches it in __init__). The result is byte-identical to omitting it, provided the cached block matches this bandwidth’s beta grid and the real dtype used here (float64 for complex128 spectra, else float32).

Returns:
torch.Tensor

Real tensor C of shape (*batch, N, N, N) with N = 2L + 2, sampled on the so3_grid() (alpha, beta, gamma) grid (axes in that order), where batch is the broadcast of the two inputs’ leading dims. argmax gives the best-matching orientation index; feed it to grid_to_rotation(). Differentiable in both spectra.