-
Notifications
You must be signed in to change notification settings - Fork 26
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Comments in code indicate that the following is possibly a more "textbook" implementation of real_sph_harmonic. Discuss with @janden and either make this the default, or discard altogether:
@staticmethod
def real_sph_harmonic2(j, m, theta, phi):
# TODO: This needs to be made the default implementation of real_sph_harmonic
# Get the real basis of spherical harmonics in terms of their complex analogues
# Note that sph_harm reverses the notation of theta/phi
# 0.707106 = 1/sqrt(2)
y_m_l = sph_harm(m, j, phi, theta)
if m == 0:
result = y_m_l
else:
y_minus_m_l = sph_harm(-m, j, phi, theta)
if m < 0:
result = 0.707106j * (y_m_l - (-1)**m * y_minus_m_l)
else:
result = 0.707106 * (y_minus_m_l + (-1)**m * y_m_l)
return np.real(result)
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working