terrylyons / libalgebra

This C++ headers only library provides tools for manipulating elements of algebras; the tensor algebra, free lie algebra etc. Early versions can be found in sourceforge. It is capable of calculations over many rings including the arbitrary precision rationals from gmp/mpir . The associated library libalgebra_tests has many examples of how to use the code. the pypy package wraps a version of it - with a simple interface (and vastly reduced functionality)
12 stars 2 forks source link

Overhaul of multiplication infrastructure and tensor multiplication #74

Closed inakleinbottle closed 1 year ago

inakleinbottle commented 1 year ago

This is the combination of a lot of work to completely overhaul the multiplication system of libalgebra.

Multiplication now has a very well-defined structure that makes use of a key-level multiplier and a base multiplication to for generic vector types, whilst subclassing and overloading provide optimised implementations for specific vector types - i.e. dense vectors. These multiplcation classes must provide a fma const method and a multiply_inplace const method that take 3 or 2 basic vector types - not the vector wrapper - such as sparse_vector, dense_vector, hybrid_vector, and apply the relevant operation. Optionally, these can make use of helper classes to assist with tiling etc.

Free tensor multiplication now utilises the tiling system and should be much more performant than before. I've also updated the antipode function to make use of some of the reimagined infrastructure developed for the multiplication. It now operations in a similar kind of way.

We still need to add documentation to all of this, which will be a pretty major undertaking.