Wolfram Language Paclet Repository

Community-contributed installable additions to the Wolfram Language

Primary Navigation

    • Cloud & Deployment
    • Core Language & Structure
    • Data Manipulation & Analysis
    • Engineering Data & Computation
    • External Interfaces & Connections
    • Financial Data & Computation
    • Geographic Data & Computation
    • Geometry
    • Graphs & Networks
    • Higher Mathematical Computation
    • Images
    • Knowledge Representation & Natural Language
    • Machine Learning
    • Notebook Documents & Presentation
    • Scientific and Medical Data & Computation
    • Social, Cultural & Linguistic Data
    • Strings & Text
    • Symbolic & Numeric Computation
    • System Operation & Setup
    • Time-Related Computation
    • User Interface Construction
    • Visualization & Graphics
    • Random Paclet
    • Alphabetical List
  • Using Paclets
    • Get Started
    • Download Definition Notebook
  • Learn More about Wolfram Language

GeometricAlgebra

Guides

  • Dual numbers
  • Geometric Algebra
  • Matrix Gateway

Tech Notes

  • Conformal Geometry
  • Dual numbers
  • Geometric Numbers
  • Matrix Gateway
  • Operator Duality
  • Projective Geometry
  • Spinors

Symbols

  • ConvertGeometricAlgebra
  • GeometricAlgebra
  • GeometricProduct
  • Grade
  • Multivector
Matrix Gateway
Interface between multivectors and matrices.
MultivectorMatrix
convert
Multivector
to a
MultivectorArray
matrix
MatrixMultivector
convert
MultivectorArray
matrix into
Multivector
MultivectorBlock
convert
Multivector
to a 2x2
MultivectorArray
matrix

p,q


2×2
(

p-1,q-1
)
Matrix Gateway to Geometric Algebra
by Garret Sobczyk, 2019.
Let’s work with 5-dimensional geometric algebras

3,0
and

2,1
In[6]:=
G1=
GeometricAlgebra
[3,0]​​G2=
GeometricAlgebra
[2,1]
Out[6]=

3
Out[7]=

2,1
And generate random numerical multivectors in these algebras
In[8]:=
SeedRandom[0];​​v=
Multivector
[Rationalize[RandomReal[{-1,1},8],0.01],G1]​​w=
Multivector
[Rationalize[RandomReal[{-1,1},8],0.01],G2]
Out[9]=
3
10
+
3
11
e
1
+
3
8
e
2
+
1
8
e
3
+
7
8
e
12
+
17
18
e
13
+-
9
17
e
23
+
3
11
e
123
Out[10]=
-
4
5
+
2
7
e
1
+-
13
19
e
2
+
5
8
e
1
+
4
5
e
12
+
2
7
e
1
1
+-
5
13
e
2
1
+
12
23
e
12
1
Any multivector can be transformed into a matrix (square MultivectorArray of rank 2) containing lower dimensional multivectors as its components
In[8]:=
MultivectorMatrix[v]
Out[8]=

3
10
+
17
18
+-
3
11
-
3
8
e
1
3
11
-

8
+
9
17
+
7
8
e
1


3
11
+

8
+
9
17
-
7
8
e
1
3
10
-
17
18
+-
3
11
+
3
8
e
1

In[9]:=
MultivectorMatrix[w]
Out[9]=

-
18
35
+
527
437
e
1
-
19
56
+
27
65
e
1


51
56
+-
77
65
e
1
-
38
35
+-
71
437
e
1

Notice that matrix components of

3,0
contain multivectors of

0,1
, and components of

2,1
contain

1,0
which are lowest dimensional algebras with the same sign of pseudoscalar squared, -1 and 1 respectivelyMatrix components of

3,0
also contain the imaginary units , which come from the conversion to a balanced algebra

3,0
≡(
e
1
,
e
2
,
e
3
)(
e
1
,
e
2
,
e
3
)≡

2,1
.
Converting from one algebra to another is easy:
In[10]:=
ConvertGeometricAlgebra
[w,G1]
Out[10]=
-
4
5
+
2
7
e
1
+-
13
19
e
2
+-
5
8
e
3
+
4
5
e
12
+-
2
7
e
13
+
5
13
e
23
+-
12
23
e
123
In[11]:=
ConvertGeometricAlgebra
[v,G2]
Out[11]=
3
10
+
3
11
e
1
+
3
8
e
2
+

8
e
1
+
7
8
e
12
+
17
18
e
1
1
+-
9
17
e
2
1
+
3
11
e
12
1
In[12]:=
ConvertGeometricAlgebra

ConvertGeometricAlgebra
[v,G2],G1v
Out[12]=
True
In[13]:=
ConvertGeometricAlgebra

ConvertGeometricAlgebra
[w,G1],G2w
Out[13]=
True
The inverse operation of MultivectorMatrix is MatrixMultivector, with an optional additional argument of desired geometric algebra, because there are exist
3+1
different geometric algebra signatures with dimension 3:
In[14]:=
MatrixMultivector[MultivectorMatrix[v],G1]v​​MatrixMultivector[MultivectorMatrix[w],G2]w
Out[14]=
True
Out[15]=
True
Multiplying matrices is equivalent to multiplying multivectors (make sure to multiply within one algebra to avoid coercion):
In[16]:=
MatrixMultivectorMultivectorMatrix[v]**MultivectorMatrix
ConvertGeometricAlgebra
[w,G1],G1===v**
ConvertGeometricAlgebra
[w,G1]​​MatrixMultivectorMultivectorMatrix
ConvertGeometricAlgebra
[v,G2]**MultivectorMatrix[w],G2===
ConvertGeometricAlgebra
[v,G2]**w
Out[16]=
True
Out[17]=
True
Using this Matrix Gateway, any conventional operation on matrices (
MatrixFunction
) can be imported into geometric algebra.
The computation is based on the following simple realization. Given a 1-dimensional algebra with pseudoscalar

that squares to -1:
In[18]:=
=I;
In[19]:=
^2
Out[19]=
-1
Applying any matrix function (like
MatrixExp
) to a matrix with scalar and pseudoscalar components
X
and
Y
is equivalent to applying it to the matrix and its conjugate and then adding them together (with appropriate coefficients):
In[20]:=
X=RandomReal[1,{4,4}];​​Y=RandomReal[1,{4,4}];​​​​M=X+Y;
In[23]:=
a=MatrixExp[X+Y];​​b=MatrixExp[X-Y];​​​​
a+b
2
+(-)
a-b
2
-MatrixExp[M]//Chop
Out[25]=
{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}
Where coefficient
-
was set exactly for the expression to simplify as
a+b
2
+
a-b
2
=a
, which makes this completely redundant, because if there is a built-in way to do exponentiation on complex matrices, we can just do it directly. But for hyperbolic case with
2

=1
and treating

itself as
1
gives the correct procedure:
In[26]:=
=
GeometricAlgebra
[1]["Pseudoscalar"];
In[27]:=
^2
Out[27]=
1
In[28]:=
a=MatrixExp[X+Y];​​b=MatrixExp[X-Y];​​​​MultivectorArray
a+b
2
+
a-b
2
MultivectorFunction[Exp,MultivectorArray[X+Y]]
Out[30]=
True
For example computing an inverse multivector uses matrix inversion function:
In[31]:=
Inverse[v]MatrixMultivector[MultivectorFunction[1/#&,MultivectorMatrix[v]],G1]
Out[31]=
True
In[32]:=
Inverse[v]**v//N//Chop​​Inverse[w]**w//N//Chop
Out[32]=
1.
Out[33]=
1.
Or exponential and logarithm:
In[34]:=
MultivectorFunction[Exp,w]//N​​MultivectorFunction[Log,v]//N
Out[34]=
0.615653+0.0261969
e
1
+(-0.467507)
e
2
+0.0711741
e
1
+0.224935
e
12
+0.384702
e
1
1
+(-0.113095)
e
2
1
+0.517206
e
12
1
Out[35]=
0.337383+0.+(0.089309+1.94289×
-16
10
)
e
1
+(0.057115+0.)
e
2
+(0.380016+3.60822×
-16
10
)
e
3
+(0.763926-3.33067×
-16
10
)
e
12
+(0.979259+0.)
e
13
+(-0.567895-8.32667×
-16
10
)
e
23
+(0.250175+0.)
e
123
Check
Log[Exp[v]]==v
and
Exp[Log[v]]==v
identities:
In[6]:=
MultivectorFunction[Log,MultivectorFunction[Exp,v]]v//FullSimplify
Out[6]=
True
Nest multivector blocks:

© 2025 Wolfram. All rights reserved.

  • Legal & Privacy Policy
  • Contact Us
  • WolframAlpha.com
  • WolframCloud.com