1 Introduction

In recent years, applications of geometric algebras have developed rapidly, as evidenced by the surveys on the topic (Hitzer et al., [3, 15, 19]). However, fundamental software tools (Hadfield et al., [12], Sangwin et al., [31]) for implementing geometric algebras are not yet ready to meet this growing demand in higher signatures. One such example is the geometric algebra for conics (GAC) (Hrdina et al., [21, 22]). GAC is a current and essential research topic in the field, as evidenced by the numerous publications on its applications (Derevianko et al., [4,5,6] and Esquivel at al., [10]).

To address this gap, we show how to use the classification of Clifford algebras and Bott periodicity to implement higher algebras effectively. To meet the needs of the GA community, we present working scripts that allow existing Python software packages [12] to work with the GAC algebra. In the case of GAC, we have implemented the necessary procedures in the form of the python package bootGAC and all of them are available online. Our procedures are designed specifically for GAC, but the ideas can be generalized to work with algebras of higher signatures.

Note that some software tools assume or even partially implement Bott periodicity. We mention Chris Doran package SimpleGA for Julia, [7]. Also, Rafal Ablamovicz developed his very well-known Maple package Clifford for dimension max 8, assuming a matrix extension, [1].

2 Panorama of geometric algebras

The concept of geometric algebras (GA) is generally associated with applications of Clifford algebras in physics, and more recently in engineering. David Hestenes’ pioneering work Space-time algebra (STA) is considered to be the first use of the concept, [13]. The term GA can refer to either Clifford algebras or a specific instance or variation of them. We will attempt to clarify the meaning of GA in this context.

Generally, a Clifford algebra \(\mathcal Cl(p,q,r)\) is an unit, distributive and associative factor algebra generated by a vector space \(\mathbb V\) over a field \(\mathbb K\). The vector space \(\mathbb V\) is equipped with a quadratic form Q with signature (pqr) and the ideal is generated by the identity

$$\begin{aligned} v^{2}=Q(v)1\ {\text { for all }}v\in \mathbb V,\end{aligned}$$
(1)

where the product on the left is that of the algebra, and the 1 is its multiplicative identity. If we replace the quadratic form Q with the corresponding bilinear form B we rewrite the identity (1) as

$$\begin{aligned} v w + w v = -2 B(v,w) \ {\text { for all }}v,w\in \mathbb V,\end{aligned}$$

and we can see that Clifford algebras are not commutative, [28]. Finally, in the chosen basis \(\{e_1, \dots e_{p+q+r}\}\) of \(\mathbb V\) we received a set of well-known identities

$$\begin{aligned} e_i^2&=1, \ \ i= 1,\dots ,p, \\ e_i^2&=-1, \ \ i= 1+p,\dots ,p+q ,\\ e_i^2&=0, \ \ i= 1+p+q,\dots ,p+q+r, \\ e_i e_j&= - e_j e_i, \ \ i \ne j. \end{aligned}$$

Thanks to the geometric product on \(\mathcal Cl(p,q,r)\), we can obtain the underlying Grassmannian algebra \(\mathcal Gr(p,q,r)\) using the expression

$$a \wedge B_k = \frac{1}{2}(a B_k + (-1)^k B_k a),$$

where a is a vector and \(B_k = e_{j_k}\cdots e_{j_1}\), \(e_j \in \{1,\dots p+q+r \}\), [29]. Note that the first non-trivial instances of Clifford algebras \(\mathcal {C}_{0,1,0} = \langle 1,e_1 \ | \ e_1^2=-1\rangle \), \(\mathcal {C}_{1,0,0} = \langle 1,e_1 \ | \ e_1^2=1\rangle \) and \(\mathcal {C}_{0,0,1} = \langle 1,e_1 \ | \ e_1^2=0\rangle \) are the complex numbers \(\mathbb C\), paracomplex numbers \(\mathbb P\) and dual numbers \(\mathbb D\) respectively.

In Clifford algebras, the subspace of bivectors (elements of the second grade) is closed under a Lie bracket and forms a Lie algebra. Generally, the algebra of bivectors of the Clifford algebra \(\mathcal Cl(p,q,r)\) corresponds to a Lie algebra \(\mathfrak {so}(p,q,r)\). The symmetry group (due the Klein Erlangen program, [30]) of the chosen geometry can then be written as a subgroup of the Lie group \(Spin(p,q,r) = \exp (\mathfrak {so}(p,q,r))\).

Special cases of Clifford algebras are algebras with a positive definite signature (n, 0, 0); these algebras are called vector geometric algebras (VGA) and denoted as \(\mathbb G_n\). Their elements form the Grassmann algebra \(\mathcal Gr(n, \mathbb R)\) and the set of bivectors corresponds to the special orthogonal Lie algebra \(\mathfrak {so}(n)\), [24, 28].

If the Clifford algebra is not a VGA, then we deal with a Clifford algebra based on bilinear form with an indefinite signature and the affine Lie algebra \(\mathfrak {aff}(n)\) is a subalgebra of the Lie algebra \(\mathfrak {so}(p,q,r)\) in these cases. We will speak about n-dimensional confromal geometric algebra \(\mathcal Cl(n+1,1,0)\). This Clifford algebra contains a subalgebra of signature (n, 0, 1) directly or with the help of tensor product

$$\begin{aligned} \mathcal Cl(n,0,1) \subset \mathcal Cl(n,0,0) \otimes \mathcal Cl(1,1,0) \cong \mathcal Cl(n+1,1,0), \end{aligned}$$
(2)

where the inclusion in the expression (2) can be written in the coordinates with the help of the null-cone in \(\mathcal Cl(1,1,0)\). The tensor product \(\mathcal Cl(n,0,0) \otimes \langle 1, e_0\rangle \), where \(e_0\) belongs to the null-cone, is isomorphic to \(\mathcal Cl(n,0,1)\). The set of bivectors of this subalgebra, together with the Lie bracket, is isomorphically equivalent to the affine Lie algebra \(\mathfrak {aff}(n)\) and its exponents to the spin affine group (double cover of the affine group), i.e a semidirect product of Spin(n) and \(\mathbb R^n\). As an additional, we choose an embedding \(\iota : \mathbb R^n \rightarrow \mathcal Cl(p,q,r)\) which is equivariant with respect to the action of this group.

