# \[ANN\] DirectSum.jl, AbstractTensors.jl : dispatch on VectorBundle \<: Manifold{n}

**URL:** https://discourse.julialang.org/t/ann-directsum-jl-abstracttensors-jl-dispatch-on-vectorbundle-manifold-n/20870
**Category:** Package Announcements
**Tags:** package, proposal, announcement
**Created:** [February 16, 2019, 7:23pm UTC](https://discourse.julialang.org/t/ann-directsum-jl-abstracttensors-jl-dispatch-on-vectorbundle-manifold-n/20870 "2019-02-16T19:23:23Z")
**Posts on this page:** 5
**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 16, 2019, 7:23pm UTC](https://discourse.julialang.org/t/ann-directsum-jl-abstracttensors-jl-dispatch-on-vectorbundle-manifold-n/20870/1 "2019-02-16T19:23:23Z")

</div>

In my work, I found it necessary to create an abstract `TensorAlgebra` type. [Searching on github](https://github.com/search?l=Julia&q=AbstractTensor&type=Code), I found that many others had also devised some sort of `AsbtractTensor` concept.

As a multilinear map, a tensor is defined on a `VectorSpace`. To facilitate compile-time operations with various different `VectorSpace` instances encountered, I created the `DirectSum` package:

> **[GitHub - chakravala/DirectSum.jl: Tangent bundle, vector space and...](https://github.com/chakravala/DirectSum.jl)**
>
> Tangent bundle, vector space and Submanifold definition - GitHub - chakravala/DirectSum.jl: Tangent bundle, vector space and Submanifold definition

In order to manage the interoperability of `TensorAlgebra{V}` elements over `V` (a `VectorSpace`) it was natural to make these abstractions available separately from the specific implementations. In this case, my original applications were for constructing the [Grassmann.jl](https://github.com/chakravala/Grassmann.jl) exterior tensor product algebra, wich required a dispatch bypass in the scope of [Reduce.jl](https://github.com/chakravala/Reduce.jl) module `Reduce.Algebra`. Thus,

> **[GitHub - chakravala/AbstractTensors.jl: Tensor algebra abstract type...](https://github.com/chakravala/AbstractTensors.jl)**
>
> Tensor algebra abstract type interoperability setup - GitHub - chakravala/AbstractTensors.jl: Tensor algebra abstract type interoperability setup

Together, this can provide a unified abstract type root for arbitrary `TensorAlgebra` dispatch.

By itself, this package does not impose any structure or specifications on the `TensorAlgebra{V}` subtypes and elements, aside from requiring `V` to be a `VectorSpace` . This means that different packages can create special types of tensors with shared method names and a common underlying `VectorSpace` structure.

These two packages have been registered and are now available for use. Although primarily intended for the implementation of the `Grassmann` package, it is my hope that perhaps the `AbstractTensors` and `DirectSum` packages could help towards making a universal `TensorAlgebra{V}` abstraction.

If any other developers are interested in this `VectorSpace` and `TensorAlgebra` abstraction layer, I would be interested to see any discussions or feedback concerning it. This [project](https://github.com/users/chakravala/projects/1) tracks related issues.

---

<div class="post-metadata">

### Author: ![juthohaegeman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juthohaegeman/32/8620_2.png) [@juthohaegeman](https://discourse.julialang.org/u/juthohaegeman)
#### Post date: [February 16, 2019, 10:19pm UTC](https://discourse.julialang.org/t/ann-directsum-jl-abstracttensors-jl-dispatch-on-vectorbundle-manifold-n/20870/2 "2019-02-16T22:19:00Z")

</div>

Related yet, as far as I can tell from a quick look, also very different: [https://github.com/Jutho/TensorKit.jl](https://github.com/Jutho/TensorKit.jl)  
Also, my package (actually mostly the documentation) is very much work in progress (best to look at the dev version of the manual if you are interested)

---

<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 16, 2019, 10:38pm UTC](https://discourse.julialang.org/t/ann-directsum-jl-abstracttensors-jl-dispatch-on-vectorbundle-manifold-n/20870/3 "2019-02-16T22:38:03Z")

</div>

> [@juthohaegeman](#):
>
> Related yet, as far as I can tell from a quick look, also very different: [https://github.com/Jutho/TensorKit.jl](https://github.com/Jutho/TensorKit.jl)

Yes, that’s very related, interesting! I’ve found various other projects on Github, we are all interested in similar things but have somewhat different ways of doing it. Another one is [VectorSpaces.jl](https://github.com/eschnett/VectorSpaces.jl/blob/master/src/VectorSpaces.jl)

It’s clear from the various projects out there (counted around 5-10) that some kind of a unified system is desired by various people, each having slightly different needs.

I imagine that in the future there are going to be many different options for these kind of tools, mine is more geared towards being fluent with [conformal geometric algebra](https://en.wikipedia.org/wiki/Conformal_geometric_algebra). Perhaps, we should be talking with each other and forming more of a community around how to organize these related tools.

However, one main difference is that I separated my specific implementation in [Grassmann.jl](https://github.com/chakravala/Grassmann.jl) away from my root abstract type for `TensorAlgebra{V}` and the `VectorSpace` definitions.

This is because the `Grassmann` tensor product space is only a subset of the full tensor product space.

This allows other packages to have interoperability with `TensorAlgebra` if needed.

---

<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 21, 2019, 8:51pm UTC](https://discourse.julialang.org/t/ann-directsum-jl-abstracttensors-jl-dispatch-on-vectorbundle-manifold-n/20870/4 "2019-05-21T20:51:03Z")

</div>

The `DirectSum` package has a `tangent` bundle encoding based on the following:

Let T^dV\in\text{Vect}\_\mathbb K be a `VectorBundle<:Manifold` of rank n,

> T^dV = (n,p,g,d),\, n \in\mathbb N,\, g :V\times V\rightarrow\mathbb K, \, d \in\mathbb Z

`::VectorBundle{n,p,g,d} where {n,p,g,d}` _byte-encoded_

- p specifies the null-basis from the projective split of V,
- g is a bilinear form that specifies the metric of the space,
- d is an integer specifying the order of the tangent bundle.

> \bigoplus T^{d\_i}V\_i = (|p|+d+\sum n\_i-|p\_i|-d\_i,\,\bigcup p\_i,\,\oplus\_i g\_i,\,\max\{d\_i\}\_i)

`::SubManifold{m,V,s} where` \{n\geq m\in\mathbb N,V\in\text{Vect}\_\mathbb K,s\in V\}

> T^eV \subset T^dW \iff \exists Z\in\text{Vect}\_\mathbb K(T^e(V\oplus Z) = T^{e\leq d}W,\,V\perp Z)

Dual space involution: (\cdot)':\text{Vect}\_\mathbb K^\text{op}\rightarrow\text{Vect}\_\mathbb K, V' = \text{Hom}(V,\mathbb K)

> T^dV = \langle v\_1,\dots,v\_n,\epsilon\_1,\dots,\epsilon\_d\rangle,\, T^dV' = \langle w\_1,\dots,w\_n,\partial\_1,\dots,\partial\_d\rangle

Additional `Manifold` types such as `SubManifold` and `DiagonalManifold` will enable the precise application of Riemannian geometry in the `Grassmann` algebra package in an upcoming release.

---

<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: [January 19, 2020, 2:32am UTC](https://discourse.julialang.org/t/ann-directsum-jl-abstracttensors-jl-dispatch-on-vectorbundle-manifold-n/20870/5 "2020-01-19T02:32:59Z")

</div>

[DirectSum.jl](https://github.com/chakravala/DirectSum.jl) has been updated to v0.5 and [AbstractTensors.jl](https://github.com/chakravala/AbstractTensors.jl) is v0.4.2 with revised features and [docs](https://grassmann.crucialflow.com/dev/design)
