Well, ev(kdelta,kdelta) just evaluates the symbol kdelta, which is simply a
name. If you wish to evaluate the trace of the tensor kdelta, make sure you
say that it is a tensor by writing
ev(kdelta([],[]),kdelta);
By adding an (empty) list of indices, you indicate that kdelta([],[]) is a
tensorial quantity. Imagine what would happen if itensor were to evaluate
kdelta to dim in any context. For instance, it'd turn kdelta([a],[b]) into
3([a],[b]), which is a rather meaningless expression!
Think of tensor names as function names; you always need to supply the list
of indices as function arguments, even when the list happens to be empty, as
in the case of a fully contracted tensor.
And yes, you can define your own evaluation function, as in
load(itensor);
idim(3);
defcon(q,q,qq);
expr:'levi_civita([i,k,m],[])*'levi_civita([],[i1,k,m])*q([],[i])*q([i1],[])
$
new_ev(a,b):=apply(ev,[a,b]);
ishow(new_ev(contract(expand(lc2kdt(expr))),kdelta))$
There are many reasons why ev() itself doesn't work this way, but I'm really
not the person with the right expertise to explain.
Viktor
-----Original Message-----
From: Nicola Cabibbo [mailto:nicola.cabibbo at roma1.infn.it]
Sent: Thursday, June 12, 2008 8:31 AM
To: Viktor T. Toth
Subject: Re: [Maxima] How to simplify kdelta?
This explains it and solves the problem.
Is there any philosophical reason why
ev(kdelta,kdelta) is not equal to the space dimension?
Or why, according to your suggestion, one cannot redefine
ev so that
new_ev(a,b)= apply(old_ev,[a,b])?
Many thanks (also to Valery) for the explanation.
Nicola
On Jun 12, 2008, at 1:26 PM, Viktor T. Toth wrote:
> The workings of ev() are mysterious. Basically, ev does the applying
> of
> kdelta before it evaluates lc2kdt, which is not what you want. This
> might
> work instead:
>
> ishow(apply(ev,[contract(expand(lc2kdt(expr))),kdelta]))$
>
> By using apply(), you ensure that ev is applied only after its
> arguments
> have been evaluated.
>
> In many cases, though, it's much easier to just do the evaluation in
> two
> steps, as in
>
> contract(expand(lc2kdt(expr)))$
> ishow(ev(%,kdelta))$
>
>
> Viktor
>
>
> -----Original Message-----
> From: maxima-bounces at math.utexas.edu
[mailto:maxima-bounces at math.utexas.edu
> ]
> On Behalf Of Nicola Cabibbo
> Sent: Thursday, June 12, 2008 7:18 AM
> To: maxima at math.utexas.edu
> Cc: Nicola Cabibbo
> Subject: Re: [Maxima] How to simplify kdelta?
>
> After more investigation, if after the commands
> if get('itensor, 'version)=false then load (itensor) ;
> idim(3);
> dim:3;
> defcon(q,q,qq);
> expr:'levi_civita([i,k,m],[])*'levi_civita([],[i1,k,m])*q([],
> [i])*q([i1],[])$
> expr1:contract(expand(lc2kdt(expr)));
> I enter
> ishow(ev(expr1,kdelta));
> the result is the expected " 2qq ", while if I enter
> ishow(ev(contract(expand(lc2kdt(expr))),kdelta));
> the result is " 5*qq-kdelta*qq ". Why the difference?
>
> Thanks
>
>
> On Jun 12, 2008, at 1:12 PM, Nicola Cabibbo wrote:
>
>> Just trying to learn Maxima, with the commands:
>>
>> if get('itensor, 'version)=false then load (itensor) ;
>> idim(3);
>> dim:3;
>> defcon(q,q,qq);
>> expr:'levi_civita([i,k,m],[])*'levi_civita([],[i1,k,m])*q([],
>> [i])*q([i1],[])$
>> ishow(contract(expand(lc2kdt(expr))));
>>
>> I obtain " 5*qq-kdelta*qq ". This is correct with kdelta=3, but
>> how can I directly obtain the simplified result "2 qq"?
>>
>> Thanks for the attention
>>
>> PS: my setup is (on a Mac)
>>
>> wxMaxima 0.7.5 http://wxmaxima.sourceforge.net
>> Maxima 5.15.0 http://maxima.sourceforge.net
>> Using Lisp CMU Common Lisp Snapshot 2008-03 (19E)
>>
>>
>>
>>
>>
>>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>