2

I am a computer scientist, not a mathematician. I am trying to understand multivectors from an applied sense.

I am reading the wiki entry: https://en.m.wikipedia.org/wiki/Bivector

So in order to define a bivector we first need to define the geometric product.

The issue I have is, the geometric product is defined in terms of its algebraic properties, but not in terms of its computation. Same with the Scalar product and Exterior product.

If I pick a basis and I have say 3D vectors $(x,y,z)$, $(u,v,w)$ what exactly do I do? I.e. how do I manipulate these elements to produce the output of each of the geometric, scalar and exterior product?

KReiser
  • 65,137
Makogan
  • 3,329
  • It depends a little how you store bivectors – Mark S. Oct 29 '22 at 04:54
  • @MarkS. What would be the simplest way to store them? How many fundamental types would I need to represent them if I constrain my algebra to just 3D for example? – Makogan Oct 29 '22 at 06:02
  • Bivectors are isomorphic to antisymmetric matrices (at least with the Euclidean dot product). If $a,b$ are vectors and $A,B$ are bivectors, then these geometric products correspond to matrix products: $$a\cdot b=\langle ab\rangle_0\cong[a]^T[b]$$ $$a\wedge b=\langle ab\rangle_2\cong[a][b]^T-[b][a]^T$$ $$A\cdot b=\langle Ab\rangle_1\cong[A][b]$$ $$A\cdot B=\langle AB\rangle_0\cong\text{tr}([A][B])$$ $$A\times B=\langle AB\rangle_2\cong[A][B]-[B][A]$$ (I may be missing some factors of $2$ in these formulas.) But this doesn't generalize to higher multivectors. – mr_e_man Oct 30 '22 at 23:26
  • @mr_e_man This is already very useful, but I'd still like to know how to compute an arbitrary multivector. – Makogan Oct 30 '22 at 23:44
  • Are you interested in $n$ dimensions, or just $n=3$? – mr_e_man Oct 31 '22 at 01:21
  • @mr_e_man fror now I guess up to n=4. – Makogan Oct 31 '22 at 02:27
  • Too late, I already wrote a general answer. :) But if you want an explicit multiplication table, see https://www.euclideanspace.com/maths/algebra/clifford/theory/cayleyTable/index.htm – mr_e_man Oct 31 '22 at 02:35
  • @mr_e_man So, based on your answer and the table you linked, the representation would be to have a scalar type, a type for the grade 1 blades, a type for the grade 3 blades...

    And computationally any multivector is a tuple of size $n \choose k$ where we, by convention, associate entry i with an order $k$ tuple of unique entries in ${n}$ ?

    And

    – Makogan Oct 31 '22 at 02:42
  • You can add multivectors of different grades; e.g. a vector plus a scalar. So I think there would be just one multivector type. – mr_e_man Oct 31 '22 at 02:47
  • But for some applications you can keep them separate. Yes, a $k$-vector is computationally an array of size $\binom nk$. – mr_e_man Oct 31 '22 at 02:51
  • Ohh! that makes a lot of sense now, thank you lots for the explanation! – Makogan Oct 31 '22 at 04:44
  • This question might be a duplicate of https://math.stackexchange.com/q/444988/472818 . See also Arthan's paper https://arxiv.org/pdf/math/0607190.pdf . – mr_e_man Oct 31 '22 at 17:42
  • @Makogan "computer scientist" - Any thoughts on computing the sign exponent $x=\sum_{i>j}s_it_j$ in high dimensions? See my comment below the answer. Also see this and this, though it's a simpler problem there, just $|S|=\sum s_i$. – mr_e_man Sep 27 '23 at 20:05

1 Answers1

4

A vector is a linear combination of the basis vectors $e_1,e_2,e_3,\cdots,e_n$. With $n=3$, you have $(x,y,z)=xe_1+ye_2+ze_3$.

A multivector is a linear combination of the basis multivectors, which correspond to the subsets of the set $\{1,2,3,\cdots,n\}$. A basis multivector is the product of all of the basis vectors whose indices are in the subset.

$$\begin{align}\text{grade }0:\quad\{1\};\qquad&\text{total}:\quad\binom{n}{0}=1 \\ \text{grade }1:\quad\{e_1,\;e_2,\;e_3,\;\cdots\;,\;e_n\};\qquad&\text{total}:\quad\binom{n}{1}=n \\ \text{grade }2:\quad\{e_1e_2,\;e_1e_3,\;e_2e_3,\;\cdots\;,\;e_{n-1}e_n\};\qquad&\text{total}:\quad\binom{n}{2}=n(n-1)/2 \\ \text{grade }3:\quad\{e_1e_2e_3,\;\cdots\;,\;e_{n-2}e_{n-1}e_n\};\qquad&\text{total}:\quad\binom{n}{3}=n(n-1)(n-2)/6 \\ \vdots& \\ \text{grade }n:\quad\{e_1e_2e_3\cdots e_n\};\qquad&\text{total}:\quad\binom{n}{n}=1\end{align}$$

Any basis multivector can be written in the form $e_1^{s_1}e_2^{s_2}e_3^{s_3}\cdots e_n^{s_n}$, where each exponent $s_i$ is either $1$ or $0$; the vector is there in the product, or it isn't there. We could also write this as $e_S$, where $S$ is a subset of $\{1,2,3,\cdots,n\}$. The total number of these is $2^n$.

Thus, any multivector $A$ can be expressed (uniquely) as

$$A=\sum_{S\subseteq\{1,\cdots,n\}}a_Se_S,$$

or as an array of $2^n$ real numbers $a_S$. The grade $k$ projection of $A$ is

$$\langle A\rangle_k=\sum_{S\subseteq\{1,\cdots,n\},\\|S|=k}a_Se_S.$$

Now let's consider the geometric product of two arbitrary multivectors $A$ and $B$. Since the product is bilinear, we only need to know how to multiply the $2^{2n}$ pairs of basis multivectors:

$$AB=\left(\sum_{S\subseteq\{1,\cdots,n\}}a_Se_S\right)\left(\sum_{S\subseteq\{1,\cdots,n\}}b_Se_S\right)$$ $$=\sum_{S\subseteq\{1,\cdots,n\},\\T\subseteq\{1,\cdots,n\}}(a_Sb_T)(e_Se_T)$$

We know how to multiply real numbers $a_Sb_T$. So what is $e_Se_T$?

I'm assuming that the basis vectors are orthogonal: $e_i\cdot e_j=0$ for $i\neq j$. (It's always possible to find an orthogonal basis, for any "dot product" (symmetric bilinear form) over any field (with characteristic not $2$).) They don't have to be normalized; let's just write $e_i\cdot e_i=g_i$, so the dot product is described by the list of numbers $g_1,g_2,g_3,\cdots,g_n$. The Euclidean dot product has $g_1=g_2=g_3=\cdots=g_n=1$.

Now here's the formula for the product. (I won't derive this here. In fact, it can be taken as a definition.) Let $S\cap T$ be the intersection of the two sets, $S\oplus T$ their symmetric difference ("xor"), and $S\times T$ their Cartesian product.

$$e_Se_T=(-1)^x\left(\prod_{i\in S\cap T}g_i\right)e_{S\oplus T},$$

where the sign exponent is

$$x=\sum_{i\in S,\\j\in T,\\i>j}(1)=\Big|\big\{(i,j)\in S\times T\mid i>j\big\}\Big|,$$

or, letting $s_i=1$ or $0$ according as $i\in S$,

$$x=\sum_{i\in\{1,\cdots,n\},\\j\in\{1,\cdots,n\},\\i>j}s_it_j.$$

(Note that we only need $x$ modulo $2$, so this sum is also "xor".)

The other products are defined in terms of the geometric product and grade projection:

$$e_S\wedge e_T=\langle e_Se_T\rangle_{|S|+|T|}=\begin{cases}e_Se_T,\quad\text{if}\;S\cap T=\{\} \\ 0,\quad\text{otherwise}\end{cases}$$ $$e_S\,\lrcorner\,e_T=\langle e_Se_T\rangle_{-|S|+|T|}=\begin{cases}e_Se_T,\quad\text{if}\;S\subseteq T\quad \\ 0,\quad\text{otherwise}\end{cases}$$ $$e_S\,\llcorner\,e_T=\langle e_Se_T\rangle_{|S|-|T|}=\begin{cases}e_Se_T,\quad\text{if}\;S\supseteq T\quad \\ 0,\quad\text{otherwise}\end{cases}$$ $$e_S\bullet e_T=\langle e_Se_T\rangle_{\big||S|-|T|\big|}=\begin{cases}e_Se_T,\quad\text{if}\;S\subseteq T\;\text{or}\;S\supseteq T \\ 0,\quad\text{otherwise}\end{cases}$$ $$e_S\circ e_T=\langle e_Se_T\rangle_0=\begin{cases}e_Se_T,\quad\text{if}\;S=T\qquad \\ 0,\quad\text{otherwise}\end{cases}$$ $$e_S\times e_T=\frac{e_Se_T-e_Te_S}{2}=\begin{cases}e_Se_T,\quad\text{if}\;|S||T|-|S\cap T|\;\text{is odd} \\ 0,\quad\text{otherwise}\end{cases}$$ $$e_S\odot e_T=\frac{e_Se_T+e_Te_S}{2}=\begin{cases}e_Se_T,\quad\text{if}\;|S||T|-|S\cap T|\;\text{is even} \\ 0,\quad\text{otherwise}\end{cases}$$

mr_e_man
  • 5,364
  • I wonder if the sign calculation can be done efficiently for large $n$ using bitwise operations. The naive solution would have a nested pair of loops, but here's a solution with just one loop: x = y = 0; for i = 0 to n-1: {x ^= 1&(S>>i)&y; y ^= 1&(T>>i);} Can we do better? – mr_e_man Sep 27 '23 at 19:00
  • (I got that single loop by factoring out the $s_i$ terms: $x=s_2t_1+s_3(t_1+t_2)+s_4(t_1+t_2+t_3)+\cdots$.) – mr_e_man Sep 27 '23 at 20:13