operations - Maple Help

Home : Support : Online Help : Physics : Vectors : operations

Physics[Vectors][+] - add algebraic Vectors

Physics[Vectors][.] - compute the dot product of algebraic Vectors

Physics[Vectors][&x] - compute the cross product of algebraic Vectors

 Calling Sequence A + B A . B A &x B

Parameters

 A, B - any algebraic expressions, including explicit (projected) or implicit (non-projected) vectors

Description

 • The addition, subtraction, dot and cross product of the algebraic vectors of the Physics[Vectors] subpackage are accomplished by the operators +, -, ., and &x respectively. When entering &x, it is recommended to make explicit the precedence of operations by using parentheses ( ) because the infix operators & have higher precedence than the standard operations [+, *, -, ^].
 • The %+ %. and %&x are the inert forms of + . and &x, that is: if used as in a function call, such as %.(A, B), they represent the same mathematical operations while holding the operations unperformed. To activate the operations use value.
 • Since the representation for vectors is algebraic, there is computationally no difference between a formal zero vector and the number $0$ and the additive inverse of a vector, say $\mathrm{A_}$, can also be represented directly by $-\mathrm{A_}$.
 • These operations commands of the Physics[Vectors] subpackage are designed to work with non-projected vector functions, as well as with cartesian, cylindrical or spherical projections (see Physics[Vectors]). In the case of projected vector functions, it is required that the vectors entering a given expression are all projected into one and the same orthonormal vector base.
 • Both projected and nonprojected vectors of the Physics[Vectors] subpackage can also represent 3-D-vectorial noncommutative quantum operators - see for instance the Quantum Mechanics section, of Physics, examples (this page opens only in the Standard Graphical User Interface). In this case, the scalar product of two vectorial quantum operators is defined as follows.
 When the quantum operator vectors A_ and B_ are not projected, the product operations return unevaluated

$\mathrm{A_}.\mathrm{B_}\to \mathrm{A_}.\mathrm{B_}$

$\mathrm{A_}&x\mathrm{B_}\to \mathrm{A_}&x\mathrm{B_}$

 When the $\mathrm{A_}$ and $\mathrm{B_}$ are projected, that is, their components in one of the cartesian, cylindrical, or spherical bases are known, the scalar and cross products of these noncommutative quantum operators are respectively symmetrized and antisymmetrized as follows:

$\mathrm{A_}.\mathrm{B_}\to \frac{\left(\mathrm{A_}.\mathrm{B_}+\mathrm{B_}.\mathrm{A_}\right)}{2}$

$\mathrm{A_}&x\mathrm{B_}\to \frac{\left(\mathrm{A_}&x\mathrm{B_}-\mathrm{B_}&x\mathrm{A_}\right)}{2}$

 Examples of the use of 3-D vectorial quantum operators are found in the Quantum Mechanics section of Physics, examples.
 • All the received arguments are checked for consistency before a result is returned; no matter the complexity of (maybe) nested expressions. For instance, if the addition of a vector with a scalar, or the standard product * between two vectors is found inside an expression, the calculations are interrupted and an error message is presented.
 • To multiply a scalar function times a vector you can use either . or the usual multiplication operator *.

