There is a benchmark of Sympy vs Mathematica at https://www.12000.org/my_notes/C... (2024)

tableofzero 3 months ago | parent | context | favorite | on: SymPy: Symbolic Mathematics in Python


There is a benchmark of Sympy vs Mathematica at https://www.12000.org/my_notes/CAS_integration_tests/reports...

The results were Mathematica failed to solve 1,523 problems, Sympy failed to solve 48,529.

So it has some catching up to do.

There is a benchmark of Sympy vs Mathematica at https://www.12000.org/my_notes/C... (1)

StevenXC 3 months ago | next [–]


SymPy is open source, mathematica is not.

Additionally, SageMath (which depends on SymPy) is the more comparable product (and is open source).

There is a benchmark of Sympy vs Mathematica at https://www.12000.org/my_notes/C... (2)

bmitc 3 months ago | parent | next [–]


> SymPy is open source, mathematica is not.

Why does that matter?

There is a benchmark of Sympy vs Mathematica at https://www.12000.org/my_notes/C... (3)

in9 3 months ago | root | parent | next [–]


1) free

2) able to be around if a single CEO isn't around (Wolfram)

3) able to continue if the supporting company is not profitable anymore

4) possibility of greater oversight if popularity rises

5) extensible if one puts the effort into it

There is a benchmark of Sympy vs Mathematica at https://www.12000.org/my_notes/C... (4)

taeric 3 months ago | root | parent | next [–]


And that matters if you are mostly worried about value, to a large extent. If you are evaluating "better" as in "supports more symbolic operations," none of those really enter into it? Right?

This is like opining that the best "car" out there is a gokart you can get complete schematics on, for all of these reasons. I think most of us would accept the argument that the better cars are the ones that pass metrics aimed at cars. In this analogy, the better algebra system is the one that does the most algebra.

There is a benchmark of Sympy vs Mathematica at https://www.12000.org/my_notes/C... (5)

wakawaka28 3 months ago | root | parent | next [–]


If SymPy meets your needs, it is objectively better. Mathematica is expensive and you probably have to pay for licenses on a continuous basis for every instance you use. Many benchmarks are stress tests and not representative of common work.

There is a benchmark of Sympy vs Mathematica at https://www.12000.org/my_notes/C... (6)

taeric 3 months ago | root | parent | next [–]


This is kind of silly, though? Yes, if you do not need a full car, a bike may fit your needs. The bike is still not a better car, though.

You can try to broaden it to saying it is a better vehicle for you. And, sure, for a lot of folks the cost will be important there. As a CAS, though, Mathematica is tough to beat.

There is a benchmark of Sympy vs Mathematica at https://www.12000.org/my_notes/C... (7)

wakawaka28 3 months ago | root | parent | next [–]


No it's not silly. A Lamborghini might be a better performing vehicle that could solve problems I didn't even know I had, but if I don't have the money for it and/or a Ford Pinto covers 99% of the cases I need, the Pinto is better.

I'm not arguing that SymPy is going to beat Mathematica on benchmarks. But if both of them meet your needs, and you like having money and/or control of the code, SymPy wins.

There is a benchmark of Sympy vs Mathematica at https://www.12000.org/my_notes/C... (8)

taeric 3 months ago | root | parent | next [–]


So, in this we don't really disagree. But, I would only agree that it is an objectively better choice for you. It is not an objectively better CAS. Demonstrably so, per that benchmark.

Similarly, a lamborghini is almost certainly an objectively faster car. Such that if you were discussing fast vehicles and someone pointed out that their ebike was good enough for them, it would be a statement out of nowhere that is not using the rubric for ordering that was being discussed. Are they wrong that the ebike is a better choice for them? Almost certainly not. Would it be valid to say that it is the best fast vehicle because of that? (I say this as someone that loves bikes and is fairly anti car...)

And there would be other rubrics that would shine light in either direction regarding python. Arguably, the stewardship of the language lost a lot of trust with people in the hilariously bad 2->3 migration. More so in how bad dependency management has become. Yes, you can roll your own, but people with large support contracts can almost certainly offload a lot of that to the team on Mathematica, if that is truly a concern.

(I could similarly cast shade on Mathematica, but I think my point is made. Yes, you can have a rubric that changes which is the better choice for a situation. No, there is no total ordering of correct choices.)

