Luthaf / wigners

Calculation of Wigner symbols and related constants
Apache License 2.0
8 stars 1 forks source link

Possible bug: wrong values for certain symbols #7

Closed ghost closed 1 year ago

ghost commented 1 year ago

Hi,

I was looking online for fast python implementations of the 3j symbols. My use of the 3j symbols comes from computations in spherical harmonics space, and as such, I'm computing the symbols for fixed m values (that depend on the spin of the spherical harmonics), and broad j values. Both m and j are integers in my cases.

As a test, I computed both in mathematica (quite slow compared to your given benchmark values) and with your package an array of w3j(j1 = 100, j2 = 300, J, m1 =2, m2 =-2, M =0) for integers J that cover all the angular momenta possible that is from 200 to 400.

I found that values of the symbols in your code can become very inaccurate, for example mathematica finds that

w3j_mathematica (J = 285) ~ 0.00198

while your code gives

w3j_wigners (J = 285) ~ 4374151.129938193

Would this be a bug that you would consider investigating ? I don't think I am using the code wrong since I find correct values for lots of other symbols.

Cheers, Alexandre

Luthaf commented 1 year ago

Hey! Thanks for opening an issue. In my line of work, I only need 3j symbols for j<20, and I only tested this package for values <100, so it is very likely that there could be an issue for larger j as you see here. I'll give it a look when I find time (I'm currently away for a couple of weeks)!

Luthaf commented 1 year ago

This should be fixed in the latest 0.3.0 release!