Geometric Algebra in Python

261 views
Skip to first unread message

Alan Bromborsky

unread,
Jan 1, 2008, 11:33:50 AM1/1/08
to sy...@googlegroups.com
I trying to determine if you would be interested in adding a geometric
algebra package to sympy. Attached are pdf files introducing geometric
algebra (imag_numbers.pdf) and a description of a python module I am
developing for symbolic geometric algebra. Comments would be welcome.
Also if the attachments don't get through how can I get them to you?
imag_numbs.pdf
symbolicGA.pdf

Ondrej Certik

unread,
Jan 1, 2008, 12:24:57 PM1/1/08
to sy...@googlegroups.com
Hi Alan!

On Jan 1, 2008 5:33 PM, Alan Bromborsky <abr...@verizon.net> wrote:
> I trying to determine if you would be interested in adding a geometric
> algebra package to sympy. Attached are pdf files introducing geometric

Yes, I am very interested in this becoming part of sympy.

> algebra (imag_numbers.pdf) and a description of a python module I am
> developing for symbolic geometric algebra. Comments would be welcome.

Which differences did you discover between swiginac and sympy?
Let's try to converge with these. Also we are interested in speed issues -
how much faster is swiginac when compared to sympy?

From the technical side, Kirill has replied in the previous thread:

http://groups.google.com/group/sympy/browse_thread/thread/a37f142aca01e8e8/

Let us know, when you release your code, so that we can play with it and then
we'll discuss how to best incorporate it into sympy.

> Also if the attachments don't get through how can I get them to you?

They went fine. You can always check that your email went through here:

http://groups.google.com/group/sympy/msg/49ee1f907ec7973c

Ondrej

David Joyner

unread,
Jan 1, 2008, 12:26:45 PM1/1/08
to sy...@googlegroups.com
Just some ideas: For me, "geometric algebra" refers to material in the
famous book by E Artin. Your usage of the term is apparently
common with mathematical physicists. I would recommend changing the
name to "clifford algebra", which seems to be used by both communities.
Also, I think there is a large package on Clifford algebras in Maple.
It might be worth comparing them, if there is overlap.

My 2 cents.

Ondrej Certik

unread,
Jan 1, 2008, 12:36:55 PM1/1/08
to sy...@googlegroups.com
On Jan 1, 2008 6:26 PM, David Joyner <wdjo...@gmail.com> wrote:
>
> Just some ideas: For me, "geometric algebra" refers to material in the
> famous book by E Artin. Your usage of the term is apparently
> common with mathematical physicists. I would recommend changing the
> name to "clifford algebra", which seems to be used by both communities.
> Also, I think there is a large package on Clifford algebras in Maple.
> It might be worth comparing them, if there is overlap.


Yes, both terms are fine with me. But it's true Clifford algebra
means for me just the anticommutation relations of Dirac matrices (and the
algebra it generates), while geometric algebra means for me:

http://en.wikipedia.org/wiki/Geometric_algebra

but now I learned, that the Dirac matrices algebra is actually called
"spacetime algebra":

http://en.wikipedia.org/wiki/Spacetime_algebra

so any name is fine with me.

In any case, Clifford albegras are really cool, I discovered that just
by accident,
but it really shows me more insight into many things in physics.

Ondrej

Alan Bromborsky

unread,
Jan 1, 2008, 12:56:41 PM1/1/08
to sy...@googlegroups.com
One reason Hestenes calls it geometric algebra is because that's what
Clifford called it, but he died to soon to impose his will upon the
mathematical community. Also, to me Clifford algebra as defined by
mathematicians today is something significantly more abstract than
Hestenes definition of geometric algebra. Hestenes also named the
follow on to geometric algebra, geometric calculus!!!

Alan Bromborsky

unread,
Jan 1, 2008, 1:08:18 PM1/1/08
to sy...@googlegroups.com
I don't know anything about Maple or Mathematica (they cost money so I
don't use them), but I would have two questions about their Clifford
packages:

1. Are they truely coordinate free or do they use an orthogonal
coordinate system with symbolic expressions for the coordinate coefficients?

2. Can you use their packages from within a python program?


Pearu Peterson

unread,
Jan 1, 2008, 1:16:06 PM1/1/08
to sympy


On Jan 1, 6:08 pm, Alan Bromborsky <abro...@verizon.net> wrote:
>
> I don't know anything about Maple or Mathematica (they cost money so I
> don't use them)..

Sometimes it is worth of looking at how other CA systems (most of them
have manuals online for free) handle certain problems and what
interfaces they provide. This is useful in a situation when a user of
these
systems tries out sympy and s/he will be more satisfied if the
general structure/user interface of the corresponding sympy package
looks similar (at least) to what s/he has been used to.

Pearu

David Joyner

unread,
Jan 1, 2008, 1:36:17 PM1/1/08
to sy...@googlegroups.com
On Jan 1, 2008 1:08 PM, Alan Bromborsky <abr...@verizon.net> wrote:
>
> David Joyner wrote:
> > Just some ideas: For me, "geometric algebra" refers to material in the
> > famous book by E Artin. Your usage of the term is apparently
> > common with mathematical physicists. I would recommend changing the
> > name to "clifford algebra", which seems to be used by both communities.
> > Also, I think there is a large package on Clifford algebras in Maple.
> > It might be worth comparing them, if there is overlap.
> >
> > My 2 cents.
> >
> > On Jan 1, 2008 11:33 AM, Alan Bromborsky <abr...@verizon.net> wrote:
> >
> >> I trying to determine if you would be interested in adding a geometric
> >> algebra package to sympy. Attached are pdf files introducing geometric
> >> algebra (imag_numbers.pdf) and a description of a python module I am
> >> developing for symbolic geometric algebra. Comments would be welcome.
> >> Also if the attachments don't get through how can I get them to you?
> >>
> >>
> >
> > >
> >
> >
> I don't know anything about Maple or Mathematica (they cost money so I
> don't use them), but I would have two questions about their Clifford
> packages:

I don't use them anymore either - I was going on my rusty memory.
However,
http://www.math.tntech.edu/rafal/cliff8/index.html
might help.

Ondrej Certik

unread,
Jan 1, 2008, 1:36:21 PM1/1/08
to sy...@googlegroups.com


Exactly. And also all opensource CA systems should have similar or the
same interface,
currently the project with a biggest momentum in this area is Sage
(sagemath.org).

Ondrej

Alan Bromborsky

unread,
Jan 1, 2008, 2:30:42 PM1/1/08
to sy...@googlegroups.com
I looked at a paper on the Maple Clifford package. The problem I would
have with it is that it is Clifford algebra for mathematicians, not for
physicists. I would not have a clue as to how to pose the sort of
problems I want to solve in that package. Also I maybe have an
irrational attachment to python as opposed to special purpose interfaces!

Bill Page

unread,
Jan 1, 2008, 3:23:58 PM1/1/08
to sy...@googlegroups.com
On 1/1/08, Alan Bromborsky wrote:
> ...

> I looked at a paper on the Maple Clifford package. The problem
> I would have with it is that it is Clifford algebra for mathematicians,
> not for physicists.

That is peculiar since it was designed by two physicists.

http://www.math.tntech.edu/rafal
http://clifford.physik.uni-konstanz.de/%7Efauser/Welcome.shtml

It is not really a good idea to call it "the Maple Clifford package"
since as far as I know it is a third party application not supported
by MapleSoft

http://math.tntech.edu/rafal/cliff11/index.html

Also I happen to know that both Rafal Ablamowicz and Bertfried Fauser
have never been very happy about the way they had to implement their
Clifford and Bialgebra packages in Maple.

> I would not have a clue as to how to pose the sort of problems
> I want to solve in that package.

I would very strongly recommend that you send an email to Rafal and/or
Bertfried and ask them about how Clifford could be applied to the
problems you want to solve.

You might also be interested to know that Axiom has a basic
CliffordAlgebra package (CLIF) and there has some initial work by
Bertfried et al. to implement some parts of the "Clifford" package in
Axiom.

> Also I maybe have an irrational attachment to python as opposed
> to special purpose interfaces!
>

I rather suspect that you are right about this admission, however I
see no inherent reason to discount the use of Python (and Sympy and
Sage) for this kind of project.

Regards,
Bill Page.

Bill Page

unread,
Jan 1, 2008, 10:17:29 PM1/1/08
to sy...@googlegroups.com
On 1/1/08, Bill Page wrote:
> On 1/1/08, Alan Bromborsky wrote:
> > ...
> > I looked at a paper on the Maple Clifford package. The problem
> > I would have with it is that it is Clifford algebra for mathematicians,
> > not for physicists.
>
> That is peculiar since it was designed by two physicists.
>...

> I would very strongly recommend that you send an email to Rafal
> and/or Bertfried and ask them about how Clifford could be applied
> to the problems you want to solve.
>

Bertfried Fauser replied the following (in part) today concerning my
request for some information abut the new version of Clifford for
Maple release 11:

---------- Forwarded message ----------
From: Bertfried Fauser <bertfrie...@googlemail.com>
Date: Jan 1, 2008 7:44 PM
Subject: Re: library_M11.zip
To: Bill Page <bill...@newsynthesis.org>
Cc: Ablamowicz <rabla...@tntech.edu>

Hi Bill,
...
I can tell you that Clifford 11 is just the same software as Clifford
10, with the folloing done:

-- Clifford 11 (Octonion, Bigebra, cliplus, code_support, GfG, SP,
SchurFkt etc) have helppages which serve as a sort of regression
test. Before posting a new file, (library) Rafal runs all helppages
and looks at them via occuli if the program produces the expected
results. Sometimes, expected results may be errors, though!

