maxima for theoretical physics



On Oct. 5, Maurizio De Sanctis wrote:
------------------------------
> At least, is there a routine for the Clebsch-Gordan
         (or Wigner 3j) coefficients?
--------------------------------------
If you look in ..share/contrib/ there is a file
clebsch_gordon.mac, by Orignac, which
has routines for wigner3j , 6j, and 9j.
You need to copy this file into your
work folder to get it loaded easily.
I have not convinced myself that
the 3j routine is correct (I found
2/3 errors in a quick trial), but at
least you can play with it and see
what you can use.

----------------------------------------------
It is straightforward to code a (very
inefficient) clebsch gordon function
( which is useful for numerical args
only)
based on  A&S as shown in the
following:

---------------------------------
/* file clebsch.mac
   very  inefficient code using Abramowitz
    and Stegun, formula (27.9.1) with
    conditions following.
 */
   /* syntax:   c(j1,j2,j3,m1,m2,m3) for numerical args only   */

 /* examples:

(%i1) display2d:false$
(%i2) load(clebsch);
(%o2) "c:/work5/clebsch.mac"
(%i3) c(3/2,1/2,2,3/2,1/2,2);
(%o3) 1
(%i4) c(3/2,1/2,1,3/2,-1/2,1);
(%o4) sqrt(3)/2
(%i5) c(3/2,1/2,1,-1/2,1/2,0);
(%o5) -1/sqrt(2)

*/






 /* In _f1%, the max and min prevent the arguments of
    factorial (!) from becoming negative when the sum
   over k is performed. */


_f1%(C,A,B,a,b) := block ([k],
 sum ( (-1)^k* (k! * (A+B-C-k)! * (A-a-k)! * (B+b-k)! *
   (C-B+a+k)! * (C-A-b+k)!)^(-1),
  k, max (0,B-C-a,A-C+b), min (A+B-C,A-a,B+b) ))$


_f2% (C,A,B) := (-C + A + B)! * (C - A + B)! *
                   (C + A - B)! /(1 + C + A + B)! $

_f3% (C, A, B, c, a, b) :=
     (1 + 2*C) * (C-c)! * (C+c)! * (A-a)! *
         (A+a)! * (B-b)! * (B+b)! $



 c(j1,j2,j3,m1,m2,m3) :=

    ( if (m3 # m1+m2) or ( j3 < abs(j1 - j2)) or
    (j3 > j1 + j2) or   (abs(m1) > j1)  or
    (abs(m2) > j2) or (abs(m3) > j3) then 0
 else
  _f1% (j3,j1,j2,m1,m2) * sqrt( _f2% (j3,j1,j2)* _f3% (j3,j1,j2,m3,m1,m2) )) 
$

    ----------------------------------------
A more efficient code would be a good
contribution to Maxima.

Best Wishes,

Ted Woollett

http://www.csulb.edu/~woollett