       Re: How to calculate covariant derivative by Mathematica?

• To: mathgroup at smc.vnet.net
• Subject: [mg106850] Re: How to calculate covariant derivative by Mathematica?
• From: Simon <simonjtyler at gmail.com>
• Date: Sun, 24 Jan 2010 05:47:18 -0500 (EST)
• References: <hjeq9u\$fr1\$1@smc.vnet.net>

```Hi Shen,

It depends on the context in which you're working, as a covariant
derivatives can _look_ quite different.
But maybe what you basically need is an operator of the type

In:= DD[t_]:=(D[#,t]+Con[#,t])&

so that
In:= DD[x]@f[x]
Out= Con[f[x],x]+(f^\[Prime])[x]

Then you need to make your connection, Con act properly.  For example,
it should return 0 when acting on scalars, and if you're acting on
explicit Tensors and don't distinguish between contravariant and
covariant, then maybe something like this would work:

In:= Con[expr_?ArrayQ,t_]:=Module[{dim=Dimensions[expr],rep,perms},
rep=Array[Subscript[r, ##][t]&,{dim[],dim[]}];
perms=Table[Range[Length@dim]/.{1->i,i->1},{i,Length@dim}];
Sum[Transpose[rep.Transpose[expr,perm],perm],{perm,perms}]
]

we can test that this works properly on a (square) matrix:

In:= rep=Array[Subscript[r, ##][t]&,{2,2}]; m=Array[Subscript[z, ##]
&,{2,2}];

In:= Con[m,t]==rep.m+m.rep\[Transpose]//Expand
Out= True

The above can be extended to vector derivatives and associated
connections.
Symbolic covariant derivatives are a bit more tricky...

There are some packages out there...  a google search for "mathematica
covariant derivative" brings up a few.
The Wolfram pages to look at are
http://library.wolfram.com/infocenter/BySubject/Mathematics/CalculusAnalysis/DifferentialGeometry/
http://library.wolfram.com/infocenter/BySubject/Science/Physics/Relativity/

Finally, if you want to do index / field theory style calculations,
then maybe you could try Cadabra.

Hope some of that helps,

Simon

On Jan 23, 8:33 pm, Shen <zshen2... at yahoo.com> wrote:
> I need to calculate covariant derivative by Mathematica. I noticed
> that there is no such a function in Mathematica. Can we define such a
> funcation? I don't know how to do it. Who can tell me how to define
> and calculate covariant derivative with Mathematica?

```

• Prev by Date: Re: Creating new ColorFunction / ColorDataFunction
• Next by Date: Re: Mathematica gets stuck, only thing I can do is quit kernel
• Previous by thread: Re: How to calculate covariant derivative by Mathematica?
• Next by thread: The formula of Abraham Moivre