2.1 Projective geometric algebra

The first nontrivial possibility is the projective (sometimes called plane-based) geometric algebra (PGA), [9]. It is a Clifford algebra \(\mathcal Cl({3,0,1})\) based on the quadratic form of signature (3, 0, 1). The bivectors of this algebra correspond directly to the affine Lie algebra \(\mathfrak {aff}(3)\) and its exponents to the spin affine group, which can be seen as a semidirect product \(Spin(3) \rtimes \mathbb R^3\). The origin is represented by the blade \(o=e_1 \wedge e_2 \wedge e_3\) and the inclusion of \(\mathbb R^3\) by the map

$$\iota (x,y,z) = e_1 \wedge e_2 \wedge e_3 + x e_0 \wedge e_2 \wedge e_3 + y e_1 \wedge e_0 \wedge e_3 + z e_1 \wedge e_2 \wedge e_0.$$

The corresponding algebra of the bivectors is a whole Lie affine algebra \(\mathfrak {aff}(3)\), so PGA is a geometric algebra corresponding to the affine geometry on \(\mathbb R^3\) and it is a powerful tool for geometric reasoning, and for solving problems in physics and engineering, [29].

2.2 Conformal geometric algebra

The second very well-known GA is conformal geometric algebra (CGA), [8, 16]. It is a Clifford algebra \(\mathcal Cl({4,1}):=\mathcal Cl({4,1,0})\), where the corresponding affine subalgebra \(\mathfrak {aff}(3)\) is an algebra generated by the span \(\langle e_1,e_2,e_3,e_{\infty }:= e_4+e_5 \rangle \). The origin is a vector \(e_0 = \frac{1}{2}(e_4-e_5)\), where the pair \(e_0\) and \(e_{\infty }\) is so called Witt pair. Finally, the inclusion of \(\mathbb R^3\) is a map

$$\begin{aligned} \iota (x,y,z) = e_0 + x e_1+y e_2 + z e_3 +\frac{1}{2} (x^2+y^2+z^2) e_{\infty }. \end{aligned}$$
(3)

The corresponding algebra of all bivectors is a conformal Lie algebra \(\mathfrak {co}(n)= \mathfrak {aff}(n)\oplus \mathbb R \), which makes CGA a geometric algebra corresponding to conformal geometry on \(\mathbb R^3\).

We can use the scalar product to represent the geometric objects in the following way. A general vector in the CGA in terms of our basis is of the form

$$\begin{aligned} v=v_1 e_1 + v_2 e_2 + v_3 e_3+ v_0 e_0+ v_{\infty } e_{\infty }, \end{aligned}$$
(4)

where \(v_{\alpha } \in \mathbb R, \ \alpha \in \{1,2,3,0,\infty \}\) and its inner product with an embedded point is then given by

$$\iota (x,y,z) \cdot v=v_{\infty } +xv_1+yv_2+zv_3-(1/2) \left( x^2+y^2+z^2\right) v_0.$$

The element v can represent geometric objects based on monoms 1, xyz and \(x^2+y^2+z^2\), so the planes

$$v_{\infty } +xv_1+yv_2+zv_3 = 0$$

if \(v_{0}=0\) and spheres if \(v_{0} < 0\), and finally the objects of the property \(v_{0} > 0\) are sometime called imaginary spheres. In the algebra CGA, the linearization of spherical objects takes place, which is successfully used, for example, in inverse kinematics, [11, 20, 25].

The key property is that the scalar product is invariant concerning the action of the affine group, so the following identity holds:

$$\begin{aligned} T \iota (x,y,z) \tilde{T} \cdot T v \tilde{T} = \iota (x,y,z) \cdot v, \end{aligned}$$
(5)

where \(\iota \) is the inclusion map and T is an affine transformation. This means that the \(T \iota (x,y,z) \tilde{T}\) represents the same object as \(\iota (x,y,z)\), mapped by the affine transformation. Finally, let’s note that the flat objects of PGA forms a subalgebra in CGA, [23].

2.3 2d-Up CGA (CGA with one more Witt pair)

Projective geometric algebra (PGA) and conformal geometric algebra (CGA) are the cornerstones of GA theory. GA can be further extended in a conformal way by adding a new pair of orthonormal generators, \(\tilde{e}_+\) and \(\tilde{e}_-\), such that \(\tilde{e}_+^2=1\) and \(\tilde{e}_-^2=-1\). This pair of generators can be used to define two additional generators, \(\tilde{e}_0=\frac{1}{2}(\tilde{e}_+-\tilde{e}_-)\) and \(\tilde{e}_{\infty }=\tilde{e}_++ \tilde{e}_-\), which are called the new Witt pair.

Thanks to the new Witt pair \(\tilde{e}_0\) and \(\tilde{e}_{\infty }\), the Lie algebra of a bivector contains two isomorphic affine Lie algebras \(\mathfrak {aff_1}:=\langle e_1,e_2,e_3,e_{\infty } \rangle \) and \(\mathfrak {aff_2}:=\langle e_1,e_2,e_3,\tilde{e}_{\infty } \rangle \) and therefore the corresponding affine Lie groups \(A_1 = Spin(3) \rtimes \mathbb R^3\) and \(A_2=Spin(3) \rtimes \tilde{\mathbb R}^3\). Moreover, we have a bivector \(e_{\infty }\tilde{e}_{\infty }\) and related versors \(W=\exp (\beta e_{\infty }\tilde{e}_{\infty })=1-\frac{1}{2} ( \beta e_{\infty }\tilde{e}_{\infty } ) \). These versors preserve the vector space \(\wedge ^1=\langle e_1,e_2,e_2,e_0,e_{\infty }, \tilde{e}_0, \tilde{e}_{\infty } \rangle \) by sandwich product \(W {x} \tilde{W}\), where \(x \in \wedge ^1 \).

Our goal is to represent a new class of appropriate geometric objects \(\mathcal O \subset \mathbb R^3\) as a general vectors

$$\begin{aligned} v=v_0 e_0+ \tilde{v}_0 \tilde{e}_0+v_1 e_1 + v_2 e_2 + v_3 e_3+ v_{\infty } e_{\infty }+\tilde{v}_{\infty } \tilde{e}_{\infty } \in \wedge ^1, \end{aligned}$$
(6)

