I want to write these two Expressions in terms of spin-weighted spherical harmonics:
$\cos^{2}\theta\,\cos^{2}\phi - \sin^{2}\phi$
$\cos^{2}\theta\,\sin^{2}\phi - \cos^{2}\phi$
I've written this code to calculate them:
ClearAll["Global`*"]; (*Define the function of theta,phi*) f[theta_, phi_] := Sin[phi]^2 - Cos[theta]^2 Cos[phi]^2; (*We will project up to some maximum ell,say ell=2 for illustration*) lmax = 2; (*The coefficient a_{l,m} is the integral of f times the conjugate \ Y_{l}^m, integrated over all solid angle (theta from 0 to Pi,phi from \ 0 to 2Pi).*) coeff[l_, m_] := Integrate[ Conjugate[SphericalHarmonicY[l, m, theta, phi]] f[theta, phi] Sin[ theta], {theta, 0, Pi}, {phi, 0, 2 Pi}]; (*Build up the spherical-harmonic expansion by summing a_{l,m} \ Y_{l}^m.*) fExpanded = Sum[coeff[l, m] (SphericalHarmonicY[l, m, theta, phi] // TraditionalForm), {l, 0, lmax}, {m, -l, l}] // FullSimplify; fExpanded // FullSimplify I have used chatGPT o1 and Deepseek and also tried to calculate them manually using Table of spherical harmonics, and TAB.1 HERE, but neither of them works.
Is it even possible to do this?
I'd appreciate any help.
Edit:
note that, it's possible to use Real and Imaginary parts of $Y_{lm}$'s separately.
For example: $\sin^{2}{\theta}\cos{2\phi} \propto \Re[Y_{22}]$ and $\sin^{2}{\theta}\sin{2\phi} \propto \Im[Y_{22}]$
$\Big($as we know: $Y_{22} \propto \sin^{2}{\theta} \exp({2i\phi}) \Big)$
New Edit: New code with spin-weighted spherical harmonics:
ClearAll["Global`*"]; f[\[Theta]_, \[Phi]_] := Sin[\[Phi]]^2 - Cos[\[Theta]]^2 Cos[\[Phi]]^2; smax = 2; lmax = 2; coeff[s_, l_, m_] := Integrate[ Conjugate[ SpinWeightedSphericalHarmonicY[s, l, m, \[Theta], \[Phi]]] f[\[Theta], \[Phi]] Sin[\[Theta]], {\ \[Theta], 0, Pi}, {\[Phi], 0, 2 Pi}]; fExpanded = Sum[coeff[s, l, m] (SpinWeightedSphericalHarmonicY[s, l, m, \[Theta], \[Phi]]), {s, 0, smax}, {l, s, lmax}, {m, -l, l}]; fExpanded // FullSimplify
Y_{22}here. $\endgroup$