-
Notifications
You must be signed in to change notification settings - Fork 88
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
Bugfix/wigner6j integer sum #148
Bugfix/wigner6j integer sum #148
Conversation
In addition, I added some code to detail which triads were failing the test. The text is added to the `msg` string with a single call to print if any of the tests fail. It would be nice to have some global verbosity flag to allow the user to turn on/off the message. Finally, I offer two error messages (coincidentally) of the same length.
No problems with the logic in the triangularity test. This commit just adds messaging in the same vein as the integer check.
return 0 for a 6j that violates triagularity return nan for a 6j with non-integer traid sum(s)
For consistency with prior code, suppress feedback on 6j triangularity and integer sum rule violations unless explicitly requested.
Hi @petermao thank you for your efforts on this update! Is there anything you want to add on this? From my side, we should just remove unreachable code (that raises error now after |
print(msg) | ||
return np.nan | ||
raise ValueError("6j-Symbol is undefined when any triad has a non-integer sum") | ||
raise ValueError("6j-Symbol is defined only when all triads have integer sums") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's remove unreachable code here (two raise statements after return)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will fix this in main after merging, before releasing new version.
Integer sum check in Wigner-6j code was not catching non-integer sums.
1b9eb26:
5a5b1d8: add similar messaging to triangularity test
b77b250: bypass errors by returning sensible values when tests fail (I acknowledge that the
nan
could be controversial)