ctensor
is a component tensor manipulation package. component tensor manipulation means that geometrical tensor objects are represented as arrays or matrices. tensor operations such as contraction or covariant differentiation are carried out by actually summing over repeated (dummy) indices with do statements. that is, one explicitly performs operations on the appropriate tensor components stored in an array or matrix
to use the ctensor
package, type load(ctensor)
. to begin an interactive session with ctensor
, type csetup()
. you are first asked to specify the dimension of the manifold. if the dimension is 2, 3 or 4 then the list of coordinates defaults to [x,y]
, [x,y,z]
or [x,y,z,t]
respectively. these names may be changed by assigning a new list of coordinates to the variable ct_coords
and the user is queried about this. next, the user enters the metric - either directly or from a file by specifying its ordinal position. the metric is stored in the matrix lg
. the metric inverse is computed and stored in the matrix ug
when a metric base is used, ctensor
can compute the following tensors:
lg -- ug \ \ lcs -- mcs -- ric -- uric \ \ \ \ tracer - ein -- lein \ riem -- lriem -- weyl \ uriem
ctensor
can also work using moving frames. when cframe_flag
is set to true
, the following tensors can be calculated:lfg -- ufg \ fri -- fr -- lcs -- mcs -- lriem -- ric -- uric \ | \ \ \ lg -- ug | weyl tracer - ein -- lein |\ | riem | \uriem
symbol dim coordinates -------------------------------------------- cartesian2d 2 [x,y] polar 2 [r,phi] elliptic 2 [u,v] confocalelliptic 2 [u,v] bipolar 2 [u,v] parabolic 2 [u,v] cartesian3d 3 [x,y,z] polarcylindrical 3 [r,theta,z] ellipticcylindrical 3 [u,v,z] confocalellipsoidal 3 [u,v,w] bipolarcylindrical 3 [u,v,z] paraboliccylindrical 3 [u,v,z] paraboloidal 3 [u,v,phi] conical 3 [u,v,w] toroidal 3 [phi,u,v] spherical 3 [r,theta,phi] oblatespheroidal 3 [u,v,phi] oblatespheroidalsqrt 3 [u,v,phi] prolatespheroidal 3 [u,v,phi] prolatespheroidalsqrt 3 [u,v,phi] ellipsoidal 3 [r,theta,phi] cartesian4d 4 [x,y,z,t] spherical4d 4 [r,theta,eta,phi] exteriorschwarzschild 4 [t,r,theta,phi] interiorschwarzschild 4 [t,z,u,v] kerr_newman 4 [t,r,theta,phi] ---------------------------------------------
cframe_flag
is false
, the function computes the inverse metric ug from the (user-defined) matrix lg. the metric determinant is also computed and stored in the variable gdet
. furthermore, the package determines if the metric is diagonal and sets the value of diagmetric
accordingly. if the optional argument dis
is present and not equal to false
, the user is prompted to see the metric inversecframe_flag
is true
, the function expects that the values of fri (the inverse frame matrix) and lfg (the frame metric) are defined. from these, the frame matrix fr and the inverse frame metric ufg are computed false
then the display of the elements will not occurtrue
, then the non-zero components are displayed true
, then these mixed components, uric[i,j] (the index i is covariant and the index j is contravariant), will be displayed directly. otherwise, ricci(false) will simply compute the entries of the array uric[i,j] without displaying the results true
, then the non-zero values of the mixed Einstein tensor ein[i,j] will be displayed where j is the contravariant index. the variable rateinstein will cause the rational simplification on these components. if ratfac is true
then the components will also be factored true
, then the non-zero values of the covariant Einstein tensor are displayed true
, unique non-zero values are displayedtrue
, the covariant Riemann tensor is computed directly from the frame field coefficients. otherwise, the (3,1) Riemann tensor is computed firsttrue
, the non-zero components weyl[i,j,k,l] will be displayed to the user. otherwise, these components will simply be computed and stored. if the switch ratweyl is set to true
, then the components will be rationally simplified; if ratfac is true
then the results will be factored as well/* calculation of params for S³-space */ kill (all) ; r[1] : a * sin (theta[3]) ; r[2] : a * cos (theta[3]) ; x : r[1] * cos (theta[1]) ; y : r[1] * sin (theta[1]) ; z : r[2] * cos (theta[2]) ; w : r[2] * sin (theta[2]) ; X : [x,y,z,w] ; g[i,j] := trigsimp (diff (X, theta[i]) . diff (X, theta[j])) ; lg : genmatrix (g,3,3,1,1) ; ug : invert (lg) ; load (ctensor) ; dim : 3 ; ct_coords : [theta[1],theta[2],theta[3]] ; christof (lcs) ; christof (mcs) ; ricci (1) ; riemann (1) ;
load (ctensor) ; ct_coordsys ([ r*cos(theta)*cos(phi) , r*cos(theta)*sin(phi) , r*sin(theta) , [r,theta,phi] ]) ; lg:trigsimp (lg) ; ct_coords ; dim ;
load (ctensor) $ depends ([a, b], [t, r]) $ ct_coords : [t, r, A, 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(A)^2 $ cmetric() $ ug $ christof (mcs) ; christof (lcs)