tingelst / pyversor

Python bindings for the Versor geometric algebra library
BSD 3-Clause "New" or "Revised" License
5 stars 4 forks source link

generation of algebras during build #7

Open arsenovic opened 6 years ago

arsenovic commented 6 years ago

my first thought on this module, is that it would be nice to generate the algebras during build time based on a user-defined config, instead of manual creating sub modules for each algebra. maybe a list of signatures (in list or tensor form), and perhaps blade names, like clifford.Cl() would suffice like

'g2', sig=[1,1], names='e'     # 2d space 
'g3', sig=[1,1,1], names='e'  # 3D space 

also in clifford, the conformalize() method takes a GA and return it's corresponding CGA, and associated maps in/out and other helper functions. i dont know how easy it would be to do this for pyversor, but the motivation is to reduce redundant work for g2cga and g3cga ( maybe even STAcga)

arsenovic commented 6 years ago

after reading some more of pablo's masters thesis (available here), and arguments made in Geometric Algebra and its Application to Computer Graphics, i think implementing my suggestions on pyversor would be like re-making gaigen.

however, i think there is room for a module that offers:

  1. simple python interface (syntax near to clifford )
  2. arbitrary GA up to reasonable dimension (like 10) (dynamic)
  3. decent performance
  4. aids in the re-use of prototyped code in full performance apps

why?

  1. scientists and engineers are (have) moved to python.

  2. python has scientific ecosystem (integration)

  3. syntax can become readable, so code looks like the math.

    v.rotate( Biv::xy .25 ) # nope v = Rv*~R # yep

  4. python's performance problems are being solved.

as pablo mentions the just in type compilers (jit) like numba might be interesting to look at. currently clifford uses a highly inefficient matrix implementation, so switching the low level code to use bitmap representation is low hanging fruit. how to make use of numba might become apparent.

this issue is now more of a 'how to do GA in python'