There is a benchmark of Sympy vs Mathematica at https://www.12000.org/my_notes/C... (9)

wakawaka28 3 months ago | root | parent | next [–]


We are essentially in agreement. I just don't think Mathematica is worth the money unless you need it for something specific like solving tricky problems. As much shade as you can throw on Python, there are lots more possibilities to use Python with SymPy than to use Mathematica. Unfortunately, the cutting edge FOSS math scene will always lag behind the commercial tools, as it is incredibly hard for them to get donations. I remember hearing a story about the developer of Octave (the most popular Matlab clone). He had worked on it for years and hardly got any donations, despite probably having hundreds of thousands of downloads and constant feature requests.

There is a benchmark of Sympy vs Mathematica at https://www.12000.org/my_notes/C... (10)

taeric 3 months ago | root | parent | next [–]


Indeed, I think we are fairly aligned.

I also think the math systems will lag for more than just donations. The work to make a good CAS is pretty intense. A lot like a good SAT system. Or really anything that is deep in the weeds of computer science. A lot of us are so far removed from the math that they focus on, that it can be mind bending to try and get back into it. (Indeed, for a lot like me, we were probably never really great at it, in the first place.)

Mathematica and Matlab are interesting to consider, as they are likely very well integrated into older workflow systems from the mainframe era. In particular, I'd expect the high end simulations for car and vehicle designs are much more integrated with those than anything open source. And a lot of that is largely availability of what they are integrating with. Most of us do not have the science labs and all of the equipment that goes with it.

Which, I think, is a bad feedback loop on this. For folks without those labs, Mathematica/Matlab are prohibitively expensive. For those with the labs, they are probably a rounding error. And there is no real path from the current equilibrium to one that can get it to more people. (The old path was free access in college. But that is becoming less of a thing in modern programming jobs.)

There is a benchmark of Sympy vs Mathematica at https://www.12000.org/my_notes/C... (11)

bmitc 3 months ago | root | parent | prev | next [–]


Objectively better in what sense? There is an objective cost in the initial installation, yes.

Additionally, Mathematica is not really that expensive.

There is a benchmark of Sympy vs Mathematica at https://www.12000.org/my_notes/C... (12)

wakawaka28 3 months ago | root | parent | next [–]


It's not just initial installation. I have not pursued a license lately but these kinds of products cost money for every running instance. Institutions often have license servers on premises that allow a fixed number of people to use the stuff at once. If you use a SDK to build a program with it, that's got a separate license. If you need it for a real product, we are generally talking like thousands of dollars per developer per year in perpetuity, plus god knows whatever you use for SaaS. You might have to negotiate a price for your use case.

There is a benchmark of Sympy vs Mathematica at https://www.12000.org/my_notes/C... (13)

bmitc 3 months ago | root | parent | prev | next [–]


(1) is true, but Mathematica is also supported because it is paid. (2), (3), and (4) are very iffy stances. Open source projects also fail when leaders move on, and it's actually less likely for a company. (5) has nothing to do with open source, and Mathematica is extensible.

I ask because I always see open source thrown around as if it's some paragon of quality and productiveness. In reality, the actual usefulness of a product is fairly independent of its open source status. And rarely does it matter all that much to a project that a software component is open source or not.

There is a benchmark of Sympy vs Mathematica at https://www.12000.org/my_notes/C... (14)

mixedmath 3 months ago | root | parent | prev | next [–]


I'm a mathematician. One reason it matters to me is that if I write a program that computes something in a proof, I need to be able to understand and verify (or possibly check that other people I trust have verified) the source and algorithms.

I have also modified and extended open source implementations in sage to work with cases I needed. And I've added some of this back to sage.

It is undeniable that Mathematica evaluates crazy integrals better than most other tools. But it will happily output complete nonsense. And you can't check!

There is a benchmark of Sympy vs Mathematica at https://www.12000.org/my_notes/C... (15)

bmitc 3 months ago | root | parent | next [–]


> One reason it matters to me is that if I write a program that computes something in a proof, I need to be able to understand and verify (or possibly check that other people I trust have verified) the source and algorithms

Do you actually do this verification? How do you accomplish this? The software stacks are huge. Why do you trust other people over the people who develop Mathematica, who just happened to be paid?