Examples

 > $\mathrm{with}\left(\mathrm{Physics}\left[\mathrm{Vectors}\right]\right)$
 $\left[{\mathrm{&x}}{,}{\mathrm{+}}{,}{\mathrm{.}}{,}{\mathrm{ChangeBasis}}{,}{\mathrm{ChangeCoordinates}}{,}{\mathrm{Component}}{,}{\mathrm{Curl}}{,}{\mathrm{DirectionalDiff}}{,}{\mathrm{Divergence}}{,}{\mathrm{Gradient}}{,}{\mathrm{Identify}}{,}{\mathrm{Laplacian}}{,}{\nabla }{,}{\mathrm{Norm}}{,}{\mathrm{Setup}}{,}{\mathrm{diff}}\right]$ (1)
 > $\mathrm{Setup}\left(\mathrm{mathematicalnotation}=\mathrm{true}\right)$
 $\left[{\mathrm{mathematicalnotation}}{=}{\mathrm{true}}\right]$ (2)
 > $A≔\mathrm{a1}\mathrm{_i}+\mathrm{a2}\mathrm{_j}+\mathrm{a3}\mathrm{_k}$
 ${A}{≔}{\mathrm{a1}}{}\stackrel{{\wedge }}{{i}}{+}{\mathrm{a2}}{}\stackrel{{\wedge }}{{j}}{+}{\mathrm{a3}}{}\stackrel{{\wedge }}{{k}}$ (3)
 > $B≔\mathrm{b1}\mathrm{_i}+\mathrm{b2}\mathrm{_j}+\mathrm{b3}\mathrm{_k}$
 ${B}{≔}{\mathrm{b1}}{}\stackrel{{\wedge }}{{i}}{+}{\mathrm{b2}}{}\stackrel{{\wedge }}{{j}}{+}{\mathrm{b3}}{}\stackrel{{\wedge }}{{k}}$ (4)
 > $C≔\mathrm{c1}\mathrm{_i}+\mathrm{c2}\mathrm{_j}+\mathrm{c3}\mathrm{_k}$
 ${C}{≔}{\mathrm{c1}}{}\stackrel{{\wedge }}{{i}}{+}{\mathrm{c2}}{}\stackrel{{\wedge }}{{j}}{+}{\mathrm{c3}}{}\stackrel{{\wedge }}{{k}}$ (5)
 > $A+B$
 $\stackrel{{\wedge }}{{i}}{}\left({\mathrm{a1}}{+}{\mathrm{b1}}\right){+}\stackrel{{\wedge }}{{j}}{}\left({\mathrm{a2}}{+}{\mathrm{b2}}\right){+}\stackrel{{\wedge }}{{k}}{}\left({\mathrm{a3}}{+}{\mathrm{b3}}\right)$ (6)
 > $A·B$
 ${\mathrm{a1}}{}{\mathrm{b1}}{+}{\mathrm{a2}}{}{\mathrm{b2}}{+}{\mathrm{a3}}{}{\mathrm{b3}}$ (7)
 > $A\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&x\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}B$
 $\left({\mathrm{a2}}{}{\mathrm{b3}}{-}{\mathrm{a3}}{}{\mathrm{b2}}\right){}\stackrel{{\wedge }}{{i}}{+}\left({-}{\mathrm{a1}}{}{\mathrm{b3}}{+}{\mathrm{a3}}{}{\mathrm{b1}}\right){}\stackrel{{\wedge }}{{j}}{+}\left({\mathrm{a1}}{}{\mathrm{b2}}{-}{\mathrm{a2}}{}{\mathrm{b1}}\right){}\stackrel{{\wedge }}{{k}}$ (8)
 > $A·\left(B\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&x\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}C\right)$
 ${\mathrm{a1}}{}{\mathrm{b2}}{}{\mathrm{c3}}{-}{\mathrm{a1}}{}{\mathrm{b3}}{}{\mathrm{c2}}{-}{\mathrm{a2}}{}{\mathrm{b1}}{}{\mathrm{c3}}{+}{\mathrm{a2}}{}{\mathrm{b3}}{}{\mathrm{c1}}{+}{\mathrm{a3}}{}{\mathrm{b1}}{}{\mathrm{c2}}{-}{\mathrm{a3}}{}{\mathrm{b2}}{}{\mathrm{c1}}$ (9)

Operations between non-projected vectors are implemented. For that purpose, either set the postfix identification for non-projected vectors using the Setup command, or use the default loaded with the Vectors package, that is the underscore _. For illustration purposes we set this postfix identification here again, and so objects like $\mathrm{A_}$, $\mathrm{B_}$ and $\mathrm{C_}$ represent non-projected vectors, with the underscore representing a mimicry for the usual "arrow on top"

The following could be any sequence of characters.

 > $\mathrm{Physics}\left[\mathrm{Setup}\right]\left(\mathrm{vectorpostfix}=_\right)$
 $\left[{\mathrm{vectorpostfix}}{=}{_}\right]$ (10)

The basic operation with non-projected vectors return normalized so mathematically equivalent expressions written in different manners are identified as mathematically equal.

Normal form for dot product of Vectors.

 > $\mathrm{A_}·\mathrm{B_}=\mathrm{B_}·\mathrm{A_}$
 $\stackrel{{\to }}{{A}}{·}\stackrel{{\to }}{{B}}{=}\stackrel{{\to }}{{A}}{·}\stackrel{{\to }}{{B}}$ (11)

Normal form for cross product of Vectors.

 > $\mathrm{A_}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&x\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{B_}=-\mathrm{B_}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&x\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{A_}$
 $\stackrel{{\to }}{{A}}{×}\stackrel{{\to }}{{B}}{=}\stackrel{{\to }}{{A}}{×}\stackrel{{\to }}{{B}}$ (12)

Basic identities are recognized.

 > $\mathrm{A_}·\left(\mathrm{B_}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&x\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{A_}\right)$
 ${0}$ (13)

Expansion rules

 > $\mathrm{eq}≔\mathrm{A_}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&x\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\left(\mathrm{B_}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&x\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{C_}\right)$
 ${\mathrm{eq}}{≔}\stackrel{{\to }}{{A}}{×}\left(\stackrel{{\to }}{{B}}{×}\stackrel{{\to }}{{C}}\right)$ (14)
 > $\mathrm{expand}\left(\mathrm{eq}\right)$
 $\stackrel{{\to }}{{B}}{}\left(\stackrel{{\to }}{{A}}{·}\stackrel{{\to }}{{C}}\right){-}\left(\stackrel{{\to }}{{A}}{·}\stackrel{{\to }}{{B}}\right){}\stackrel{{\to }}{{C}}$ (15)

The triple product has the cyclic property

 > $\mathrm{A_}·\left(\mathrm{B_}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&x\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{C_}\right)-\mathrm{C_}·\left(\mathrm{A_}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&x\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{B_}\right)$
 ${0}$ (16)
 >