by tikej · 6y ago · 0 comments
On one hand it's great that it was written in Python and fairly extensible thanks to that, but on the other it's a shame, since it probably will never be fast enough for high performance symbolic computing.
That said I think CASes (Computer Algebra Systems) are heavily under-utilised nowadays. Schools and universities should use is as widely as possible i.e. it should be even more widely used than calculator is/once was. I believe that for every two hours of regular pen-and-paper exercises there should be at least one hour of CAS assisted computer exercises. It's pretty radical and sadly there aren't enough teachers (even in good universities/colleges), that know CASes enough to teach that, so it isn't gonna happen any time soon. Maybe I'm biassed here (I hated doing repeated exercises, such as algebraic simplifications, fraction simplifications etc. in high school), because I use CASes as crutches for doing tough math, but I believe sciences would benefit if more papers in math and physics was written as a code (less mistakes, plus it's not a mistake – it's a bug!). Hopefully it will happen someday and we will have "open source derivations" of formulas, theories, theorems etc. :)
That said, the thing about CASes I'm missing most is more hand guided, step-by-step and mathematical transformations assistant approach. Recently they added a bit of this kind of functionality to Mathematica 12 (sadly I use it most of the time, despite it being closed source) – functions like AddSides, MutiplySides, ApplySides – but I think it's still too automatic for what I have in mind. Hopefully when I finish my PhD I will have some time to work on the kind of "assistant CAS" I have in mind using projects like SymPy, Maxima and Reduce for some parts. What I have in mind is to make hand-like derivations using CAS and let it do small things, like I want to substitute log(a) as x in integral, so find dx for this substitution (actually SymPy has this functionality, even though slightly limited at the moment! [https://github.com/sympy/sympy/blob/58e1e9abade7c38c66871fd0...) and do more things this way (series, equations, inequalities, derivatives, limits, operators etc).
Yeah, it's probably more suited for series of blog posts than HN comment but if someone knows FOSS software that is focused on this kind of approach I'll be thankful for links to articles code etc.
There’s also the SymEngine project, which is a rewrite of SymPy in C++ with bindings to other languages (like Python where it is a drop-in API replacement for SymPy). It’s not finished yet, but the CAS is a lot faster and it’s lambdify can give you an internal representation or an LLVM-compiled version, both of which are much faster than SymPy in compile-time and run-time for our expressions (which are often quite large, but simple in terms of the mathematical functions used).
Yeah, SymEngine is a great idea and it is a lot faster, but its functionality is very limited compared to SymPy. The development is slower than SymPy and I suppose its due to the fact that its in C++, which is more difficult to write after all. Therefore I don't believe it will ever catch up with SymPy features and it boils down to the two-language problem. I think Julia (with multiple dispatch, parametric type system and JIT) is a great candidate for CAS, but it's still very far behind SymPy (although the nice thing is that functionalities can be "borrowed" via PyCall until they are rewritten).
I’m damn sure not calculating permutation groups by hand.
Sage is a lot larger than Sympy (it's more than 1 million LOC AFAIK), but it still delegates to other libraries to do most types of underlying symbolic and numerical computations.
I usually use sympy (or rather some wrapper of symengine these days) when I'm writing a pure python script, sage otherwise.
For a lot of math and CS courses, I think having some knowledge of some sort of computer-assisted theorem proving. I think the most promising is maybe Lean these days (Coq still might take too long to learn): https://github.com/leanprover-community/mathlib