Skip to content
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

Issue with Look-up of Wigner6J Table #42

Closed
pbanner opened this issue Mar 30, 2020 · 3 comments
Closed

Issue with Look-up of Wigner6J Table #42

pbanner opened this issue Mar 30, 2020 · 3 comments
Assignees

Comments

@pbanner
Copy link

pbanner commented Mar 30, 2020

The calculation of 6-J symbols in the wigner module includes a look-up table that appears to make assumptions that certain inputs are integers, though they need not be. Thus many symbols, such as wigner.Wigner6j(1/2,1/2,1,2,1,3/2), will throw errors as those inputs are not integers. Specifically, line 215,

return wignerPrecal6j[j1,
                      2 + j1 - J3,
                      int(roundPy2(2 + 2*(j3-j1))),
                      int(roundPy2(2 + 2*(J1-J3))),
                      J2 - 1,
                      int(roundPy2(2 * j2))],

throws the error.

@nikolasibalic nikolasibalic self-assigned this Mar 30, 2020
@nikolasibalic
Copy link
Owner

nikolasibalic commented Mar 30, 2020

Hi @pbanner

Thank you for issue submission. I have run

from arc import *
print(wigner.Wigner6j(0.5,0.5,1,2,1,1.5))

and have got

0.28867513459481287

I get same when I run wigner.Wigner6j(1/2,1/2,1,2,1,3/2) (note that this is same only on Python 3.*, in Python 2 division is assumed to be integer and this would render to wigner.Wigner6j(0,0,1,2,1,1) throwing error that symbol is not triangular).

Line 215 should not be the problem since there is a condition before in line 211

abs(roundPy2(j1)-j1) < 0.1

that should evaluate to False for your test case, forcing module not to use pre calculated look-up table. So I am bit confused why you see the error.

@pbanner could you please let me know which Python you are using, on which OS, and share complete error trace that Python returns? Also could you please confirm that you are running latest ARC.

@pbanner
Copy link
Author

pbanner commented Mar 30, 2020 via email

@nikolasibalic
Copy link
Owner

Hi Patrick,

Great, thank you! And don't hesitate to submit issue if you encounter any problems of even if you have question. With complicated programs like this, input from users is irreplaceable for tracking down all edge cases.

Best wishes,
Nikola

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants