CanonPrint.mws

Function: Canon[CanonPrint, CanonUnPrint] - printing routines for the Canon package

Calling Sequence:
CanonPrint(tensor);

CanonUnPrint(printed tensor);

Parameters:
tensor - a tensor expression

printed tensor - a tensor expression as printed by CanonPrint

Description:

Examples:

> with(Canon):

> CanonPrint(T[a,-b]);

T*``^a*``[b]

> CanonPrint(T[a,-b]*R[b,-c]);

T*``^a*``[b]*R*``^b*``[c]

The following commands reveal some of the internal structure:

> lprint(CanonPrint(T[a,-b]));

_TENSOR(T[a,-b])

> CanonUnPrint(%);

T[a,-b]

> CanonUnPrint( _TENSOR(T[a,-b])*_TENSOR(R[b,-c]) );

T[a,-b]*R[b,-c]

The user may employ the function _SCALAR for powering of an expression with no free indices. This function has also an associated `print/_SCALAR` procedure.

> CanonPrint(_SCALAR(V[a]*V[-a])^2);

``(V*` `^a*V*``[a])^2

> lprint(%);

_SCALAR(_TENSOR(V[a])*_TENSOR(V[-a]))^2

See Also: CanonDefine , Canonical , CanonicalOne