Skip to content

Commit 6f7e962

Browse files
committed
add the gaunt cross coefficients used for vector spherical addition and translation
1 parent 8eb743f commit 6f7e962

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

src/physics/special_functions.jl

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export sbesselj, shankelh1, diffsbessel, diffbessel
22
export diffbesselj, diffhankelh1, diffsbesselj, diffshankelh1, diff3sbesselj, diff2sbesselj, diff2shankelh1, diff3shankelh1
3-
export gaunt_coefficient
3+
export gaunt_coefficient, gaunt_cross_coefficient
44
export associated_legendre_indices, spherical_harmonics_indices, lm_to_spherical_harmonic_index
55

66
export complex_legendre_array
@@ -197,6 +197,18 @@ function gaunt_coefficient(T::Type{<:AbstractFloat},l1::Int,m1::Int,l2::Int,m2::
197197
end
198198
gaunt_coefficient(l1::Int,m1::Int,l2::Int,m2::Int,l3::Int,m3::Int) = gaunt_coefficient(Float64,l1,m1,l2,m2,l3,m3)
199199

200+
"""
201+
gaunt_cross_coefficient(l1,m1,l2,m2,l3,m3)
202+
203+
Similar to the Gaunt coefficient, but use for vector spherical harmonics, and specifically how one shear wave coverts to the other.
204+
"""
205+
function gaunt_cross_coefficient(T::Type{<:AbstractFloat},l1::Int,m1::Int,l2::Int,m2::Int,l3::Int,m3::Int)
206+
# note the wigner3j has only one convention, and is highly symmetric.
207+
return (one(T)*im)^(l2+l3-l1) * (-T(1))^m1 * sqrt(4pi*(2*l1+1)*(2*l2+1)*(2*l3+1)) *
208+
wigner3j(T,l1,l2,l3,1,-1,0) * wigner3j(T,l1,l2,l3,m1,-m2,-m3)
209+
end
210+
gaunt_cross_coefficient(l1::Int,m1::Int,l2::Int,m2::Int,l3::Int,m3::Int) = gaunt_cross_coefficient(Float64,l1,m1,l2,m2,l3,m3)
211+
200212
function lm_to_spherical_harmonic_index(l::Int,m::Int)::Int
201213
if l < abs(m)
202214
error("The order m of a spherical harmonic must be great or equal than the degree l.")

0 commit comments

Comments
 (0)