spherharm

Spherical harmonics, tesseral harmonics.

Syntax
y = spherharm(L,M,theta,phi)
y = spherharm(L,M,theta,phi,'r')
Description

spherharm returns the value of the normalized spherical harmonic [eqn] with non-negative integer L and |M| ≤ L. The Condon-Shortley phase (-1)M is included.

theta is the angle down from the z axis (colatitude), and phi is the counterclockwise angle off the x axis in the xy plane (longitude). Both angles are in radians. theta and phi can be scalars or alternatively arrays of the same size.

If 'r', real-valued spherical harmonics are evaluated. These are linear combinations of the complex-valued spherical harmonics. Their signs are defined such that they give nonnegative values near theta=0 and phi=0 for all L and M. For the expressions, see below. Real-valued spherical harmonics are also called tesseral harmonics, those with L==M are called sectorial harmonics, and those with M=0 are called zonal harmonics.

Examples

Plot the dependence on theta of the axial spherical harmonics with L = 7 and M = 0:

theta = linspace(0,pi);
phi = zeros(size(theta));
v = spherharm(7,0,theta,phi);
plot(theta,v);

Plot a real-values spherical harmonic as a color map over the unit sphere:

L = 4;
M = 2;
[x,y,z] = sphere(100);
[phi,theta] = vec2ang(x,y,z);
Y = spherharm(L,M,theta,phi,'r');
surf(x,y,z,Y);
axis equal tight
shading interp
Algorithm

spherharm computes the complex-valued spherical harmonics according to the expression

[eqn]

with the Condon-Shortley phase factor [eqn] and the associated Legendre polynomial [eqn] computed by plegendre. In this expression, the associated Legendre polynomial itself does not include the Condon-Shortley phase.

The real-valued spherical harmonics are computed as follows. For M>0

[eqn]

(without the first factor for M=0), and for M<0

[eqn]

These expressions do not include the Condon-Shortley phase, also not in the associated Legendre polynomials.

Both the set of complex spherical harmonics and the set of real-valued spherical harmonics defined by the above expressions are orthonormal sets.

See also

clebschgordan, plegendre, wigner3j, wigner6j, wignerd