such that \(\mathcal O = \{ x \in \mathbb R^3 |\iota (x) \cdot v =0 \}\), where \(\iota : \mathbb R^3 \rightarrow \mathcal Cl(5,2)\) is a chosen embedding. So our goal is to find the embedding \(\iota : \mathbb R^3 \rightarrow \mathcal Cl(5,2)\) and the group of Euclidean transformations so that the vectors representing the chosen geometric objects are equivariant with respect to the action of this group. We are looking for an analogous CGA situation where the group of Euclidean transformations (5) preserves the space of spheres and planes (4) with the help of inclusion (3).

First, let’s say that \(A_1 \cap A_2 = Spin(3)\) and therefore, new transformations arise thanks to the translational part of the group \(A_2\) and W. Let’s see how the two affine groups \(A_1\) and \(A_2\) act on the conformal embedding \(\iota \) (3) and on a new Witt pair \(\langle \tilde{e}_{0},\tilde{e}_{\infty } \rangle \).

  • The Lie group \(A_1\) acts on \(\iota (x_1,x_2,x_3)\) as usual.

  • The translation part \(T_2\) of \(A_2\) acts on \(\iota (x_1,x_2,x_3)\) in the following way

    $$\begin{aligned}&\left( 1-\frac{1}{2} u_ie_i\tilde{e}_{\infty } \right) \iota (x_1,x_2,x_3) \left( 1+\frac{1}{2} u_i e_i\tilde{e}_{\infty } \right) = \iota (x_1,x_2,x_3) + u_i x_i \tilde{e}_{\infty }, \end{aligned}$$
  • The Lie group \(A_1\) acts on a new Witt pair \(\langle \tilde{e}_{0},\tilde{e}_{\infty } \rangle \) as an identity.

  • The translation part \(T_2\) of \(A_2\) acts on \(\langle \tilde{e}_{\infty } \rangle \) as an identity and on \(\langle \tilde{e}_{0} \rangle \) as CGA inclusion of the second copy of CGA

    $$\iota _2 (x,y,z) = \tilde{e}_0 + x e_1+y e_2 + z e_3 + (x^2+y^2+z^2) \tilde{e}_{\infty } $$

The new versor W acts on \(\iota (x_1,x_2,x_3)\) in the following way

$$\begin{aligned} \left( 1-\frac{1}{2} ( \beta e_{\infty }\tilde{e}_{\infty } ) \right) \iota (x_1,x_2,x_3) \left( 1+\frac{1}{2}( \beta e_{\infty }\tilde{e}_{\infty } )\right) = \iota (x_1,x_2,x_3) - \beta \tilde{e}_{\infty } \end{aligned}$$

and on \(\langle \tilde{e}_{\infty } \rangle \) as an identity. With the help of composition the vector of the new embedding

$$\begin{aligned} \tilde{\iota }(x_1,x_2,x_3) = \iota (x_1,x_2,x_3) + \delta \tilde{e}_{\infty } \end{aligned}$$
(7)

can be map to the vector \(\iota (x_1,x_2,x_3) + (\delta - \beta + u_i x_i ) \tilde{e}_{\infty }\) by versor \(T_2 \circ W\). This new dimension (parameter \(\delta \)) can be used, for example, to add the monom \(\frac{1}{2}x^2\tilde{e}_{\infty } \) into inclusion (7) and the versors \(T_i\) and W can be used as new generators of the translation group in the following way:

$$\begin{aligned} T_1 \tilde{\iota }(x_1,x_2,x_3) \tilde{T}_1&= \iota (x_1+\alpha ,x_2,x_3) + \frac{1}{2} x^2 \tilde{e}_{\infty } \\ WT_1 \tilde{\iota }(x_1,x_2,x_3) \tilde{T}_1 \tilde{W}&= \iota (x_1+\alpha ,x_2,x_3) + (x^2 + \alpha ^2) \tilde{e}_{\infty } \\ T_2WT_1 \tilde{\iota }(x_1,x_2,x_3) \tilde{T}_1 \tilde{W} \tilde{T}_2&= \iota (x_1+\alpha ,x_2,x_3) + (x^2 + \alpha ^2 + 2 \alpha x_1) \tilde{e}_{\infty } \\&= \tilde{\iota }(x_1+\alpha ,x_2,x_3), \end{aligned}$$

where \(T_1=1-\frac{1}{2}(\alpha e_{\infty } e_1)\), \(W=1+\frac{1}{2} \alpha ^2 e_{\infty } \tilde{e}_{\infty } \) and \(T_2=1-\frac{1}{2}(2 \alpha \bar{e}_{\infty } e_1)\). Now, a general vector in this algebra in terms of our basis is of the form

$$v=v_0 e_0+v_1 e_1 + v_2 e_2 + v_3 e_3+ \tilde{v}_0 \tilde{e}_0+ v_{\infty } e_{\infty }+\tilde{v}_{\infty } \tilde{e}_{\infty },$$

where \(\tilde{v}_{\infty },\tilde{v}_0\), \(v_{\alpha } \in \mathbb R, \ \alpha \in \{1,2,3,0,\infty \}\) and its inner product with an embedded point is then given by

$$\tilde{\iota }(x,y,z) \cdot v=v_{\infty } +xv_1+yv_2+zv_3-(1/2) \left( x^2+y^2+z^2\right) v_0-(1/2) x^2 \tilde{v}_0$$

and may represent a special kind of ellipsoids. Rotations in this case, make sense only in the case of spheres (\(\delta =0\)) otherwise, they do not preserve the class of defined objects (special kind of ellipsoids). This procedure gives us an algebra \(\mathcal Cl(4,2)\) not yet intensively studied.

2.4 A natural flag \(\mathbb G_n \subset PGA_n \subset CGA_n \)

In the previous chapters, we introduced PGA and CGA separately. This is due to the historical fact that these algebras have been developed separately concerning applications. But the conceptual point of view is as follows. If we want to work with the n-dimensional Euclidean space \(\mathbb R^n\), we choose the geometric algebra \(\mathbb G_n\). By adding one Witt pair \(\{e_0,e_{\infty } \}\), we obtain the n-dimensional CGA and the n-dimensional PGA is given as its subalgebra of flat objects, [23].

