SphericalHarmonicY
SphericalHarmonicY[l, m, θ, ϕ] gives the spherical harmonic Ylm(θ,ϕ).
Examples
SphericalHarmonicY[2, 1, θ, ϕ]
(* -1/2 Sqrt[15/(2 π)] Cos[θ] Sin[θ] E^(I ϕ) *)SphericalHarmonicY[1, 0, Pi/4, 0]
(* Sqrt[3/(4 π)] Cos[Pi/4] *)Please visit the official Wolfram Language Reference for more details.