tensor(deprecated)/prod - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : tensor(deprecated)/prod

tensor

  

prod

  

inner and outer tensor product

 

Calling Sequence

Parameters

Description

Examples

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 MINRankA,RankB. 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.

withtensor:

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

Tcreate1,1,arrayw,x,0,y,z,0,0,y2,xyw

Ttablecompts=wx0yz00y2xyw,index_char=1,−1

(1)

Ucreate1,arrayl,m,n

Utablecompts=lmn,index_char=1

(2)

prodT,U,2,1

tablecompts=wl+mxyl+mznwxy+my2,index_char=1

(3)

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

Vcreate1,arraya,b,c

Vtablecompts=abc,index_char=−1

(4)

prodV,U

tablecompts=alamanblbmbnclcmcn,index_char=−1,1

(5)

prodV,U,1,1

tablecompts=al+bm+cn,index_char=

(6)

Find the product of two scalars:

Acreate,a

Atablecompts=a,index_char=

(7)

Bcreate,b

Btablecompts=b,index_char=

(8)

prodA,B

tablecompts=ab,index_char=

(9)

See Also

DifferentialGeometry[&tensor]

DifferentialGeometry[Tensor][TensorInnerProduct]

Physics[`.`]

Physics[*]

tensor(deprecated)

tensor(deprecated)/permute_indices

tensor(deprecated)[contract]

tensor(deprecated)[simp]