2.5 2d-Up STA

Note that the flag structure discussed in Section 2.4 has a relativistic counterpart. We can interpret the algebra \(\mathcal {C}l(2,4)\) as a conformal extension of the space-time algebra (STA) [13], meaning it is a Clifford algebra of the vector space with a bilinear form of signature (1,3) that permits conformal transformations. This algebra is sometimes referred to as 2d-Up STA or conformal STA (CSTA). It has intristing applications in mathematical physics [26] and is implemented, for example, in the Julia package SimpleGA [7].

As with the Euclidean metric, it may be more efficient to work exclusively with flat objects, thereby using the PGA subalgebra. This approach can also be beneficial for the conformal space-time algebra (CSTA), resulting in the algebra of signature \(\mathcal {C}l(1,4)\), known as 1d-Up STA, [27]. Thus, we obtain the flag structure \({STA} \subset ``\text {1d-Up}\ STA'' \subset ``\text {2d-Up}\ STA''\) for Minkowski’s signature.

2.6 Geometric algebra for conics

Generally, we can add more Witt pairs with this procedure. For example, this gives us the well known geometric algebra for conics (GAC), [21] which can be seen as a Compass ruler algebra (CRA) (the 2D version of CGA), [17, 18] with two additional Witt pairs. GAC has three copies of the two dimensional affine algebras \(\mathfrak {aff}_i(2), \ i=1,2,3\) based on the three Witt pairs \(\{e_0, e_{\infty } \}\), \(\{\tilde{e}_0, \tilde{e}_{\infty } \}\) and \(\{\bar{e}_0, \bar{e}_{\infty } \}\) respectively. In addition, we have a three dimensional commutative Lie algebra with bivectors \(\langle e_{\infty } \tilde{e}_{\infty },e_{\infty } \bar{e}_{\infty },\bar{e}_{\infty } \tilde{e}_{\infty } \rangle \) which we can freely use. This algebra allows us to linearize up to three monoms in \(\mathbb R^2\), if the inclusion of \(\mathbb R^2\) is the map

$$\begin{aligned} \iota (x,y) =e_0 + x e_1 + y e_2 + \frac{1}{2} \left( x^2 + y^2\right) e_{\infty } + \frac{1}{2} \left( x^2 - y^2\right) \tilde{e}_{\infty } + x y \bar{e}_{\infty } \end{aligned}$$

as usual and the general vector in this algebra in terms of our basis is of the form

$$v=v_1 e_1 + v_2 e_2 + v_0 e_0+ \tilde{v}_0 \tilde{e}_0+ \bar{v}_0 \tilde{e}_0+ v_{\infty } e_{\infty } +\tilde{v}_{\infty } \tilde{e}_{\infty }+\bar{v}_{\infty } \bar{e}_{\infty },$$

where \(\bar{v}_{\infty },\bar{v}_0\), \(\tilde{v}_{\infty },\tilde{v}_0\), \(v_{\alpha } \in \mathbb R, \ \alpha \in \{1,2,3,0,\infty \}\) then its inner product with an embedded point is given by

$$ \iota (x,y) \cdot v= -\frac{1}{2}(v_+ + \tilde{v}_0) x^2 -\frac{1}{2}(v_+ - \tilde{v}_0) y^2 -\bar{v}_0 xy + x v_1 + y v_2 +v_0 $$

and represents an arbitrary conics section.

To find the appropriate affine group, we have considered three classes of translation versors \(T_{ij}\) and three new versors based on Witt pairs \(W_j\) at our use:

$$\begin{aligned} T_{i1}&= 1- \frac{1}{2}(\alpha _1 e_i e_{\infty }), T_{i2}= 1- \frac{1}{2}(\alpha _2 e_i \tilde{e}_{\infty }) \text { and } T_{i3}= 1- \frac{1}{2}(\alpha _3e_i \bar{e}_{\infty } ), \\ W_1&= 1- \frac{1}{2}(\beta _1 e_{\infty } \tilde{e}_{\infty }), W_2= 1- \frac{1}{2}(\beta _2 e_{\infty } \bar{e}_{\infty }) \text { and } W_3= 1- \frac{1}{2}(\beta _3 \tilde{e}_{\infty } \bar{e}_{\infty } ). \end{aligned}$$

In the same way as in Section 2.3 we can set parameters \(\alpha _i\) and \(\beta _i\) to implement the translation subgroup equivariant with respect to the inclusion \(\iota \).

In GAC, it makes sense to discuss rotations and thus obtain the whole Affine group equivariant with respect to the inclusion \(\iota \). The CGA rotor \(R_+ = \cos (\frac{\psi }{2}) + \sin (\frac{\psi }{2}) e_1 \wedge e_2\) acts as an identity on \(\langle \tilde{e}_{\infty }, \bar{e}_{\infty } \rangle \), but we still have not used bivectors \(\bar{e}_0 \wedge \tilde{e}_{\infty }\) and \( \bar{e}_{\infty } \wedge \tilde{e}_{0}\). Concerning [21], we state that rotation is represented by the bivector’s

$$r=\frac{1}{2}e_1 \wedge e_2 + \bar{e}_0 \wedge \tilde{e}_{\infty } + \bar{e}_{\infty } \wedge \tilde{e}_{0} $$

and \(\exp (\psi r)\) can be seen in the form \(R_+ (R_1 \wedge R_2)\), where

$$\begin{aligned} R_+&= \cos (\frac{\psi }{2}) + \sin (\frac{\psi }{2}) e_1 \wedge e_2, R_1 = \cos (\psi ) + \sin (\psi ) \bar{e}_0 \wedge \tilde{e}_{\infty } \\ R_2&= \cos (\psi ) + \sin (\psi ) \bar{e}_{\infty } \wedge \tilde{e}_{0}, \end{aligned}$$

So we can say that the algebra constructed in this way allows you to work efficiently with conics, [4,5,6].

2.7 Geometric algebra for quadrics

Another natural possibility is to find a geometric algebra realizing quadrics. Each quadric can be written with the help of monoms

