#### Previous topic

scipy.special.lpmv

#### Next topic

scipy.special.clpmn

# scipy.special.sph_harm

`scipy.special.``sph_harm`(m, n, theta, phi) = <ufunc 'sph_harm'>

  Compute spherical harmonics.

  \[Y^m_n(\theta,\phi) = \sqrt{\frac{2n+1}{4\pi}\frac{(n-m)!}{(n+m)!}} e^{i m \theta} P^m_n(\cos(\phi))\]

  Parameters: | m : int `|m| <= n`; the order of the harmonic. n : int where n >= 0; the degree of the harmonic. This is often called `l` (lower case L) in descriptions of spherical harmonics. theta : float [0, 2*pi]; the azimuthal (longitudinal) coordinate. phi : float [0, pi]; the polar (colatitudinal) coordinate.
  Returns: | y_mn : complex float The harmonic \(Y^m_n\) sampled at theta and phi

  Notes

  There are different conventions for the meaning of input arguments theta and phi. We take theta to be the azimuthal angle and phi to be the polar angle. It is common to see the opposite convention - that is theta as the polar angle and phi as the azimuthal angle.

  References

  [R289] | Digital Library of Mathematical Functions, 14.30. http://dlmf.nist.gov/14.30