MathGroup Archive 2010

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Covariant derivatives of tensors?

  • To: mathgroup at
  • Subject: [mg107460] Re: Covariant derivatives of tensors?
  • From: Erik Max Francis <max at>
  • Date: Sat, 13 Feb 2010 05:23:08 -0500 (EST)
  • References: <hkeard$t22$> <hkrm9u$m3f$>

dh wrote:
> to accomodate an unknown number of indices, you may dynamically build 
> the iteration specification. Here is an example:
> multiindex[exp_, vars_, dim_] :=
>   Table[exp, Evaluate[Sequence @@ {#, 1, dim} & /@ vars]]
> if you e.g. say:  multiindex[a[i1, i2], {i1, i2}, 2]
> you get: {{a[1, 1], a[1, 2]}, {a[2, 1], a[2, 2]}}

Thanks for your help.  I did in fact come up with a solution which 
involved iterating over each permutation of the list of indices 
(creating them via Tuples), then performing the (involved) computation 
for each permutation (along with the new covariant index), building a 
list of rules, and then constructing an empty (higher-dimensional) array 
with Nest and Outer, and finally applying the replacements with 
ReplacePart.  This is probably not ideal in terms of efficiency, but it 

Since the main excuse here was to 1. get more experience with 
Mathematica just for the fun of it, 2. help solidify my knowledge of 
tensor calculus, and 3. write a package for the first time, I'll put 
together some "examples" using the package and then post it somewhere 
for feedback.

Erik Max Francis && max at &&
  San Jose, CA, USA && 37 18 N 121 57 W && AIM/Y!M/Skype erikmaxfrancis
   Love is a hole in the heart.
    -- Ben Hecht

  • Prev by Date: Re: Random number with custom distribution
  • Next by Date: Re: Re: Normality test
  • Previous by thread: Re: Covariant derivatives of tensors?
  • Next by thread: Inserting a position-limited Locator inside a Manipulate multiplot