\( \{ 1,x,y,z,x^2,y^2,z^2,xy,xz,yz\}.\) If we want to follow the same procedure as in the case of GAC we have to extend the geometric algebra \(\mathbb G_3\) by six Witt pairs \(\{ e_{0i},e_{\infty i}\}, \ i=1,\dots 6\) (or the geometric algebra CGA by five Wit pairs). The inclusion \(\iota : \mathbb R^3 \rightarrow \mathcal Cl(9,6) \) can be chosen, for example, as

$$\begin{aligned} \iota (x,y)&=e_{01} + x e_1 + y e_2 + z e_3 + \frac{1}{2} (x^2 + y^2+ z^2) e_{\infty 1} + \frac{1}{2} (x^2 - y^2+ z^2) \tilde{e}_{\infty 2} \\&\quad + x y \bar{e}_{\infty 3} + \frac{1}{2} (x^2 + y^2 - z^2) e_{\infty 4} + xz \tilde{e}_{\infty 5} + yz \bar{e}_{\infty 6}. \end{aligned}$$

To find the translation, we consider a Lie group \(\mathcal V\) of versors generated by elements

$$ T_{1ij}= 1-\frac{1}{2} (\alpha _{ij} e_i e_{\infty j}), \ \ W_{ij} =1-\frac{1}{2} (\beta _{ij} e_{\infty i}e_{\infty j}) $$

and we’re just looking for the versors \(T_{x_0,y_0,z_0} \in \mathcal V\) which are the solutions of the equations

$$\begin{aligned} T_{x_0,y_0,z_0} \iota (x,y,z) \tilde{T}_{x_0,y_0,z_0} = \iota (x+x_0,y+y_0,z+z_0). \end{aligned}$$

For the rotation, we proceed similarly with help of versors \(R_+ = \exp (e_ie_j), R_{ij}= \exp (e_{0i} e_{\infty j})\). This geometric algebra is sometimes called quadric CGA (QCGA) (Hitzer et al. [2, 14]).

2.8 Final remark

By this procedure, we can implement any class of geometric objects and see them as linear objects in a Clifford algebra of the right dimension.

3 Bott periodicity

In the following, we show how GA can be realized in a suitable matrix algebra. The complete classification of Clifford algebras is based on advanced concepts of linear algebra and algebraic geometry, [28]. Important for us are the following identities which are valid for Clifford algebras generally

$$\begin{aligned}&\mathcal Cl (p+1,q+1) = M_2 ( \mathcal Cl (p,q)) , \end{aligned}$$
(8)
$$\begin{aligned}&\mathcal Cl (p+4,q) =\mathcal Cl (p,q+4), \end{aligned}$$
(9)

where \(M_2 ( \mathcal Cl (p,q))\) are \(2 \times 2\) matrices over Clifford algebra \(\mathcal Cl (p,q)\). These identities are based on the general theory and the aforementioned considerations lead to the following classical description of the Boot periodicity

$$\begin{aligned} \mathcal Cl (p+8,q)&= \mathcal Cl (p+4,q+4) = M_{2^4} (\mathcal {C}l (p,q)). \end{aligned}$$

In view of these considerations, for example, the algebra \(\mathcal Cl(4,2)\) of the signature (4, 2) can be viewed as an algebra of \(2 \times 2\) matrices over CRA, ie. the algebra \(\mathcal Cl(3,1)\) of the signature (3, 1).

3.1 Algebra GAC realized as matrices over CRA

Our goal is to realize and consequently implement the automorphism \(\Psi \) based on (89) between the GAC and the corresponding matrices over CRA

$$\Psi : \mathcal {C}l(5,3) \rightarrow M_2(M_2(\mathcal {C}l(3,1))) \cong M_4(\mathcal {C}l(3,1)).$$

An algebra \(\mathcal {C}l(5,3)\) is formed by a set of orthogonal generators

CGA \(e_1,e_2,e_+,e_-\) and two orthogonal couples of pairs \(\tilde{e}_-,\tilde{e}_+\) and \(\bar{e}_-,\bar{e}_+\) satisfying the following identities

$$\begin{aligned} e_1^2 = e_2^2 = e_+^2 = \tilde{e}_+^2= \bar{e}_+^2= 1, \quad e_-^2 = \tilde{e}_-^2 =\bar{e}_-^2 = -1. \end{aligned}$$

Theorem 3.2

Let \(\mathcal {C}l(5,3)\) be a Clifford algebra based on the signature (5, 3) and \(M_4(\mathcal {C}l(3,1))\) be an algebra of \(4 \times 4\) matrices over Clifford algebra \(\mathcal {C}l(3,1)\). Let \(e_i, \ i \in \{1,2,+,-\}\) and \(\tilde{e}_+,\tilde{e}_-,\bar{e}_+,\bar{e}_-\) be an orthogonal basis of \(\mathcal {C}l(5,3)\) and \(N,F_+,F_-,G_+,G_-\) be the following \(4\times 4\) matrices over \(\mathbb R\)

$$\begin{aligned} N&= \begin{pmatrix} 1 & 0 & 0 & 0\\ 0 & -1 & 0 & 0\\ 0 & 0 & -1 & 0 \\ 0 & 0 & 0 & 1 \end{pmatrix}, F_+ = \begin{pmatrix} 0 & 1 & 0 & 0\\ 1 & 0 & 0 & 0\\ 0 & 0 & 0 & -1 \\ 0 & 0 & -1 & 0 \end{pmatrix}, F_- = \begin{pmatrix} 0 & 1 & 0 & 0\\ -1 & 0 & 0 & 0\\ 0 & 0 & 0 & -1 \\ 0 & 0 & 1 & 0 \end{pmatrix},&\\ G_+&= \begin{pmatrix} 0 & 0 & 1 & 0\\ 0 & 0 & 0 & 1\\ 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \end{pmatrix}, G_- = \begin{pmatrix} 0 & 0 & 1 & 0\\ 0 & 0 & 0 & 1\\ -1 & 0 & 0 & 0 \\ 0 & -1 & 0 & 0 \end{pmatrix}.&\end{aligned}$$

Then the map \(\Psi : \mathcal {C}l(5,3) \rightarrow M_4(\mathcal {C}l(3,1))\) generated by

