Maxima enabled me to make my color space [HSLuv](https://www.hsluv.org/). I encoded CIELUV <-> RGB transformation functions into Maxima, ran `solve` and converted the output back into code. It's great to be able to commit [Maxima code](https://github.com/hsluv/hsluv/tree/master/math) into your repository and not leave the math as an "exercise to the reader".
Quick note to avoid disappointment: maxima itself is a text application. wxMaxima is a graphical front-end with conventional math notation. Output only. You'll frequently encounter text/command-line options, though. E.g., when you pick a command like differentiate from the menu, and you want to apply it to the previous result, you'll have to enter something like %o10 (no need to guess; you'll see the reference in the output). Idk if there's a better GUI.
What is Sagemath then? I have used it many times and I assumed it was a CAS alternative to Maxima. Is it actually just a big library built on top of Maxima? Sort of like how LaTeX is a library on top of TeX?
> SageMath is a free open-source mathematics software system licensed under the GPL. It builds on top of many existing open-source packages: NumPy, SciPy, matplotlib, Sympy, Maxima, GAP, FLINT, R and many more. Access their combined power through a common, Python-based language or directly via interfaces or wrappers.
In this case, Sagemath contains a domain that interfaces heavily with Maxima.
By default Symbolic Calculus, which is a pretty common use-case since the space of integral-tables is huge and complicated, makes pretty heavy use of calls to Maxima as a backend, but it can slip over to SymPy, and some others pretty easily.
Sagemath is, a little rough to use as a novice-y math guy, really quirky especially since Python isn't as up-front with typing as I would like, and I've run into some lazy-evaluation confusion as well, but if your time is worthless, use-case restricted it can be an alternative to paying out the nose for Mathematica.
While I generally agree with you, but I'd like to point out that Sagemath is more than a "Mathematica alternative". It seems like Sagemath is a better fit for some fields like cryptography, given its strong support for operations related to abstract algebra.
Sagemath is, a little rough to use as a novice-y math guy
Yeah I mainly used it in my real analysis, complex analysis, and differential geometry classes. Also used it a bit in an intro cryptography class to play around with some rings and solve assignment problems.
I'm using Python right now in a neural networks class and I hate it. It's absolutely horrible to debug. You press run and then your neural network starts training and then craps out with divide-by-0 after a long time and no clue as to where the offending code might be.
It does still work! Not sure if actively maintained though...
I think the process is a bit different depending on your OS. On Linux it's often bundled as a package for example on Ubuntu it's called maxima-emacs. I only use pretty vanilla Emacs so I'm not sure how that would interact with Doomemacs. You could try the manual install directions from the page perhaps [0].
> Imaxima provides a graphical user interface front-end for the computer algebra system Maxima in an Emacs buffer. Imaxima processes the output from Maxima with LaTeX to beautifully render the mathematical formula. It inserts the rendered math formula image in the buffer.
I paid money for a Reduce release for RISCOS back in the last ice age. I recollect having to register my licence with the Rand Corporation for some reason.
Reduce is awesome! Dozens of specialized packages[1]. My favourite two packages are
1. The Source Code Optimization Package, SCOPE. It will take an expression or group of expression and produce a simpler set of expressions that minimize the use of arithmetic expressions.
2. The coeff2 package[3]. Tell coeff2 what the variables are and it will rewrite your expression as a simpler expression in terms of the variables alone and represent mush the others into constants.
I could not do what I do without it these two packages. Beats Maxima IMO.
I like maxima and used to use it (through the interface wxmaxima or KDE Cantor) for solving my physics problem. I am no expert in CAS, just use them for simple problem solving.
“Maxima gets elementary math wrong, it knows very little about integration, it is weak on simplifying expressions, it fails on trivial equations, it is slow, Maxima usage is discouraged by CAS power users. In summary: do not go and waist your time or wreck your nerves using Maxima. JUST DON'T DO IT”
Since this was in 2015, I want to know the situation now, and the comments of experts on the issues raised by the blog poste.
I’m a bit suspicious of the section saying “Maxima is slow” blaming linked lists. Maxima is built on Common Lisp which definitely has arrays and vectors, so the claims made there seem a bit uninformed. I don’t really know enough math to judge the rest, though.
I'm extremely suspicious of that explanation. It would be nice to see a few benchmarks.
Anectote time: I used Mathematica many years ago. One surprising thing was that when you update the content of a vector, Mathematica creates a new vector and copies the content of the old vector. If you just copy an algorithm from C to Mathematica, it may be N times slower because it's creating a lot of intermediate vectors. So you must rewrite your code using "fold", or something like that. It was a long time ago, so I'm not sure if they have already added some trick to optimize code from people like me that don't know what they are doing. If Mathematica or Maxima has this trick but the other doesn't, it may cause a huge difference of time between algorithm that look very similar. Anyway, this is totally unrelated to lists.
Checked the examples and Maxima still fails. It's even more disheartening that author mentions towards the end that had reported those issues years before they wrote the article. I had also used Maxima before and, though unsurprisingly found it less polished than Mathematica, got the job done without issues. But will probably refrain from recommending it. Would also like to see how other systems tackle those examples.
I checked the failing limt one and it worked fine. Maybe it was fixed recently?
;;; Loading #P"/usr/lib/ecl-21.2.1/sb-bsd-sockets.fas"
;;; Loading #P"/usr/lib/ecl-21.2.1/sockets.fas"
Maxima 5.46.0 https://maxima.sourceforge.io
using Lisp ECL 21.2.1
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
(%i1) declare(a,real);
(%o1) done
(%i2) declare(b,real);
(%o2) done
(%i3) assume(a>b,b>0);
(%o3) [a > b, b > 0]
(%i4) limit(log(b-a+%i*eta),eta,0,plus);
(%o4) log(a - b) + %i %pi
(%i5) limit(log(b-a+%i*eta),eta,0,minus);
(%o5) log(a - b) - %i %pi
Version I've installed is 5.45.1 and gets "log(b - a) + %i %pi" and "log(b - a) - %i %pi", so should be. Gave changelog for 5.46.0 a look but not sure whether it had a direct fix for this or was indirectly fixed due to one of the other closed bugs.
My university course uses Maxima for optimization modules and essentially none of the examples from the textbook work as they should. Official documentation is sparse and often unhelpful too. The functions output Lisp stacktraces if you do something wrong, rather than actually catching errors and printing some human-friendly message that describes the problem and which particular argument caused it without having to dig into Maxima source code. It would be great CAS software if it was a bit more polished, but unfortunately that is unlikely to ever change - it hasn't in the last 4 years that I've used it at least.
Somewhat related: I've read before that the FOSS CAS Axiom has the only kinda complete implementation of the Risch algorithm for integration. Axiom looks harder to use, but maybe it's an option.
The axiom implementation isn't complete either and doesn't handle mixed algebraic transcendental functions like sqrt(atan(x)), from what I understand.
The Sympy implementation handles the purely transcendental case and does best effort on the algebraic extensions. It's a lot more ergonomic than fricas/axiom though.
Except when it doesn't work. I tried using it a few months ago on both Windows and WSL, but I had to give up and resort to run a Maxima kernel on EIN.¹
I was going to try again before commenting, but I broke my WSL setup last week and didn't have time to fix it yet, but I sure will try it again next month.
I'd like to make calls to Maxima with s-expressions and get s-expressions back.
Is there a way to embed Maxima, say by having its Common Lisp host running on top of, say, a Clojure environment (really anything JVM or JS or Python or .Net, anything with clean in-process interop)? I know SageMath accomplishes something like this by calling out to Maxima from its Python-based environment...
Cadabra author here. The choice for C++ was intentional and is part of the design to separate the maths language (LaTeX), programming language (python) and implementation language (C++). This has advantages (eg. notation looks natural for mathematicians/physicists, programming the system uses a language already familiar to many, and it can still run algorithms at C++ speeds) and disadvantages (eg. some things become much more involved to implement). As always, it depends a lot on what you do with the system whether this is good or bad. Cadabra is not for everyone, but it does some things much nicer (IMHO) than other CAS systems.
its an intriguing combination of languages and maybe one that would serve well other projects. Combining python and C++ is clearly common, but expressing algorithms / expressions as latex hits another sweet spot.
Makes sense to have a performant "backend". My experience with macsyma is, ahem, quite a bit dated, but I still remember it would choke on large calculations and needed careful massaging of intermediate steps.
Maxima is a surprisingly good alternative to SymPy. We had to learn that the hard way at my job. Both systems offer similar functionality, but it turns out Maxima is typically 50-200x as fast as SymPy for many tasks (I guess because it was written at a time when computers were slow and expensive). For our application, switching from SymPy to Maxima shortened the time-to-solution from hours to minutes.
Also, it shows that Maxima has been in use for a very long time, and maintained by very bright people. I have yet to encounter a bug in Maxima. And I have already encountered plenty of bugs and inconsistent behavior in SymPy.
Maxima sees serious 'more free' versions of computational algorithms that migrate out from less free acedemic systems.
On the computational real actual algebra side (ie. a bit past computing a quadractic at 'x') a number of things that appear in Magma follow into Maxima (but not all the things, although with time they will come).
The first HFE cryptosystem challenge of J. Patarin is solved by Magma in 82.5 seconds, using 1.3GB memory; with 4 threads the time taken is just 29.0 seconds. This involves solving a system of 80 quadratic equations in 80 variables over GF(2) (each input polynomial has about 1600 terms). The challenge was first solved by J.-C. Faugère in 52 hours on an 1GHz Alpha in 2002 using his unpublished F5/2 algorithm. At the time of writing, there is apparently still no publically-available software besides Magma which can solve the challenge.
Notes on the grobner package: The code is a little bit out of date now. Modern implementation use the fast F4 algorithm described in "A new efficient algorithm for computing Gröbner bases (F4)" Jean-Charles Faugère
( *NB a somewhat old example, I'm not keeping up on the comp.algebra lists and I'm assuming here the online manuals are up to date )
If you need programmability or interoperability, Sympy is way nicer. If you just want an interactive symbolic calculator, Maxima is fine but sometimes quirky (has odd conventions due mainly to its age). As heisig points out, Maxima can be quite a bit faster (but I run into slow things with it too). Using Maxima via Sage is in some ways the best of both worlds.
From FOSS CAS Fricas seems to fair best. But damn, Mathematica is on another level. And somehow Rubi looks even more impressive and puts a foundation for shareable high-quality integration to other systems.
I wish one could use these libraries inside common lisp as opposed to having some badly designed language on top of it.
Sure, technically you can use it (see Maxima), but the weird ways in which it needs to be written is completely off-putting and not in line with (modern and ancient) Common Lisp programming guidelines.
I use Maxima's GRTensor package for GR computations, such as computing the Einstein tensor of a metric. This only involves differential equations with real-valued functions, so it would not trigger the complex number issues that are described in the article.