Symbolica ⊆ Modern Computer Algebra
Symbolica is a blazing fast computer algebra system for Python and Rust, born of a need to push the boundaries of computations in science and enterprise. Check out the live Jupyter Notebook demo!
For documentation and more, see symbolica.io.
Quick Example
Symbolica allows you to build and manipulate mathematical expressions, for example from a Jupyter Notebook:
You are able to perform these operations from the comfort of a programming language that you (probably) already know, by using Symbolica's bindings to Python and Rust:
Installation
Symbolica can be installed for Python >3.5 using pip:
pip install symbolica
Visit the Get Started page for detailed installation instructions.
Examples
Below we list some examples of the features of Symbolica. Check the guide for a complete overview.
Pattern matching
Variables ending with a _ are wildcards that match to any subexpression.
In the following example we try to match the pattern f(w1_,w2_):
from symbolica import *
x, y, w1_, w2_, f = S('x','y','w1_','w2_', 'f')
e = f(3,x)*y**2+5
r = e.replace_all(f(w1_,w2_), f(w1_ - 1, w2_**2))
print(r)
which yields y^2*f(2,x^2)+5.
Solving a linear system
Solve a linear system in x and y with a parameter c:
from symbolica import *
x, y, c, f = S('x', 'y', 'c', 'f')
x_r, y_r = Expression.solve_linear_system(
[f(c)*x + y + c, y + c**2], [x, y])
print('x =', x_r, ', y =', y_r)
which yields x = (-c+c^2)*f(c)^-1 and y = -c^2.
Series expansion
Perform a series expansion in x:
from symbolica import *
e = E('exp(5+x)/(1-x)').series(S('x'), 0, 3)
print(e)
which yields (exp(5))+(2*exp(5))*x+(5/2*exp(5))*x^2+(8/3*exp(5))*x^3+𝒪(x^4).
Rational arithmetic
Symbolica is world-class in rational arithmetic, outperforming Mathematica, Maple, Form, Fermat, and other computer algebra packages. Simply convert an expression to a rational polynomial:
from symbolica import *
p = E('(x*y^2*5+5)^2/(2*x+5)+(x+4)/(6*x^2+1)').to_rational_polynomial()
print(p)
which yields (45+13*x+50*x*y^2+152*x^2+25*x^2*y^4+300*x^3*y^2+150*x^4*y^4)/(5+2*x+30*x^2+12*x^3).
Community packages
The PyPi version of Symbolica ships with the following community packages:
- spenso: perform tensor network computations
- idenso: perform Dirac and color algebra
- vakint: compute massive vacuum bubbles
They can be accessed through:
import symbolica.community.spenso
Example use can be found here.
Development
Follow the development and discussions on Zulip!
Metadata
Release files for symbolica 2.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| symbolica-2.2.0.tar.gz | 132.7 kB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| symbolica-2.2.0-cp37-abi3-win_amd64.whl | CPython 3.7 | abi3 | Windows x86-64 | Details |
| symbolica-2.2.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.7 | abi3 | Linux glibc 2.17+ x86-64 | Details |
| symbolica-2.2.0-cp37-abi3-macosx_11_0_arm64.whl | CPython 3.7 | abi3 | macOS 11.0+ ARM64 | Details |
| symbolica-2.2.0-cp37-abi3-macosx_10_12_x86_64.whl | CPython 3.7 | abi3 | macOS 10.12+ x86-64 | Details |
Total release size: 212.5 MB
Release files / symbolica-2.2.0.tar.gz
| Download URL | symbolica-2.2.0.tar.gz |
|---|---|
| Size | 132.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5df429454b65d8f23c45c652a95f162176168d19351c2aca36e826e5c3e99071
|
|
BLAKE2b-256 checksum How to use checksums |
a7b2591ea17b4b02016ed368a0b71cd538bd37a5a4263ebfb57640f1da219b24
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.14.1
|
Release files / symbolica-2.2.0-cp37-abi3-win_amd64.whl
| Download URL | symbolica-2.2.0-cp37-abi3-win_amd64.whl |
|---|---|
| Size | 56.5 MB |
| Tags | CPython 3.7 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
b8809d8f24f345a7df1cd26fbdc4c4dfb24f64d185446fbfdd6f74515fde0640
|
|
BLAKE2b-256 checksum How to use checksums |
8be0073296733c0826be26c633223875fb3fdc596d741a85a1052454d457d835
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.14.1
|
Release files / symbolica-2.2.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | symbolica-2.2.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 54.1 MB |
| Tags | CPython 3.7 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
879fee0c292a7e6838f18e8e990d3cdc0029cdd53515b0443bdbbff13bc2cd12
|
|
BLAKE2b-256 checksum How to use checksums |
f0dd7ace090e597c1e9a5dd3ff669d36425074877e8630ed3467cfa57fe23cac
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.14.1
|
Release files / symbolica-2.2.0-cp37-abi3-macosx_11_0_arm64.whl
| Download URL | symbolica-2.2.0-cp37-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 46.5 MB |
| Tags | CPython 3.7 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
40df78dd01545bcf5c74030b9a1df9d398f1cc24f833d102e1a343e4863f3642
|
|
BLAKE2b-256 checksum How to use checksums |
33428dc9bf51fccb7cf2bffc6dba4577aa3dbb8c1b9a1a6cae7309c270a420ae
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.14.1
|
Release files / symbolica-2.2.0-cp37-abi3-macosx_10_12_x86_64.whl
| Download URL | symbolica-2.2.0-cp37-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 55.2 MB |
| Tags | CPython 3.7 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
9094b99c17af23cd7e4e7e2597b0c3f193dae25494381a1cfeecb9828a7b5ee8
|
|
BLAKE2b-256 checksum How to use checksums |
4a786dc81602ce01a02ca791ae112904d12c0f3b72ecc2c9c576b8bb46c12658
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.14.1
|