2 * This program is free software; you can redistribute it and/or
3 * modify it under the terms of the GNU General Public License as
4 * published by the Free Software Foundation; either version 2 of
5 * the License, or (at your option) any later version.
7 * This program is distributed in the hope that it will be
8 * useful, but WITHOUT ANY WARRANTY; without even the implied
9 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
10 * PURPOSE. See the GNU General Public License for more details.
12 * Tensor index contraction
15 if get('itensor,'version)=false then load(itensor);
17 ("defcon() assigns contraction properties to tensors")$
19 ishow(e([a],[b])*f([b],[c]))$
22 ("kdelta is the Kronecker delta with special contraction properties")$
25 ishow(contract(kdelta([a],[b])*kdelta([b],[a])))$
28 ("The imetric() function sets up contraction properties for the metric")$
34 ishow(contract(rename(expand(%))))$
36 ("The contract() function can also raise and lower indices")$
38 ishow(Te([i,j],[k,l])*Ti([k,m])*Ti([l,n]))$
40 ishow(Te([i,j],[k,l])*Ti([],[i,n])*Ti([],[j,m]))$
43 /* End of demo -- comment line needed by MAXIMA to resume demo menu */