Need a code to construct an antisymmetric tensor with Mathematica 6.

Click For Summary

Discussion Overview

The discussion revolves around constructing an antisymmetric tensor using Mathematica 6.0, particularly focusing on the implementation of the Levi-Civita tensor and the properties of antisymmetric tensors in six dimensions. Participants explore coding strategies, mathematical properties, and potential applications in tensor analysis.

Discussion Character

  • Technical explanation
  • Exploratory
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • One participant presents a code snippet intended to define an antisymmetric tensor A[m, n, p] but encounters issues with Mathematica not recognizing the antisymmetric property during computations.
  • Another participant points out that the provided code leads to an infinitely recursive function definition, suggesting that evaluating A[1,2,3] would exceed recursion limits.
  • Some participants express a desire to automate the recognition of antisymmetric properties in tensors, indicating that manual adjustments are too time-consuming.
  • A simple example involving a 2x2 antisymmetric matrix is shared, though its relevance to the original tensor discussion is questioned.
  • One participant mentions the LeviCivitaTensor command and its potential to create large tensors, prompting further exploration of its capabilities in Mathematica.
  • Another participant proposes an alternative function, Antisymmetrize[f_], to achieve antisymmetrization through permutations of tensor indices.
  • Discussion includes a variety of topics related to tensors, such as fluid dynamics, Einstein Field Equations, and the significance of covariant and contravariant indices.
  • Participants share links to external resources, including a tensor analysis package that may assist in their work.

Areas of Agreement / Disagreement

There is no consensus on the best approach to implement antisymmetric tensors in Mathematica. Multiple competing views and methods are presented, with some participants agreeing on the need for automation while others focus on specific coding techniques.

Contextual Notes

Participants express uncertainty regarding the limitations of their current Mathematica version and its capabilities, particularly in relation to tensor functions and the handling of antisymmetry. The discussion also highlights the complexity of tensor operations and the potential for computational tools to aid in understanding these concepts.

Who May Find This Useful

This discussion may be useful for individuals interested in tensor analysis, particularly those using Mathematica for mathematical modeling in physics, engineering, or related fields. It may also benefit those exploring the properties of antisymmetric tensors and their applications in theoretical frameworks.

gda
Messages
17
Reaction score
0
Hello! I'm doing a code in Mathematica 6.0 in order to calculate a contraction of indices with the Levi-Civita tensor (in six dimensions) and an antiSymmetric tensor A[m,n,p] (it has 3 indices running from 1 to 6). For example in order to turn A into an antisymmetric tensor, I wrote something like this in the code:

Input: A[m, n, p] := 1/6 (A[m, n, p] - A[m, p, n] - A[n, m, p] + A[n, p, m] + A[p, m, n] - A[p, n, m]);

But it seems that mathematica doesn't take it into account because at the end of the final computation, the output shows this kind of things:

2 b (-A[5, 4, 6] B[1, 2, 3] + A[5, 6, 4] B[1, 2, 3] +
A[6, 4, 5] B[1, 2, 3] - A[6, 5, 4] B[1, 2, 3] -
A[3, 5, 6] B[1, 2, 4] + A[3, 6, 5] B[1, 2, 4] +
A[5, 3, 6] B[1, 2, 4] - A[5, 6, 3] B[1, 2, 4] )

(B is another antisymmetric tensor and b is a constant). So , as you see, the first 3 terms should be together because of the antisymmetric property of A, but they arent. The expression is already simplified by mathematica.

Anybody knows how can i fix the code? thank you in advance.
 
Physics news on Phys.org
As for your code:

Code:
A[m, n, p] := 1/6 (A[m, n, p] - A[m, p, n] - A[n, m, p] + A[n, p, m] + A[p, m, n] - A[p, n, m]);

This appears to be an infinitely recursive function definition. As soon as you evaluate A[1,2,3] you'll see it says

$RecursionLimit::reclim: Recursion depth of256 bexceeded.
 
yes it does. I want to teach Mathematica to recognize the antisymmetric property. For example: A[4,5,6] = - A[4,6,5] = A[6,4,5]= . . .
I can do it manually , of course, but it takes to long.
 
A simple example:

Code:
A={{0,-1},{0,1}}
MatrixForm[A]
-A
Transpose[A]

I'm not entirely sure whether the following is relevant to tensors or not, but it is very curious how you can use a matrix exponent to get rotation and lorentz transformation matrices:

Code:
Clear["Global`*"]
Print["A"]
A = {{0, -\[Theta]}, {\[Theta], 0}}
MatrixForm[A]
Print["Antisymmetric?"]
-A == Transpose[A]
Print["MatrixExp:"]
MatrixForm[MatrixExp[A]]
Print["B:"]
B = {{\[Theta], 0}, {0, \[Theta]}}
Print["Antisymmetric?"]
-B == Transpose[B]
Print["Symmetric?"]
B == Transpose[B]
Print["MatrixExp[B]:"]
MatrixForm[MatrixExp[B]]

Print["c"]
c = {{0, t, 0, 0}, {t, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}
MatrixForm[c]
Print["MatrixExp[c]:"]
MatrixForm[MatrixExp[c]]

But I think what you're wanting to do is handle a six by six by six tensor, and swap the indices out. Starting a little simpler, you could do a three-by-three-by-three

Code:
m = {{{111, 112, 113}, {121, 122, 123}, {131, 132, 133}}, {{211, 212, 
    213}, {221, 222, 223}, {231, 232, 233}},
  {{311, 312, 313}, {321, 322, 323}, {331, 332, 333}}}
MatrixForm[m]
m[[1]][[2]][[3]]  (*First Row, Second Column, Third... Book?*)
MatrixForm[n = Transpose[m]]
n[[1]][[2]][[3]] (*First Row, Second Column, Third... Book?*)

Now, the Transpose function just transposes the row and the column but we need access to other transpositions; to swap the row with the book, or the column with the book. You might figure out how to do it. I think the relevant help would be under nested lists...

Now that I look at the help file, Under Nested Lists, I see a link to tensors, and then to LeviCevitaTensors in the Mathematica Help file. It appears that running LeviCivitaTensor[6] actually creates an extremely large 6 x 6 x 6 x 6 x 6 x 6 tensor.

Code:
LeviCivitaTensor[4]
MatrixForm[%]
 
Ok doolin thank you for your time. I've seen the link to tensor in the mathematica help file. I'll try to use what you write above and figure it out the swap between row and the book.
 
I didnt probe it yet but I think this might help:

Antisymmetrize[f_] := Module[{p = Permutations[f]}, Signature[f]Signature/@ p . p] .
 
I wonder, do you have the LeviCivitaTensor command in Mathematica 6? I'm running Mathematica 7.
 
gda said:
Ok doolin thank you for your time. I've seen the link to tensor in the mathematica help file. I'll try to use what you write above and figure it out the swap between row and the book.

I'd be happy to spend more time on it, because I'm learning too. There's a lot I don't know.

  • I'd like to see a problem in fluid dynamics that could be solved with tensors. I assume it has to do with bulk-modulus, shear-modulus, young's modulus, stress, and strain.
  • I'd like to see a unit analysis of Einstein Field Equations
  • I'd like to see how Schwarzschild metric is a solution to the Einstein Field Equations. i.e. how exactly it fits in there and solves it.
  • I'd like to get some clarity on covariant and contravariant. How does popping the index up to the top, or down on the bottom actually affect the shape of the Array? As far as I can tell one 3x3x3 array should have about the same shape as another 3x3x3 array.
  • I'd like to get a clear understanding of "Christoffel Connection Coefficients."

I think using Mathematica (or any programming language) could really help explain these ideas. These are nice tools we can use, so we don't have to be as smart as Einstein to understand everything.

Of course the use of a computer prevents us from using any ambiguously defined, or undefinable concepts. That might be a problem if we find that General Relativity relies heavily on these. Humans can "deal" with that, but not computers.
 
Last edited:
gda said:
I didnt probe it yet but I think this might help:

Antisymmetrize[f_] := Module[{p = Permutations[f]}, Signature[f]Signature/@ p . p] .

By the way, thanks for that. I'm not entirely sure what the significance is, but it is notationally, at least, very descriptive (with the help files).
 
  • #11
If you find the relative computational capabilities of the average computer vs. the smartest human depressing, remember...

A computer can perform billions or trillions of floating-point-operations per second, but it is utterly incapable of formulating an opinion of whether such calculations are interesting, relevant, applicable, or worthwhile.
 
Last edited:
  • #13
JDoolin said:
A computer can perform billions or trillions of floating-point-operations per second, but it is utterly incapable of formulating an opinion of whether such calculations are interesting, relevant, applicable, or worthwhile.

yeah it's true. They are just nothing but a sophisticated calculator :D.

Anyway, if you write this in mathematica (I'm using 6.0)

Antisymmetrize[f_] := Module[{p = Permutations[f]}, Signature[f]Signature/@ p . p] .

it will antisymmetrize your operation, i.e Antisymmetrize[f[a,b,c]] will give you f[a,b,c]-f[b,a,c]+...
 
  • #14
Right. I think I can see what it is doing. It gives you all permutations of {a,b,c} and then gives a positive sign for abc, bca, cab, (shift operations) and a negative sign for acb, bac, cba (swap operations).

I can see what it's doing, but I can't seem to fathom why it's doing it; other than obviously it is programmed to do so.

Is there a simple question that someone might ask that would motivate me to antisymmetrize a function of three variables?
 
  • #15
gda said:
thanks sam. I'm going to see what this package is capable of.

If you're planning to do any serious tensor work with Mathematica I don't think this package has a competitor. It's 1) really good, 2) free, and 3) well maintained and has an amazing "google group" where people discuss issues and answer questions people might have. This is by far the most popular tensor analysis package for GR, at least among the younger crowd.
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 0 ·
Replies
0
Views
1K
  • · Replies 3 ·
Replies
3
Views
1K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 15 ·
Replies
15
Views
1K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 22 ·
Replies
22
Views
4K
  • · Replies 59 ·
2
Replies
59
Views
8K