-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Spin x/y/z bases representation #431
Conversation
Hi Sean, thanks for the pull request! Can you rebase it on top of the latest master? It can't be merged currently. |
Test results html report: http://pastehtml.com/view/axdgv94h2.html Automatic review by sympy-bot. |
I didn't fully clean up the rebase, I updated the file and it should be fine now |
Test results html report: http://pastehtml.com/view/axdktb5eu.html Automatic review by sympy-bot. |
This should clear up the doctest error, but I'm not sure, since I can't reproduce it. |
result = exp(-I*m*alpha)*exp(-I*mp*gamma) | ||
result *= cls.d(j, m, mp, beta) | ||
return result | ||
|
||
@classmethod | ||
def d(cls, j, m, mp, beta): | ||
"""Wigner's lowercase d function.""" | ||
"""Wigner small-d function.i |
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.
What's this 'i', in the end of the sentence?
That last commit should address all the points that have been addressed so far, with the exception of the testing of D/d/rewrite, which will come in a later pull request. |
One more thing. In the docstrings you are using uppercase J, M, etc., but in the code we use the more common lowercase j, m. Can you update the docstrings to use lowercase letters for j, m? |
Use the Wigner D-function to define the represent function for spin states which allows for statesof any j and m values to be represented as vectors in the new basis. Implementation of rewrite, which is used to write states in terms of different basis is improved to work for all j and m values and for changing to any basis, not just to z. This utilizes the represent function. Changed the InnerProduct evaluation logic to use the represent functions allowing for innerproducts to be evaluated between any spin states.
Test results html report: http://pastehtml.com/view/ay1bpv44i.html Automatic review by sympy-bot. |
Spin x/y/z bases representation
This looks good to me (doctests are there, all tests pass), I merged it in. Thanks! |
Provides improved functionality in moving between Jx, Jy and Jz spin bases. Implements logic for using represent, rewrite and InnerProducts between arbitrary states in any basis. See the docstrings for usage. Also implements some tests and documentation for things in the spin module. Let me know if you have any questions or comments.
Note that there are still bugs in the Rotation.d function that will effect results from this work, see [1]. Some of the cases that need to be resolved are in an XFAIL test.
[1] http://code.google.com/p/sympy/issues/detail?id=2423