sympy/sympy — pull request #1297 by flacjacket (2012-05-14 12:30:49+00:00)
Title: Add 'doit' option to represent for Rotation operator

All the big changes is spin.py are moving the coupling/uncoupling code down below the spin states the only real changes are spin.pyL590 and the new tests.

Passing doit=True as an option to represent allows the evaluation of the Rotation operator matrix elements, rather than returning a matrix of Wigner D functions. For example:

```
In [3]: represent(Rotation(0, pi/2, 0))
Out[3]:
⎡ 1/2 ⎛π⎞ 1/2 ⎛π⎞ ⎤
⎢d ⎜─⎟ d ⎜─⎟ ⎥
⎢ 1/2,1/2⎝2⎠ 1/2,-1/2⎝2⎠ ⎥
⎢ ⎥
⎢ 1/2 ⎛π⎞ 1/2 ⎛π⎞⎥
⎢d ⎜─⎟ d ⎜─⎟⎥
⎣ -1/2,1/2⎝2⎠ -1/2,-1/2⎝2⎠⎦

In [4]: represent(Rotation(0, pi/2, 0), doit=True)
Out[4]:
⎡ ___ ___⎤
⎢╲╱ 2 -╲╱ 2 ⎥
⎢───── ──────⎥
⎢ 2 2 ⎥
⎢ ⎥
⎢ ___ ___ ⎥
⎢╲╱ 2 ╲╱ 2 ⎥
⎢───── ───── ⎥
⎣ 2 2 ⎦
```