There is a benchmark of Sympy vs Mathematica at https://www.12000.org/my_notes/C... (16)

mixedmath 3 months ago | root | parent | next [–]


Yes, I do. And open source software can have papers and algorithms documenting various aspects. This is very much like using results of other math research papers, in that there is communal review and trees of dependencies and everything can be cross-verified.

It is also true that, just like with a generic math research paper, that I don't check every claim of every step of every implementation of every algorithm in the process. But checking is possible, and when we find errors (which we do frequently) we can look and try to explain what it happening.

But when we find errors in tools such as Mathematica, we cannot. We report the errors and then know nothing more. (And sometimes the errors are never fixed).

There is a benchmark of Sympy vs Mathematica at https://www.12000.org/my_notes/C... (17)

wiz21c 3 months ago | prev | next [–]


Although super interesting, the website you mention is only about integrals...

There is a benchmark of Sympy vs Mathematica at https://www.12000.org/my_notes/C... (18)

Affric 3 months ago | parent | next [–]


I mean, integrating is one of the operations you might want particular help with. Especially for integrands without elementary function integrals.

There is a benchmark of Sympy vs Mathematica at https://www.12000.org/my_notes/C... (19)

wiz21c 3 months ago | prev [–]


Do you know why there's such a big difference ? For example, is the way sympy does its job fundamentally flawed ?

There is a benchmark of Sympy vs Mathematica at https://www.12000.org/my_notes/C... (20)

epistasis 3 months ago | parent | next [–]


I doubt there's any sort of fundamental flaw in sympy. Getting more and more solutions is mostly about putting in lots of work to tweak the bag of tricks. There is no universal algorithm for solving integrals.

As an open source project depending on volunteers (or is it just the one major author?) I am impressed that sympy does as much as it does.

There is a benchmark of Sympy vs Mathematica at https://www.12000.org/my_notes/C... (21)

jcla1 3 months ago | root | parent | next [–]


> There is no universal algorithm for solving integral.

Not that I want to dispute this, but depending on what you meant, there is in fact such an algorithm: https://en.wikipedia.org/wiki/Risch_algorithm

Though often it is not implemented because it is quite complex (its details covering two thick books) and many of the special cases it covers rarely crop up in the real world, so the effort isn't worth it.

The caveat of Risch's algorithm is that it only "works" if the function you are trying to integrate has an elementary antiderivative. Many of the problems that Mathematica can solve (but SymPy fails at) involved special (i.e. non-elementary) functions.

There is a benchmark of Sympy vs Mathematica at https://www.12000.org/my_notes/C... (22)

epistasis 3 months ago | root | parent | next [–]


That is an excellent caveat, and well cited, thanks.

There is a benchmark of Sympy vs Mathematica at https://www.12000.org/my_notes/C... (23)

WoahNoun 3 months ago | parent | prev | next [–]


It's a running joke that Wolfram is a jobs program for math PhD's. The difference isn't necessarily technical, but the sheer amount of labor that has gone into adding more edge cases and niche use cases. Sympy is great but like most open source, it's created by volunteer maintainers supported by donations.

I imagine the difference is even bigger in things like solving ODE's/PDE's.

There is a benchmark of Sympy vs Mathematica at https://www.12000.org/my_notes/C... (24)

Qem 3 months ago | root | parent | next [–]


> It's a running joke that Wolfram is a jobs program for math PhD's.

Nice. The PhDs just need take care their contributions aren't misappropriated. See https://en.m.wikipedia.org/wiki/Rule_110

There is a benchmark of Sympy vs Mathematica at https://www.12000.org/my_notes/C... (25)

wakawaka28 3 months ago | root | parent | next [–]


It's funny you should say that. Wolfram himself tried to take credit for the concept of cellular automata.

There is a benchmark of Sympy vs Mathematica at https://www.12000.org/my_notes/C... (26)

pquki4 3 months ago | parent | prev [–]


I mean, literally people with Math PhDs are being paid to work on the product, full-time. And they have a financial incentive to address feedback from customers and try to solve as many problems as possible.

By comparison, open source projects are developed by people with a wide range of knowledge level and commitment, and you simply can't expect the quality to be the same.

I find that discussions on HN often fail to acknowledge that proprietary software is usually extremely good at their domain, and what companies put into UX, support and the development/feedback loop are actually very valuable.

There is a benchmark of Sympy vs Mathematica at https://www.12000.org/my_notes/C... (27)

wiz21c 3 months ago | root | parent | next [–]


I know that but the idea behind my question was this: the knowledge we need to put in such a program doesn't move as fast as the program evolves. Therefore, given enough time (say 20 years), the open source solutions will cover more or less the same ground as the expensive solution. Of course the expensive one may always have an edge but that edge should get smaller over time. For example, Oracle remains a gold standard, really expensive but postgres covers many needs. Linux-on-the-desktop is also quite good, although not as good as, say, MacOS.

In the same vein, I was expecting SymPy to be like 80% of Mathematica but the given benchmark says it's about 25%. So I was suprised.

And I'm not thinking about UX, support, etc. which are indeed not often very good because, I guess, people prefer to put their energy in things that have the bigger leverage.

There is a benchmark of Sympy vs Mathematica at https://www.12000.org/my_notes/C... (28)

Affric 3 months ago | root | parent | prev [–]


Yep. Know a few in the math department that have worked on Mathematic. Don’t know any who have worked on SymPy.

There is a benchmark of Sympy vs Mathematica at https://www.12000.org/my_notes/C... (29)

wakawaka28 3 months ago | root | parent [–]


You mean they were Mathematica customers. Academics are incentivized to use proprietary solutions as those solutions tend to be best-in-class and also offered at a discount.

There is a benchmark of Sympy vs Mathematica at https://www.12000.org/my_notes/C... (30)

Affric 3 months ago | root | parent [–]


No, I mean I am yet to meet a person who has done development on SymPy (that I can recall) but I know a few academics that came from working for Wolfram on Mathematica itself.

Thank you for allowing me to disambiguate.

There is a benchmark of Sympy vs Mathematica at https://www.12000.org/my_notes/C... (31)

wakawaka28 3 months ago | root | parent [–]


That's interesting. You should consider yourself lucky to have met Wolfram employees, as they are obviously vastly outnumbered by users of Mathematica.

I have not met any developers for either of these products but I know that SymPy has a huge list of contributors for a project of its size. See: https://github.com/sympy/sympy/blob/master/AUTHORS

You may not be hearing about SymPy users because SymPy is not a monolithic product. It is a library. If you know mathematicians big into using Python, they are probably aware of SymPy as it is the main attraction when it comes to symbolic computation in Python. They wouldn't necessarily spit out a bunch of libraries in the same breath as "I use Python."

There is a benchmark of Sympy vs Mathematica at https://www.12000.org/my_notes/C... (32)

Affric 3 months ago | root | parent [–]


I have been playing around with SymPy for the last couple of weeks because the CompSci department (not entirely uncontroversially) wants to become Python native for the students to make the courses more accessible. I have been looking into ways to incorporate SymPy and SageMath into my tutoring for the mathematics for comp sci students type units.

1261 is an impressive number of contributors. I am interested to see if I could round up some people to hack up some of these test failures.

There is a benchmark of Sympy vs Mathematica at https://www.12000.org/my_notes/C... (2024)

FAQs

Is SymPy better than Mathematica? ›

I'm not arguing that SymPy is going to beat Mathematica on benchmarks. But if both of them meet your needs, and you like having money and/or control of the code, SymPy wins. So, in this we don't really disagree. But, I would only agree that it is an objectively better choice for you.

What is better than Mathematica? ›

Explore other competing options and alternatives. Other important factors to consider when researching alternatives to Mathematica include functionality and user interface. The best overall Mathematica alternative is MATLAB. Other similar apps like Mathematica are Scilab, GNU Octave, Maple, and SageMath.

Which is easier Matlab or Mathematica? ›

The learning curve is steeper in Mathematica than in Matlab. Matlab is mostly used as a procedural language while mathematics is used as procedural, functional, modular and object-oriented. The user interface of Mathematica is simpler and easier to build when compared with Matlab.

Why use SymPy? ›

SymPy is a powerful library dedicated to symbolic mathematics. It enables you to create variables and functions, as well as extend and simplify mathematical statements symbolically or solve equations.

