problem about using itensor to demonstrate the riemann tensor' symmetry
Subject: problem about using itensor to demonstrate the riemann tensor' symmetry
From: Viktor T. Toth
Date: Fri, 10 May 2013 20:28:04 -0400
Actually, I think the solutions that I provided work just fine. Both scripts
that I provided yield a '0' as the final result.
The script that you used indeed fails to perform the final simplification,
but this can be easily remedied. The reason for the failure is subtle: it
has to do with the dummy indices used by itensor controlled by the variable
icounter. Look at the following example:
load(itensor)$
remcomps(g);
imetric(g);
decsym(g,2,0,[sym(all)],[]);
decsym(g,0,2,[],[sym(all)]);
rt(a,b,c,d):=idiff(ichr1([b,d,a]),c)-idiff(ichr1([b,c,a]),d)+ichr1([a,d,r])*
ichr2([b,c],[r])-ichr1([a,c,r])*ichr2([b,d],[r])$
expr:rt(i,j,k,l)+rt(j,i,k,l)$
icounter;
ishow(canform(canform(expr)))$
icounter;
ishow(canform(canform(expr)))$
icounter:4;
ishow(canform(canform(expr)))$
icounter:100;
ishow(canform(canform(expr)))$
As you can see, when icounter is 4 before the attempt at simplification, the
simplification fails. When icounter is 100 or 220, the simplification
succeeds. The underlying reason I believe is that depending on the dummy
indices used, subexpressions are ordered differently and consequently,
itensor may fail to recognize certain simplification patterns. Yes, it could
be smarter about this, but the fact is that it isn't.
Another situation I occasionally encounter is that depending on the value of
icounter, there may be conflicting indices in certain expressions. This is
always Bad News, as it can lead to incorrect results. So when you work with
complicated itensor expressions, it is always a good idea to double-check
the result, perhaps by using a large value for icounter (e.g., set
icounter:1000) and verifying that the result remains the same. Similarly, if
during the simplification process, you notice conflicting indices (e.g.,
expressions in which the same dummy index appears twice in a covariant or
twice in a contravariant position) this may be remedied by manually setting
icounter to an appropriate value.
Viktor
PS: The vttoth at ... address is my personal e-mail address. The maxima at ...
address is that of the mailing list. Feel free to send your reply to both.
-----Original Message-----
From: ?? [mailto:pengfei_guo at 163.com]
Sent: Thursday, May 09, 2013 2:40 AM
To: Maxima at math.utexas.edu; vttoth at vttoth.com
Subject: Re:RE: [Maxima] problem about using itensor to demonstrate the
riemann tensor' symmetry
Thanks Toth.
The alternative way you suggested seems to not work.
A strange thing is that when I run the code twice, itensor will give me "0".
load(itensor)$
remcomps(g);
imetric(g);
decsym(g,2,0,[sym(all)],[]);
decsym(g,0,2,[],[sym(all)]);
rt(a,b,c,d) := idiff( ichr1([b,d,a]),c ) - idiff( ichr1([b,c,a]),d )
+ ichr1([a,d,r])*ichr2([b,c],[r]) -
ichr1([a,c,r])*ichr2([b,d],[r])$
expr:rt(i,j,k,l) + rt(j,i,k,l)$
ishow(canform(canform(expr)))$
I don't know which email adress should be replied, vttoth at vttoth.com or
Maxima at math.utexas.edu , so I emailed both.
I'm sorry if I emailed wrong way .
Regards.
Guo
At 2013-05-07 20:45:58,"Viktor T. Toth" <vttoth at vttoth.com> wrote:
>Hello,
>
>Here is a way to accomplish what you were looking for:
>
>load(itensor)$
>remcomps(g);
>imetric(g);
>decsym(g,2,0,[sym(all)],[]);
>decsym(g,0,2,[],[sym(all)]);
>components(rt([i,j,k,l],[]),idiff(ichr1([j,l,i]),k)-idiff(ichr1([j,k,i]),l)
+
>ichr1([i,l,r])*ichr2([j,k],[r])-ichr1([i,k,r])*ichr2([j,l],[r]))$
>expr:ishow(rt([i,j,k,l],[]) + rt([j,i,k,l],[]))$
>canform(expr)$
>flipflag:not flipflag;
>canform(%th(2))$
>flipflag:not flipflag;
>canform(%th(2));
>
>
>Note that I replaced your function definition for rt with a component
>definition. This is not strictly necessary; however, I found that Maxima
>kind of got lost (not an issue specific to the tensor packages, but
>certainly affecting this case) when the function form was used and the
names
>of the formal and actual parameters coincided. Another alternative would
>have been to keep your functional form for rt, but use different formal
>parameters (e.g., rt(a,b,c,d):= ...).
>
>Curiously, the flipflag thing is not needed to show the antisymmetry of the
>second pair of indices:
>
>load(itensor)$
>remcomps(g);
>imetric(g);
>decsym(g,2,0,[sym(all)],[]);
>decsym(g,0,2,[],[sym(all)]);
>components(rt([i,j,k,l],[]),idiff(ichr1([j,l,i]),k)-idiff(ichr1([j,k,i]),l)
+
>ichr1([i,l,r])*ichr2([j,k],[r])-ichr1([i,k,r])*ichr2([j,l],[r]))$
>expr:ishow(rt([i,j,k,l],[]) + rt([i,j,l,k],[]))$
>canform(canform(expr));
>
>
>Hope this helps.
>
>
>Viktor
>
>
>
>
>
>
>-----Original Message-----
>From: maxima-bounces at math.utexas.edu
[mailto:maxima-bounces at math.utexas.edu]
>On Behalf Of 163
>Sent: Thursday, May 02, 2013 10:07 AM
>To: maxima at math.utexas.edu
>Subject: problem about using itensor to demonstrate the riemann
>tensor' symmetry
>
>my code is below. why can't i get the answer zero. thanks.
>
>load(itensor)$
>
>remcomps(g);
>imetric(g);
>
>decsym(g,2,0,[sym(all)],[]);
>
>decsym(g,0,2,[],[sym(all)]);
>
>
>rt(i,j,k,l) := idiff( ichr1([j,l,i]),k ) - idiff( ichr1([j,k,i]),l )
> + ichr1([i,l,r])*ichr2([j,k],[r]) -
>ichr1([i,k,r])*ichr2([j,l],[r])$
>
>expr:rt(i,j,k,l) + rt(j,i,k,l);
>
>expand(expr)$
>
>canform(%)$
>
>nterms(%);
>
>ishow( conmetderiv(simpmetderiv(canform(contract(rename(%th(2))))),g))$
>
>nterms(%);
>
>ishow( conmetderiv(simpmetderiv(canform(contract(rename(%th(2))))),g))$
>
>nterms(%);
>_______________________________________________
>Maxima mailing list
>Maxima at math.utexas.edu
>http://www.math.utexas.edu/mailman/listinfo/maxima
>