moble / SphericalFunctions.jl

Spherical functions of arbitrary float types
MIT License
9 stars 2 forks source link

`D_iterator` is tranposed compared to what documentation implies #41

Open ariaradick opened 2 months ago

ariaradick commented 2 months ago

According to the documentation for D_iterator, the D^ell matrices that result from this should be indexed D^{ell}[ell+mp+1, ell+m+1], however comparing with D[WignerDindex(ell,mp,m)] (where D is the full D vector), it appears that they are tranposed from one another, and the D^ell matrices actually correspond to D^{ell}[ell+m+1, ell+mp+1]

r = cos(π/6) + sin(π/6)*imy
D = D_matrices(r, 1)
d1 = [D[WignerDindex(1,mp,m)] for mp in -1:1, m in -1:1] # indexed how the documentation states, d1[ell+mp+1, ell+m+1]
d2 = zeros(ComplexF64, (3,3))
for (l,d) in zip(1:1, D_iterator(D,1,1))
    d2[:] = d[:]
end

d1 == d2 # returns false
d1 == transpose(d2) # returns true, showing that they are transposes of each other