What is faster than SymPy? ›

Try symengine (https://github.com/symengine), which is much faster than sympy but less functionalities (only basic functions of sympy). It also has python wrappers (https://github.com/symengine/symengine.py).

Is SymPy slow? ›

As one point of comparison, SymPy is comically slow compared to Sage.

Do engineers use Mathematica? ›

Engineering emerges as the single most common use of Mathematica. Within engineering, electrical engi- neering is the most common subfield, followed by mechanical engineering. mathematicians, the number of math- ematicians in the world is small rela- tive to the total number of scientists and engineers.

Is Maple better than Mathematica? ›

Choosing between Maple and Mathematica ®? On the surface, they appear to be very similar products. However, in the information that follows, you'll see numerous technical comparisons that show that Maple is much easier to use, has superior symbolic technology, and gives you better performance.

Is Mathematica license forever? ›

No. While your subscription is active, you will have both desktop and cloud access to Mathematica. If your subscription lapses, you will retain perpetual desktop access but will lose access to Mathematica in the cloud, upgrades and advanced technical support (if previously included with your subscription).

Is Mathematica good for machine learning? ›

An introduction to the main concepts. Wolfram Mathematica (or simply Mathematica) is one of the best software that exists for scientific computations and multitasking. With Mathematica one essentially can perform all scientific calculations including Machine Learning (ML).

Why is Mathematica good? ›

Unlike other systems, Mathematica applies intelligent automation in every part of the system, from algorithm selection to plot layout and user interface design. You get reliable, high-quality results without needing algorithm expertise—and even if you're an expert, you get results faster.

Is it better to learn Python or MATLAB? ›

So which language is better, Python or Matlab? In most cases, Python will be the better choice. The language is far more comprehensive, easier to learn and free. Matlab can be a better choice if you require the services of Simulink.

Does SymPy have pi? ›

Sympy has sympy. pi and sympy. I, however Euler's constant is found via sympy. exp(1).

Is SymPy a library or package? ›

SymPy is an open-source Python library for symbolic computation. It provides computer algebra capabilities either as a standalone application, as a library to other applications, or live on the web as SymPy Live or SymPy Gamma.

Where is SymPy used? ›

Sympy is used to generate reference values for unit tests and some code generation. Quantum Programming in Python: Quantum 1D Simple Harmonic Oscillator and Quantum Mapping Gate.

What is the best math library in Python? ›

SciPy. This python math library provides all the scientific tools for Python. It contains various models for mathematical optimization, linear algebra, Fourier Transforms, etc. The numpy module provides the basic data structure of array to the SciPy library.

What is the best module in Python? ›

These are the 13 top Python libraries for developers:
  1. OS and Shutil. The OS and Shutil modules keep being brought up by online users as some of the most easy-to-work with libraries for Python — even if they're not strictly libraries. ...
  2. NumPy. ...
  3. Matplotlib. ...
  4. SciPy. ...
  5. Pandas. ...
  6. Scikit-learn. ...
  7. Requests. ...
  8. Scrapy.
Jan 24, 2024

Which library is best for linear algebra in Python? ›

To work with linear algebra in Python, you can count on SciPy, which is an open-source Python library used for scientific computing, including several modules for common tasks in science and engineering. Of course, SciPy includes modules for linear algebra, but that's not all.

Can SymPy solve equations? ›

SymPy can also solve numerically. The Solving Guidance page provides recommendations applicable to many types of solving tasks. Notes: SymPy has a function called solve() which is designed to find the solutions of an equation or system of equations, or the roots of a function.

Top Articles
Latest Posts
Article information

Author: Jamar Nader

Last Updated:

Views: 6477

Rating: 4.4 / 5 (55 voted)

Reviews: 94% of readers found this page helpful

Author information

Name: Jamar Nader

Birthday: 1995-02-28

Address: Apt. 536 6162 Reichel Greens, Port Zackaryside, CT 22682-9804

Phone: +9958384818317

Job: IT Representative

Hobby: Scrapbooking, Hiking, Hunting, Kite flying, Blacksmithing, Video gaming, Foraging

Introduction: My name is Jamar Nader, I am a fine, shiny, colorful, bright, nice, perfect, curious person who loves writing and wants to share my knowledge and understanding with you.