{VERSION 5 0 "IBM INTEL LINUX" "5.0" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 1 }{CSTYLE "2D Math" -1 2 "Times" 0 1 0 0 0 0 0 0 2 0 0 0 0 0 0 1 }{CSTYLE "2D Output" 2 20 "" 0 1 0 0 255 1 0 0 0 0 0 0 0 0 0 1 } {PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Text Output" -1 2 1 {CSTYLE "" -1 -1 "Courier" 1 10 0 0 255 1 0 0 0 0 0 1 3 0 3 0 }1 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "" 2 6 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 2 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "M aple Output" 0 11 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 }3 3 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "" 11 12 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 }1 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }} {SECT 0 {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 49 "# Define operations for multiplication of tensors" }} }{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 594 "PTM:=proc(R,S)\n# \"Pure tensor\" (tensor monomial ) multiplication\n# This procedure is not used on the command line, bu t by the procedures `&*` and `&^`\n\n# convert R,S to lists of the for m [c,[a,b]] that represent c*(a \\otimes b)\n# or more generally [c,[a _1,a_2,...,a_n]] \n# represents c*(a_1 \\otimes ... \\otimes a_n)\nloc al A,B:\nif type(R,`*`) then A:=[mul(op(i,R),i=1..nops(R)-1),[op([op(R )][nops(R)])]] \nelse A:=[1,[op(R)]] fi;\nif type(S,`*`) then B:=[mul( op(i,S),i=1..nops(S)-1),[op([op(S)][nops(S)])]] \nelse B:=[1,[op(S)]] \+ fi; \n\nRETURN(A[1]*B[1]*`&o`(seq(A[2,i]*B[2,i],i=1..nops(A[2]))));\ne nd:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 " > " 0 "" {MPLTEXT 1 0 437 "`&*`:=proc(R,S)\n# Multiplies sums of \"pur e tensors\".\nlocal M,r,s;\nif type(R,`+`) then r:=nops(R) else r:=1 f i; #print(r);\nif type(S,`+`) then s:=nops(S) else s:=1 fi; #print(s); \nif (r=1 and s=1) then \n RETURN(PTM(R,S));\n\n elif r=1 then\n M :=matrix(r,s,(i,j)->PTM(R,op(j,S)));\n\n elif s=1 then\n M:=matrix(r ,s,(i,j)->PTM(op(i,R),S));\n\n else\n M:=matrix(r,s,(i,j)->PTM(op(i, R),op(j,S)));\nfi;\nRETURN(add(add(M[i,j],i=1..r),j=1..s))\nend:" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 152 "`&^`:=proc(a,p)\n# An exponentiation for sums of \+ \"pure tensors\".\nif p=0 then RETURN(1)\nelif p=1 then RETURN(a)\nels e RETURN(`&*`(a,`&^`(a,p-1))); fi;\nend:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 94 "# Save \+ these procedures in a file `PRTensor.m` that can be read into \"future \" Maple worksheets" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 33 "save PTM,`&*`,`&^`, `PRTensor.m`;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 31 "# Sample future Maple worksheet" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart: " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 76 "# Load the file `PRTens or.m` so that we can use the procedures `&*` and `&^`" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "read `PRTensor.m`;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 161 "# Remark: to get the \"define\" command to work\n# c orrectly, you may need to download the\n# package for Maple called \"B igebra\" from\n# http://math.tntech.edu/rafal/" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 14 "with(Bigebra);" }}{PARA 6 "" 1 "" {TEXT -1 83 "Increase verbosity by infolevel[`function`]=val -- use online help > \+ ?Bigebra[help]" }}{PARA 12 "" 1 "" {XPPMATH 20 "6#7C%%&ccoG%%&gcoG%'&g co_dG%(&gco_plG%%&mapG%#&vG%#EVG%(VERSIONG%(bracketG%)contractG%'drop_ tG%$epsG%*gantipodeG%)gco_unitG%(gswitchG%&hodgeG%&linopG%'linop2G%*li sts2matG%+lists2mat2G%+make_BI_IdG%&mapopG%'mapop2G%%meetG%'op2matG%(o p2mat2G%(pairingG%%peekG%%pokeG%*remove_eqG%'switchG%)tcollectG%(tsolv e1G" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 " > " 0 "" {MPLTEXT 1 0 143 "# Define the tensor product.\ndefine(`&o`,f lat,multilinear);\n# Remark: we could've named this tensor product `&t ` or something else besides `&o`" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "# Examp les" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 " > " 0 "" {MPLTEXT 1 0 39 "&*( &o(4*v,3*w)+&o(2*v,5*y), &o(x,z) );" }} {PARA 11 "" 1 "" {XPPMATH 20 "6#,&*&\"#7\"\"\"-%#&oG6$*&%\"vGF&%\"xGF& *&%\"wGF&%\"zGF&F&F&*&\"#5F&-F(6$F**&%\"yGF&F/F&F&F&" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "&^( &o(4*v,3*w), 3);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#,$*&\"%G<\"\"\"-%#&oG6$*$)%\"vG\"\"$F&*$)%\"wGF-F&F&F& " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 124 "# Remark: for more opt ions about the kinds of scalars allowed (e.g. integer, rational, etc.) , see the Bigebra documentation." }}}}{MARK "21 0 0" 76 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }