ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Mon, 21 Jan 2013 09:15:40 -0600Defining Clifford Algebrashttp://ask.sagemath.org/question/9704/defining-clifford-algebras/Dear all.
I'm a high energy physicist, interested in using SAGE for manipulations of Clifford algebras.
Being accustomed to the architecture of SAGE, I believe that the fundamental structures of these algebras is defined somewhere (probably as an algebra with basis).
**Question(s)**
- How could I define the Clifford algebra structure from the basis elements?
- Is it possible to manipulate the order of terms like $v w u \to u v w$ ?
Thank you.Fri, 11 Jan 2013 06:29:58 -0600http://ask.sagemath.org/question/9704/defining-clifford-algebras/Answer by burcin for <p>Dear all.</p>
<p>I'm a high energy physicist, interested in using SAGE for manipulations of Clifford algebras.</p>
<p>Being accustomed to the architecture of SAGE, I believe that the fundamental structures of these algebras is defined somewhere (probably as an algebra with basis).</p>
<p><strong>Question(s)</strong></p>
<ul>
<li><p>How could I define the Clifford algebra structure from the basis elements?</p></li>
<li><p>Is it possible to manipulate the order of terms like $v w u \to u v w$ ?</p></li>
</ul>
<p>Thank you.</p>
http://ask.sagemath.org/question/9704/defining-clifford-algebras/?answer=14453#post-id-14453[GiNaC](http://www.ginac.de), the C++ library used as the backend for symbolic expressions in Sage, supports Clifford algebras. See [this article](http://arxiv.org/abs/cs/0410044) for more details. Using this implementation might be easier than starting from scratch in Python/Cython. I expect the performance of GiNaC to be quite competitive, thanks to [Pynac](http://pynac.org) we can also use arbitrary coefficient domains from Sage.
After a brief look at the article mentioned above, I can say that it would be fairly straightforward to wrap those C++ functions and provide access to these data structures from Sage. I would be happy to do this and create a prototype implementation if somebody is willing to take over the polish. :)Sat, 12 Jan 2013 11:41:21 -0600http://ask.sagemath.org/question/9704/defining-clifford-algebras/?answer=14453#post-id-14453Comment by benjaminfjones for <p><a href="http://www.ginac.de">GiNaC</a>, the C++ library used as the backend for symbolic expressions in Sage, supports Clifford algebras. See <a href="http://arxiv.org/abs/cs/0410044">this article</a> for more details. Using this implementation might be easier than starting from scratch in Python/Cython. I expect the performance of GiNaC to be quite competitive, thanks to <a href="http://pynac.org">Pynac</a> we can also use arbitrary coefficient domains from Sage.</p>
<p>After a brief look at the article mentioned above, I can say that it would be fairly straightforward to wrap those C++ functions and provide access to these data structures from Sage. I would be happy to do this and create a prototype implementation if somebody is willing to take over the polish. :)</p>
http://ask.sagemath.org/question/9704/defining-clifford-algebras/?comment=18399#post-id-18399That sounds interesting. I'd certainly be willing to help polish.Mon, 14 Jan 2013 05:48:04 -0600http://ask.sagemath.org/question/9704/defining-clifford-algebras/?comment=18399#post-id-18399Answer by benjaminfjones for <p>Dear all.</p>
<p>I'm a high energy physicist, interested in using SAGE for manipulations of Clifford algebras.</p>
<p>Being accustomed to the architecture of SAGE, I believe that the fundamental structures of these algebras is defined somewhere (probably as an algebra with basis).</p>
<p><strong>Question(s)</strong></p>
<ul>
<li><p>How could I define the Clifford algebra structure from the basis elements?</p></li>
<li><p>Is it possible to manipulate the order of terms like $v w u \to u v w$ ?</p></li>
</ul>
<p>Thank you.</p>
http://ask.sagemath.org/question/9704/defining-clifford-algebras/?answer=14449#post-id-14449It should certainly be possible. One place you might start looking is the implementation of Quaternion algebras in Sage. This is in the `sage.algebras.quatalg` package: https://github.com/sagemath/sagelib/tree/master/sage/algebras/quatalg
Fri, 11 Jan 2013 21:24:28 -0600http://ask.sagemath.org/question/9704/defining-clifford-algebras/?answer=14449#post-id-14449Comment by Dox for <p>It should certainly be possible. One place you might start looking is the implementation of Quaternion algebras in Sage. This is in the <code>sage.algebras.quatalg</code>package: <a href="https://github.com/sagemath/sagelib/tree/master/sage/algebras/quatalg">https://github.com/sagemath/sagelib/t...</a></p>
http://ask.sagemath.org/question/9704/defining-clifford-algebras/?comment=18384#post-id-18384@benjaminfjones : I have a doubt with the QuaternionAlgebra. The basis is form by `i,j,k` and the definition of what `i` and `j` are, is related with the values of `arg1` and `arg2`. But I still don't get how and when the base `k` is defined. Also, where in the code is imposed that `i` and `j` anticommute? Thank you!Thu, 17 Jan 2013 03:32:34 -0600http://ask.sagemath.org/question/9704/defining-clifford-algebras/?comment=18384#post-id-18384Comment by benjaminfjones for <p>It should certainly be possible. One place you might start looking is the implementation of Quaternion algebras in Sage. This is in the <code>sage.algebras.quatalg</code>package: <a href="https://github.com/sagemath/sagelib/tree/master/sage/algebras/quatalg">https://github.com/sagemath/sagelib/t...</a></p>
http://ask.sagemath.org/question/9704/defining-clifford-algebras/?comment=18361#post-id-18361For a basis over a field K you also need a vector representing 1. I think the reason `i` and `j` are there but not `k` is that you only need 2 of the 3 to generate the quaternions as an algebra (recall `k = i * j`). To see where the multiplicative structure on the algebra is defined look at the ring multiplication for generic elements (see the code starting with `cpdef RingElement _mul_(self, RingElement _right):` in `quaternion_algebra_element.pyx`.Mon, 21 Jan 2013 09:15:40 -0600http://ask.sagemath.org/question/9704/defining-clifford-algebras/?comment=18361#post-id-18361