tensor(deprecated)/act - 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}}_{1,1}≔x:$${\mathrm{U_compts}}_{1,2}≔1-{\mathrm{sin}\left(t\right)}^{2}-{\mathrm{cos}\left(t\right)}^{2}:$${\mathrm{U_compts}}_{2,2}≔y:$
 > $U≔\mathrm{create}\left(\left[1,-1\right],\mathrm{op}\left(\mathrm{U_compts}\right)\right)$
 ${U}{≔}{\mathrm{table}}\left(\left[{\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]{,}{\mathrm{index_char}}{=}\left[{1}{,}{-}{1}\right]\right]\right)$ (1)
 > $Z≔\mathrm{act}\left(\mathrm{subs},\left[t=z,x=x+xy\right],U\right)$
 ${Z}{≔}{\mathrm{table}}\left(\left[{\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]{,}{\mathrm{index_char}}{=}\left[{1}{,}{-}{1}\right]\right]\right)$ (2)
 > $\mathrm{act}\left(\mathrm{factor},Z\right)$
 ${\mathrm{table}}\left(\left[{\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]{,}{\mathrm{index_char}}{=}\left[{1}{,}{-}{1}\right]\right]\right)$ (3)
 > $V≔\mathrm{act}\left(\mathrm{simplify},Z,\mathrm{trig}\right)$
 ${V}{≔}{\mathrm{table}}\left(\left[{\mathrm{compts}}{=}\left[\begin{array}{cc}{x}{}{y}{+}{x}& {0}\\ {0}& {y}\end{array}\right]{,}{\mathrm{index_char}}{=}\left[{1}{,}{-}{1}\right]\right]\right)$ (4)
 > $\mathrm{act}\left(\mathrm{display},V\right)$
 NON-ZERO INDEPENDENT COMPONENTS :"[2, 2] ="
 "[1, 1] ="
 CHARACTER :
 INDEXING FUNCTION :
 ${\mathrm{_________________________________________________}}$
 ${y}$
 ${x}{}{y}{+}{x}$
 $\left[{1}{,}{-}{1}\right]$
 ${\mathrm{symmetric}}$
 ${\mathrm{_________________________________________________}}$ (5)
 > $\mathrm{S_tble}≔\mathrm{table}\left(\left['\mathrm{κ}'=x,'\mathrm{σ}'=x,'\mathrm{ρ}'=x,'\mathrm{τ}'=y,'\mathrm{ε}'=y,'\mathrm{α}'=y,'\mathrm{β}'=z,'\mathrm{γ}'=z,'\mathrm{ν}'=z,'\mathrm{λ}'=0,'\mathrm{μ}'=0,'\mathrm{π}'=0\right]\right)$
 ${\mathrm{S_tble}}{≔}{\mathrm{table}}\left(\left[{\mathrm{ε}}{=}{y}{,}{\mathrm{τ}}{=}{y}{,}{\mathrm{κ}}{=}{x}{,}{\mathrm{α}}{=}{y}{,}{\mathrm{σ}}{=}{x}{,}{\mathrm{ρ}}{=}{x}{,}{\mathrm{β}}{=}{z}{,}{\mathrm{γ}}{=}{z}{,}{\mathrm{π}}{=}{0}{,}{\mathrm{ν}}{=}{z}{,}{\mathrm{μ}}{=}{0}{,}{\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}}{≔}{\mathrm{table}}\left(\left[{\mathrm{ε}}{=}{{\mathrm{sin}}{}\left({y}\right)}^{{2}}{+}{{\mathrm{cos}}{}\left({y}\right)}^{{2}}{,}{\mathrm{τ}}{=}{{\mathrm{sin}}{}\left({y}\right)}^{{2}}{+}{{\mathrm{cos}}{}\left({y}\right)}^{{2}}{,}{\mathrm{κ}}{=}{x}{,}{\mathrm{α}}{=}{{\mathrm{sin}}{}\left({y}\right)}^{{2}}{+}{{\mathrm{cos}}{}\left({y}\right)}^{{2}}{,}{\mathrm{σ}}{=}{x}{,}{\mathrm{ρ}}{=}{x}{,}{\mathrm{β}}{=}{z}{,}{\mathrm{γ}}{=}{z}{,}{\mathrm{π}}{=}{0}{,}{\mathrm{ν}}{=}{z}{,}{\mathrm{μ}}{=}{0}{,}{\mathrm{λ}}{=}{0}\right]\right)$ (7)
 > $\mathrm{act}\left(\mathrm{simplify},\mathrm{S_tble}\right)$
 ${\mathrm{table}}\left(\left[{\mathrm{ε}}{=}{1}{,}{\mathrm{τ}}{=}{1}{,}{\mathrm{κ}}{=}{x}{,}{\mathrm{α}}{=}{1}{,}{\mathrm{σ}}{=}{x}{,}{\mathrm{ρ}}{=}{x}{,}{\mathrm{β}}{=}{z}{,}{\mathrm{γ}}{=}{z}{,}{\mathrm{π}}{=}{0}{,}{\mathrm{ν}}{=}{z}{,}{\mathrm{μ}}{=}{0}{,}{\mathrm{λ}}{=}{0}\right]\right)$ (8)
 > $\mathrm{act}\left(\mathrm{display},\mathrm{S_tble}\right):$
 NON-ZERO SPIN COEFFICIENTS :"epsilon ="
 "tau ="
 "kappa ="
 "alpha ="
 "sigma ="
 "rho ="
 "beta ="
 "gamma ="
 "nu ="
 ${\mathrm{_________________________________________________}}$
 ${{\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}$
 ${{\mathrm{sin}}{}\left({y}\right)}^{{2}}{+}{{\mathrm{cos}}{}\left({y}\right)}^{{2}}$
 ${x}$
 ${x}$
 ${z}$
 ${z}$
 ${z}$
 ${\mathrm{_________________________________________________}}$ (9)
 > $\mathrm{PHI}≔\mathrm{array}\left(0..2,0..2\right):$
 > $\mathbf{for}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}i\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathbf{from}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}0\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathbf{to}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}2\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathbf{do}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathbf{for}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}j\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathbf{from}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}0\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathbf{to}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}2\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathbf{do}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{PHI}}_{i,j}≔\mathrm{cat}\left('\mathrm{PHI}',i,j\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathbf{end do}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathbf{end 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{Φ}'=\mathrm{op}\left(\mathrm{PHI}\right),'\mathrm{Ψ}'=\mathrm{op}\left(\mathrm{PSI}\right),'R'=R\right]\right)$
 ${\mathrm{Curve}}{≔}{\mathrm{table}}\left(\left[{\mathrm{Φ}}{=}{\mathrm{ARRAY}}{}\left(\left[{0}{..}{2}{,}{0}{..}{2}\right]{,}\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){,}{R}{=}{R}{,}{\mathrm{Ψ}}{=}{\mathrm{ARRAY}}{}\left(\left[{0}{..}{4}\right]{,}\left[{0}{=}{\mathrm{PSI0}}{,}{1}{=}{\mathrm{PSI1}}{,}{2}{=}{\mathrm{PSI2}}{,}{3}{=}{\mathrm{PSI3}}{,}{4}{=}{\mathrm{PSI4}}\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}}{≔}{\mathrm{table}}\left(\left[{\mathrm{Φ}}{=}{\mathrm{ARRAY}}{}\left(\left[{0}{..}{2}{,}{0}{..}{2}\right]{,}\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){,}{R}{=}{\mathrm{tan}}{}\left({t}\right){,}{\mathrm{Ψ}}{=}{\mathrm{ARRAY}}{}\left(\left[{0}{..}{4}\right]{,}\left[{0}{=}{0}{,}{1}{=}{0}{,}{2}{=}{{x}}^{{2}}{,}{3}{=}{x}{}{{y}}^{{3}}{,}{4}{=}{0}\right]\right)\right]\right)$ (11)
 > $\mathrm{act}\left(\mathrm{simplify},\mathrm{Curve2}\right)$
 ${\mathrm{table}}\left(\left[{\mathrm{Φ}}{=}{\mathrm{ARRAY}}{}\left(\left[{0}{..}{2}{,}{0}{..}{2}\right]{,}\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){,}{R}{=}{\mathrm{tan}}{}\left({t}\right){,}{\mathrm{Ψ}}{=}{\mathrm{ARRAY}}{}\left(\left[{0}{..}{4}\right]{,}\left[{0}{=}{0}{,}{1}{=}{0}{,}{2}{=}{{x}}^{{2}}{,}{3}{=}{x}{}{{y}}^{{3}}{,}{4}{=}{0}\right]\right)\right]\right)$ (12)
 > $\mathrm{act}\left(\mathrm{display},\mathrm{Curve2}\right)$
 NON-ZERO CURVATURE COMPONENTS :Psi[2] =
 Psi[3] =
 R =
 ${\mathrm{_________________________________________________}}$
 ${{x}}^{{2}}$
 ${x}{}{{y}}^{{3}}$
 ${\mathrm{tan}}{}\left({t}\right)$
 ${"%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, 2\right] =}}$
 ${y}$
 ${"%a"}{,}{\mathrm{Phi\left[2, 0\right] =}}$
 ${y}$
 ${"%a"}{,}{\mathrm{Phi\left[2, 1\right] =}}$
 ${z}$
 ${"%a"}{,}{\mathrm{Phi\left[0, 1\right] =}}$
 ${x}$
 ${"%a"}{,}{\mathrm{Phi\left[1, 0\right] =}}$
 ${x}$
 ${\mathrm{_________________________________________________}}$ (13)