| New Reply |
need a code to construct an antisymmetric tensor with Mathematica 6. |
Share Thread |
| Feb4-12, 05:31 PM | #1 |
|
|
need a code to construct an antisymmetric tensor with Mathematica 6.
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 doesnt 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. |
| Feb5-12, 07:48 AM | #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]); $RecursionLimit::reclim: Recursion depth of256 bexceeded. |
| Feb5-12, 09:27 AM | #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. |
| Feb5-12, 12:48 PM | #4 |
|
|
need a code to construct an antisymmetric tensor with Mathematica 6.
A simple example:
Code:
A={{0,-1},{0,1}}
MatrixForm[A]
-A
Transpose[A]
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]]
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 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[%] |
| Feb5-12, 04:18 PM | #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.
|
| Feb5-12, 05:43 PM | #6 |
|
|
I didnt probe it yet but I think this might help:
Antisymmetrize[f_] := Module[{p = Permutations[f]}, Signature[f]Signature/@ p . p] . |
| Feb6-12, 08:51 AM | #7 |
|
|
I wonder, do you have the LeviCivitaTensor command in Mathematica 6? I'm running Mathematica 7.
|
| Feb6-12, 09:24 AM | #8 |
|
|
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. |
| Feb6-12, 09:52 AM | #9 |
|
|
|
| Feb6-12, 10:19 AM | #10 |
|
|
|
| Feb6-12, 12:15 PM | #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. |
| Feb6-12, 02:08 PM | #12 |
|
|
|
| Feb6-12, 02:13 PM | #13 |
|
|
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]+.... |
| Feb6-12, 03:24 PM | #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? |
| Feb7-12, 10:36 AM | #15 |
|
|
|
| New Reply |
Similar discussions for: need a code to construct an antisymmetric tensor with Mathematica 6.
|
||||
| Thread | Forum | Replies | ||
| Using cadabra to calculate antisymmetric tensor field | Special & General Relativity | 7 | ||
| construct field tensor an dual tensor | Advanced Physics Homework | 5 | ||
| totally antisymmetric tensor | Advanced Physics Homework | 4 | ||
| Simple identity for antisymmetric tensor | Differential Geometry | 4 | ||
| Antisymmetric 4-tensor | Special & General Relativity | 3 | ||