Since I moved my website to WordPress, I have been watching what search-engine searches land people on my page.
Sadly, two of the things that get people to my page most often still have not been moved over to the new site from the old. One of those things is a C++ template library for Clifford algebras. I am going to move that stuff over this week, I promise. But, I thought I might also make a Lisp library for Clifford algebras, too.
An example Clifford algebra might be . A generic element in this algebra is of the form:
where the are coefficients. For ease in dealing with these items, I will probably store that in a vector that looks something like this:
If you want a simple element though (where most of the coefficients are zero), you shouldn’t have to stare down all of that stuff or remember that comes before . I want you to be able to make more simply. Something like one of the following:
(defvar *a* (ca-element '(3 (4 . :e1) (5 . :e1-2-3)) :p 3))
(defvar *a* (ca-element :s 3 :e1 4 :e1-2-3 5 :p 3))
Similarly, I will define something akin to (aref …) so that one can check or change like one of the following:
(caref *a* :e1-2)
By analogy with the complex numbers, I should instead have:
But, that just doesn’t scale very well.
I am leaning toward using a list of numbers to tell which is being referenced. This would allow greater flexibility in other functions. But, it’s also less mathy.
Does anyone have any suggestions? Should I really be supporting both? Through the same function names or through (caref …) and (caref* …) or something?