$$\begin{aligned} E_i := \Psi (e_i) = e_iN, \ \Psi (\tilde{f}_+) = F_+, \, \Psi (\tilde{e}_-) = F_-, \, \Psi (\bar{e}_+) = G_+, \, \Psi (\bar{e}_-) = G_-, \end{aligned}$$

is an isomorphism of Clifford algebras.

Proof

The map \(\Psi \) is a linear mapping between vector spaces. From Bott’s periodicity, we know that these two algebras are isomorphic. So it suffices to show that the resulting matrices satisfy the identities of the generators of the Clifford algebra. This property, together with the universal property of Clifford algebras, completes the proof. Thus, we show that the matrices satisfy the required identities. By straightforward calculation, it can be shown that

$$E_1^2=E_1^2=E_+^2=F_+^2=G_+^2=1 \text { and } E_-^2=F_-^2=G_-^2=-1.$$

The matrices \(E_i\) correspond to the algebra \(\mathcal {C}l(3,1)\) and matrix N commute with others matrices. Again by direct calculation, it is easily shown that the matrices \(F_+,F_-,G_+\) and \(G_-\) commute with each other, which completes the proof. \(\square \)

Now we will show how our considerations can be used in a practical way in computing with the GAC algebra. In this algebra there are both points and conics represented by vectors

$$\begin{aligned} \textbf{u} = k_1e_1 + k_2e_2 + k_3 e_\infty + k_4 e_0 + k_5 \tilde{e}_\infty + k_6 \tilde{e}_0 + k_7 \bar{e}_\infty + k_8 \bar{e}_0, \end{aligned}$$
(10)

in the Witt basis, where \(e_\infty = e_- + e_+, e_0 = {1 \over 2}( e_- - e_+), \, \tilde{e}_\infty = \tilde{e}_- + \tilde{e}_+, \tilde{e}_0 = {1 \over 2}( \tilde{e}_- - \tilde{e}_+), \, \bar{e}_\infty = \bar{e}_- + \bar{e}_+, \bar{e}_0 = {1 \over 2}( \bar{e}_- - \bar{e}_+)\). We can see the GAC vectors (points, conics) as a matrices of a form

$$\begin{aligned} \Psi (\textbf{u}) = \begin{pmatrix} \textbf{s} & 2k_5 & 2k_7 & 0\\ -k_6 & -\textbf{s} & 0 & 2k_7\\ -k_8 & 0 & -\textbf{s} & -2k_5 \\ 0 & -k_8 & k_6 & \textbf{s} \end{pmatrix}, \end{aligned}$$
(11)

where \(\textbf{s} = k_1e_1 + k_2e_2 + k_3 e_\infty + k_4 e_0\). Due to the isomorphisms \(\Psi \) in the Theorem 3.2, we can realize the wedge product and the scalar product between vector \(\textbf{u}\) of the form (610) and vector \(\textbf{v}\) of the form

$$\begin{aligned} \textbf{v} = c_1e_1 + c_2e_2 + c_3 e_\infty + c_4 e_0 + c_5 \tilde{e}_\infty + c_6 \tilde{e}_0 + c_7 \bar{e}_\infty + c_8 \bar{e}_0 \end{aligned}$$

with help of matrix multiplication on the matrices (11) as follows

$$\begin{aligned} & \Psi (\textbf{u} \wedge \textbf{v}) = \frac{1}{2}\left( \Psi (\textbf{u})\Psi (\textbf{v}) - \Psi (\textbf{v})\Psi (\textbf{u})\right) = \end{aligned}$$
(12)
$$\begin{aligned} & = \begin{pmatrix} -\mathbf {s_2} -\mathbf {s_3} + \mathbf {s_1} & 2\mathbf {s_4} & 2\mathbf {s_6} & 4(k_5c_7 - k_7c_5)\\ \mathbf {s_5} & \mathbf {s_2} -\mathbf {s_3} +\mathbf {s_1} & -2(k_6c_7 - k_7c_6) & -2\mathbf {s_6}\\ \mathbf {s_7} & 2(k_5c_8 - k_8c_5) & -\mathbf {s_2} +\mathbf {s_3} +\mathbf {s_1} & 2\mathbf {s_4} \\ -k_6c_8 + k_8c_6 & -\mathbf {s_7} & \mathbf {s_5} & \mathbf {s_2} +\mathbf {s_3} +\mathbf {s_1} \end{pmatrix}, \end{aligned}$$
(13)
$$\begin{aligned} & \Psi (\textbf{u} \cdot \textbf{v}) = \frac{1}{2}\left( \Psi (\textbf{u})\Psi (\textbf{v}) + \Psi (\textbf{v})\Psi (\textbf{u})\right) = \textbf{t}I_d, \end{aligned}$$
(14)

where

$$\begin{aligned} \mathbf {s_1}= & (k_1c_2 - k_2c_1)e_1\wedge e_2 + (k_1c_3 - k_3c_1)e_1 \wedge e_\infty + (k_1c_4 - k_4c_1)e_1 \wedge e_0\\ & \quad + (k_2c_3 - k_3c_2)e_2\wedge e_\infty + (k_2c_4 - k_4c_2)e_2 \wedge e_0 + (k_3c_4 - k_4c_3)e_\infty \wedge e_0,\\ \mathbf {s_2}= & k_5c_6 - k_6c_5,\\ \mathbf {s_3}= & k_7c_8 - k_8c_7,\\ \mathbf {s_4}= & (k_1c_5 - k_5c_1)e_1 + (k_2c_5 - k_5c_2)e_2 + (k_3c_5 - k_5c_3)e_\infty + (k_4c_5 - k_5c_4)e_0,\\ \mathbf {s_5}= & (k_1c_6 - k_6c_1)e_1 + (k_2c_6 - k_6c_2)e_2 + (k_3c_6 - k_6c_3)e_\infty + (k_4c_6 - k_6c_4)e_0,\\ \mathbf {s_6}= & (k_1c_7 - k_7c_1)e_1 + (k_2c_7 - k_7c_2)e_2 + (k_3c_7 - k_7c_3)e_\infty + (k_4c_7 - k_7c_4)e_0,\\ \mathbf {s_7}= & (k_1c_8 - k_8c_1)e_1 + (k_2c_8 - k_8c_2)e_2 + (k_3c_8 - k_8c_3)e_\infty + (k_4c_8 - k_8c_4)e_0,\\ \textbf{t}= & k_1c_1 + k_2c_2 -k_3c_4 - k_4c_3 - k_5c_6 - k_6c_5 - k_7c_8 - k_8c_7 \end{aligned}$$

