Error, (in rtable/Product) use *~ for elementwise multiplication of Vectors or Matrices; use . (dot) for Vector/Matrix multiplication - Maple Help

Home : Support : Online Help : Error, (in rtable/Product) use *~ for elementwise multiplication of Vectors or Matrices; use . (dot) for Vector/Matrix multiplication

Error, (in rtable/Product) use *~ for elementwise multiplication of Vectors or Matrices; use . (dot) for Vector/Matrix multiplication

Description

An expression involving the multiplication of Vectors and/or Matrices (possibly and/or Arrays) has been constructed using the standard multiplication operator, *, which is ambiguous.

Note that in 2-D math * displays as a center dot: ⋅, and typing a dot (using the period key) displays as $·$, as show in the following table.

 When you type It displays as A*b $A\cdot b$ A.b $A·b$

This display can be modified through the interactive Typesetting Rule Assistant.

For Vector/Matrix multiplication, use . (dot).  If instead you want to perform elementwise multiplication, use *~.

Examples

Example 1:

This error results if Matrices, or a Matrix and a Vector, are multiplied using a commutative multiplication operator, *:

 >
 $\left[\begin{array}{cc}\mathit{a__11}& \mathit{a__12}\\ \mathit{a__21}& \mathit{a__22}\end{array}\right]$ (2.1)
 >
 $\left[\begin{array}{c}\mathit{v__1}\\ \mathit{v__2}\end{array}\right]$ (2.2)
 > $A\cdot A$
 > $A\cdot v$

Solution 1:

To multiply Matrices and/or Vectors together using the standard Linear Algebra multiplication operation, use the non-commutative multiplication operator, . (dot):

 > $A·A$
 > $A·v$

Example 2:

Implicit multiplication (using a space to mean multiplication) can also be ambiguous.

 >
 $\left[\begin{array}{cc}a& b\\ c& d\end{array}\right]$ (2.3)
 >

Solution 2:

To multiply Vectors and/or Matrices and/or Arrays together using elementwise multiplication, use the standard multiplication operator, * followed by the "elementwise" operator, ~:

 >
 >

Note that when multiplying Arrays together (not with Vectors or Matrices), the standard multiplication operator will result in the elementwise product, so the ~ is not necessary:

 >
 $\left[\begin{array}{cc}{a}^{2}& {b}^{2}\\ {c}^{2}& {d}^{2}\end{array}\right]$ (2.4)

Note also that implicit multiplication is interpreted based on the operands, and when it can, Maple parses these as follows: For Vector/Matrix operands this will be interpreted as the . (dot) non-commutative multiplication operator, while for Array operands this will be interpreted as the elementwise operator:

 >
 >

However, best practice is to insert the explicit multiplication operator into your expressions.