Hi all,

In working on some stuff with spin states, I ran into some problems with the
current implementation of the Wigner small-d matrix, Rotation.d in
sympy.physics.quantum.spin. I had written methods to change bases using the
Wigner D-function [0] and in testing decided to try
>>>qapply(JzBra(1,1)*JzKet(1,1).rewrite('Jx'))
which should be 1, as the spin ket is rewritten in the Jx basis and then
back to the Jz basis to apply the innerproduct, but I have that it gives 0.
I traced this back to a bug in the Rotation.d function, which currently has
an open issue [1]. For the Wigner D-function and the small d-matrix, the
conventions laid out in Varshalovich "Quantum Theory of Angular Momentum".
It seems the d-matrix is fine for positive values of angle argument, but
does not obey the symmetry d(j,m,mp,-beta)=(-1)**(m-mp)*d(j,m,mp,beta) and
does not agree with the tables in Varshalovich. Those terms that fail for
the j=1 case are in an XFAIL test in my branch. What is odd is that when I
ran the equation used to define the d-matrix through Mathematica, I got
results that agreed with the sympy output, so the problem may be in the
equation and not a bug in the code. If anyone could take a look at that, I'd
appreciate it.

The function in question is the Rotation.D function, which is invoked as:
>>>Rotation.D(j, m, mp, alpha, beta, gamma)
where alpha, beta, gamma are the Euler angles of the rotation, expressed as
a passive transformation, and j,m,mp satisfy: <j,m|R(alpha,beta,gamma)|j,mp>
for the rotation operator R. The D-function invokes the small d-function,
which is done as:
>>>Rotation.d(j, m, mp, beta)


Another thing is even if the right values were given, my methods would not
give the right results. Comparing to [2], when I rewrite a Jx ket in the Jz
basis, it gives the wrong result, the signs on the terms that appear in
JzKet(1,0).rewrite("Jx") are switched. This is likely me messing up the
Euler angles or the invoking of the D-function. What is implemented is
rewrite, which rewrites states in terms of a new basis. For example, we
would expect:
>>>JzKet(1, 0).rewrite("Jx")
sqrt(2)/2*|1, 1>-sqrt(2)/2*|1, -1>
Note that the output kets are JxKet's, the printing of this is currently
ambiguous. Also in this is the ability to take innerproducts, such as:
>>>from sympy.physics.quantum.innerproduct import InnerProduct
>>>Innerproduct(JxBra(1,1), JzKet(1,0)).doit()
sqrt(2)/2*|1, 1>
Both of these functions, however, rely on represent, which gives the
transformed state as a vector in terms of the basis elements of the new
basis, so
>>>from sympy.physics.quantum.represent import represent
>>>represent(JzKet(1,0), basis=Jx)
[ sqrt(2)/2]
[         0]
[-sqrt(2)/2]
Represent invokes Note that the statement from
above, qapply(JzBra(1,1)*JzKet(1,1).rewrite('Jx')), qapply automatically
turns the multiplication into an innerproduct and evaluates it. Tomorrow
morning, I'll be putting in some docstrings to make the usage of this clear
and opening a pull request for this branch, any review as to the
implementation of the Wigner D-function would be a great help.

Let me know if you have any questions or see any issues. Thanks.

Sean

[0] https://github.com/flacjacket/sympy/tree/xyz_bases
[1] http://code.google.com/p/sympy/issues/detail?id=2423
[2]
http://www.chem.ucsb.edu/coursepages/11spring/226-Metiu/dl/115A%20Course%20Notes/Ch11_Angular_20Nov09.pdf
page
23

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sympy?hl=en.

Reply via email to