and \(I_d\) is identity matrix of order 4.

3.2 Remark on higher algebras

In Sections 2.3, 2.5 and 2.6 we have shown how to construct algebras that can work with additional monoms by adding Witt pairs. In the \(\iota \) embedding, we can represent these monoms and in the IPNS representation we get a wider class of objects. For example, if we start with the CGA algebra in the case of quadrics (Section 2.6), we need five more monoms to describe an arbitrary quadric. Each Witt pair then leads to a new signature, and the resulting algebra can then be represented by matrices over the previous algebra. In the case of QCGA therefore we work with \(32 \times 32\) matrices over the CGA. Of course, if we want to use GA for example for real time calculation we have to choose a deeper implementation. However, the proposed apparatus allows relatively easy implementation of any geometric algebra with the use of suitable software allowing to work with PGA and CGA algebras which are widely available nowadays.

4 Geometric objects and the python realisations

We aim to allow the GA community to work with the high-order algebras, and therefore we have created the corresponding software packages bootGAC for algebra GAC. The algebra \(\mathcal {C}l(5,3)\) is implemented in Python with the Numpy and Clifford packages, [12]. The Clifford package allows working with CGA objects, including those of subalgebra CRA, and the Numpy package allows working with matrices, including CGA matrices. Even matrix multiplication and scalar multiplication work internally like multiplication on the algebra CGA. This allows for straightforward implementation of the algebra \(\mathcal {C}l(5,3)\) as the algebra \(M_4(\mathcal {C}l(3,1))\). To demonstrate the implementation, we present matrix representations of geometric objects such as points and conics, taking the \(\mathcal {C}l(5,3)\) representations of the objects from [21]. A general point with coordinates xy

$$\begin{aligned} \textbf{p} = \textbf{p}_{cra} + {1 \over 2}(x^2 - y^2) \tilde{e}_\infty + xy \bar{e}_\infty , \end{aligned}$$
(15)

where \(\textbf{p}_{cra} = xe_1+y_2 + {1 \over 2}(x^2 + y^2)e_\infty + e_0\).

$$\begin{aligned} \Psi (\textbf{p}) = \begin{pmatrix} \textbf{p}_{cra} & x^2 - y^2 & 2xy & 0\\ 0 & -\textbf{p}_{cra} & 0 & 2xy\\ 0 & 0 & -\textbf{p}_{cra} & y^2 - x^2\\ 0 & 0 & 0 & \textbf{p}_{cra} \end{pmatrix} \end{aligned}$$

A general parabola is given by vertex uv, semi-latus rectum parameter p and rotation \(\theta \). An ellipse and a hyperbola are given by center uv, semi-axis lengths ab and rotation \(\theta \). An element \(\textbf{c}\) of the form

$$\begin{aligned} \textbf{c} = \textbf{s} - \alpha \cos {2\theta }\tilde{e}_0 - \alpha \sin {2\theta }\bar{e}_0, \end{aligned}$$
(16)

represents a parabola if \(\alpha = -1\) and

$$\begin{aligned} \textbf{s}= & (u + u\cos {2\theta } + v\sin {2\theta } -2p\sin \theta )e_1 + (v - v\cos {2\theta } + u\sin {2\theta }+2p\cos \theta )e_2\\+ & {1 \over 2}(u^2 + v^2 + (u^2 - v^2)\cos {2\theta } + 2uv\sin {2\theta } -4pu\sin \theta +4pv\cos \theta )e_\infty + e_0. \end{aligned}$$

The element \(\textbf{c}\) (16) represents an ellipse or a hyperbola, if

$$\begin{aligned} \textbf{s}= & (u - u\alpha \cos {2\theta } - v\alpha \sin {2\theta })e_1 + (v + v\alpha \cos {2\theta } - u\alpha \sin {2\theta })e_2 \end{aligned}$$
(17)
$$\begin{aligned}+ & {1 \over 2}(u^2 + v^2 - \beta - (u^2 - v^2)\alpha \cos {2\theta } - 2uv\alpha \sin {2\theta })e_\infty + e_0 \end{aligned}$$
(18)

and \(\textbf{c}\) is an ellipse if

$$\begin{aligned} \alpha = \frac{a^2 - b^2}{a^2 + b^2}, \quad \beta = \frac{2a^2 b^2}{a^2 + b^2}, \end{aligned}$$

and \(\textbf{c}\) is a hyperbola if

$$\begin{aligned} \alpha = \frac{a^2 + b^2}{a^2 - b^2}, \quad \beta = -\frac{2a^2 b^2}{a^2 - b^2}. \end{aligned}$$

According to Eq. (11), the representations of the conics (16) are of the form

$$\begin{aligned} \Psi (\textbf{c}) = \begin{pmatrix} \textbf{s} & 0 & 0 & 0\\ \alpha \cos {2\theta } & -\textbf{s} & 0 & 0\\ \alpha \sin {2\theta } & 0 & -\textbf{s} & 0 \\ 0 & \alpha \sin {2\theta } & -\alpha \cos {2\theta } & \textbf{s} \end{pmatrix}. \end{aligned}$$

4.1 Python implementation

The key to our approach is to use the existing software (Python) packages for handling CGA. These packages are common and have continuous support provided by the users and software developers. The following imports are needed for implementation.

figure a

Next we have to download new routines bootGAC and import them into the head of the code;

figure b

The chosen conics sections can now be entered in the form of matrices over the GAC using the defined procedures, For example a general parabola given by parameters uvp and \(\theta \) can be created using the following procedure

figure c

where E1, E2, Einf, E0, F0, G0 are numpy representations of matrices \(E_1, E_2, E_0: = \Psi (e_0), E_\infty : = \Psi (e_\infty ), F_0: = \Psi (\tilde{e}_0)\) and \( G_0: = \Psi (\bar{e}_0)\). Now, a general ellipse, resp. hyperbola given by parameters uvab and \(\theta \) can be created using procedures

figure d

A general vector and a general point can be represented similarly. The wedge of two general vectors can be computed using a procedure

