Function Repository Resource:

SolidHarmonicR

Source Notebook

Evaluate the regular solid harmonic function

Contributed by: Jan Mangaldan

ResourceFunction["SolidHarmonicR"][l,m,x,y,z]

gives the regular solid harmonic .

Details

Mathematical function, suitable for both symbolic and numerical manipulation.
Explicit polynomials are given when possible.
The regular solid harmonic is a homogeneous polynomial that satisfies Laplace's partial differential equation.
For certain special arguments, ResourceFunction["SolidHarmonicR"] automatically evaluates to exact values.
ResourceFunction["SolidHarmonicR"] can be evaluated to arbitrary numerical precision.
ResourceFunction["SolidHarmonicR"] automatically threads over lists.

Examples

Basic Examples (2) 

Evaluate symbolically:

In[1]:=
ResourceFunction["SolidHarmonicR"][3, 1, x, y, z]
Out[1]=

Plot over a subset of the reals:

In[2]:=
Plot[ResourceFunction["SolidHarmonicR"][2, 1, x, 0, -x], {x, -5, 5}]
Out[2]=

Scope (3) 

Evaluate to high precision:

In[3]:=
N[ResourceFunction["SolidHarmonicR"][4, 3, 12/25, 16/25, 3/5], 30]
Out[3]=

The precision of the output tracks the precision of the input:

In[4]:=
ResourceFunction[
 "SolidHarmonicR"][4, 3, 12/25, 16/25, 0.600000000000000000000000]
Out[4]=

SolidHarmonicR threads elementwise over lists:

In[5]:=
ResourceFunction["SolidHarmonicR"][2, {-1, 0, 1}, x, y, z]
Out[5]=

Applications (1) 

Plot a real linear combination of regular solid harmonics:

In[6]:=
With[{l = 4, m = 2},
 ContourPlot3D[
  Evaluate[I/Sqrt[
    2] ((-1)^(m + 1)
        ResourceFunction["SolidHarmonicR"][l, m, x, y, z] + ResourceFunction["SolidHarmonicR"][l, -m, x, y, z])],
  {x, -3, 3}, {y, -3, 3}, {z, -3, 3}]]
Out[6]=

Properties and Relations (3) 

The regular solid harmonic satisfies the Laplace equation:

In[7]:=
Laplacian[
  ResourceFunction["SolidHarmonicR"][4, 2, x, y, z], {x, y, z}] // Simplify
Out[7]=

SolidHarmonicR uses Racah's normalization:

In[8]:=
With[{l = 4, m = -3},
  \!\(
\*SubsuperscriptBox[\(\[Integral]\), \(0\), \(\[Pi]\)]\(
\*SubsuperscriptBox[\(\[Integral]\), \(0\), \(2  \[Pi]\)]Conjugate[\*
InterpretationBox[
TagBox[
FrameBox[
PaneBox[GridBox[{
{
StyleBox[
StyleBox[
AdjustmentBox["\<\"[\[FilledSmallSquare]]\"\>",
BoxBaselineShift->-0.25,
BoxMargins->{{0, 0}, {-1, -1}}], "ResourceFunctionIcon",
FontColor->RGBColor[
                  0.8745098039215686, 0.2784313725490196, 0.03137254901960784]],
ShowStringCharacters->False,
FontFamily->"Source Sans Pro Black",
FontSize->0.65 Inherited,
FontWeight->"Heavy",
PrivateFontOptions->{"OperatorSubstitution"->False}], 
StyleBox[
RowBox[{
StyleBox["\<\"SolidHarmonicR\"\>", "ResourceFunctionLabel"], " "}],
ShowAutoStyles->False,
ShowStringCharacters->False,
FontSize->0.9 Inherited,
FontColor->GrayLevel[0.1]]}
},
GridBoxSpacings->{"Columns" -> {{0.25}}}],
Alignment->Left,
BaseStyle->{LineSpacing -> {0, 0}, LineBreakWithin -> False},
BaselinePosition->Baseline,
FrameMargins->{{3, 0}, {0, 0}}],
Background->RGBColor[0.968627, 0.976471, 0.984314],
BaselinePosition->Baseline,
DefaultBaseStyle->{},
FrameMargins->{{0, 0}, {1, 1}},
FrameStyle->RGBColor[0.831373, 0.847059, 0.85098],
RoundingRadius->4],
{"FunctionResourceBox", 
RGBColor[0.8745098039215686, 0.2784313725490196, 0.03137254901960784],
            "\"SolidHarmonicR\""},
TagBoxNote->"FunctionResourceBox"],
ResourceFunction["SolidHarmonicR"],
BoxID -> "SolidHarmonicR",
Selectable->False][l, m, Sin[\[Theta]] Cos[\[Phi]], Sin[\[Theta]] Sin[\[Phi]], Cos[\[Theta]]]] \*
InterpretationBox[
TagBox[
FrameBox[
PaneBox[GridBox[{
{
StyleBox[
StyleBox[
AdjustmentBox["\<\"[\[FilledSmallSquare]]\"\>",
BoxBaselineShift->-0.25,
BoxMargins->{{0, 0}, {-1, -1}}], "ResourceFunctionIcon",
FontColor->RGBColor[
                 0.8745098039215686, 0.2784313725490196, 0.03137254901960784]],
ShowStringCharacters->False,
FontFamily->"Source Sans Pro Black",
FontSize->0.65 Inherited,
FontWeight->"Heavy",
PrivateFontOptions->{"OperatorSubstitution"->False}], 
StyleBox[
RowBox[{
StyleBox["\<\"SolidHarmonicR\"\>", "ResourceFunctionLabel"], " "}],
ShowAutoStyles->False,
ShowStringCharacters->False,
FontSize->0.9 Inherited,
FontColor->GrayLevel[0.1]]}
},
GridBoxSpacings->{"Columns" -> {{0.25}}}],
Alignment->Left,
BaseStyle->{LineSpacing -> {0, 0}, LineBreakWithin -> False},
BaselinePosition->Baseline,
FrameMargins->{{3, 0}, {0, 0}}],
Background->RGBColor[0.968627, 0.976471, 0.984314],
BaselinePosition->Baseline,
DefaultBaseStyle->{},
FrameMargins->{{0, 0}, {1, 1}},
FrameStyle->RGBColor[0.831373, 0.847059, 0.85098],
RoundingRadius->4],
{"FunctionResourceBox", 
RGBColor[0.8745098039215686, 0.2784313725490196, 0.03137254901960784],
           "\"SolidHarmonicR\""},
TagBoxNote->"FunctionResourceBox"],
ResourceFunction["SolidHarmonicR"],
BoxID -> "SolidHarmonicR",
Selectable->False][l, m, Sin[\[Theta]] Cos[\[Phi]], Sin[\[Theta]] Sin[\[Phi]], Cos[\[Theta]]] Sin[\[Theta]] \[DifferentialD]\[Phi] \
\[DifferentialD]\[Theta]\)\) == (4 \[Pi])/(2 l + 1)] // Simplify
Out[8]=

SolidHarmonicR can be expressed in terms of SphericalHarmonicY:

In[9]:=
With[{l = 4, m = 2},
   ResourceFunction["SolidHarmonicR"][l, m, x, y, z] == Sqrt[(4 \[Pi])/(2 l + 1)] (x^2 + y^2 + z^2)^(l/2)
      SphericalHarmonicY[l, m, ArcCos[z/Sqrt[x^2 + y^2 + z^2]], ArcTan[x, y]]] // ExpToTrig // Simplify
Out[9]=

Version History

  • 1.0.0 – 22 January 2021

Source Metadata

Related Resources

License Information