-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wigner 3j returns 0s instead of actual input, but yields good inputs on permutation of the l's #1
Comments
The issue seems to be related to the algorithm itself, not this particular implementation. For such high quantum numbers, the classical region (where the solution to the recurrence relations are oscillatory) are quite large. There doesn't seem to be an easy around this. For the time being, I have implemented a temporary hack that simply determines which quantum number is the largest and uses that one as l1. Note that will not solve the problem when using There exists a similar algorithm in the literature that claims to remove the overflow problems associated with the Schulten+Gordon algorithm. I will try implementing it and see if this issue still appears.
|
Hi Joey, Thank you so much for your great work again! On Wed, Jul 16, 2014 at 2:56 PM, Joey Dumont [email protected]
|
That is correct. I will try to implement the new algorithm this week, but I am a little short on time. If you need such high quantum numbers, however, it might be worth looking into some approximation schemes or semiclassical results that might be applicable in your specific case. |
Hi Joey, Thanks a lot! On Wed, Jul 16, 2014 at 5:09 PM, Joey Dumont [email protected]
|
Hi Joey, Thanks a lot! On Wed, Jul 16, 2014 at 5:16 PM, Jeff Zheng [email protected] wrote:
|
Hi, I don't know of any specific numerical recipe, but you might these (and the references therein) useful. The first one might have some useful series approximations and such, while the others are more particular to the current algorithm, but may contain useful references.
|
… if the input was 0. It now returns 1 if the input is 0. Also changed the FORTRAN implementation to the original one and included the necessary dependencies. The d1mach and i1mach functions are not taken from SLATEC, however; they come from Algorithm 528 by P. Fox et al. It fixes the over/underflow issues caused by the original implementations.
It turns out that the problems were caused by the sgn() function. The vector function should now return proper values. |
Hi Joey, which I suppose the vector version should be Thanks a lot! On Fri, Jul 18, 2014 at 4:00 PM, Joey Dumont [email protected]
|
Since this is caused by another problem, I've opened up a new issue. See #2. |
Hi Joey, Thanks a lot! On Fri, Jul 18, 2014 at 6:27 PM, Joey Dumont [email protected]
|
I found some quite confusing bug where it returns 0 (where Mathematica returns non-zero). In all cases, the whole list of values for all l1 are 0 or -0. However, if I permute the 1,2,3 indices to say 2,3,1, I always get the correct answer. Here's one example:
[l1, l2, l3, m1, m2, m3] = [ 325 999 1221 280 899 -1179] Mathematica answer: 0.000163542255419
call (l1, l2, l3, m1, m2, m3): 0
call (l2, l3, m1, m2, m3): all 0's returned
call (l2, l3, l1, m2, m3, m1): 0.000163542255418
I appended more examples at the end. Would you mind take a quick look and see what is causing this? Since your code can clearly handle l numbers much larger than these, and it can return correct answer by just permuting the indices, my guess is that it is some benign bug?
More examples:
[ 693 896 1371 513 -838 325] 3.82641344761e-140 -0.0 0.0175918809377 3.82641344761e-140
[ 772 874 1231 442 756 -1198] 0.00171146251356 0.0 0.0 0.00171146251356
[ 842 996 1714 376 979 -1355] -9.12730017838e-14 -0.0 0.0 -9.12730017838e-14
[ 101 987 1084 -80 -935 1015] -0.00274486614091 -0.0 0.0 -0.00274486614091
[ 51 1003 978 -32 993 -961] -0.00561491486489 -0.0 0.0 -0.00561491486489
[ 217 1008 1107 -76 -987 1063] -0.00129163704248 -0.0 0.0 -0.00129163704248
[ 408 894 954 -114 -840 954] 0.000141186572123 0.0 0.0 0.000141186572123
[ 808 980 1734 341 954 -1295] -1.13581014918e-35 -0.0 0.0 -1.13581014918e-35
[ 827 1020 1570 590 902 -1492] -0.00091099434249 -0.0 0.0 -0.00091099434249
The text was updated successfully, but these errors were encountered: