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

In summary, the conversation revolved around using Mathematica 6.0 to calculate a contraction of indices with the Levi-Civita tensor and an antiSymmetric tensor. The individual was trying to teach Mathematica to recognize the antisymmetric property and fix the code for a six by six by six tensor. They also discussed the use of computers in understanding and solving complex concepts in physics, such as fluid dynamics and the Einstein Field Equations. Finally, the conversation touched on the capabilities of computers versus humans in terms of computational speed and critical thinking.
  • #1
gda
17
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
  • #2
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.
 
  • #3
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.
 
  • #4
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[%]
 
  • #5
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.
 
  • #6
I didnt probe it yet but I think this might help:

Antisymmetrize[f_] := Module[{p = Permutations[f]}, Signature[f]Signature/@ p . p] .
 
  • #7
I wonder, do you have the LeviCivitaTensor command in Mathematica 6? I'm running Mathematica 7.
 
  • #8
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:
  • #9
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.
 

What is an antisymmetric tensor?

An antisymmetric tensor is a mathematical object that represents a multilinear map from a set of vector spaces to the real or complex numbers. It is characterized by the property that the value of the tensor is unchanged when the order of the arguments is reversed.

What is Mathematica 6?

Mathematica 6 is a software program developed by Wolfram Research for symbolic and numerical computation. It is commonly used in scientific and mathematical research for tasks such as data analysis, visualization, and equation solving.

How do I construct an antisymmetric tensor in Mathematica 6?

To construct an antisymmetric tensor in Mathematica 6, you can use the built-in function "SymmetrizedArray". This function allows you to specify the dimensions of the tensor, as well as the symmetry properties you want it to have. For example, to create a 3x3 antisymmetric tensor, you can use the command "SymmetrizedArray[{1,2,3}, AntiSymmetricTensor[3]]".

Can I manipulate an antisymmetric tensor in Mathematica 6?

Yes, Mathematica 6 has a wide range of functions and commands for manipulating tensors, including antisymmetric tensors. These include operations such as addition, subtraction, multiplication, and contraction. You can also use functions like "TensorReduce" and "TensorExpand" to simplify and expand tensor expressions.

Is there a limit to the size of an antisymmetric tensor in Mathematica 6?

Yes, the size of the tensor may be limited by the memory and processing capabilities of your computer. However, Mathematica 6 can handle tensors with large numbers of dimensions and elements, so this should not be a significant limitation in most cases.

Similar threads

  • Special and General Relativity
Replies
22
Views
2K
  • Special and General Relativity
Replies
11
Views
1K
  • Special and General Relativity
Replies
1
Views
1K
  • Special and General Relativity
2
Replies
59
Views
4K
  • Special and General Relativity
Replies
4
Views
2K
  • Special and General Relativity
Replies
4
Views
549
  • Special and General Relativity
Replies
2
Views
850
  • Special and General Relativity
Replies
18
Views
1K
  • Special and General Relativity
Replies
1
Views
873
Replies
0
Views
164
Back
Top