In [1]:
from __future__ import print_function
from sympy import Symbol, symbols, sin, cos, Rational, expand, simplify, collect, S
from galgebra.printer import Eprint, Get_Program, Print_Function, Format
from galgebra.ga import Ga, one, zero
from galgebra.mv import Nga
Format()
In [2]:
X = (x, y, z) = symbols('x y z')
o3d = Ga('e_x e_y e_z', g=[1, 1, 1], coords=X)
(ex, ey, ez) = o3d.mv()
grad = o3d.grad
In [3]:
c = o3d.mv('c', 'scalar')
In [4]:
a = o3d.mv('a', 'vector')
b = o3d.mv('b', 'vector')
In [5]:
A = o3d.mv('A','mv')
B = o3d.mv('B','mv')
The inner product of blades in GAlgebra is zero if either operand is a scalar:
$$\begin{split}\begin{aligned} {\boldsymbol{A}}_{r}{\wedge}{\boldsymbol{B}}_{s} &\equiv {\left <{{\boldsymbol{A}}_{r}{\boldsymbol{B}}_{s}} \right >_{r+s}} \\ {\boldsymbol{A}}_{r}\cdot{\boldsymbol{B}}_{s} &\equiv {\left \{ { \begin{array}{cc} r\mbox{ and }s \ne 0: & {\left <{{\boldsymbol{A}}_{r}{\boldsymbol{B}}_{s}} \right >_{{\left |{r-s}\right |}}} \\ r\mbox{ or }s = 0: & 0 \end{array}} \right \}} \end{aligned}\end{split}$$This definition comes from David Hestenes and Garret Sobczyk, “Clifford Algebra to Geometric Calculus,” Kluwer Academic Publishers, 1984.
In some other literature, the inner product is defined without the exceptional case for scalar part and the definition above is known as "the modified Hestenes inner product" (this name comes from the source code of GAViewer).
In [6]:
c|a
Out[6]:
In [7]:
a|c
Out[7]:
In [8]:
c|A
Out[8]:
In [9]:
A|c
Out[9]:
$ab=a \wedge b + a \cdot b$ holds for vectors:
In [10]:
a*b
Out[10]:
In [11]:
a^b
Out[11]:
In [12]:
a|b
Out[12]:
In [13]:
(a*b)-(a^b)-(a|b)
Out[13]:
$aA=a \wedge A + a \cdot A$ holds for the products between vectors and multivectors:
In [14]:
a*A
Out[14]:
In [15]:
a^A
Out[15]:
In [16]:
a|A
Out[16]:
In [17]:
(a*A)-(a^A)-(a|A)
Out[17]:
$AB=A \wedge B + A \cdot B$ does NOT hold for the products between multivectors and multivectors:
In [18]:
A*B
Out[18]:
In [19]:
A|B
Out[19]:
In [20]:
(A*B)-(A^B)-(A|B)
Out[20]:
In [21]:
(A<B)+(A|B)+(A>B)-A*B
Out[21]:
In [ ]: