Y(l,m) = (-1)^m sqrt((2l + 1) / (4 pi) (l - m)! / (l + m)!) * P(l,m) exp(i m phi) -- associated Legendre of cos theta (arxiv.org/abs/1805.12125) P(l,m,k) = test(m < 0, (-1)^m (l + m)! / (l - m)! P(l,-m), 2^(-m) sin(theta)^m sum(k,0,l - m, (-1)^k (l + m + k)! / (l - m - k)! / (m + k)! / k! * ((1 - cos(theta)) / 2)^k)) Y(0,0) Y(1,0) Y(1,1) Y(1,-1) Y(2,0) Y(2,1) Y(2,2) Y(2,-1) Y(2,-2) "Verify spherical harmonics" Lap(f) = 1/sin(theta) d(sin(theta) d(f,theta),theta) + 1/sin(theta)^2 d(f,phi,2) for(l,0,2,for(m,-l,l,check(-Lap(Y(l,m)) == l (l + 1) Y(l,m)))) "ok"
Run