Gianluca,
I think it's a case of garbage in, garbage out. You are feeding an invalid
tensor expression to itensor, so you shouldn't expect a valid result.
To itensor, l([a,b])^2 means nothing. It evaluates to l([a,b])*l([a,b])
which has the same indices repeated in the covariant position. This is not a
valid itensor expression and it simply will not work.
To express the contraction of l with itself (I presume that's what you had
in mind), you should be using the expression l([a,b],[])*l([],[a,b]).
However, to carry out the differentiation you also need to tell Maxima how
l([a,b],[]) and l([],[a,b]) are related to one another. Something like this:
load(itensor);
imetric(g);
components(l([],[i,j]),l([a,b],[])*g([],[a,i])*g([],[b,j]));
ishow(diff(l([a,b],[])*l([],[a,b]),l([i,j],[])))$
remcomps(l);
ishow(rename(contract(%th(2))))$
In this code, the second line is needed to make sure that itensor
automatically applies any contraction rules related to the metric. The third
line spells out the contravariant form or l in terms of its covariant form
and the metric, to make sure that all occurrences of the covariant l are
explicit in the expression prior to differentiation. The fourth line carries
out the differentiation. The fifth line (remcomps) is used because we no
longer need or want Maxima to rewrite l([],[a,b]) in terms of the
l([a,b],[]) and the metric during final simplification. The sixth line is
the simplification.
You can also forego this components() business altogether by just writing
down the contraction of l with itself in explicit form:
load(itensor);
imetric(g);
l([a,b],[])*l([c,d],[])*g([],[a,c])*g([],[b,d]);
ishow(contract(diff(%,l([i,j]))))$
In both cases, you get the correct result which, incidentally, is
2*l([],[i,j]) and not 2*kdelta([i,j],[]).
I hope this helps.
Viktor
-----Original Message-----
From: maxima-bounces at math.utexas.edu [mailto:maxima-bounces at math.utexas.edu]
On Behalf Of Gianluca Malato
Sent: Wednesday, June 30, 2010 2:02 PM
To: maxima at math.utexas.edu
Subject: itensor problem
Hi all. I need to differentiate a contraction of tensors in a way such
that expressions like
diff(contract(l([a,b])^2),l([i,j]));
are to be simplified as
2*kdelta([i,j],[])
and not as
2*kdelta([a],[i])*l([a,b],[])*kdelta([b],[j])
I know that the things I've written aren't correct tensorial expressions
(there are no repeated indices...) but I need them to be in this form. I
already know that the things I've writtend correspond to a metric tensor
equal to unity (no difference between upper and lower indices), but I
cannot implement it in Maxima.
Can anyone help me?
--
Gianluca Malato
_______________________________________________
Maxima mailing list
Maxima at math.utexas.edu
http://www.math.utexas.edu/mailman/listinfo/maxima