Quantum mechanical angular momemtum.
Wigner D operator in terms of Euler angles.
Defines the rotation operator in terms of the Euler angles defined by the zyz convention for a passive transformation. That is the coordinate axes are rotated first about the zaxis, giving the new x’y’z’ axes. Then this new coordinate system is rotated about the new y’axis, giving new x’‘y’‘z’’ axes. Then this new coordinate system is rotated about the z’‘axis. Conventions follow those laid out in [R422].
Parameters :  alpha : Number, Symbol
beta : Number, Symbol
gamma : Number, Symbol


References
[R422]  (1, 2) Varshalovich, D A, Quantum Theory of Angular Momentum. 1988. 
Examples
A simple example rotation operator:
>>> from sympy import pi
>>> from sympy.physics.quantum.spin import Rotation
>>> Rotation(pi, 0, pi/2)
R(pi,0,pi/2)
With symbolic Euler angles and calculating the inverse rotation operator:
>>> from sympy import symbols
>>> a, b, c = symbols('a b c')
>>> Rotation(a, b, c)
R(a,b,c)
>>> Rotation(a, b, c).inverse()
R(c,b,a)
Wigner Dfunction.
Returns an instance of the WignerD class corresponding to the WignerD function specified by the parameters.
Parameters :  j : Number
m : Number
mp : Number
alpha : Number, Symbol
beta : Number, Symbol
gamma : Number, Symbol


See also
Examples
Return the WignerD matrix element for a defined rotation, both numerical and symbolic:
>>> from sympy.physics.quantum.spin import Rotation
>>> from sympy import pi, symbols
>>> alpha, beta, gamma = symbols('alpha beta gamma')
>>> Rotation.D(1, 1, 0,pi, pi/2,pi)
WignerD(1, 1, 0, pi, pi/2, pi)
Wigner smalld function.
Returns an instance of the WignerD class corresponding to the WignerD function specified by the parameters with the alpha and gamma angles given as 0.
Parameters :  j : Number
m : Number
mp : Number
beta : Number, Symbol


See also
Examples
Return the WignerD matrix element for a defined rotation, both numerical and symbolic:
>>> from sympy.physics.quantum.spin import Rotation
>>> from sympy import pi, symbols
>>> beta = symbols('beta')
>>> Rotation.d(1, 1, 0, pi/2)
WignerD(1, 1, 0, 0, pi/2, 0)
WignerD function
The Wigner Dfunction gives the matrix elements of the rotation operator in the jmrepresentation. For the Euler angles \(\alpha\), \(\beta\), \(\gamma\), the Dfunction is defined such that:
Where the rotation operator is as defined by the Rotation class [R423].
The Wigner Dfunction defined in this way gives:
Where d is the Wigner smalld function, which is given by Rotation.d.
The Wigner smalld function gives the component of the Wigner Dfunction that is determined by the second Euler angle. That is the Wigner Dfunction is:
Where d is the smalld function. The Wigner Dfunction is given by Rotation.D.
Note that to evaluate the Dfunction, the j, m and mp parameters must be integer or half integer numbers.
Parameters :  j : Number
m : Number
mp : Number
alpha : Number, Symbol
beta : Number, Symbol
gamma : Number, Symbol


See also
References
[R423]  (1, 2) Varshalovich, D A, Quantum Theory of Angular Momentum. 1988. 
Examples
Evaluate the WignerD matrix elements of a simple rotation:
>>> from sympy.physics.quantum.spin import Rotation
>>> from sympy import pi
>>> rot = Rotation.D(1, 1, 0, pi, pi/2, 0)
>>> rot
WignerD(1, 1, 0, pi, pi/2, 0)
>>> rot.doit()
sqrt(2)/2
Evaluate the Wignerd matrix elements of a simple rotation
>>> rot = Rotation.d(1, 1, 0, pi/2)
>>> rot
WignerD(1, 1, 0, 0, pi/2, 0)
>>> rot.doit()
sqrt(2)/2
Eigenket of Jx.
See JzKet for the usage of spin eigenstates.
See also
Eigenbra of Jx.
See JzKet for the usage of spin eigenstates.
See also
Eigenket of Jy.
See JzKet for the usage of spin eigenstates.
See also
Eigenbra of Jy.
See JzKet for the usage of spin eigenstates.
See also
Eigenket of Jz.
Spin state which is an eigenstate of the Jz operator. Uncoupled states, that is states representing the interaction of multiple separate spin states, are defined as a tensor product of states.
Parameters :  j : Number, Symbol
m : Number, Symbol


See also
Examples
Normal States:
Defining simple spin states, both numerical and symbolic:
>>> from sympy.physics.quantum.spin import JzKet, JxKet
>>> from sympy import symbols
>>> JzKet(1, 0)
1,0>
>>> j, m = symbols('j m')
>>> JzKet(j, m)
j,m>
Rewriting the JzKet in terms of eigenkets of the Jx operator: Note: that the resulting eigenstates are JxKet’s
>>> JzKet(1,1).rewrite("Jx")
1,1>/2  sqrt(2)*1,0>/2 + 1,1>/2
Get the vector representation of a state in terms of the basis elements of the Jx operator:
>>> from sympy.physics.quantum.represent import represent
>>> from sympy.physics.quantum.spin import Jx, Jz
>>> represent(JzKet(1,1), basis=Jx)
Matrix([
[ 1/2],
[sqrt(2)/2],
[ 1/2]])
Apply innerproducts between states:
>>> from sympy.physics.quantum.innerproduct import InnerProduct
>>> from sympy.physics.quantum.spin import JxBra
>>> i = InnerProduct(JxBra(1,1), JzKet(1,1))
>>> i
<1,11,1>
>>> i.doit()
1/2
Uncoupled States:
Define an uncoupled state as a TensorProduct between two Jz eigenkets:
>>> from sympy.physics.quantum.tensorproduct import TensorProduct
>>> j1,m1,j2,m2 = symbols('j1 m1 j2 m2')
>>> TensorProduct(JzKet(1,0), JzKet(1,1))
1,0>x1,1>
>>> TensorProduct(JzKet(j1,m1), JzKet(j2,m2))
j1,m1>xj2,m2>
A TensorProduct can be rewritten, in which case the eigenstates that make up the tensor product is rewritten to the new basis:
>>> TensorProduct(JzKet(1,1),JxKet(1,1)).rewrite('Jz')
1,1>x1,1>/2 + sqrt(2)*1,1>x1,0>/2 + 1,1>x1,1>/2
The represent method for TensorProduct’s gives the vector representation of the state. Note that the state in the product basis is the equivalent of the tensor product of the vector representation of the component eigenstates:
>>> represent(TensorProduct(JzKet(1,0),JzKet(1,1)))
Matrix([
[0],
[0],
[0],
[1],
[0],
[0],
[0],
[0],
[0]])
>>> represent(TensorProduct(JzKet(1,1),JxKet(1,1)), basis=Jz)
Matrix([
[ 1/2],
[sqrt(2)/2],
[ 1/2],
[ 0],
[ 0],
[ 0],
[ 0],
[ 0],
[ 0]])
Eigenbra of Jz.
See the JzKet for the usage of spin eigenstates.
See also
Coupled eigenket of Jx.
See JzKetCoupled for the usage of coupled spin eigenstates.
See also
Coupled eigenbra of Jx.
See JzKetCoupled for the usage of coupled spin eigenstates.
See also
Coupled eigenket of Jy.
See JzKetCoupled for the usage of coupled spin eigenstates.
See also
Coupled eigenbra of Jy.
See JzKetCoupled for the usage of coupled spin eigenstates.
See also
Coupled eigenket of Jz
Spin state that is an eigenket of Jz which represents the coupling of separate spin spaces.
The arguments for creating instances of JzKetCoupled are j, m, jn and an optional jcoupling argument. The j and m options are the total angular momentum quantum numbers, as used for normal states (e.g. JzKet).
The other required parameter in jn, which is a tuple defining the \(j_n\) angular momentum quantum numbers of the product spaces. So for example, if a state represented the coupling of the product basis state \(j_1,m_1\rangle\timesj_2,m_2\rangle\), the jn for this state would be (j1,j2).
The final option is jcoupling, which is used to define how the spaces specified by jn are coupled, which includes both the order these spaces are coupled together and the quantum numbers that arise from these couplings. The jcoupling parameter itself is a list of lists, such that each of the sublists defines a single coupling between the spin spaces. If there are N coupled angular momentum spaces, that is jn has N elements, then there must be N1 sublists. Each of these sublists making up the jcoupling parameter have length 3. The first two elements are the indicies of the product spaces that are considered to be coupled together. For example, if we want to couple \(j_1\) and \(j_4\), the indicies would be 1 and 4. If a state has already been coupled, it is referenced by the smallest index that is coupled, so if \(j_2\) and \(j_4\) has already been coupled to some \(j_{24}\), then this value can be coupled by referencing it with index 2. The final element of the sublist is the quantum number of the coupled state. So putting everything together, into a valid sublist for jcoupling, if \(j_1\) and \(j_2\) are coupled to an angular momentum space with quantum number \(j_{12}\) with the value j12, the sublist would be (1,2,j12), N1 of these sublists are used in the list for jcoupling.
Note the jcoupling parameter is optional, if it is not specified, the default coupling is taken. This default value is to coupled the spaces in order and take the quantum number of the coupling to be the maximum value. For example, if the spin spaces are \(j_1\), \(j_2\), \(j_3\), \(j_4\), then the default coupling couples \(j_1\) and \(j_2\) to \(j_{12}=j_1+j_2\), then, \(j_{12}\) and \(j_3\) are coupled to \(j_{123}=j_{12}+j_3\), and finally \(j_{123}\) and \(j_4\) to \(j=j_{123}+j_4\). The jcoupling value that would correspond to this is:
((1,2,j1+j2),(1,3,j1+j2+j3))
Parameters :  args : tuple


