if J == 0: // Y^0 is angularly independent, choose any angle
return spherical_harmonics(0, 123, 321) // [m]
else: // insert zeros for Y^J with J!=0
return 0
else: // not at the origin, sample spherical harmonic
alpha, beta = x_to_alpha_beta([x, y, z])
return spherical_harmonics(J, alpha, beta) // [m]
After Change
:param xyz: tensor of shape [A, 3]
:return: tensor of shape [m, A]
if not isinstance(order, list):
order = [order]
with torch_default_dtype(torch.float64):
alpha, beta = x_to_alpha_beta(xyz) // two tensors of shape [A]
out = spherical_harmonics(order, alpha, beta) // [m, A]