-- In a second step he produces the pdf's (this cannot be automated
which is still a shame for maple, and I demanded such a feature
for a long time)

So, Clifford 11 will run stable on maple 11, and I guess on maple
12, since no new maple had major library changes rom maple 8
onwards, and Clifford/Bigebra does not interact very deeply with
the maple libraries, and just uses stanrard features of the kernel.
...
> This email is the result of perhaps the first of my New Year's
> resolutions: To discover the status of the computer algebra work
> going on in Clifford Algebra's. I was pleasantly surprised to see
> that "Clifford" is still being maintained and developed (especially
> GfG).

Clifford is still a tool used by a variety of people (especially now
in engineering, robotics and optimization of geometric problems).
It is somehow complete in its functionality, since you will not find
mathematics on 'ordinary' Clifford algebras which is not covered by
this program (if Bigebra is considered a part of Clifford, for example
the restriction to one digit indices is overcome etc.). We got even
citations for our patch of maples define routine (define.m and
definemore.m come with this library), which is (as far as I can see
in maple 10) still malfunctional in the original maple library (even
mathematically meaningless, since you cannot define the base
field/ring over which say linearity or multilinearity defined). This
is needede to be able to define a tensor, which is also used in
GfG (corpoducts, implicitely) and heavily in the SchurFkt package
(which therefore is bundlered in the library_Mnn.zip files.
...
You may want to do the following:

1) Make a new directory where the library files shall be situated.
Usually under /usr/local/maple12/Cliffordlib (or the windows
equivalent)

2) Unzip the library files in that directory. If you want to use
all of the functionality, there should be a zip file called
"matdatam_M10.zip" (needs separate download) which contains
precomputed results to look up data about clifford algebras and
about several representations. You should get the following list
of files:

define.m maple.hdb maple.lib matquatL.m matrealR.m
definemore.m maple.ind matcompL.m matquatR.m mydefs.m
maple.ini matcompR.m matrealL.m

make sure maple has rights to read (and possibly write) these
files. ...

3) produce a maple.ini file (or hardcode in the startup script) so
that 'libname' is set to something like:

libname;
"/usr/local/maple/maple10/Cliffordlib",
"/usr/local/maple/maple10/FGblib","/usr/local/maple/maple10/lib"

you see that I have installed FGblib by Fauget (in a separate
directory) which contains a fast Groebner solver for maple runing
externally as a C program. Its really really fast and I guess it was
now incorporated into Maple? Do this:

> libname:="<your/Clifford/path>",libname:

Make sure all custom libraries come before the maple main library,
so that maple will use these functionality first. Otherwise, for
example 'define' will not work. The library contains the full help
browser documentation of all packages:
Clifford / Bigebra / Cliplus / GfG (possibly no material there yet) /
SP (same status as GfG) / SchurFkt / Octonion / code_support / ...
if any. Try

> ?Clifford

Many helppages of Bigebra and some of Clifford do contain
unpublished mathematics, as quite a few pages of SchurFkt
do also (especially the Rota-Stein outer product for monomial
symmetric functions).

The README.txt is posted on the web page and should, of
course, be included into the zip file of the library. We had quite
a few updates recently and it seems it got lost in course of
doing so.

If you have problems let me know please!

...
> Of course I also remain very interested in the possibility of
> developing something like Clifford in Axiom and hope that I
> will have some time available this year to pursue this subject.

Rafal's and my intention is to merge (in a larger sense) the
Clifford/Bigebra/Cliplus/GfG/and SchurFkt packages. Clifford and
Bigebra can handle matrix reps etc, while SchurFkt can handle
infinite dimesnional objects and such things as tensor products
of representations which is simply too slow in Bigebra to be
pushed really forward. (A computer is still not able to compute
the multiplication table of the Clifford algebra CL(9,0) and store
it precomputed.

Using Young tableaux techniques you can deal with arbitrary
(OK, say reasonably high) weight tensor products, which are
light years out of reach by Bigebra(Clifford). Such a merge
should (has to!) include super algebras and Hilbert modules,
as it has also to contain q-deformed structures which are partly
implemented in Clifford (if you know how to activate them) but
not yet fully developed/functional (or even documented).

I have declined Tim's offer/attempt to recode Clifford for AXIOM.
AXIOM deserves a newly designed package, which prevents lots
of design errors of Clifford (and SchurFkt). I cannot recommand
a port, its just far too big! and would port errors in design, which
any would be possibly uncodable in AXIOM due to its typing
system :)

The projects contain currently:

