tensor(deprecated)/prod - Maple Help

tensor

 prod
 inner and outer tensor product

 Calling Sequence prod(A, B, [a1, b1], [a2, b2], ...)

Parameters

 A, B - tensor_type objects of which to find the product [ai, bi] - pair of integer indices of opposite index character to be contracted over in the (inner) product, the first index being from A, the second from B. The number of index pairs is arbitrary, so long as it does not exceed $\mathrm{MIN}\left(\mathrm{Rank}\left(A\right),\mathrm{Rank}\left(B\right)\right)$. If no index pairs are given, the outer product of A and B is formed.

Description

Important: The tensor package has been deprecated. Use the superseding command DifferentialGeometry[Tensor][TensorInnerProduct] and operator &tensor in the DifferentialGeometry package, or the Physics[.] and Physics[*] operators.

 • The function prod(A, B, [a1,b1], [a2,b2], ...) computes the inner product of the A and B with contraction taking place over the pairs of indices a1 (from A) and b1 (from B), a2 (from A) and b2 (from B), and so on.
 • The function prod(A, B) computes the outer product of A and B.
 • The indices in each pair must be of opposite index character.
 • There must not be any duplicates in the given indices from each tensor (it is impossible to contract over a single index more than once).  Thus, the call prod(A, B, [1,2], [1,3]) is illegal.  However, the call prod(A, B, [1,1]) is not illegal (provided the indices are of opposite index character) since there is no repetition of indices from A and no repetition of indices from B.
 • The return value is the resultant tensor_type object of rank equal to rank(A) + rank(B) - 2 * (# of pairs in the call).
 • Simplification:  This routine uses the tensor/prod/simp routine for simplification purposes.  The simplification routine is applied to each component of the result after it is computed.  By default, tensor/prod/simp is initialized to the tensor/simp routine. It is recommended that the tensor/prod/simp routine be customized to suit the needs of the particular problem.
 • This function is part of the tensor package, and so can be used in the form prod(..) only after performing the command with(tensor), or with(tensor,prod). This function can always be accessed in the long form tensor[prod](..).

Examples

Important: The tensor package has been deprecated. Use the superseding command DifferentialGeometry[Tensor][TensorInnerProduct] and operator &tensor in the DifferentialGeometry package, or the Physics[.] and Physics[*] operators.

 > $\mathrm{with}\left(\mathrm{tensor}\right):$

Create a rank-2 tensor and a rank-1 tensor and form their inner product:

 > $T≔\mathrm{create}\left(\left[1,-1\right],\mathrm{array}\left(\left[\left[w,x,0\right],\left[y,z,0\right],\left[0,{y}^{2},xyw\right]\right]\right)\right)$
 ${T}{≔}{table}{}\left(\left[{\mathrm{compts}}{=}\left[\begin{array}{ccc}{w}& {x}& {0}\\ {y}& {z}& {0}\\ {0}& {{y}}^{{2}}& {x}{}{y}{}{w}\end{array}\right]{,}{\mathrm{index_char}}{=}\left[{1}{,}{-1}\right]\right]\right)$ (1)
 > $U≔\mathrm{create}\left(\left[1\right],\mathrm{array}\left(\left[l,m,n\right]\right)\right)$
 ${U}{≔}{table}{}\left(\left[{\mathrm{compts}}{=}\left[\begin{array}{ccc}{l}& {m}& {n}\end{array}\right]{,}{\mathrm{index_char}}{=}\left[{1}\right]\right]\right)$ (2)
 > $\mathrm{prod}\left(T,U,\left[2,1\right]\right)$
 ${table}{}\left(\left[{\mathrm{compts}}{=}\left[\begin{array}{ccc}{w}{}{l}{+}{m}{}{x}& {y}{}{l}{+}{m}{}{z}& {n}{}{w}{}{x}{}{y}{+}{m}{}{{y}}^{{2}}\end{array}\right]{,}{\mathrm{index_char}}{=}\left[{1}\right]\right]\right)$ (3)

Create another 1-tensor and form the outer and inner products with U:

 > $V≔\mathrm{create}\left(\left[-1\right],\mathrm{array}\left(\left[a,b,c\right]\right)\right)$
 ${V}{≔}{table}{}\left(\left[{\mathrm{compts}}{=}\left[\begin{array}{ccc}{a}& {b}& {c}\end{array}\right]{,}{\mathrm{index_char}}{=}\left[{-1}\right]\right]\right)$ (4)
 > $\mathrm{prod}\left(V,U\right)$
 ${table}{}\left(\left[{\mathrm{compts}}{=}\left[\begin{array}{ccc}{a}{}{l}& {a}{}{m}& {a}{}{n}\\ {b}{}{l}& {b}{}{m}& {b}{}{n}\\ {c}{}{l}& {c}{}{m}& {c}{}{n}\end{array}\right]{,}{\mathrm{index_char}}{=}\left[{-1}{,}{1}\right]\right]\right)$ (5)
 > $\mathrm{prod}\left(V,U,\left[1,1\right]\right)$
 ${table}{}\left(\left[{\mathrm{compts}}{=}{a}{}{l}{+}{b}{}{m}{+}{c}{}{n}{,}{\mathrm{index_char}}{=}\left[\right]\right]\right)$ (6)

Find the product of two scalars:

 > $A≔\mathrm{create}\left(\left[\right],a\right)$
 ${A}{≔}{table}{}\left(\left[{\mathrm{compts}}{=}{a}{,}{\mathrm{index_char}}{=}\left[\right]\right]\right)$ (7)
 > $B≔\mathrm{create}\left(\left[\right],b\right)$
 ${B}{≔}{table}{}\left(\left[{\mathrm{compts}}{=}{b}{,}{\mathrm{index_char}}{=}\left[\right]\right]\right)$ (8)
 > $\mathrm{prod}\left(A,B\right)$
 ${table}{}\left(\left[{\mathrm{compts}}{=}{a}{}{b}{,}{\mathrm{index_char}}{=}\left[\right]\right]\right)$ (9)