figure e

Analogously, a function can be created for the inner product. It can be noticed that the wedge function uses matrix multiplication using the Numpy package on matrices of the CGA objects. Selection of implemented procedures are listed in Table 1.

Fig. 1
figure 1

Ellipse and hyperbola plotted by draw command

Table 1 Selection of implemented procedures

4.2 Displaying

The Pyganja package was used as the displaying tool, as this package supports the Clifford package. It is therefore easy to display planar and conformal objects, i.e. lines, circles, etc. It is therefore necessary to use these objects to display conics. An ellipse is uniquely determined, for example, by its incircle, circumcircle and major axis, a hyperbola is uniquely determined by its asymptotes and focuses. The conic section itself can then be plotted discretely point by point, but the plotting can be more time-consuming. In the sample examples, we use a combination of these approaches - the conic section itself is plotted point by point, for the hyperbola the asymptotes are also displayed, for the ellipse the axes, the incircle and the circumcircle are displayed.

5 Examples

In this chapter we use a series of examples to demonstrate and illustrate how the package bottGA works.

5.1 Initialization and plotting an ellipse and a hyperbola

First we show how to use the bootGA package to create objects. For a particular ellipse and hyperbola based on coefficients \(a = 5\), \(b = 3\), \(\theta =\frac{\pi }{3}\) and \((u,v)=(4,-3)\) (and \(a=1, b = \frac{2}{3}, \theta = \frac{\pi }{5}, (u,v)= (3.5, -2.5)\) respectively), the corresponding matrices (1718) are following

$$\begin{pmatrix} \textbf{s} & 0 & 0 & 0 \\ -0.24 & -\textbf{s} & 0 & 0 \\ 0.41 & 0 & -\textbf{s}& 0 \\ 0 & 0.41 & 0.24 & \textbf{s} \end{pmatrix}, \begin{pmatrix} \textbf{t} & 0 & 0 & 0 \\ 0.8 & -\textbf{t} & 0 & 0 \\ 2.47 & 0 & -\textbf{t}& 0 \\ 0 & 2.47 & 0.8 & \textbf{t} \end{pmatrix},$$

where \(\textbf{s} =e_0+4.28 e_1 - 3.92 e_2 + 11.1 e_{\infty } \) and \(\textbf{t}=e_0+12.5 e_1 - 13.16 e_2 + 28.78 e_{\infty }\). In the Fig. 1 both objects are plotted by the procedure draw of package Pyganja and the corresponding code is as follows

figure f

5.2 Translation of an ellipse and a hyperbola

In order to perform the translations we have to initialize the objects and versors. Initialization of an ellipse and a hyperbola is based on the code

figure g

and the initialization of the translator and its conjugate translator given by vector \(\textbf{t} = 2e_1 + 7e_2\) is based on the code

figure h

Numerically, it gives the matrices

$$\begin{aligned} \textbf{tr} = \begin{pmatrix} \textbf{t} & \textbf{k} & \textbf{s} & \textbf{r} \\ 0 & \textbf{t} & 0 & -\textbf{s} \\ 0 & 0 & \textbf{t}& \textbf{k} \\ 0 & 0 & 0 & \textbf{t} \end{pmatrix}, \, \mathbf {tr_{inv}} = \begin{pmatrix} \tilde{\textbf{t}} & \tilde{\textbf{k}} & \tilde{\textbf{s}} & \tilde{\textbf{r}} \\ 0 & \tilde{\textbf{t}} & 0 & -\tilde{\textbf{s}} \\ 0 & 0 & \tilde{\textbf{t}}& \tilde{\textbf{k}} \\ 0 & 0 & 0 & \tilde{\textbf{t}} \end{pmatrix}, \end{aligned}$$
(19)

where

\(\textbf{t} = 1 - e_{1\infty } - {7 \over 2}e_{2\infty }\),

\(\tilde{\textbf{t}} = 1 + e_{1\infty } + {7 \over 2}e_{2\infty }\),

\(\textbf{k} = -2e_1 + 7e_2 + 14e_{12\infty }\),

\(\tilde{\textbf{k}} = 2e_1 - 7e_2 + 14e_{12\infty }\),

\(\textbf{s} = -7e_1 - 2e_2 + {45 \over 2}e_{12\infty }\),

\(\tilde{\textbf{s}} = 7e_1 + 2e_2 + {45 \over 2}e_{12\infty }\),

\(\textbf{r} = -28-53e_{12} + 28e_{1\infty } + 98e_{2\infty }\),

\(\tilde{\textbf{r}} = 28-53e_{12} + 28e_{1\infty } + 98e_{2\infty }\).

The specific translation is then performed by conjugation using the following code

figure i

Finally, the effect can be displayed using the following code and seen in Fig. 2

figure j
Fig. 2
figure 2

Translation of an ellipse and a hyperbola

5.3 Rotation of an ellipse and a parabola

Next, we illustrate the rotation of the objects, again first introducing the objects and the motor. Initialization of an ellipse and a parabola is based on the code

figure k

Initialization of the rotor and its conjugate rotor given by angle \({2 \over 5}\pi \) is based on the code

figure l

The rotation of the objects is based on the code

figure m

and we can see them in Fig. 3 with the help of the code

figure n
Fig. 3
figure 3

Rotation of an ellipse and a parabola

5.4 Finding a conic by 5 points

With the help of the developed procedures we can also define the conics sections using the set of points that lie on it. Initialization of points and finding the conic is based on the code

figure o

The result can be displayed in the Fig. 4 using the code

figure p
Fig. 4
figure 4

Conic given by 5 general points

Initialization of the points lying on a parabola with the help of the code

figure q

and finding appropriate conics by the code

figure r

we can find the parabola as we can see in the Fig. 5.

Fig. 5
figure 5

Conic given by 5 general points

6 Conclusion

Our goal was to bring algebras of higher orders, especially GAC, [21] into the current framework by the most natural way. In order to achieve this, we considered the Bott periodicity [28] and we obtained an explicit description of the conics in the form of matrices over the CRA algebra. We have used this representation for creating scripts in the most frequently used software tool, the Python packages Clifford and Pyganja, [12]. All implemented procedures of the bootGAC package can be found online, including the mentioned examples.