-- Clifford: 84 exporter proceedures
-- Bigebra: 33 exported proceedures
-- Cliplus: 10 exported proceedures
-- Octonion: 12 exported proceedures
-- SP: 29 exported proceedures
-- GfG: 23 exported proceedures
-- SchurFkt: 76 exported proceedures (still growing)
-- code_support: 11 exported functuions
-- RJgrobner 26 exported proceedures (by Rafal Ablamowicz and Jane Liu)

== in toto ===============
304 exported functuions

Note that Clifford/Bigebra/ and SchurFkt come with many own
types etc which are not counted (!) and several internal helper
functuions which are also not exported from the packages, so
a 'port' of the main functionality is a formidable task (may be
about 500 proceedures!)

AXIOMs Clifford package is in my eyes not more than a 'its
possible' study. Note that we face the problem that Clifford
can handle a much more general class of Clifford algebras
defined by providing a _bilinear form_ not a quadratic form,
such Clifford algebras are found mandatorially in QFT and
where named 'quantum Clifford algebras' since they can mimic
q-deformed Clifford algebras (see one of my J.Phys.A papers
on that topic). (However to produce (Feynman) graphs, and
count them, one is better of with Schur functions!).

After the AXIOM workshop at the RISC in 2007, Martin Rubey,
Ralf Hemmecke and I discussed the possibility of a Schur
function package for AXIOM. This would be a major issue,
since Clifford algebras are somehow strongly related with that
and the Hopf algebra structure of Schur functions and Clifford
algebars is almost perfectly aligned. So there would be only
one attempt to achieve this goal in parallel.

There are still unsolved mathematical problems coming with
Clifford algebras. With Zbigniew I tried quite a while to
understand which categorial axioms one needs to set up to
define Clifford algebras, (not as a universal object, but in terms
of internal logic, say equationally) this is still unsolved, though
Zbigniew made some progress. However, some exotic non
Clifford algebras remain as models of such a setting and the
computations are tremendously cumbersome if a search in
model space is performed (unsolved computational problem)

I am currently computing heavy duty knot invariant calculations
whith the SchurFkt package, and amazingly this leads back to
(spinors (anyons (fractional spin) and 'Clifford algebras of a
polynomial invariant form, not just a quadratic form), so I may
come back to Clifford more seriously later.

Hope this helps
Ciao
BF.

--
% PD Dr Bertfried Fauser
% Privat Docent: University of Konstanz, Physics Dept
<http://www.uni-konstanz.de>
% contact |-> URL : http://clifford.physik.uni-konstanz.de/~fauser/
% Phone : +49 7531 693491

Ondrej Certik

unread,
Jan 1, 2008, 10:23:19 PM1/1/08
to sy...@googlegroups.com
On Jan 2, 2008 4:17 AM, Bill Page <bill...@newsynthesis.org> wrote:
>
> On 1/1/08, Bill Page wrote:
> > On 1/1/08, Alan Bromborsky wrote:
> > > ...
> > > I looked at a paper on the Maple Clifford package. The problem
> > > I would have with it is that it is Clifford algebra for mathematicians,
> > > not for physicists.
> >
> > That is peculiar since it was designed by two physicists.
> >...
> > I would very strongly recommend that you send an email to Rafal
> > and/or Bertfried and ask them about how Clifford could be applied
> > to the problems you want to solve.
> >
>
> Bertfried Fauser replied the following (in part) today concerning my
> request for some information abut the new version of Clifford for
> Maple release 11:

Thanks Bill for posting this! After reading this I realized I also know
B. Fauser, as we were on the RISC workshop together with Mateusz
(another sympy developer). I know they were discussing schur
functions, but I didn't find it interesting then. :)

Ondrej

Robert Kern

unread,
Jan 2, 2008, 12:01:56 PM1/2/08
to sympy
On Jan 1, 10:33 am, Alan Bromborsky <abro...@verizon.net> wrote:
> I trying to determine if you would be interested in adding a geometric
> algebra package to sympy. Attached are pdf files introducing geometric
> algebra (imag_numbers.pdf) and a description of a python module I am
> developing for symbolic geometric algebra. Comments would be welcome.

I'd be interested. A long time ago, I wrote a module for numeric
computations in geometric algebra. I have (mostly) updated it to use
numpy, but that conversion may still be a little rough.

http://www.enthought.com/~rkern/cgi-bin/hgwebdir.cgi/clifford/

You may also be interested in the book _Geometric Algebra for Computer
Science: An Object-oriented Approach to Geometry_ by Leo Dorst, Daniel
Fontijne and Stephen Mann. A substantial chunk of the book is devoted
to discussing implementation, with code, albeit from a numerical
perspective.

http://www.geometricalgebra.net/

Alan Bromborsky

unread,
Jan 2, 2008, 12:30:16 PM1/2/08
to sy...@googlegroups.com
I got that book recently. My favorite is "Geometric Algebra for
Physicists" by Doran and Lazenby!!!!
Reply all
Reply to author
Forward
0 new messages