On Fri, Jun 17, 2011 at 10:11 AM, Brian Granger <[email protected]> wrote: > Ondrej, > > On Thu, Jun 16, 2011 at 11:12 PM, Ondrej Certik <[email protected]> > wrote: >> On Thu, Jun 16, 2011 at 9:27 PM, Brian Granger <[email protected]> wrote: >>> Sean, >>> >>> Here are some notes I sent to you earlier in the summer. The points >>> made here are quite important.. >>> >>> So there are some things you should know about the Wigner D matrix: >>> >>> * While I implemented it, I have 0 confidence that the current >>> implementation is free of bugs. Because of this, one of the first >>> tasks should be to test this part of the code extensively, both for >>> numerical and symbolic arguments. >>> >>> I would test the D and d matrix code thoroughly *before* moving on to >>> anything else. It would be great to see a pull request for that. >>> >>> * The current method of computing the D matrix is not optimal. This >>> is because we probably want to use a different form for the integer >>> and half integer spin values. This is to get the canonical forms >>> where, for 1/2 integer spins there are things like sin(theta/2) and >>> cos(theta/2), but for integer spins, sin(theta) and cos(theta) appear. >>> This should be implemented and then tested extensively. >>> >>> This will also help in testing and comparing to the tables in Varsh. >>> >>> * Let's use the convention of Varshalovich for the D-matrices. He >>> follows the convention of most of the other main people in the field >>> (see Table 4.2 for a list). >>> >>> * We should use his convention for Euler angles as well. >>> >>> * Because of the intimate relationship between CG, Wigner 3j6j, etc >>> and the rotation matrices, we probably want to have a symbolic DMatrix >>> class that we can use when we are representing various sum and >>> integrals symbolically. This should be separate from the rotation >>> matrix operator and should be in the same category object as the GC >>> and Wigner symbols. This will allow us to implement all of the >>> symmetry relationships that D satisfies as well. >>> >>> * Currently I have implemented one of the differential representations >>> of d(J,m,m') from section 4.3.2. I think that is probably OK for >>> integer spin, but for half integer spins we should use one of the >>> formulas from section 4.3.1 that are a sum over k. >> >> >> Brian, Sean, I think that we should have a WignerD class, that will >> behave just like this: >> >> http://reference.wolfram.com/mathematica/ref/WignerD.html > > I am +1 on this with one exception. I think that it should be > symbolic and not return the actual function be default. This way we > can use this class in a symbolic manner when manipulating various > kinds of sums and integrals. This mean that the class would have a > method that returns the actual representation in terms of cos(), > sin().
Yes, that's what I had in mind. All these functions (like spherical harmonics, Legendre polynomials, ...) should be both symbolic and the actual result. I think we might be able to use the eval=False option when constructing the class, so that it plays well with the sympy machinery. In any case, this is easy to fix. The hard part is to actually calculate the correct result. Sean, did you make any progress? I did. Attached find the working version of the Wigner small d function. See the comments in the function -- I have found some wrong equations in Varshalovich (or my understanding of them is wrong). But I have figured out the right ones, see the comments, and I have checked them with the tables in Varshalovich, and it agrees, both for general beta, and for beta=pi/2. My function returns the trigonometric expressions in the form sin(a*beta/2), while Varshalovich uses powers of sin(beta/2). But they are equivalent. If you run the script, it prints the tables, so you can directly compare it to Varshalovich. Sean, can you compare the speed of evaluation for general beta, using Brian+your fix, versus my implementation? Let's use the one, which is faster. Ondrej -- 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.
a.py
Description: Binary data
