File Exchange

## Wigner3j symbol

version 1.1 (2.01 KB) by

Wigner3j( J123, M123) calculates the Wigner 3j symbol.

Updated

Wigner3j( J123, M123) calculates the Wigner 3j-symbol according to Racah formula.
The Wigner 3j symbol is useful for multiplication of Spherical Harmonics (and their generalizations) and for addition of angular momentum.
The are related to the Clebsch-Gordan coefficients by:
Wigner3j( J123, M123 ) = <J1,J2,M1,M2| J1,J2,J3,-M3> * (-1)^(J1-J2-M3) * (2*J3+1)^(-1/2).
This function is not limited to the factorial limitation (170), so it can be useful for any value of J.

kai chen

### kai chen (view profile)

thanks, it's the best code for wigner 3j symbol!

jx m

### jx m (view profile)

thanks ，very generous for share

Woojun

Amos

### Amos (view profile)

Does exactly what I need. Thanks!

Barratt Park

### Barratt Park (view profile)

Instead of returning zero when the triangle rule abs(j1-j2)<=j3<=(j1+j2) or the projection addition rule m1+m2=m3, this program instead returns an error message. In my opinion this is not how a Three-J script should work, since many programers will want to apply a Three-J even in cases where it is trivially zero. The script should be modified to return zero when the Three-J is trivially equal to zero.

Brice DUBOST

### Brice DUBOST (view profile)

Please replace "m3 does not match m1 + m2" and the triangle condition by returning 0 instead of an error message

Bruno Masiero

On line 35, to the check if m1+m2 = m3, you should use:

m1 + m2 - m3 ~= 0

cheers