HN user

SPACECADET3D

134 karma

Founder and lead researcher of Symbolica (https://symbolica.io), a modern computer algebra system.

Posts0
Comments30
View on HN
No posts found.

In the end the zero test problem is undecidable for reasonably complicated expressions, so sadly there is no guarantee that you can rewrite one Computable into another even if they evaluate to the same. For polynomials you can do finite field evaluation tests to prove equality with a likelihood bound of your choosing. That may be interesting for hyperreal too.

I saw this project before, nice work! What is your plan when it comes to the hard core algebra parts like multivariate polynomial factorization and cylindrical algebraic decomposition? These features require quite some complex mathematical code and it is tricky to get it correct, and to get it working fast. Do you want to use other libraries for this or do you want to implement this all yourself?

If you want to use Symbolica for some of these features, feel free to reach out!

Nice, I will check this out in more detail later. I had a quick look at the benchmarks and it looks like you compare f64 hyperreal with numericas 128 bit implementation, which will fall back to using arb-prec GMP. There is also F64(simply wrapping around f64), and now DoubleFloat with 106 bits precision, which should be much faster. There is also the ErrorPropagatingFloat wrapper that may be of interest.

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?

Author of Symbolica here! If these packages work well for you, then just use them :) I don't have a lot of experience with using these tools, but the last time I tried the user experience isn't so great, because of lack of LSP support (no typing, autocomplete etc). It could have improved in the mean time. I believe the tools are also more oriented to polynomial algebra and no so much for manipulating general expressions.

I used mermaid, which gets live-compiled on the website, that is built using quarto. Here is an example:

```{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 ```

It's not a language specific feature, but you can do the bookkeeping yourself. In the simplest form you can write:

    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.

You can also just use

    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.

Thanks for the feedback! I will see if I can slow down the slideshow. You can see more demos in the docs and the live notebook.

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

These polynomials appear when computing Feynman diagrams, which are used to make predictions for the Large Hadron Collider. The collider can measure collisions with such astonishing precision (<1% error) that predictions of the same order are also needed. The more precise you want to be, the more terms in a series approximation of the mathematical description of the collision you need to compute. For example, I computed the fifth-order approximation of the QCD beta function, which governs how intense the strong force affects matter. This takes 5 days of symbolic manipulations (pattern matching, substitutions, rational polynomial arithmetic, etc) on 32 cores.

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.

I've actually been a developer of FORM since my PhD (which I did with the author of FORM, Jos Vermaseren)! In Symbolica, I am taking the best features of FORM, while making it easier to use.

Most of these features are included in Symbolica in some capacity (ODE solving is missing) and there are CAS features Symbolica has and that Maxima has not (like advanced pattern matching), even though it is only a year old.

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.

Symbolica is only a year old, however most features are already in there. What is a Sage feature you'd like to see in Symbolica?

Note that there are also features in Symbolica that are not in Sage, such as numerical integration, pattern matching and term streaming.

Thanks for reporting, I fixed the typo.

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

Author of Symbolica here: Symbolica is used in physics calculations to do arithmetic on rational polynomials that are hundreds of megabytes long.

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.

Author here: thanks for the feedback. I will add a price range soon. The reason why it is not there in the first place is because I am thinking about site-wide licenses, which are often quote-based (also for Mathematica). For universities site-wide licenses are common, but for industry maybe less so. For reference, a university site-wide license is about 6000 EUR per year at the moment.

Author here: you can generate the Groebner basis in lex order or compute a resultant, but it doesn't automatically backsubstitute the system at the moment. This is mostly because I haven't committed yet to a format to describe roots of polynomials. It's on the todo list though :)

It depends on what you want to do. It should be much faster than Sympy and it is often much faster than Mathematica, for example if you do pattern matching or are manipulating rational polynomials.

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.

One use case is in theoretical physics, where expressions that take up about a terabyte are generated when computing Feynman diagrams, but only in the intermediate stages. By the end of a two-month computation you get a result similar to equation 4.5 in this paper: https://arxiv.org/pdf/1707.01044

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.

It has pattern matching, Groebner basis computations, expression simplification, series expansion, numerical integration, etc.

Deep down every CAS is about manipulating polynomials :)

Author of Symbolica here: for your personal projects the cost is 0, as you'd be a hobbyist.

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

Author of Symbolica here: this may change in the future. Note that it is easy to do this, you just call the function

    from symbolica import \*
    set_license_key('YOUR_KEY')
    print(get_offline_license_key())