Open 0382 opened 1 year ago
Thanks a lot for sharing this! It does look quite a bit faster indeed, I'll dig deeper to see how I could use the same algorithm here!
How far have you validated the coefficients though? I tried your code on the example in issue #7 (i.e. wigner.f3j(2*100, 2*300, 2*285, 2*2, 2*-2, 0)
), and the result is -0.0
instead of the expected 0.001979165708981953
.
For smaller j1/j2/j3 values, everything seems fine.
It seems that my code makes something wrong. Thank you for the test, I will check it.
I have debugged my code, and find the problem comes from vary large float numbers multiply overflow to Inf. I will not fix this, because my code is just designed for fast numeric calculation, and the large J is not a common angular momentum in real world physical system. I also test the GSL library, which also does also not give the right result. The algorithm in your code is better for large J. Thanks again for your test.
Sounds good! I'll add your code to the set of benchmarks in this repo as well.
It seems that you just want float result, then https://github.com/0382/WignerSymbol is a faster implementation.
A simple benchmark code