In certain applications, solid spherical harmonics can be very useful. They are essentially the usual, 'surface' spherical harmonics, with the appropriate power of the radius inserted:
$$S_l^m(x,y,z)=r^l Y_l^m(\theta,\phi).$$
They are particularly useful because, for integer $l$ and $m$, they are homogeneous polynomials of degree $l$ in $x$, $y$ and $z$, and do not therefore require any ugly square roots or inverse trigonometric functions. The first few such functions are as follows: $$ \begin{array}{ccc} \frac{1}{2 \sqrt{\pi }} & 0 & 0 \\ \frac{1}{2} \sqrt{\frac{3}{\pi }} z & -\frac{1}{2} \sqrt{\frac{3}{2 \pi }} (x+i y) & 0 \\ -\frac{1}{4} \sqrt{\frac{5}{\pi }} \left(x^2+y^2-2 z^2\right) & -\frac{1}{2} \sqrt{\frac{15}{2 \pi }} z (x+i y) & \frac{1}{4} \sqrt{\frac{15}{2 \pi }} (x+i y)^2 \\ \end{array} $$
More generally, though, it is useful to be able to implement a spherical harmonic when the natural input is the cartesian components of the argument.
Is this implemented in Mathematica? There is nothing very obvious at all in the documentation, though maybe it is hidden away in some third-party package. If there isn't a built-in function, is there some specific reason for that?
Edit: Since January 2021, the Wolfram Function Repository contains an implementation, which it calls SolidHarmonicR
.
SphericalHarmonicYr
or $Y_{L,m}$ rather than the standard built-in quantum spherical harmonicsSphericalHarmonicY
or $Y_L^m$ because they're useful for data which is purely real-valued. As an example of converting to Cartesian coordinates, one can doTable[FullSimplify[ SolidHarmonicRr[L, m, ##] & @@ CoordinateTransform["Cartesian" -> "Spherical", {x, y, z}], Assumptions -> Element[{x, y, z}, Reals]], {L, 0, 2}, {m, -L, L}]
. $\endgroup$ChebyshevT
when you first computeChebyshevT[60,x]
and then do%/.x->2.0/3
which gives an incorrect answer. So if you're doing numerics for high $L$ you may actually want to evaluate them in spherical coordinates (but again I haven't tested to see if this is necessary). $\endgroup$