Conversion Between the Cartesian and Spherical Bases

The spherical harmonics of a particular rank are covariant components of an irreducible tensor. This can be used to find the prescription for converting between the spherical and Cartesian bases.
This loads the package with coordinate systems. (Quiet suppresses some shadowing warnings that will occur if the ADM package is already loaded.)
In[1]:=
Click for copyable input
Here are the spherical harmonics of rank 1 in terms of the angular coordinates and .
In[2]:=
Click for copyable input
Out[2]=
Here are rules for converting the angular coordinates to Cartesian coordinates.
In[3]:=
Click for copyable input
Out[3]=
The spherical harmonics in terms of Cartesian coordinates, with a new normalization.
In[4]:=
Click for copyable input
Out[4]=
The spherical harmonics are still in the spherical basis, but they are written in terms of the coordinates x, y, and z. To put them in the Cartesian basis, we want to find a linear (unitary) transformation whose result transforms like a Cartesian vector, i.e., like {x, y, z}.
Find a unitary matrix that transforms the spherical harmonics to {x, y, z}.
In[5]:=
Click for copyable input
Out[5]//MatrixForm=
The ADM package has functions that use this matrix to convert between the spherical and Cartesian bases.
ToCovariant[expr]convert expr to a covariant spherical tensor
ToContravariant[expr]convert expr to a contravariant spherical tensor
ToCartesian[expr]convert expr to Cartesian basis

Converting between standard and Cartesian bases.

Load the ADM package.
In[6]:=
Click for copyable input
Convert the Cartesian components of a vector to covariant spherical components.
In[7]:=
Click for copyable input
Out[7]//MatrixForm=
Convert to contravariant spherical components.
In[8]:=
Click for copyable input
Out[8]//MatrixForm=
ToCartesian converts either set back to Cartesian components.
In[9]:=
Click for copyable input
Out[9]=
Convert the rank-1 spherical harmonics to the Cartesian basis.
In[10]:=
Click for copyable input
Out[10]=
Plot them. They clearly will transform like the Cartesian basis vectors.
In[11]:=
Click for copyable input
Out[11]=
The conversion functions also work on vectors whose components are operators.
Use WignerEckart to obtain the covariant spherical components of the angular-momentum operator for a j=1/2 state.
In[12]:=
Click for copyable input
Out[12]//MatrixForm=
Convert to the Cartesian basis.
In[13]:=
Click for copyable input
Out[13]=