GAlgebra software

Wes Hansen
4 min readJul 31, 2023

--

This is just a short note for anyone who may be interested in learning Geometric Algebra/Calculus and using the GAlgebra software built on the Python packages Numpy and Sympy. Alan Macdonald uses GAlgebra for the computer exercises in his introductory textbooks, Linear and Geometric Algebra and Vector and Geometric Calculus. I’ve gone through Macdonald’s textbooks and I was a bit critical of them. I didn’t appreciate that there were critical definitions missing from the Algebra textbook and I still find the way he treats the differential in the Calculus textbook simply baffling! But these books are “for the second year undergraduate linear algebra course” and “the undergraduate vector calculus course,” so perhaps I was a bit harsh. I’m currently using Michael D. Taylor’s book, An Introduction to Geometric Algebra and Geometric Calculus, which is a bit more to my liking; however, Taylor assumes a strong foundation in Linear Algebra and Vector Calculus already. His emphasis is on introducing Geometric Algebra/Calculus and then briefly showing how they apply to the geometric/algebraic treatment of multivariable analysis. It’s a really good book in my opinion, although I wish I would’ve already worked through his An Introduction to Multivariable Analysis from Vector to Manifold and I’m probably going to order it next. Michael Taylor treats the differential correctly in my opinion, but that’s me.

That said, I’m very much a novice at Python and Anaconda. Lee Vaughn, an author who writes instruction manuals on Anaconda and the Python Scientific Packages and who is also active here on Medium, left a comment on one of my articles and the ensuing discussion led me to purchase his introductory book, Python Tools for Scientists. He basically introduces you to the Anaconda ecosystem, covering both the Navigator Graphical User Interface and Command Line Interface options. He then introduces Jupyter Console QT, a “lightweight” app “designed for quickly testing ideas, exploring datasets, and working through tutorials”, Spyder, a heavy duty Interactive Development Environment, Jupyter Notebook, and Jupyter Lab. I stopped at the introduction to Spyder and moved on to Part II of his book, which provides a Primer for the actual Python language itself. But I plan to go back to Jupyter Notebook and, of course, Jupyter Lab, which is ultimately needed for the GAlgebra software. I haven’t gotten too far into Vaughn’s book, but I’ve already encountered some of the items he teaches in the latter chapters. At any rate, I highly recommend Python Tools for Scientists to anyone wishing to learn Anaconda and Python.

Now, to get to the heart of this article. In Alan Macdonald’s GAlgebra Primer there is the footnote 1 on page 3:

1) I had a report WARNING of a Jupyter Lab installation problem from an Ubuntu user: Do not use conda to install the recommended software; use pip as recommended.

I started looking into the situation and found that problems in general can arise when trying to use conda install and pip install together. Anaconda has actually written a blog post on the subject: Understanding Conda and Pip. This led me to a second Anaconda blog post, Using Pip in a Conda Environment, where they state:

Unfortunately, issues can arise when conda and pip are used together to create an environment, especially when the tools are used back-to-back multiple times, establishing a state that can be hard to reproduce.

And further down:

There are a few steps which can be used to avoid broken environments when using conda and pip together. One surefire method is to only use conda packages. If software is needed which is not available as a conda package, conda build can be used to create packages for said software. For projects available on PyPI, the conda skeleton command (which is part of conda-build) frequently produces a recipe which can be used create a conda package with little or no modifications.

GAlgebra was originated by Alan Bromborsky, a researcher formerly with U. S. Army Intelligence. The software is now being further developed/maintained by the Pythonic Geometric Algebra Enthusiasts and their GitHup site is here. According to Macdonald’s Primer, “Gregory Grunberg is active in both improving and finding bugs in GAlgebra.” The Primer recommends using pip install, but GAlgebra has been available on PyPI, hence, they are not referring to Anaconda environments. I sent an email to Alan Macdonald with links to the requisite tutorials, suggesting that he or someone with the Pythonic Enthusiasts group create their own channel on Anaconda(dot)org and use conda build to build a conda compatible GAlgebra package which they could then upload to their channel, making it available for conda install to anyone. He told me he wasn’t interested but for me to go ahead. So, I did. It turned out that I didn’t need my own channel, although I do now have one: https://anaconda.org/wes_hansen. At any rate, I followed the instructions in the tutorial, Building Conda Packages with Conda Skeleton, and everything just seemed to happen automatically. I’m not entirely certain which channel galgebra 0.5.0 is on, I believe the default as opposed to conda forge, but it is definitely now on a conda channel and all you need do is conda install the same as you do for any other package. In fact, you can find it through Navigator in the “not installed” list. It seems to work fine too, although I haven’t gotten too deep into it because I’m just learning it myself.

So, thanks to Alan Bromborsky, Alan Macdonald, Gregory Grunberg, Lee Vaughn, and Michael D. Taylor! Thanks for making my life a little bit more interesting! Who is going to update the GAlgebra package when the next version comes out? Don’t look at me . . . or, maybe by then I’ll actually be somewhat proficient and can actually do it intelligently. We’ll see . . .

--

--