See also
Examples
Defining simple spin states, both numerical and symbolic:
>>> from sympy.physics.quantum.spin import JzKetCoupled
>>> from sympy import symbols
>>> JzKetCoupled(1, 0, (1, 1))
1,0,j1=1,j2=1>
>>> j, m, j1, j2 = symbols('j m j1 j2')
>>> JzKetCoupled(j, m, (j1, j2))
j,m,j1=j1,j2=j2>
Defining coupled spin states for more than 2 coupled spaces with various coupling parameters:
>>> JzKetCoupled(2, 1, (1, 1, 1))
2,1,j1=1,j2=1,j3=1,j(1,2)=2>
>>> JzKetCoupled(2, 1, (1, 1, 1), ((1,2,2),(1,3,2)) )
2,1,j1=1,j2=1,j3=1,j(1,2)=2>
>>> JzKetCoupled(2, 1, (1, 1, 1), ((2,3,1),(1,2,2)) )
2,1,j1=1,j2=1,j3=1,j(2,3)=1>
Rewriting the JzKetCoupled in terms of eigenkets of the Jx operator: Note: that the resulting eigenstates are JxKetCoupled
>>> JzKetCoupled(1,1,(1,1)).rewrite("Jx")
1,1,j1=1,j2=1>/2  sqrt(2)*1,0,j1=1,j2=1>/2 + 1,1,j1=1,j2=1>/2
The rewrite method can be used to convert a coupled state to an uncoupled state. This is done by passing coupled=False to the rewrite function:
>>> JzKetCoupled(1, 0, (1, 1)).rewrite('Jz', coupled=False)
sqrt(2)*1,1>x1,1>/2 + sqrt(2)*1,1>x1,1>/2
Get the vector representation of a state in terms of the basis elements of the Jx operator:
>>> from sympy.physics.quantum.represent import represent
>>> from sympy.physics.quantum.spin import Jx
>>> from sympy import S
>>> represent(JzKetCoupled(1,1,(S(1)/2,S(1)/2)), basis=Jx)
Matrix([
[ 0],
[ 1/2],
[sqrt(2)/2],
[ 1/2]])
Coupled eigenbra of Jz.
See the JzKetCoupled for the usage of coupled spin eigenstates.
See also
Couple a tensor product of spin states
This function can be used to couple an uncoupled tensor product of spin states. All of the eigenstates to be coupled must be of the same class. It will return a linear combination of eigenstates that are subclasses of CoupledSpinState determined by ClebschGordan angular momentum coupling coefficients.
Parameters :  expr : Expr
jcoupling_list : list or tuple


Examples
Couple a tensor product of numerical states for two spaces:
>>> from sympy.physics.quantum.spin import JzKet, couple
>>> from sympy.physics.quantum.tensorproduct import TensorProduct
>>> couple(TensorProduct(JzKet(1,0), JzKet(1,1)))
sqrt(2)*1,1,j1=1,j2=1>/2 + sqrt(2)*2,1,j1=1,j2=1>/2
Numerical coupling of three spaces using the default coupling method, i.e. first and second spaces couple, then this couples to the third space:
>>> couple(TensorProduct(JzKet(1,1), JzKet(1,1), JzKet(1,0)))
sqrt(6)*2,2,j1=1,j2=1,j3=1,j(1,2)=2>/3 + sqrt(3)*3,2,j1=1,j2=1,j3=1,j(1,2)=2>/3
Perform this same coupling, but we define the coupling to first couple the first and third spaces:
>>> couple(TensorProduct(JzKet(1,1), JzKet(1,1), JzKet(1,0)), ((1,3),(1,2)) )
sqrt(2)*2,2,j1=1,j2=1,j3=1,j(1,3)=1>/2  sqrt(6)*2,2,j1=1,j2=1,j3=1,j(1,3)=2>/6 + sqrt(3)*3,2,j1=1,j2=1,j3=1,j(1,3)=2>/3
Couple a tensor product of symbolic states:
>>> from sympy import symbols
>>> j1,m1,j2,m2 = symbols('j1 m1 j2 m2')
>>> couple(TensorProduct(JzKet(j1,m1), JzKet(j2,m2)))
Sum(CG(j1, m1, j2, m2, j, m1 + m2)*j,m1 + m2,j1=j1,j2=j2>, (j, m1 + m2, j1 + j2))
Uncouple a coupled spin state
Gives the uncoupled representation of a coupled spin state. Arguments must be either a spin state that is a subclass of CoupledSpinState or a spin state that is a subclass of SpinState and an array giving the j values of the spaces that are to be coupled
Parameters :  expr : Expr
jn : list or tuple
jcoupling_list : list or tuple


Examples
Uncouple a numerical state using a CoupledSpinState state:
>>> from sympy.physics.quantum.spin import JzKetCoupled, uncouple
>>> from sympy import S
>>> uncouple(JzKetCoupled(1, 0, (S(1)/2, S(1)/2)))
sqrt(2)*1/2,1/2>x1/2,1/2>/2 + sqrt(2)*1/2,1/2>x1/2,1/2>/2
Perform the same calculation using a SpinState state:
>>> from sympy.physics.quantum.spin import JzKet
>>> uncouple(JzKet(1, 0), (S(1)/2, S(1)/2))
sqrt(2)*1/2,1/2>x1/2,1/2>/2 + sqrt(2)*1/2,1/2>x1/2,1/2>/2
Uncouple a numerical state of three coupled spaces using a CoupledSpinState state:
>>> uncouple(JzKetCoupled(1, 1, (1, 1, 1), ((1,3,1),(1,2,1)) ))
1,1>x1,1>x1,1>/2  1,0>x1,0>x1,1>/2 + 1,1>x1,0>x1,0>/2  1,1>x1,1>x1,1>/2
Perform the same calculation using a SpinState state:
>>> uncouple(JzKet(1, 1), (1, 1, 1), ((1,3,1),(1,2,1)) )
1,1>x1,1>x1,1>/2  1,0>x1,0>x1,1>/2 + 1,1>x1,0>x1,0>/2  1,1>x1,1>x1,1>/2
Uncouple a symbolic state using a CoupledSpinState state:
>>> from sympy import symbols
>>> j,m,j1,j2 = symbols('j m j1 j2')
>>> uncouple(JzKetCoupled(j, m, (j1, j2)))
Sum(CG(j1, m1, j2, m2, j, m)*j1,m1>xj2,m2>, (m1, j1, j1), (m2, j2, j2))
Perform the same calculation using a SpinState state
>>> uncouple(JzKet(j, m), (j1, j2))
Sum(CG(j1, m1, j2, m2, j, m)*j1,m1>xj2,m2>, (m1, j1, j1), (m2, j2, j2))