 tensor(deprecated)/act - Maple Help

tensor

 act
 perform an action on either a tensor_type, a spin coefficient table and curvature component table Calling Sequence act( action, args[2..nargs]) Parameters

 action - name that is recognized by act() to designate the action wanted to be performed on an object. args[2..nargs] - contains the objects to be acted upon and additional parameters depending on the specified action. Description

Important: The tensor package has been deprecated. Use the superseding packages DifferentialGeometry and Physics instead.

 • action usually is the name of an admissible procedure, and,
 1 acts on precisely ONE algebraic argument, and
 2 the "target" argument it acts on is its FIRST argument. (Most of the standard functions like simplify(), normal() fall into this category.) Note: an admissible procedure may employ extra or optional argument(s), as long as they come after the "target" one in the parameter list, e.g. simplify( .. , trig ).
 – There are, however, two exceptions :
 a. action can take the name display, used as a flag.  In which case act displays the nonzero element/component(s) of the parameter immediately after it which is presumably either a tensor_type, spin coefficient table or a curvature component table.
 b. action can also take subs, which is a maple function. subs is an exception because the "target" object in the function subs() is the last parameter.
 – To reinforce, any other input to action (which then must be the name of a procedure) must abide by the restrictions (1) and (2) above.
 • args[2..nargs] - if action was input 'display', then this contains ONE argument which is the object to display.
 • args[2..nargs] - if action is an "admissible" procedure name, then this is essentially the argument sequence of the procedure "action", including any possible extra arguments needed to specify the operation wanted, except the target argument is now of a more complex structure than just algebraic.
 • This function is part of the tensor package, and can be used in the form act(..) only after performing the command with(tensor), or with(tensor, act).  The function can always be accessed in the long form tensor[act]. Examples

Important: The tensor package has been deprecated. Use the superseding packages DifferentialGeometry and Physics instead.

 > $\mathrm{with}\left(\mathrm{tensor}\right):$
 > $\mathrm{U_compts}≔\mathrm{array}\left(\mathrm{symmetric},1..2,1..2\right):$
 > $\mathrm{U_compts}\left[1,1\right]≔x:$$\mathrm{U_compts}\left[1,2\right]≔1-{\mathrm{sin}\left(t\right)}^{2}-{\mathrm{cos}\left(t\right)}^{2}:$$\mathrm{U_compts}\left[2,2\right]≔y:$
 > $U≔\mathrm{create}\left(\left[1,-1\right],\mathrm{op}\left(\mathrm{U_compts}\right)\right)$
 ${U}{≔}{table}{}\left(\left[{\mathrm{index_char}}{=}\left[{1}{,}{-1}\right]{,}{\mathrm{compts}}{=}\left[\begin{array}{cc}{x}& {1}{-}{{\mathrm{sin}}{}\left({t}\right)}^{{2}}{-}{{\mathrm{cos}}{}\left({t}\right)}^{{2}}\\ {1}{-}{{\mathrm{sin}}{}\left({t}\right)}^{{2}}{-}{{\mathrm{cos}}{}\left({t}\right)}^{{2}}& {y}\end{array}\right]\right]\right)$ (1)
 > $Z≔\mathrm{act}\left(\mathrm{subs},\left[t=z,x=x+xy\right],U\right)$
 ${Z}{≔}{table}{}\left(\left[{\mathrm{index_char}}{=}\left[{1}{,}{-1}\right]{,}{\mathrm{compts}}{=}\left[\begin{array}{cc}{x}{}{y}{+}{x}& {1}{-}{{\mathrm{sin}}{}\left({z}\right)}^{{2}}{-}{{\mathrm{cos}}{}\left({z}\right)}^{{2}}\\ {1}{-}{{\mathrm{sin}}{}\left({z}\right)}^{{2}}{-}{{\mathrm{cos}}{}\left({z}\right)}^{{2}}& {y}\end{array}\right]\right]\right)$ (2)
 > $\mathrm{act}\left(\mathrm{factor},Z\right)$
 ${table}{}\left(\left[{\mathrm{index_char}}{=}\left[{1}{,}{-1}\right]{,}{\mathrm{compts}}{=}\left[\begin{array}{cc}{x}{}\left({y}{+}{1}\right)& {1}{-}{{\mathrm{sin}}{}\left({z}\right)}^{{2}}{-}{{\mathrm{cos}}{}\left({z}\right)}^{{2}}\\ {1}{-}{{\mathrm{sin}}{}\left({z}\right)}^{{2}}{-}{{\mathrm{cos}}{}\left({z}\right)}^{{2}}& {y}\end{array}\right]\right]\right)$ (3)
 > $V≔\mathrm{act}\left(\mathrm{simplify},Z,\mathrm{trig}\right)$
 ${V}{≔}{table}{}\left(\left[{\mathrm{index_char}}{=}\left[{1}{,}{-1}\right]{,}{\mathrm{compts}}{=}\left[\begin{array}{cc}{x}{}\left({y}{+}{1}\right)& {0}\\ {0}& {y}\end{array}\right]\right]\right)$ (4)
 > $\mathrm{act}\left(\mathrm{display},V\right)$
 NON-ZERO INDEPENDENT COMPONENTS :"[1, 1] ="
 "[2, 2] ="
 CHARACTER :
 INDEXING FUNCTION :
 ${\mathrm{_____________________________________________________}}$
 ${x}{}\left({y}{+}{1}\right)$
 ${y}$
 $\left[{1}{,}{-1}\right]$
 ${\mathrm{symmetric}}$
 ${\mathrm{_____________________________________________________}}$ (5)
 > $\mathrm{S_tble}≔\mathrm{table}\left(\left['\mathrm{\kappa }'=x,'\mathrm{\sigma }'=x,'\mathrm{\rho }'=x,'\mathrm{\tau }'=y,'\mathrm{\epsilon }'=y,'\mathrm{\alpha }'=y,'\mathrm{\beta }'=z,'\mathrm{\gamma }'=z,'\mathrm{\nu }'=z,'\mathrm{\lambda }'=0,'\mathrm{\mu }'=0,'\mathrm{pi}'=0\right]\right)$
 ${\mathrm{S_tble}}{≔}{table}{}\left(\left[{\mathrm{\alpha }}{=}{y}{,}{\mathrm{\sigma }}{=}{x}{,}{\mathrm{\rho }}{=}{x}{,}{\mathrm{\beta }}{=}{z}{,}{\mathrm{\epsilon }}{=}{y}{,}{\mathrm{\tau }}{=}{y}{,}{\mathrm{\kappa }}{=}{x}{,}{\mathrm{\gamma }}{=}{z}{,}{\mathrm{\lambda }}{=}{0}{,}{\mathrm{\mu }}{=}{0}{,}{\mathrm{\nu }}{=}{z}{,}{\mathrm{π}}{=}{0}\right]\right)$ (6)
 > $\mathrm{S_tble}≔\mathrm{act}\left(\mathrm{subs},y={\mathrm{sin}\left(y\right)}^{2}+{\mathrm{cos}\left(y\right)}^{2},\mathrm{S_tble}\right)$
 ${\mathrm{S_tble}}{≔}{table}{}\left(\left[{\mathrm{\alpha }}{=}{{\mathrm{sin}}{}\left({y}\right)}^{{2}}{+}{{\mathrm{cos}}{}\left({y}\right)}^{{2}}{,}{\mathrm{\sigma }}{=}{x}{,}{\mathrm{\rho }}{=}{x}{,}{\mathrm{\beta }}{=}{z}{,}{\mathrm{\epsilon }}{=}{{\mathrm{sin}}{}\left({y}\right)}^{{2}}{+}{{\mathrm{cos}}{}\left({y}\right)}^{{2}}{,}{\mathrm{\tau }}{=}{{\mathrm{sin}}{}\left({y}\right)}^{{2}}{+}{{\mathrm{cos}}{}\left({y}\right)}^{{2}}{,}{\mathrm{\kappa }}{=}{x}{,}{\mathrm{\gamma }}{=}{z}{,}{\mathrm{\lambda }}{=}{0}{,}{\mathrm{\mu }}{=}{0}{,}{\mathrm{\nu }}{=}{z}{,}{\mathrm{π}}{=}{0}\right]\right)$ (7)
 > $\mathrm{act}\left(\mathrm{simplify},\mathrm{S_tble}\right)$
 ${table}{}\left(\left[{\mathrm{\alpha }}{=}{1}{,}{\mathrm{\sigma }}{=}{x}{,}{\mathrm{\rho }}{=}{x}{,}{\mathrm{\beta }}{=}{z}{,}{\mathrm{\epsilon }}{=}{1}{,}{\mathrm{\tau }}{=}{1}{,}{\mathrm{\kappa }}{=}{x}{,}{\mathrm{\gamma }}{=}{z}{,}{\mathrm{\lambda }}{=}{0}{,}{\mathrm{\mu }}{=}{0}{,}{\mathrm{\nu }}{=}{z}{,}{\mathrm{π}}{=}{0}\right]\right)$ (8)
 > $\mathrm{act}\left(\mathrm{display},\mathrm{S_tble}\right):$
 NON-ZERO SPIN COEFFICIENTS :"alpha ="
 "sigma ="
 "rho ="
 "beta ="
 "epsilon ="
 "tau ="
 "kappa ="
 "gamma ="
 "nu ="
 ${\mathrm{_____________________________________________________}}$
 ${{\mathrm{sin}}{}\left({y}\right)}^{{2}}{+}{{\mathrm{cos}}{}\left({y}\right)}^{{2}}$
 ${x}$
 ${x}$
 ${z}$
 ${{\mathrm{sin}}{}\left({y}\right)}^{{2}}{+}{{\mathrm{cos}}{}\left({y}\right)}^{{2}}$
 ${{\mathrm{sin}}{}\left({y}\right)}^{{2}}{+}{{\mathrm{cos}}{}\left({y}\right)}^{{2}}$
 ${x}$
 ${z}$
 ${z}$
 ${\mathrm{_____________________________________________________}}$ (9)
 > $\mathrm{PHI}≔\mathrm{array}\left(0..2,0..2\right):$
 > $\mathbf{for}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}i\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{from}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}0\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{to}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}2\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{do}\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\mathbf{for}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}j\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{from}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}0\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{to}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}2\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{do}\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\mathrm{PHI}\left[i,j\right]≔\mathrm{cat}\left('\mathrm{PHI}',i,j\right)\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\mathbf{end}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{do}\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\mathbf{end}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{do}:$$\mathrm{PSI}≔\mathrm{array}\left(0..4,\left[\mathrm{PSI0},\mathrm{PSI1},\mathrm{PSI2},\mathrm{PSI3},\mathrm{PSI4}\right]\right):$$\mathrm{Curve}≔\mathrm{table}\left(\left['\mathrm{\Phi }'=\mathrm{op}\left(\mathrm{PHI}\right),'\mathrm{\Psi }'=\mathrm{op}\left(\mathrm{PSI}\right),'R'=R\right]\right)$
 ${\mathrm{Curve}}{≔}{table}{}\left(\left[{R}{=}{R}{,}{\mathrm{\Psi }}{=}{array}{}\left({0}{..}{4}{,}\left[\left({0}\right){=}{\mathrm{PSI0}}{,}\left({1}\right){=}{\mathrm{PSI1}}{,}\left({2}\right){=}{\mathrm{PSI2}}{,}\left({3}\right){=}{\mathrm{PSI3}}{,}\left({4}\right){=}{\mathrm{PSI4}}\right]\right){,}{\mathrm{\Phi }}{=}{array}{}\left({0}{..}{2}{,}{0}{..}{2}{,}\left[\left({0}{,}{0}\right){=}{\mathrm{PHI00}}{,}\left({0}{,}{1}\right){=}{\mathrm{PHI01}}{,}\left({0}{,}{2}\right){=}{\mathrm{PHI02}}{,}\left({1}{,}{0}\right){=}{\mathrm{PHI10}}{,}\left({1}{,}{1}\right){=}{\mathrm{PHI11}}{,}\left({1}{,}{2}\right){=}{\mathrm{PHI12}}{,}\left({2}{,}{0}\right){=}{\mathrm{PHI20}}{,}\left({2}{,}{1}\right){=}{\mathrm{PHI21}}{,}\left({2}{,}{2}\right){=}{\mathrm{PHI22}}\right]\right)\right]\right)$ (10)
 > $\mathrm{Curve2}≔\mathrm{act}\left(\mathrm{subs},\left[\mathrm{PHI00}=0,\mathrm{PHI11}={\mathrm{sin}\left(t\right)}^{2},R=\mathrm{tan}\left(t\right),\mathrm{PSI2}={x}^{2},\mathrm{PSI3}=x{y}^{3},\mathrm{PSI0}=0,\mathrm{PSI1}=0,\mathrm{PSI4}=0,\mathrm{PHI22}=0,\mathrm{PHI11}=0,\mathrm{PHI01}=x,\mathrm{PHI10}=x,\mathrm{PHI02}=y,\mathrm{PHI20}=y,\mathrm{PHI12}=z,\mathrm{PHI21}=z\right],\mathrm{Curve}\right)$
 ${\mathrm{Curve2}}{≔}{table}{}\left(\left[{R}{=}{\mathrm{tan}}{}\left({t}\right){,}{\mathrm{\Psi }}{=}{array}{}\left({0}{..}{4}{,}\left[\left({0}\right){=}{0}{,}\left({1}\right){=}{0}{,}\left({2}\right){=}{{x}}^{{2}}{,}\left({3}\right){=}{x}{}{{y}}^{{3}}{,}\left({4}\right){=}{0}\right]\right){,}{\mathrm{\Phi }}{=}{array}{}\left({0}{..}{2}{,}{0}{..}{2}{,}\left[\left({0}{,}{0}\right){=}{0}{,}\left({0}{,}{1}\right){=}{x}{,}\left({0}{,}{2}\right){=}{y}{,}\left({1}{,}{0}\right){=}{x}{,}\left({1}{,}{1}\right){=}{{\mathrm{sin}}{}\left({t}\right)}^{{2}}{,}\left({1}{,}{2}\right){=}{z}{,}\left({2}{,}{0}\right){=}{y}{,}\left({2}{,}{1}\right){=}{z}{,}\left({2}{,}{2}\right){=}{0}\right]\right)\right]\right)$ (11)
 > $\mathrm{act}\left(\mathrm{simplify},\mathrm{Curve2}\right)$
 ${table}{}\left(\left[{R}{=}{\mathrm{tan}}{}\left({t}\right){,}{\mathrm{\Psi }}{=}{array}{}\left({0}{..}{4}{,}\left[\left({0}\right){=}{0}{,}\left({1}\right){=}{0}{,}\left({2}\right){=}{{x}}^{{2}}{,}\left({3}\right){=}{x}{}{{y}}^{{3}}{,}\left({4}\right){=}{0}\right]\right){,}{\mathrm{\Phi }}{=}{array}{}\left({0}{..}{2}{,}{0}{..}{2}{,}\left[\left({0}{,}{0}\right){=}{0}{,}\left({0}{,}{1}\right){=}{x}{,}\left({0}{,}{2}\right){=}{y}{,}\left({1}{,}{0}\right){=}{x}{,}\left({1}{,}{1}\right){=}{{\mathrm{sin}}{}\left({t}\right)}^{{2}}{,}\left({1}{,}{2}\right){=}{z}{,}\left({2}{,}{0}\right){=}{y}{,}\left({2}{,}{1}\right){=}{z}{,}\left({2}{,}{2}\right){=}{0}\right]\right)\right]\right)$ (12)
 > $\mathrm{act}\left(\mathrm{display},\mathrm{Curve2}\right)$
 NON-ZERO CURVATURE COMPONENTS :Psi =
 Psi =
 R =
 ${\mathrm{_____________________________________________________}}$
 ${{x}}^{{2}}$
 ${x}{}{{y}}^{{3}}$
 ${\mathrm{tan}}{}\left({t}\right)$
 ${"%a"}{,}{\mathrm{Phi\left[1, 0\right] =}}$
 ${x}$
 ${"%a"}{,}{\mathrm{Phi\left[1, 2\right] =}}$
 ${z}$
 ${"%a"}{,}{\mathrm{Phi\left[1, 1\right] =}}$
 ${{\mathrm{sin}}{}\left({t}\right)}^{{2}}$
 ${"%a"}{,}{\mathrm{Phi\left[0, 1\right] =}}$
 ${x}$
 ${"%a"}{,}{\mathrm{Phi\left[2, 0\right] =}}$
 ${y}$
 ${"%a"}{,}{\mathrm{Phi\left[0, 2\right] =}}$
 ${y}$
 ${"%a"}{,}{\mathrm{Phi\left[2, 1\right] =}}$
 ${z}$
 ${\mathrm{_____________________________________________________}}$ (13)