Trace(indices: Ex)
Declares a trace operator
Declares the object to be a trace operator, optionally indicating the index set over which
the trace acts. In the basic form, without argument, the trace will be understood to act on
all implicit index sets of objects inside it:Tr{#}::Trace;
Tr{#}::LaTeXForm("{\rm Tr}").
{A,B}::ImplicitIndex;
ex:= Tr( A B C );
untrace(_);
\(\displaystyle{}\text{Property Trace attached to }Tr\left(\#\right).\)
\(\displaystyle{}\text{Property ImplicitIndex attached to }\left[A, B\right].\)
\(\displaystyle{}{\rm Tr}\left(A B C\right)\)
\(\displaystyle{}C {\rm Tr}\left(A B\right)\)
If you have multiple implicit index sets, you can indicate the set over which you want to trace
by using the optional
indices argument, as in:{a,b,c,d}::Indices(vector);
{i,j,k,l}::Indices(group);
tr{#}::Trace(indices=group);
A::ImplicitIndex(A_{i j});
B::ImplicitIndex(B_{a b});
ex:= tr(A B);
\(\displaystyle{}\text{Property Indices(position=free) attached to }\left[a, b, c, d\right].\)
\(\displaystyle{}\text{Property Indices(position=free) attached to }\left[i, j, k, l\right].\)
\(\displaystyle{}\text{Property Trace attached to }tr\left(\#\right).\)
\(\displaystyle{}\text{Property ImplicitIndex attached to }A.\)
\(\displaystyle{}\text{Property ImplicitIndex attached to }B.\)
\(\displaystyle{}tr\left(A B\right)\)
untrace(_);
\(\displaystyle{}B tr\left(A\right)\)