134 karma · joined February 29, 2024
If you want to use Symbolica for some of these features, feel free to reach out!
For simple numerical operations, using an entire Symbolica Atom will introduce a large amount of overhead. It should only be used if the expression contains symbols as well. But perhaps I misunderstood the point of the benchmark?
You can also use Symbolica in Rust, which also has operator overloading so it will look quite similar. At some point I will also add Julia bindings.
```{mermaid} flowchart LR A -- 1 --- B B -- 2 --- C B -- 8 --- E C -- 3 --- D C -- 9 --- F D -- 10 --- E D -- 4 --- G G -- 5 --- H G -- 6 --- F E -- 9 --- F ```
f(1,...)*f(2,...)
Then when you do pattern matching with wildcards x_ and y_ you can do f(x_,...)*f(y_,..)
with the requirement that x_ < y_. This way you will know you match them in the expected order and not the other way around. Expression.parse('x+f(x)+5')
Of course, to refer to a specific variable of the CAS in Python, you need to bind it to a Python variable. There is no way around this.In the end most of the time of the user is not spent on syntax, but on designing algorithms. With Mathematica, you are locked into the Mathematica ecosystem. With Symbolica / sympy and other CASs that are libraries, you can use all the familiar data structures of the language you are coding in.
An expression is very general. Each variable and function is commutative and should hold for the complex numbers. For functions you can set if they are symmetric, linear or antisymmetric. Non-commutativity can be emulated by adding an extra argument that determines the ordering or by giving them different names.
If you use the Polynomial class instead of Expression, you can choose the field yourself. This is especially the clear in Rust where most structures are generic over the field. For example:
MultivariatePolynomial<AlgebraicNumberRing<RationalField>>
or
UnivariatePolynomial<FiniteField<u64>>The large polynomials appear in the middle of the computation, often referred to as intermediate expression swell. This also happens when you do a Gaussian elimination or compute greatest common divisors: the final result will be small, but intermediately, the expressions can get large.
It is not just a matter of whether a feature is there, it needs to be usable in practice. You cannot use Maxima to do computation with large rational polynomials as this paper shows:
https://arxiv.org/pdf/2304.13418
Symbolica is 10 times faster and uses 60 times less memory than Maxima on a medium-sized problem. The larger sized problem does not run with Maxima. Note that this is tested with an older version of Symbolica, the latest version is even faster.
Note that there are also features in Symbolica that are not in Sage, such as numerical integration, pattern matching and term streaming.
I actually had an idea to do an OEM license check in build.rs that compiles out all license checks so that this version can be included in customers' software ^^
For my physics research I have worked with expressions that was just shy of a terabyte long and had > 100M terms. The way that works is that you stream terms from disk, perform manipulations on them and write them to disk again. Using a mergesort, terms that add up can be identified by sorting them to be adjacent.
The idea of Symbolica is that you can use it as a library inside your existing projects, which is harder to do with MM since it is its own ecosystem.
Moreover, for personal projects Symbolica is free.
An exact answer is desired since the final result reveals some structure that can be studied, and because it is very hard to get a numerical result due to the occurrence of spurious poles. For example, evaluating
(1-x)/x - 1/x
numerically is challenging around x=0 even though symbolically it can be made regular.
Deep down every CAS is about manipulating polynomials :)
x, y = Expression.vars('x', 'y')
indeedSymbolica is developed by only one person, so forgive me if I can't get every aspect of the project right on the first try (especially the non-technical part) :) I will see about removing the online on start-up part. It's essentially the only anti-piracy step that I have.
At the moment there is no fixed cost for use in industry, since the price will vary based on the amount of users and other factors.
from symbolica import \*
set_license_key('YOUR_KEY')
print(get_offline_license_key())For many operations it is orders of magnitude faster than sympy.