# \[ANN\] Grassmann.jl : Differential geometric algebra

**URL:** <https://discourse.julialang.org/t/ann-grassmann-jl-differential-geometric-algebra/21125>\
**Category:** Package Announcements\
**Tags:** package, announcement, differentiation, array, linearalgebra\
**Created:** [February 23, 2019, 9:55pm UTC](https://discourse.julialang.org/t/ann-grassmann-jl-differential-geometric-algebra/21125 "2019-02-23T21:55:49Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![chakravala](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chakravala/32/6832_2.png) [@chakravala](https://discourse.julialang.org/u/chakravala)\
**Post date:** [February 23, 2019, 9:55pm UTC](https://discourse.julialang.org/t/ann-grassmann-jl-differential-geometric-algebra/21125/1 "2019-02-23T21:55:49Z")

</div>

Grassmann algebra, Clifford algebra, and conformal geometric algebra are powerful algebraic tools

> **[Conformal geometric algebra](https://en.wikipedia.org/wiki/Conformal_geometric_algebra)**
>
> Conformal geometric algebra (CGA) is the geometric algebra constructed over the resultant space of a map from points in an n-dimensional base space Rp,q to null vectors in Rp+1,q+1. This allows operations on the base space, including reflections, rotations and translations to be represented using versors of the geometric algebra; and it is found that points, lines, planes, circles and spheres gain particularly natural and computationally amenable representations.
> The effect of the mapping is th...

To help bring conformal geometric algebra to julia, the `Grassmann` library now provides most of the basic tools needed to begin working with a fully generalized `MultiVector` algebra.

> **[GitHub - chakravala/Grassmann.jl: ⟨Grassmann-Clifford-Hodge⟩ multilinear...](https://github.com/chakravala/Grassmann.jl)**
>
> ⟨Grassmann-Clifford-Hodge⟩ multilinear differential geometric algebra

This package is a work in progress providing the necessary tools to work with arbitrary dual `MultiVector` elements with optional origin. Due to the parametric type system for the generating `VectorSpace` , the Julia compiler can fully preallocate and often cache values efficiently. Both static and mutable vector types are supported.

It is currently possible to do both high-performance numerical computations with `Grassmann` and it is also currently possible to use symbolic scalar coefficients when the `Reduce` package is also loaded.

Fully general products available for high-performance and sparse computation include `∧,∨,⋅,*` (exterior, regressive, interior, geometric). Some unary operations include `complementleft` , `complementright` , `reverse`, `involve` , `conj` , and `adjoint` .

### Notable features

What’s particularly special about `Grassmann` is its ability to handle caching and code generation in a tiered multi-stage setup and the ability to easily handle the creation of extra specialized methods to replace composite or dynamic dispatch scenarios with more efficient code.

This can work up to `N=62` indices in the `VectorSpace`, reaching a `4,611,686,018,427,387,904` dimensional `TensorAlgebra` space, which is much beyond what Julia arrays can handle natively.

```Julia
julia> using Grassmann

julia> i,j,k = complementright.((-Λ(3).v1,-Λ(3).v2,-Λ(3).v3))
(-1v₂₃, 1v₁₃, -1v₁₂)

julia> @btime i^2, j^2, k^2, i*j*k
  158.925 ns (5 allocations: 112 bytes)
(-1v, -1v, -1v, -1v)

julia> @btime -(j+k) * (j+k)
  176.233 ns (8 allocations: 240 bytes)
2

julia> @btime -(j+k) * i
  111.394 ns (6 allocations: 192 bytes)
0 - 1v₁₂ - 1v₁₃

```

The `Grassmann` package is fully general, and includes number systems such as quaternions `1,i,j,k`.

#### Design, code generation

Due to the abstract generality of the product algebra code generation, it is possible to extend the `Grassmann` library to include additional high performance products with few extra definitions. Operations on ultra-sparse representations for very high dimensional algebras will be gaining further performance enhancements in future updates, while the standard lower dimensional algebras already are highly performant and optimized. Thanks to the design of the product algebra code generation, any additional optimizations to the type stability will automatically enhance all the different products simultaneously. Likewise, any new product formulas will be able to quickly gain from the setup of all of the existing optimizations.

#### Calculating some bivectors

There are are a variety of resources online which help with the introduction to the subject. One notable video useful for just about anybody interested in geometric algebra was posted by @waldyrious

[![](https://global.discourse-cdn.com/julialang/original/3X/8/8/88be9a784e13dd1cfb2eb6d65902c191980ad83c.jpeg "A Bigger Mathematical Picture for Computer Graphics") ](https://www.youtube.com/watch?v=WZApQkDBr5o)

Some of the examples in that video can be verified `using Reduce, Grassmann` in julia

```Julia
julia> using Reduce,Grassmann; basis"4"
Reduce (Free CSL version, revision 4590), 11-May-18 ...
(⟨++++⟩, v, v₁, v₂, v₃, v₄, v₁₂, v₁₃, v₁₄, v₂₃, v₂₄, v₃₄, v₁₂₃, v₁₂₄, v₁₃₄, v₂₃₄, v₁₂₃₄)

julia> P,Q = :px*v1 + :py*v2 + :pz* v3 + v4, :qx*v1 + :qy*v2 + :qz*v3 + v4
(pxv₁ + pyv₂ + pzv₃ + 1.0v₄, qxv₁ + qyv₂ + qzv₃ + 1.0v₄)

julia> P∧Q
0.0 + (px * qy - py * qx)v₁₂ + (px * qz - pz * qx)v₁₃ + (px - qx)v₁₄ + (py * qz - pz * qy)v₂₃ + (py - qy)v₂₄ + (pz - qz)v₃₄

julia> R = :rx*v1 + :ry*v2 + :rz*v3 + v4
rxv₁ + ryv₂ + rzv₃ + 1.0v₄

julia> P∧Q∧R
0.0 + ((px * qy - py * qx) * rz - ((px * qz - pz * qx) * ry - (py * qz - pz * qy) * rx))v₁₂₃ + (((px * qy - py * qx) + (py - qy) * rx) - (px - qx) * ry)v₁₂₄ + (((px * qz - pz * qx) + (pz - qz) * rx) - (px - qx) * rz)v₁₃₄ + (((py * qz - pz * qy) + (pz - qz) * ry) - (py - qy) * rz)v₂₃₄

```

In this example, the exterior product of points is inspected and compared with inner,cross products.

It is my hope to use absorb of the feedback from the geomtric algebra community when making ongoing improvements to help refine the package’s source code generation and sparse specialization.

---

<div class="post-metadata">

**Author:** ![waldyrious](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/waldyrious/32/80_2.png) [@waldyrious](https://discourse.julialang.org/u/waldyrious)\
**Post date:** [February 25, 2019, 12:05pm UTC](https://discourse.julialang.org/t/ann-grassmann-jl-differential-geometric-algebra/21125/2 "2019-02-25T12:05:54Z")

</div>

> [@chakravala](#):
>
> There are are a variety of resources online which help with the introduction to the subject. One notable video useful for just about anybody interested in geometric algebra was posted by @waldyrious: [A Bigger Mathematical Picture for Computer Graphics](https://www.youtube.com/watch?v=WZApQkDBr5o).

For a gentler introduction, I would recommend [The Vector Algebra War: a historical perspective](https://www.youtube.com/watch?v=_AaOFCl2ihc) (video, 13min). As someone lacking rigorous mathematical background, I find that this sort of layman-friendly introductions greatly help motivate the initial exploration of this field, and consumption of more advanced materials.

For those more familiar with the concepts used in GA, the [Ganja.js Cheat Sheets](https://enkimute.github.io/GanjaCheatSheets/) provide some really nice and comprehensive reference sheets.

It may also be worth noting the (abandoned?) package [GeoAlg.jl](https://github.com/andrioni/GeoAlg.jl) by [@andrioni](https://github.com/andrioni):

> work-in-progress straight port of [Fontijne’s reference implementation](http://www.geometricalgebra.net/reference_impl.html) of geometric algebra utilities to Julia.

---

<div class="post-metadata">

**Author:** ![drjrkuhn](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/drjrkuhn/32/920_2.png) [@drjrkuhn](https://discourse.julialang.org/u/drjrkuhn)\
**Post date:** [February 26, 2019, 4:26pm UTC](https://discourse.julialang.org/t/ann-grassmann-jl-differential-geometric-algebra/21125/3 "2019-02-26T16:26:49Z")

</div>

Thank you. I can’t wait to try this out!

Daniel Fontijne’s OpenGL [GAViewer](http://www.geometricalgebra.net/gaviewer_download.html) still has one of the best graphic displays for multivectors I have seen, but its development has been defunct for a while now. I’ve scanned through his source and most of the drawing takes place in only a few methods. It might be nice to merge Grassmann.jl with GAViewer’s color/display methods on top of [Makie.jl](https://github.com/JuliaPlots/Makie.jl) to explore multivectors and spaces. I’ve been waiting for Makie’s WebGL backend before tackling something like this.

---

<div class="post-metadata">

**Author:** ![chakravala](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chakravala/32/6832_2.png) [@chakravala](https://discourse.julialang.org/u/chakravala)\
**Post date:** [February 26, 2019, 5:20pm UTC](https://discourse.julialang.org/t/ann-grassmann-jl-differential-geometric-algebra/21125/4 "2019-02-26T17:20:30Z")

</div>

There is also [pyganja](https://github.com/pygae/pyganja) based on [ganja.js](https://github.com/enkimute/ganja.js) for visualization, perhaps that would be easier to port since in Julia we already have python interoperability?

> [@drjrkuhn](#):
>
> It might be nice to merge Grassmann.jl with GAViewer’s color/display methods on top of [Makie.jl](https://github.com/JuliaPlots/Makie.jl) to explore multivectors and spaces.

The `Grassmann` package is going to remain a separate package, it is intended for the abstract mathematical representation aspect of geometric algebra. Any visualization library would best be placed into a separate repository, since visualization requires additional many dependencies.

Perhaps you could get started on such a repository? [related issue on using SymPy with Grassmann](https://github.com/chakravala/Grassmann.jl/issues/6)

---

<div class="post-metadata">

**Author:** ![Mason](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mason/32/2423_2.png) [@Mason](https://discourse.julialang.org/u/Mason)\
**Post date:** [February 26, 2019, 6:11pm UTC](https://discourse.julialang.org/t/ann-grassmann-jl-differential-geometric-algebra/21125/5 "2019-02-26T18:11:48Z")

</div>

Looks great! So this is now more of a Geometric / Clifford Algebra package than a Grassmann Algebra package? Do you plan on supporting custom metrics in as a generalization to just specifying the signature?

I had tried doing something similar a while ago but got stuck figuring out a satisfactory way of supporting non-diagonal metrics.

---

<div class="post-metadata">

**Author:** ![chakravala](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chakravala/32/6832_2.png) [@chakravala](https://discourse.julialang.org/u/chakravala)\
**Post date:** [February 26, 2019, 6:33pm UTC](https://discourse.julialang.org/t/ann-grassmann-jl-differential-geometric-algebra/21125/6 "2019-02-26T18:33:04Z")

</div>

> [@Mason](#):
>
> So this is now more of a Geometric / Clifford Algebra package than a Grassmann Algebra package?

Roughly speaking, these algebras of Geometric / Clifford / Grassmann types are all fundamentally the same thing, with slightly different notations, formalisms, and preferences. The package itself implements conformal geometric algebra and it is named after Grassmann, who is often not adequately cited for his role in the invention of linear algebra and many other related subjects.

> [@Mason](#):
>
> supporting custom metrics in as a generalization to just specifying the signature?

Yes, I do have an interest in that regard… but it is much lower on my list of design priorities. My primary goal was to get started an initial setup intended for high performance. The current setup helps facilitate the highest performance possible for most standard conformal geometric algebras.

There are a couple of ideas I got for that, but I have other goals first. You could open an issue for it?

---

<div class="post-metadata">

**Author:** ![chakravala](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chakravala/32/6832_2.png) [@chakravala](https://discourse.julialang.org/u/chakravala)\
**Post date:** [February 27, 2019, 12:09am UTC](https://discourse.julialang.org/t/ann-grassmann-jl-differential-geometric-algebra/21125/7 "2019-02-27T00:09:44Z")

</div>

To those interested, I opened up a new pull-request to discuss the sign value of `LinearAlgebra.I` when interpreted as a generalized universal pseudoscalar value

[https://github.com/chakravala/Grassmann.jl/pull/10](https://github.com/chakravala/Grassmann.jl/pull/10)

Since `LinearAlgebra.I` has a sign associated to it, I would like to interpret that as a minus sign, which is helpful in the theory and expressiveness of various formulas, but am opening it for discussion

---

<div class="post-metadata">

**Author:** ![chakravala](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chakravala/32/6832_2.png) [@chakravala](https://discourse.julialang.org/u/chakravala)\
**Post date:** [April 28, 2019, 4:19pm UTC](https://discourse.julialang.org/t/ann-grassmann-jl-differential-geometric-algebra/21125/8 "2019-04-28T16:19:47Z")

</div>

Some new features have been added to fully support multivariable and higher-order dual numbers, i.e. Taylor numbers and Cartan differential forms.

The `tangent` map takes `V` to its tangent bundle and can be applied repeatedly or specified `tangent(V,order)` for higher.

```nohighlight
julia> V = tangent(ℝ^3)
⟨+++₁⟩

julia> V'
⟨---¹⟩'

julia> V+V'
⟨+++---₁¹⟩*

```

The chain rule is encoded into `Grassmann` algebra when a `tangent` bundle is used, demonstrated here symbolically with `Reduce` by using the dual number definition:

```nohighlight
julia> using Grassmann, Reduce
Reduce (Free CSL version, revision 4590), 11-May-18 ...

julia> @mixedbasis tangent(ℝ^1)
(⟨+-₁¹⟩*, v, v₁, w¹, ϵ₁, ∂¹, v₁w¹, v₁ϵ₁, v₁∂¹, w¹ϵ₁, w¹∂¹, ϵ₁∂¹, v₁w¹ϵ₁, v₁w¹∂¹, v₁ϵ₁∂¹, w¹ϵ₁∂¹, v₁w¹ϵ₁∂¹)

julia> a,b = :x*v1 + :dx*ϵ1, :y*v1 + :dy*ϵ1
(xv₁ + dxϵ₁, yv₁ + dyϵ₁)

julia> a * b
x * y + (dy * x - dx * y)v₁ϵ₁

```

Additionally, the generalized exponential map is implemented

```nohighlight
julia> exp(π*Λ(ℝ^2).v12)
-1.0000000000000004 + 3.3443843799521084e-16v₁₂

```

Unfortunately, the logarithm function is not converging yet…

---

<div class="post-metadata">

**Author:** ![TsurHerman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tsurherman/32/1234_2.png) [@TsurHerman](https://discourse.julialang.org/u/TsurHerman)\
**Post date:** [April 28, 2019, 5:23pm UTC](https://discourse.julialang.org/t/ann-grassmann-jl-differential-geometric-algebra/21125/9 "2019-04-28T17:23:05Z")

</div>

This looks cool, what are some applications for Grassman algebra?

can you post a small contained practical example?

---

<div class="post-metadata">

**Author:** ![chakravala](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chakravala/32/6832_2.png) [@chakravala](https://discourse.julialang.org/u/chakravala)\
**Post date:** [April 28, 2019, 8:18pm UTC](https://discourse.julialang.org/t/ann-grassmann-jl-differential-geometric-algebra/21125/10 "2019-04-28T20:18:09Z")

</div>

> [@TsurHerman](#):
>
> This looks cool, what are some applications for Grassman algebra?

It can be used for pretty much anything involving geometry, vectors, rotations, differentiations, etc

For example, quantum computing, automatic differentiation, differential geometry, algebraic forms, invariant theory, electric circuits, wave scattering, spacetime geometry, relativity, computer graphics, photogrammetry, and much more.

> [@TsurHerman](#):
>
> can you post a small contained practical example?

Currently, I am creating this package to learn geometric algebra itself, since I was not taught this subject and nobody explained it to me or working with me. Therefore, I am just learning it from scratch.

My goal is to implement a multi-dimensional continued fraction algorithm for special functions and also to solve the Navier-Stokes and Maxwell equations.

However, since I am somebody interested in the foundations of pure mathematics, the Applied Math aspect takes a back seat for me. My primary goal is to explore the foundations of mathematics, to make a better language for expressing complicated geometric scientific problems. In order to achieve this, I must make sure that the foundations are absolutely correct and highly extensible for many purposes. This is why I am not using `Grassman` for specific applications yet, to focus on foundations.

In the long-term future, I imagine that this kind of mathematics could become very central to most scientific and engineering research applications; however, it is still in early stages of development.

I would be excited to see what other people might want to do with it, there are countless possibilities.

So in conclusion, I am mainly focusing on researching the **foundations of mathematics** and how to combine various areas of math into a unified and efficient geometric algebra framework. In order to apply this in the future, I am doing the necessary work of constructing the underlying foundations.

In the future, I will have applications such as quantum computing and partial differential equations.

---

<div class="post-metadata">

**Author:** ![TsurHerman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tsurherman/32/1234_2.png) [@TsurHerman](https://discourse.julialang.org/u/TsurHerman)\
**Post date:** [April 29, 2019, 7:25am UTC](https://discourse.julialang.org/t/ann-grassmann-jl-differential-geometric-algebra/21125/11 "2019-04-29T07:25:04Z")

</div>

> [@chakravala](#):
>
> computer graphics, photogrammetry, and much more.

If you can point me in the general direction of an example in these areas that would be great.

> [@chakravala](#):
>
> since I am somebody interested in the foundations of pure mathematics

I can relate

---

<div class="post-metadata">

**Author:** ![chakravala](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chakravala/32/6832_2.png) [@chakravala](https://discourse.julialang.org/u/chakravala)\
**Post date:** [April 29, 2019, 9:13am UTC](https://discourse.julialang.org/t/ann-grassmann-jl-differential-geometric-algebra/21125/12 "2019-04-29T09:13:52Z")

</div>

> [@TsurHerman](#):
>
> If you can point me in the general direction of an example in these areas that would be great.

Have a look at ganja.js works in browser

> **[GitHub - enkimute/ganja.js: :triangular\_ruler: Javascript Geometric Algebra...](https://github.com/enkimute/ganja.js)**
>
> :triangular\_ruler: Javascript Geometric Algebra Generator for Javascript, c++, c#, rust, python. (with operator overloading and algebraic literals) - - GitHub - enkimute/ganja.js: :triangular\_rule...

For photogrammetry, this kind of math was [used in the matrix movies](https://pdfs.semanticscholar.org/e97d/25b9c8949af1eca6419f4e496c595257e413.pdf)

---

<div class="post-metadata">

**Author:** ![chakravala](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chakravala/32/6832_2.png) [@chakravala](https://discourse.julialang.org/u/chakravala)\
**Post date:** [May 15, 2019, 5:40pm UTC](https://discourse.julialang.org/t/ann-grassmann-jl-differential-geometric-algebra/21125/13 "2019-05-15T17:40:29Z")

</div>

In v0.1.4 of `Grassmann` the null-basis of the conformal split has been fully incorporated into the algebra

```nohighlight
julia> using Grassmann; @basis S"∞∅++"
(⟨∞∅++⟩, v, v∞, v∅, v₁, v₂, v∞∅, v∞₁, v∞₂, v∅₁, v∅₂, v₁₂, v∞∅₁, v∞∅₂, v∞₁₂, v∅₁₂, v∞∅₁₂)

julia> v∞^2, v∅^2, v1^2, v2^2
(0v, 0v, v, v)

julia> v∞ ⋅ v∅
-1v

julia> v∞∅^2
v

julia> v∞∅ * v∞, v∞∅ * v∅
(-1v∞, v∅)

julia> v∞ * v∅, v∅ * v∞
(-1 + 1v∞∅, -1 - 1v∞∅)

```

This provides the point at infinity `v∞`, the origin `v∅`, and the Minkowski plane `v∞∅` also.

---

<div class="post-metadata">

**Author:** ![Olof\_Salberger](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/olof_salberger/32/4850_2.png) [@Olof\_Salberger](https://discourse.julialang.org/u/Olof_Salberger)\
**Post date:** [May 19, 2019, 12:27am UTC](https://discourse.julialang.org/t/ann-grassmann-jl-differential-geometric-algebra/21125/14 "2019-05-19T00:27:34Z")

</div>

In physics, we see clifford algebras show up directly in a few different cases. There are two particularly common cases:

The first is for the creation and annihilation operators of fermions which form a clifford algebra of order 2n with signature (+ (n times), - (n times) ).

The second is for representing rotations and lorentz transforms, where you get the clifford algebras of order 3 of signature (+,+,+) to describe rotations and of order 4 with signature (+,+,+,-) in relativistic physics. In those cases it’s also useful to consider the representation theory of Clifford algebras, which gives the Gamma matrices acting on spinors.

That’s just in physics. You can use them to do a lot of other stuff conveniently as well. For example, you can use them to simplify the linear algebra that you would use when writing a raytracer.

---

<div class="post-metadata">

**Author:** ![chakravala](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chakravala/32/6832_2.png) [@chakravala](https://discourse.julialang.org/u/chakravala)\
**Post date:** [July 2, 2019, 1:22pm UTC](https://discourse.julialang.org/t/ann-grassmann-jl-differential-geometric-algebra/21125/15 "2019-07-02T13:22:06Z")

</div>

[Grassmann.jl](https://github.com/chakravala/Grassmann.jl) v0.2 has now been released with many new features along with the following,

Today the first draft of the _Differential geometric algebra using Leibniz, Grassmann_ paper is released:

[![DropBox](https://img.shields.io/badge/download_PDF-DropBox-blue.svg)](https://www.dropbox.com/sh/tphh6anw0qwija4/AAACiaXig5djrLVAKLPFmGV-a/Geometric-Algebra?preview=grassmann-juliacon-2019.pdf)

This is supposed to be my submission for the JuliaCon 2019 proceesings, with 6-page limit it has to be concise to introduce the most important concepts and nuances. Later a more detailed a longer version will also be published. If anybody has comments about topics that could be expanded on in these papers, it could be directed to either this concise version or to the longer version in the future.

The source is made available [here](https://github.com/chakravala/Grassmann.jl/blob/master/paper/paper.tex) and [here](https://github.com/chakravala/Math-Research-Notes/blob/master/Geometric-Algebra/grassmann-juliacon-2019.tex) with the [PDF](https://www.dropbox.com/sh/tphh6anw0qwija4/AAACiaXig5djrLVAKLPFmGV-a/Geometric-Algebra?preview=grassmann-juliacon-2019.pdf) linked from DropBox.

---

<div class="post-metadata">

**Author:** ![chakravala](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chakravala/32/6832_2.png) [@chakravala](https://discourse.julialang.org/u/chakravala)\
**Post date:** [July 15, 2019, 11:44pm UTC](https://discourse.julialang.org/t/ann-grassmann-jl-differential-geometric-algebra/21125/16 "2019-07-15T23:44:15Z")

</div>

Next week at JuliaCon I will be giving a lightning talk on the Grassmann.jl package, I’d like to know if anyone is interested in meeting afterwards so I can answer a few questions or discuss applications you have in mind.

> **[Geometric algebra in Julia with Grassmann.jl JuliaCon 2019](https://pretalx.com/juliacon2019/talk/CES8P9/)**
>
> The design of \[Grassmann.jl\](https://github.com/chakravala/Grassmann.jl) is based on the \`TensorAlgebra\` abstract type system interoperability from \[AbstractTensors.jl\](https://github.com/chakravala/AbstractTensors.jl) with a \`VectorSpace\` parameter...

---

<div class="post-metadata">

**Author:** ![chakravala](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chakravala/32/6832_2.png) [@chakravala](https://discourse.julialang.org/u/chakravala)\
**Post date:** [October 7, 2019, 10:16am UTC](https://discourse.julialang.org/t/ann-grassmann-jl-differential-geometric-algebra/21125/17 "2019-10-07T10:16:44Z")

</div>

With v0.3.1 of [Grassmann.jl](https://github.com/chakravala/Grassmann.jl) it is now fairly stable to work with higher-order generalizations of derivations.

> **[Differential geometric algebra foundations using Grassmann.jl](https://discourse.bivector.net/t/differential-geometric-algebra-foundations-using-grassmann-jl/27)**
>
> Greetings, recently I have been working on a paper along with various packages in the Julia language to try to figure out the best foundations to unify differential geometry with geometric algebra. This work is still in progress and not complete...

Using the `tangent(V,D,#)` space it is possible to explore the higher order Leibniz derivations.

Based on the definitions of differential geometric algebra, a higher order derivation is `∂i^(D+1)==0`:

```plaintext
julia> using Reduce, Grassmann; @mixedbasis tangent(ℝ^2,3,2);

julia> x = :x*v1 + ∂1v1 + ∂1*∂1v1 + ∂1*∂1*∂1v1
0.0 + xv₁ + (1 + (1 + 1∂₁)∂₁)∂₁v₁

julia> x^2
x ^ 2 + (2x + (2x + 1 + (2 * (x + 1))∂₁)∂₁)∂₁

julia> x^3
0.0 + (x ^ 3)v₁ + (3 * x ^ 2 + (3 * (x + 1) * x + (3 * x ^ 2 + 6x + 1)∂₁)∂₁)∂₁v₁

julia> x^7
0.0 + (x ^ 7)v₁ + (7 * x ^ 6 + (7 * (x + 3) * x ^ 5 + (7 * (x ^ 2 + 6x + 5) * x ^ 4)∂₁)∂₁)∂₁v₁

julia> x^8
x ^ 8 + (8 * x ^ 7 + (4 * (2x + 7) * x ^ 6 + (8 * (x ^ 2 + 7x + 7) * x ^ 5)∂₁)∂₁)∂₁

julia> x^11
0.0 + (x ^ 11)v₁ + (11 * x ^ 10 + (11 * (x + 5) * x ^ 9 + (11 * (x ^ 2 + 10x + 15) * x ^ 8)∂₁)∂₁)∂₁v₁

```

As you can see, this is the 3rd order Leibniz-Taylor algebra. Arbitrary Leibniz-Taylor algebras are supported.

```plaintext
julia> V(∇)
0v₁₂ + 1∂₁v₁ + 0∂₂v₁ + 0∂₁v₂ + 1∂₂v₂ + 0∂₁₂

julia> V(∇)^2
0 + 1∂₁∂₁ + 1∂₂∂₂

julia> V(∇)^3
0.0 + 1∂₁∂₁∂₁v₁ + 1∂₂∂₂∂₂v₂ + 1∂₂∂₁₂v₁ + 1∂₁∂₁₂v₂

julia> V(∇)^4
0.0v⃖

```

---

<div class="post-metadata">

**Author:** ![chakravala](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chakravala/32/6832_2.png) [@chakravala](https://discourse.julialang.org/u/chakravala)\
**Post date:** [October 14, 2019, 1:45pm UTC](https://discourse.julialang.org/t/ann-grassmann-jl-differential-geometric-algebra/21125/18 "2019-10-14T13:45:51Z")

</div>

By having `GeometryTypes.Point` interoperability, the `Grassmann` is now compatible with `Makie`:

```plaintext
using Grassmann, Makie
@basis S"∞+++" # 4D, Riemann sphere
sub = V(2,3,4) # 3D, SubManifold
glines(f,r=-2π:0.0001:2π) = lines([Point(sub(Grassmann.vector(f(t)))) for t ∈ r]);
f(t) = ↓(exp(t*v∞*(sin(3t)*3v1+cos(2t)*7v2-sin(5t)*4v3)/2)>>>↑(v1+v2-v3));
glines(f) # make plot in Makie

```

 ![Screenshot_2019-10-14_09-42-55](https://global.discourse-cdn.com/julialang/original/3X/b/7/b71d901f82e5a4e499e38dfe1d0eba6685ea720e.jpeg)

Note that `Point(sub(Grassmann.vector(f(t))))` is used to `convert` the `TensorAlgebra` into the required `GeometryTypes.Point` format for `AbstractPlotting`.

Preferably, I’d like to completely bypass the `Point` abstraction and just directly plot and compute with the multivector `TensorAlgebra` type system… but I might need some help from @sdanisch for that.

---

<div class="post-metadata">

**Author:** ![DoktorMike](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/doktormike/32/2736_2.png) [@DoktorMike](https://discourse.julialang.org/u/DoktorMike)\
**Post date:** [October 14, 2019, 4:36pm UTC](https://discourse.julialang.org/t/ann-grassmann-jl-differential-geometric-algebra/21125/19 "2019-10-14T16:36:31Z")

</div>

That’s awesome. 😊

---

<div class="post-metadata">

**Author:** ![dehann](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dehann/32/2003_2.png) [@dehann](https://discourse.julialang.org/u/dehann)\
**Post date:** [October 15, 2019, 2:05am UTC](https://discourse.julialang.org/t/ann-grassmann-jl-differential-geometric-algebra/21125/20 "2019-10-15T02:05:23Z")

</div>

Wow, yeah this is great!

[Next page](https://discourse.julialang.org/t/ann-grassmann-jl-differential-geometric-algebra/21125.md?page=2)
