In Mathematica's documentation, the Spherical Harmonics are said to be defined as follows, for $l \geq 0$:

enter image description here

Furthermore, we know that $\cos(x)=\cos(-x)$, hence one can be led to believe that $Y_l^m(-\theta,\phi)=Y_l^m(\theta,\phi)$.

A quick check with mathematica shows us that might not be the case

Table[Table[{SphericalHarmonicY[l, m, -(\[Pi]/2), 0], 
   SphericalHarmonicY[l, m, \[Pi]/2, 0]}, {m, -l, l}], {l, 0, 2}]

enter image description here

as the $l=1=m$ values differ.

Am I doing something wrong? Does the value of $\theta$ need to be in the canonical range $[0,\pi]$. If so, how do I relate $-\frac{\pi}{2}$ to something in that range. The formulae I know allow me to relate it to $\frac{3\pi}{2}$, which is still outside the range.

  • $\begingroup$ Indeed, something weird is going on: Simplify[Table[SphericalHarmonicY[l, m, th, ph] == Sqrt[(2 l + 1)/(4 Pi)] (Sqrt[Gamma[l - m + 1]]/Sqrt[Gamma[l + m + 1]]) Exp[I ph m] LegendreP[l, m, 2, Cos[th]], {l, 0, 2}, {m, -l, l}], 0 <= th <= Pi && 0 <= ph <= 2 Pi] $\endgroup$ Commented Jan 6, 2021 at 18:51
  • $\begingroup$ @J.M. That remaining equation is an identity under the conditions you specified though, isn't it? At least, the lhs does evaluate to $0$ for all positive values of th. That's more a failure of plain Simplify than of the definitions. Indeed, if you change to FullSimplify, and add ComplexExpand as a TransformationFunction (which should be ok, since variables are real), then all results are True. Or am I missing something else? $\endgroup$
    – MarcoB
    Commented Jan 6, 2021 at 20:07
  • $\begingroup$ @J.M. What is this fourth argument in LegendreP ? The documentation allows only 3. And why the extra phase factor? Are the Gamma functions doing something under the hood, as for integer arguments, they are equvalent to factorials. $\endgroup$ Commented Jan 6, 2021 at 21:28
  • $\begingroup$ @Thunder, the extra argument in LegendreP[] modifies the branch cut convention of the Legendre function used. Please have a look at the docs for more details, but in brief, the discrepancy apparently happens since we are using "type 2" Legendre functions. $\endgroup$ Commented Jan 8, 2021 at 4:43
  • $\begingroup$ @Marco, ah you are right! Things work out when I change one of the conditions to 0 < th <= Pi. $\endgroup$ Commented Jan 8, 2021 at 4:48

2 Answers 2


The definition with Cos[phi]is a bit misleading. Consider e.g.

SphericalHarmonicY [1,1,phi,theta] == ... LegendreP[1,1,Cos[phi]] ..

Now the associated Legendre Polynomial LegendreP[1,1,x]is defined by:

LegendreP[1, 1, x] == -Sqrt[1 - x^2]


LegendreP[1,1,Cos[phi]] ==  -Sqrt[1 - Cos[phi]^2] ==  -Sqrt[Sin[phi]^2] == -Sin[phi]

Therefore, we get for the full blown function:

SphericalHarmonicY [1,1,[phi],theta] == [![enter image description here][1]][1]

  • $\begingroup$ Ok, you are making a choice of sign for the square root, which is ok if you are on $0\leq \theta\leq \pi$. And I guess the definition in terms of Associated Legendre Polynomials is probably only defined on the standard range of coordinates on $S^2$. How do I then transform my $-\frac{\pi}{2}$ Spherical harmonic to one in that range? $\endgroup$ Commented Jan 7, 2021 at 12:14
  • $\begingroup$ What do you think about taking the absolute value of -Pi/2 and add Pi tp ϕ? $\endgroup$ Commented Jan 7, 2021 at 12:48
  • $\begingroup$ I guess that should work. Does it work for any values of $\theta$ and $\phi$? $\endgroup$ Commented Jan 7, 2021 at 13:14
  • $\begingroup$ You would have to ask Wolfram for this. $\endgroup$ Commented Jan 7, 2021 at 13:19
  • 1
    $\begingroup$ @Thunder, as you might have already noticed, if you use the explicit definition of the spherical harmonics that uses "type-2" Legendre functions, for l = m = 1, there is a dangling factor of $\frac{\cos \theta-1}{\sqrt{1-\cos\theta}}$. The result you were expecting would be valid if the "type 1" Legendre function, LegendreP[l, m, 1, Cos[th]], had been used instead. $\endgroup$ Commented Jan 8, 2021 at 4:54

The parity transform $P$ is conventionally defined as total coordinate inversion with respect to the origin. Thats a bit misleading, because in even dimensions the inversion has $\det = 1$ and is a rotation, see e.g. $\mathbb R^2$.

So its better to define parity by a mirror operation on a hyperplane, that has $\det = -1$ in any dimension, changing the sign of a single vector direction only.

On the 2-sphere, this may be the mirroring on the equatorial plane $$z= r \cos \theta \to -z = - r \cos \theta$$,

that is $\theta \to \pi -\theta$.

The complete inversion is an additional rotation by $\pm \pi$ around the $z$-axis. This sends any point on the sphere to it antipodal point.

So the parity in in the Hilbert space over the sphere in spherical coordinates is conventionally tied to the sign of

$$e^{i m \phi}\ L_m^n(\cos \theta) \to e^{i m( \phi + \pi )} L_m^n(-\cos \theta)$$


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.