Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to calculate covariant derivative by Mathematica?

800 views
Skip to first unread message

Shen

unread,
Jan 23, 2010, 7:33:02 AM1/23/10
to
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?

Peter Breitfeld

unread,
Jan 24, 2010, 5:38:58 AM1/24/10
to
Shen wrote:

I wrote a small package called brfART.m for calculations with tensors and
GRT stuff. It has a function to calculate covariant derivatives. You may
find it on <http://www.pbreitfeld.de/Download.html>

There is an introduction brfART-Bsp.nb too on this site.

Beware: Language is German.

--
_________________________________________________________________
Peter Breitfeld, Bad Saulgau, Germany -- http://www.pBreitfeld.de

rolf....@gmail.com

unread,
Jan 24, 2010, 5:45:24 AM1/24/10
to

For High Energy Physics I once programmed that a long time ago:
http://www.feyncalc.org/FeynCalcBook/CovariantD/

But maybe you want something different?

Rolf Mertig
GluonVision GmbH
Berlin, Germany

Simon

unread,
Jan 24, 2010, 5:45:11 AM1/24/10
to
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[1]:= DD[t_]:=(D[#,t]+Con[#,t])&

so that
In[2]:= DD[x]@f[x]
Out[3]= 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[5]:= Con[expr_?ArrayQ,t_]:=Module[{dim=Dimensions[expr],rep,perms},
rep=Array[Subscript[r, ##][t]&,{dim[[1]],dim[[1]]}];
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[6]:= rep=Array[Subscript[r, ##][t]&,{2,2}]; m=Array[Subscript[z, ##]
&,{2,2}];

In[7]:= Con[m,t]==rep.m+m.rep\[Transpose]//Expand
Out[7]= 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

0 new messages