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_coeffs
torch.Tensor Master spectrum
a_lm, shape(..., (L+1)**2)(packedc = l*l + l + m, theharmonicsconvention). May carry leading batch dims that broadcast againstpattern_coeffs.- pattern_coeffs
torch.Tensor Pattern spectrum
b_lm, shape(..., (L+1)**2). The leading dims are the batch of patterns (many indexed at once).- bandwidth
int The band limit
L; both spectra must have(L+1)**2slots.- wigner_d_cached
torch.Tensor,optional A precomputed Wigner-d block
wigner_d(L, beta)for this bandwidth’s SOFTbetagrid, shape(N, L+1, 2L+1, 2L+1)withN = 2L + 2(seede_ebsd.index.spherical.wigner.wigner_d()). ThisO(L^4)block is otherwise rebuilt on every call; pass it to reuse one block across a mini-batched scan (SphericalIndexercaches it in__init__). The result is byte-identical to omitting it, provided the cached block matches this bandwidth’sbetagrid and the real dtype used here (float64for complex128 spectra, elsefloat32).
- master_coeffs
- Returns:
torch.TensorReal tensor
Cof shape(*batch, N, N, N)withN = 2L + 2, sampled on theso3_grid()(alpha, beta, gamma)grid (axes in that order), wherebatchis the broadcast of the two inputs’ leading dims.argmaxgives the best-matching orientation index; feed it togrid_to_rotation(). Differentiable in both spectra.