Hacker News new | ask | show | jobs
by wiz21c 847 days ago
Do you know why there's such a big difference ? For example, is the way sympy does its job fundamentally flawed ?
3 comments

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 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.

That is an excellent caveat, and well cited, thanks.
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.

> 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

It's funny you should say that. Wolfram himself tried to take credit for the concept of cellular automata.
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.

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.

Yep. Know a few in the math department that have worked on Mathematic. Don’t know any who have worked on SymPy.
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.
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.

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."

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.