Earlier quoted context omitted.
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.
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 no…
SymPy: Symbolic Mathematics in Python
131–137 of 137 posts
Re: SymPy: Symbolic Mathematics in Python
#132As an aside - I have a bunch of logical expressions and I need to see if they are mutually exclusive. As in, if one is true given some combination of the variables, none of the other expressions must be true for the same combination. For example Country="US" and Type="Sales" is not exclusive with Type in ("Sales", "Purchase") What would be an approach to solving this?
If your logical expressions aren't too strange, and there aren't too many, that's well suited to an SMT solver, such as Z3. You might, for example, create a new logical expression for each pair of your original expressions, joining each pair with AND, and then join those AND pairs with OR. Then ask the SMT solver to generate an unsatisfiability proof.
Re: SymPy: Symbolic Mathematics in Python
#133Earlier quoted context omitted.
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 no…
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 donat…
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.)
Re: SymPy: Symbolic Mathematics in Python
#134Earlier quoted context omitted.
Why are you calculating the Jacobian symbolically? AFAIK, for complex cases, the numerical Jacobian is often faster / more numerically stable.
There are plenty of situations where the scenario goes like this: you first do symbolical calculations. then fill in some of the free variables, your resulting expression will simplify a lot. Then you compile that resulting expression to native code and evaluate the simplified specialized code for a zillion parameter vectors. Anyway,if your day job needs something like this you're better off using a lisp than python.
Re: SymPy: Symbolic Mathematics in Python
#135Earlier quoted context omitted.
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 e…
> 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?
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).
Re: SymPy: Symbolic Mathematics in Python
#136Earlier quoted context omitted.
Funfact: you can probably JIT compile that using JAX for an easy performance gain.
But then they would have to compile the jit-optimized XLA to C. Do you know if that’s straightforwardly doable?
Re: SymPy: Symbolic Mathematics in Python
#137Earlier quoted context omitted.
There are plenty of situations where the scenario goes like this: you first do symbolical calculations. then fill in some of the free variables, your resulting expression will simplify a lot. Then you compile that resulting expression to native code and evaluate the simplified specialized code for a zillion parameter vectors. Anyway,if your day job needs something like this you're better off using a lisp than python.
For those of us that have never touched lisp - can you explain why?