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

Spin x/y/z bases representation #431

Merged
merged 1 commit into from
Jun 23, 2011
Merged

Conversation

flacjacket
Copy link
Member

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

@certik
Copy link
Member

certik commented Jun 16, 2011

Hi Sean, thanks for the pull request! Can you rebase it on top of the latest master? It can't be merged currently.

@certik
Copy link
Member

certik commented Jun 16, 2011

Test results html report: http://pastehtml.com/view/axdgv94h2.html

Automatic review by sympy-bot.

@flacjacket
Copy link
Member Author

I didn't fully clean up the rebase, I updated the file and it should be fine now

@certik
Copy link
Member

certik commented Jun 16, 2011

Test results html report: http://pastehtml.com/view/axdktb5eu.html

Automatic review by sympy-bot.

@flacjacket
Copy link
Member Author

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
Copy link
Contributor

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?

@flacjacket
Copy link
Member Author

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.

@ellisonbg
Copy link
Member

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.
@certik
Copy link
Member

certik commented Jun 22, 2011

Test results html report: http://pastehtml.com/view/ay1bpv44i.html

Automatic review by sympy-bot.

certik added a commit that referenced this pull request Jun 23, 2011
Spin x/y/z bases representation
@certik certik merged commit 3d7f6d0 into sympy:master Jun 23, 2011
@certik
Copy link
Member

certik commented Jun 23, 2011

This looks good to me (doctests are there, all tests pass), I merged it in. Thanks!

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

Successfully merging this pull request may close these issues.

4 participants