Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/moble/spacetimealgebra

The geometric algebra of spacetime, now with python!
https://github.com/moble/spacetimealgebra

Last synced: about 1 month ago
JSON representation

The geometric algebra of spacetime, now with python!

Awesome Lists containing this project

README

        

SpacetimeAlgebra
================

The geometric algebra of spacetime, now with `c++` *and* `python`!

***NB:*** The current exponential function, as output by Gaigen 2.5,
is wrong in some cases. It appears to be safe for bivector blades,
but it is not safe for general bivectors. In particular, it appears
that anything that should result in a pseudoscalar component is wrong.
I expect that similar errors are also present in the sin, cos, sinh,
and cosh functions.

This collection of code contains C++ and python interfaces to code
expressing the geometric algebra of spacetime. The core of this code
is generated by the excellent
[Gaigen](http://staff.science.uva.nl/~fontijne/g25.html) package,
while the interface is provided via [Cython](http://cython.org/), which gives us all the advantages of `c++` speed, with the friendly interactivity of python. Either interface is, of course, usable. In particular, this code can be used directly in `c++` code, or in `python` code, and every effort is made to ensure that the functions to be called have the same names, and the syntax is as identical as possible.

To compile and use this code in a `c++` project, nothing external should be required (beyond a reasonable compiler). To use this code in `python`, or relatively recent installation of `python` is required, along with `cython`. [Cython can usually be installed easily via the command line as `pip install Cython`.]

While the code can be used as is, it may be desirable to change something at a very low level. Because most of the code is generated automatically, this requires the user to have the code-generating tools installed. They include

* [Gaigen](http://staff.science.uva.nl/~fontijne/g25.html)
* [Cython](http://cython.org/)
* [Saxon](http://saxon.sourceforge.net/)

Again, however, these are not necessary for most purposes.

Note that the best documentation about wrapping `c++` libraries for python
with cython is not obvious to find, but is
[here](http://docs.cython.org/src/userguide/wrapping_CPlusPlus.html).