computing christoffel symbols



Thomas,

Try this:

load(ctensor);
depends([a,b],[t,r]);
ct_coords:[t,r,O,P];
lg:ident(4);
lg[1,1]:-exp(2*a);
lg[2,2]:exp(2*b);
lg[3,3]:r^2;
lg[4,4]:r^2*sin(O)^2;
cmetric();
ug;
christof(mcs);


The function ct_coordsys is useful when you are building a metric from
coordinate transformation functions, but that's not what you are doing; you
have a metric, so you just need to build a metric tensor. Since your metric
is diagonal, I find it convenient to start with the unit matrix ident(4),
and then modify the diagonal elements.

Note the correct syntax for the power-of operator (^, not ^^; ^^ is used for
matrices) and correct operator precedence (a^b*c is NOT the same as
a^(b*c)). Further, note that Maxima's indexing convention for various
objects may differ from what other people are using (for instance, Maxima's
index ordering for Gamma's is a cyclical permutation of the index ordering
used in your colleague's session.)

Here's the above, in an actual Maxima session:

(%i1) load(ctensor);
(%o1)          /usr/share/maxima/5.12.0/share/tensor/ctensor.mac
(%i2) depends([a,b],[t,r]);
(%o2)                         [a(t, r), b(t, r)]
(%i3) ct_coords:[t,r,O,P];
(%o3)                            [t, r, O, P]
(%i4) lg:ident(4);
                                [ 1  0  0  0 ]
                                [            ]
                                [ 0  1  0  0 ]
(%o4)                           [            ]
                                [ 0  0  1  0 ]
                                [            ]
                                [ 0  0  0  1 ]
(%i5) lg[1,1]:-exp(2*a);
                                        2 a
(%o5)                               - %e
(%i6) lg[2,2]:exp(2*b);
                                       2 b
(%o6)                                %e
(%i7) lg[3,3]:r^2;
                                       2
(%o7)                                 r
(%i8) lg[4,4]:r^2*sin(O)^2;
                                   2    2
(%o8)                             r  sin (O)
(%i9) cmetric();
(%o9)                                done
(%i10) ug;
                    [     - 2 a                          ]
                    [ - %e          0     0       0      ]
                    [                                    ]
                    [              - 2 b                 ]
                    [     0      %e       0       0      ]
                    [                                    ]
                    [                     1              ]
(%o10)              [     0         0     --      0      ]
                    [                      2             ]
                    [                     r              ]
                    [                                    ]
                    [                             1      ]
                    [     0         0     0   ---------- ]
                    [                          2    2    ]
                    [                         r  sin (O) ]
(%i11) christof(mcs);
                                             da
(%t11)                          mcs        = --
                                   1, 1, 1   dt

                                       da   2 a - 2 b
(%t12)                    mcs        = -- %e
                             1, 1, 2   dr

                                             da
(%t13)                          mcs        = --
                                   1, 2, 1   dr

                                             db
(%t14)                          mcs        = --
                                   1, 2, 2   dt

                                         2 b - 2 a db
(%t15)                    mcs        = %e          --
                             2, 2, 1               dt

                                             db
(%t16)                          mcs        = --
                                   2, 2, 2   dr

                                             1
(%t17)                          mcs        = -
                                   2, 3, 3   r

                                             1
(%t18)                          mcs        = -
                                   2, 4, 4   r

                                            - 2 b
(%t19)                     mcs        = - %e      r
                              3, 3, 2

                                           cos(O)
(%t20)                        mcs        = ------
                                 3, 4, 4   sin(O)

                                        - 2 b      2
(%t21)                 mcs        = - %e      r sin (O)
                          4, 4, 2

(%t22)                   mcs        = - cos(O) sin(O)
                            4, 4, 3

(%o22)                               done


Viktor



 

-----Original Message-----
From: Thomas Widlar [mailto:twidlar at yahoo.com] 
Sent: Wednesday, September 05, 2007 5:28 PM
Cc: maxima at math.utexas.edu; vttoth at vttoth.com
Subject: computing christoffel symbols

My colleague computed the Christoffel symbols to verify the calculations 
given in Sean Carroll's book by using Maxima matrices.  His session is 
in the attachment.

I wanted to do the samr thing using the tensor package. It seemed it 
would only take a few lines.

load("ctensor");
depends([alpha,beta], [t,r]);
ct_coordsys([-%e^^2*alpha,%e^^2*b,r^^2,r^^2*(sin(theta))^^2]);
cmetric();
lg:trigsimp(lg);
ug:trigsimp(ug);
christof();

I am told
(%i5) cmetric();
  Division by 0#0: cmetric(dis=[])(ctensor.mac line 310) -- an error.  
To debug this try debugmode(true);

(%i6) lg;
(%o6) matrix([0,0,0],[0,0,0],[0,0,0])

(%i7) ug;
(%o7) matrix([1,0,0],[0,1,0],[0,0,1])

So obviously I don't know what I am doing.

1. How should I do it?
2. How did he get that nice output of the WxMaxima session?
3. He said he got the Greek letters by simply puting in their names 
without a preceding %.  That didn't work for me? Is there a trick?

Thanks