Maple Program

Riemann.mpl (v1.10)

  • General information

  • When you use this package, you have to prepare a coordinate name list 'varlist' and a metric 'ds2' expressed as an equation quadratic in the differential of the coordinate names. For example, for the Schwarzschild spacetime,

  • varlist:=[t, r, theta, phi],
  • ds2 := -(1-2*M/r)*dt^2+dr^2/(1-2*M/r)+r^2*(dtheta^2+dphi^2*sin(theta)^2)
  • Global variables

  • _u, _d : symbols representing the tensor index position.
  • FB : formal symbol for basis differential forms expressed in terms of the exterior product of 1-forms like FB[1], FB[2,3]=FB[2] ∧ FB[3], FB[dt,dr]=dt ∧ dr.
  • .
  • Common abbreviation

  • dim = the dimension of the space(time) under consideration.
  • T::tensor table = tensor T expressed by a table with
  • the entries specifying the value of components as T[1,2]=a ⇒ (1,2)=a,
  • the entry "indextype"=[_u,_d,...] specifying the index positions,
  • the entry specifying the space dimension, say "dim"=4.
  • When you read out the component values , you must first convert T to Array TA by
  • TA := Array(1..dim, ..., 1..dim, T)

  • Then, you can get the component value as TA[1,2]. This is because only the information on the components with non-vanishing values are left in the table obtained by type conversion from an Array.
  • varlist = a coordinate name list
  • dvarlist = the list of the differential of the coordinate names
  • ds2 = the metric expressed as an equation quadratic in dvarlist
  • Gdata = a table of the following set of geometric data:
  • (varlist, dim, metric, invmetric, Christoffel, Riem13, Riem04, Riem22, Weyl04, Ric02, Ric11, RS, ET02, ET11)

  • Here, "metric" and "invmetric" are the matrix representing the space metric and its inverse matrix, respectively. "Christoffel" refers to Ch:=Array(1..dim,1..dim, 1..dim) repsenting the Christoffel symbol (Levi-Civita connection coefficients). "Riem13", "Riem04" and "Riem22" represent the tensor tables corresponding to the (1,3)-type, (0,4)-type, and (2,2)-type expressions of the Riemann curvature tensor, respectively, and "Weyl04" means the tensor table for the Weyl tensor of the type (0,4). "Ric02" and "Ric11" represent the tensor tables of the Ricci tensors with index type (0,2) and (1,1), respectively. "ET02" and "ET11" are the tensor tables of the Einstein tensors, and "RS" is the scalar curvature. Each entry object can be referred to as, say, Gdata["dim"].
  • Central procedures

  • Riemann( varlist, ds2[, sw]) ⇒ Gdata
  • calculates the connection coefficients, Riemann curvature tensors, Weyl tensor, Ricci tensor, Ricci scalar and Einstein tensor for a given metric.
  • sw=0 ⇒ no simplification of results and no message (default)
  • sw=1 ⇒ no simplification with diplay of progress messages
  • sw=2 ⇒ simplified results with progress messages
  • For example,
  • Gdata:=Riemann( varlist, ds2 ); Riem13tbl:=Gdata["Riem13"]

  • gives the tensor table Riem13tlb for the (1,3)-type Riemann curvature tensor of the metrid ds2, and by the conversion
  • Riem13:=Array(1..dim,1..dim,1..dim,1..dim, Riem13tbl)

  • you can get the (a,b,c,d) component of the tensor as Riem13[a,b,c,d],
  • Printing procedures

  • The following are procedures to show the data in Gdata on the monitor.

  • printCh( Gdata ) ⇒ add(add(Ch[a,b,c]*dx[b]*dx[c],b=1..dim),c=1..dim)
  • printRiem( Gdata, Ttype ) ⇒ Riem04/Riem13/Riem22[*,*,*,*] ≠ 0
  • Ttype = "13", "04", "22"
  • printWeyl( Gdata ) ⇒ Weyl04[*,*,*,*] ≠ 0
  • printRic( Gdata, Ttype ) ⇒ Ric02/Ric11[*,*] ≠ 0
  • Ttype = "02", "11"
  • printET( Gdata, Ttype ) ⇒ ET02/ET11[*,*] ≠ 0
  • Ttype = "02", "11"
  • printTensor( T::tensor table ) ⇒ T[*,*,..] ≠ 0
  • displays all non-vanishing components of a given tensor table T of any type.
  • Special procedures

  • Kretschmann( Gdata ) ⇒ the Kretschmann invariant K
  • K=add(add(add(add(Riem22[a,b,c,d]*Riem22[c,d,a,b], a=1..dim), b=1..dim), c=1..dim), d=1..dim)
  • KretschmannS( Gdata ) ⇒ (K1,K2) [only for a static metric]
  • K1=4*add(add(Riem22[1,i,1,j]*Riem22[1,j,1,i],i=2..dim),j=2..dim)
  • K2=add(add(add(add(Riem22[i,j,k,l]*Riem22[k,l,i,j], i=2..dim), j=2..dim), k=2..dim), l=2..dim)
  • NPC( Gdata, NullTetrad[, sw] ) ⇒ NPCtbl [dim=4 only!!]
  • calculates the spin coefficients and the Newman-Penrose coefficients for the Weyl curvature and the Ricci curvature w.r.t. a given null frame in four space dimensions.
  • NullTetrad::list = [NB[1]=k_*, NB[2]=l_*, NB[3]=m_*, NB[4]=conjugate(m_*)]
  • where k, l, m, conjugate(m) are a linearly independent null 1-forms reprensenting a null tetrad normalized as g(k,k)=g(l,l)=g(m,m)=0, g(k.l)=-1, g(m,conjugate(m))=1.
  • NPCtbl= table(["SCNP"=SCNP, "WeylNP"=WeylNP, "RicNP"=RicNP, "NullTetrad"=NullTerad, "dim"=dim, "varlist"=varlist, "metric"=G])
  • where SCNP is a table of the NP spin coefficients which can be referred to as e.g. NPCtbl["SCNP"]["alpha"]. WeylNP is the NP coefficients Psi[0], .., Psi[4] for the Weyl tensor, referred to as NPCtbl["WeylNP"]["Psi[0]"]. RicNP is the NP coefficients Phi[0,0],...,Phi[2,2] for the Ricci tensor, referred to as NPCtbl["RicNP"]["Phi[0,0]"]
  • sw=0 ⇒ no output display
  • sw=1 ⇒ display the simplified Psi[*] and Phi[*,*]
  • General frame

  • CBtoFBT( T::tensor table, varlist, FormBasis[,sw] ) ⇒ T1::tensor table w.r.t. the frame specified by FormBasis
  • transforms the tensor T from the coord basis to a general basis.
  • T = a tensor table with components in the coordinate basis
  • FormBasis::list = [FB[1]=theta[1], ..., FB[dim]=theta[m]]
  • where theta[i]'s are linearly independent 1-forms defining a covector basis.
  • sw=0 ⇒ no simplification
  • sw=1 ⇒ simplification of the results
  • Connection and curvature forms

  • ConnectionForm( FormBasis::list, Gdata[, sw] ) ⇒ CFM=(omega[a,b])
  • calculates the matrix CFM whose component omega[a,b] is the connection form w.r.t. the FormBasis
  • FormBasis = [FB[1]=theta[1],..,FB[dim]=theta[dim]]
  • theta[a]= add(theta[a,mu]*dx[mu], mu=1..dim)
  • sw=0 ⇒ omega[a,b]=add(omega[a,b][mu]*dx[mu],mu=1..dim)
  • sw=1 ⇒ omega[a,b]=add(omega[a,b][c]*FB[c],c=1..dim)
  • RiemForm( FormBasis::list, Gdata[, sw] ) ⇒ RFM::Matrix=( RF[a,b])
  • calculates the curvature form RFa,b] w.r.t. the FormBasis
  • sw=0 ⇒ RF[a,b]=(1/2)add(add(Riem13[a,b mu nu]*FB[dx[mu],dx[nu]], mu=1..dim), nu=1..dim)
  • sw=1 ⇒ RF[a,b]=(1/2)add(add(Riem13[a,b c d]*FB[c,d],c=1..dim),d=1..dim)
  • where mu and nu refer to coordinate labels and a,b,c,d refer to frame labels of the FormBasis.
  • Covariant derivative of tensors

  • Covder( T,[a[1],...,a[n]], [b, c, ...], Gdata ) ⇒ (D_a[1] ... D_a[n] T)[b,c,,...]
  • calculates each component of the n-th covariant derivative of a tensor T.
  • T = a tensor table or a scalar
  • No simplification is applied.
  • CovDT( T:: tensor table, Gdata[, sw] ) ⇒ DT
  • constructs a tensor table DT correspoinding to the covariant derivative of the given tensor table T.
  • sw=0 ⇒ no simplification
  • sw=1 ⇒ simplification of the results
  • CovnDT( T::tensor table, n::positive integer, Gdata[, sw] ) ⇒ DnT
  • constructs a tensor table DnT correspoinding to the n-the covariant derivative of the given tensor table T.
  • sw=0 ⇒ no simplification
  • sw=1 ⇒ simplification of the results
  • Laplacian( T::tensor table, [a[1],...,a[n]], Gdata ) ⇒ (∆ T)[a[1],..a[n]]
  • DV( X, Y, Gdata ) ⇒ D_X Y ::list
  • calculates the covariant derivative of two vectors X and Y.
  • X, Y = vectors expressed by lists, Vectors, Matrices or Arrays.
  • The output D_X Y is given in the form of list.
  • Div( T::tensor table, [mu,nu,..], Gdata ) ⇒ add((DT)[alpha,alpha,mu, nu,..],alpha=1..dim)
  • DivT( T::tensor table, Gdata[, sw] )⇒ DivTtbl::tensor table
  • DivTtbl[mu,nu,...]=Div(T, [mu,nu,...], Gdata)
  • sw=0 ⇒ no simplification
  • sw=1 ⇒ simplification of the results
  • Algebraic procedures

  • ContractT( T::tensor table, [a,b], Gdata[, sw] ) ⇒ CT::tensor table
  • constructs a tensor table CT with two rank down from a tensor table T by contracting the specified indicies.
  • [a,b] = the index positions to contract
  • IP( V, W, Gdata ) ⇒ val::scalar
  • calculates the inner product of two tensors/vectors/forms of the same rank.
  • V,W:: tensor tables/Vectors/dforms