|
|
Subscribe / Log in / New account

Symbolic mathematics on Linux

Symbolic mathematics on Linux

Posted Jan 9, 2017 13:11 UTC (Mon) by marcel.oliver (subscriber, #5441)
Parent article: Symbolic mathematics on Linux

As a professional mathematician, this is a topic close to my heart and I really appreciate it being covered, even though not a lot was fundamentally new to me.

For the better or worse, I have had precisely two commercial software packages on my (Linux) machine for the last decade or so. One is Mathematica, the other one is for doing my taxes. And I have some hope that at least the former can be replaced by free software most of the time...

Learning any symbolic math software well is a long-time investment. I happened to grow into using Mathematica as a graduate student, so that is my point of reference and in my opinion also represents pretty much the state of the art. When comparing, there are a number of factors to consider:

  • Raw capabilities (e.g. special functions, symbolic integration, algebraic structures implemented, etc.)
  • Coherence of the system, quality and quantity of documentation
  • Expressiveness of the language
  • Integration with non-symbolic programming
I tend to shy away from single-purpose languages, even though for a particular problem, they could be just fine or even the best possible solution. So that leaves mostly Sage and Sympy as serious competitors (Sage being able to call upon a large host of additional software transparently).

Raw capabilities are difficult to compare because they depend heavily on how far out of the trivial any one particular project pushes the software. Needless to say that Mathematica's capabilities are uniformly very strong, Sage's list of capabilities is also impressive and as I hear at least from some number theory colleagues in some areas the best. My own record is mixed - the last time I seriously pushed things was when I was checking a limit of a parametric integral a graduate student had been computing by hand: Mathematica got it wrong by a factor of 2 (since fixed at least according to an email they sent me recently), Sage did not terminate the computation and Sympy gave up...

Regarding documentation and consistency, Mathematica sets a standard that is hard to come close, for the others it's a mixed bag (but not hopeless).

What I am personally unsure about is the expressiveness of Python for symbolic programming. I understand the Mathematica (or Wolfram) language reasonably well, with everything (program and data alike) being part of a tree structure, and powerful pattern matching and transformation capabilities. This also brings a certain baggage, as undefined objects are simply carried along symbolically whether that makes sense or not, and the difficulty to have intrinsically typed objects. For example, even (Euclidean) vector calculus seems to map poorly into the transformational rules of Mathematica.

Python appears to provide a rather different paradigm where typed objects and operator overloading are very natural. I have the impression that this is potentially very powerful, yet different, but I am much less certain how far it carries.

Unfortunately there are (at least) two competing Python-based systems, with Sympy seemingly cleaner, yet more limited, and Sage trying to integrate large chunks of the available third-party symbolic systems. For simple things, both have similar capabilities with again similar, but annoyingly different details. For more complicated things, Sage by design should be a superset of Sympy, but I am not sure if the underlying programming concept is equally flexible, or is constrained by the need to pass symbolic expressions to an external symbolic computation instance. Unfortunately, the documentation of neither package is sufficiently clear on advanced programming concepts, one probably needs to invest into working on some nontrivial project in both to find out.

It also bothers me that Sage has a modified front-end that does not behave like true Python. I can certainly see the point of doing it and I know it's possible to switch off. Yet, I think it makes things unnecessarily brittle and impedes the mixing of "standard" Python programs with symbolic computation.

So, in short, I am looking at both Python-based symbolic packages with great interest and think they have a lot of potential. I would feel much more comfortable with an approach where the base system is pure Python (possibly with C-extensions where necessary or beneficial for speed) and where all the other interfaces could be loaded on top where needed. So some kind of convergence of the Sympy and Sage into a unified framework. But I have no idea if this is architecturally possible.


to post comments

Symbolic mathematics on Linux

Posted Jan 12, 2017 9:45 UTC (Thu) by parisse (guest, #113390) [Link] (1 responses)

Giacpy is a Cython interface to Giac for python that might interest you because it can be used inside a normal python interpreter and the computing kernel is fast (compiled C++ library instead of interpreted python). Under linux, install the giac package then from your python interpreter
from giacpy import *
x=giac('x')
int(1/(x**4+1),x,0,inf)
a=ranm(10,10) // random integer matrix
b=inv(a)
maxnorm(a*b-idn(a)) // check

Symbolic mathematics on Linux

Posted Jan 12, 2017 13:29 UTC (Thu) by leephillips (subscriber, #100450) [Link]

Interesting program/library. Thanks for bringing it up.


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds