<h1 align="center">
<br>
<img src="https://symbolica.io/logo.svg" alt="logo" width="200">
<br>
</h1>
<p align="center">
<a href="https://symbolica.io"><img alt="Symbolica website" src="https://img.shields.io/static/v1?label=symbolica&message=website&color=orange&style=flat-square"></a>
<a href="https://reform.zulipchat.com"><img alt="Zulip Chat" src="https://img.shields.io/static/v1?label=zulip&message=discussions&color=blue&style=flat-square"></a>
<a href="https://github.com/benruijl/symbolica"><img alt="Symbolica website" src="https://img.shields.io/static/v1?label=github&message=development&color=green&style=flat-square&logo=github"></a>
<a href="https://app.codecov.io/gh/benruijl/symbolica"><img alt="Codecov" src="https://img.shields.io/codecov/c/github/benruijl/symbolica?token=N43MATK5XJ&style=flat-square"></a>
</p>
# 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](https://colab.research.google.com/drive/1VAtND2kddgBwNt1Tjsai8vnbVIbgg-7D?usp=sharing)!
For documentation and more, see [symbolica.io](https://symbolica.io).
## Quick Example
Symbolica allows you to build and manipulate mathematical expressions, for example from a Jupyter Notebook:
<img width="600" alt="A demo of Symbolica" src="https://symbolica.io/resources/demo.light.svg">
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:
<img width="600" alt="A demo of Symbolica" src="https://symbolica.io/resources/completion.light.png">
# Installation
Visit the [Get Started](https://symbolica.io/docs/get_started.html) page for detailed installation instructions.
## Python
Symbolica can be installed for Python >3.5 using `pip`:
```sh
pip install symbolica
```
## Rust
If you want to use Symbolica as a library in Rust, simply include it in the `Cargo.toml`:
```toml
[dependencies]
symbolica = "0.13"
```
# Examples
Below we list some examples of the features of Symbolica. Check the [guide](https://symbolica.io/docs/) 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_)`:
```python
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`:
```python
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`:
```python
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:
```python
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)`.
## Development
Follow the development and discussions on [Zulip](https://reform.zulipchat.com)!
Raw data
{
"_id": null,
"home_page": null,
"name": "symbolica",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "math, algebra, polynomial, expression, manipulation",
"author": "Ben Ruijl",
"author_email": "benruyl@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/e1/30/5d0e2d0720043b7ee1338f18cdbc87158d8068808cae9186aadf05c3444f/symbolica-0.13.0.tar.gz",
"platform": null,
"description": "<h1 align=\"center\">\n <br>\n <img src=\"https://symbolica.io/logo.svg\" alt=\"logo\" width=\"200\">\n <br>\n</h1>\n\n<p align=\"center\">\n<a href=\"https://symbolica.io\"><img alt=\"Symbolica website\" src=\"https://img.shields.io/static/v1?label=symbolica&message=website&color=orange&style=flat-square\"></a>\n <a href=\"https://reform.zulipchat.com\"><img alt=\"Zulip Chat\" src=\"https://img.shields.io/static/v1?label=zulip&message=discussions&color=blue&style=flat-square\"></a>\n <a href=\"https://github.com/benruijl/symbolica\"><img alt=\"Symbolica website\" src=\"https://img.shields.io/static/v1?label=github&message=development&color=green&style=flat-square&logo=github\"></a>\n <a href=\"https://app.codecov.io/gh/benruijl/symbolica\"><img alt=\"Codecov\" src=\"https://img.shields.io/codecov/c/github/benruijl/symbolica?token=N43MATK5XJ&style=flat-square\"></a>\n</p>\n\n# Symbolica \u2286 Modern Computer Algebra\n\nSymbolica 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.\nCheck out the live [Jupyter Notebook demo](https://colab.research.google.com/drive/1VAtND2kddgBwNt1Tjsai8vnbVIbgg-7D?usp=sharing)!\n\nFor documentation and more, see [symbolica.io](https://symbolica.io).\n\n\n\n## Quick Example\n\nSymbolica allows you to build and manipulate mathematical expressions, for example from a Jupyter Notebook:\n\n<img width=\"600\" alt=\"A demo of Symbolica\" src=\"https://symbolica.io/resources/demo.light.svg\">\n\nYou 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:\n\n<img width=\"600\" alt=\"A demo of Symbolica\" src=\"https://symbolica.io/resources/completion.light.png\">\n\n# Installation\n\nVisit the [Get Started](https://symbolica.io/docs/get_started.html) page for detailed installation instructions.\n\n## Python\n\nSymbolica can be installed for Python >3.5 using `pip`:\n\n```sh\npip install symbolica\n```\n\n## Rust\n\nIf you want to use Symbolica as a library in Rust, simply include it in the `Cargo.toml`:\n\n```toml\n[dependencies]\nsymbolica = \"0.13\"\n```\n\n# Examples\n\nBelow we list some examples of the features of Symbolica. Check the [guide](https://symbolica.io/docs/) for a complete overview.\n\n### Pattern matching\n\nVariables ending with a `_` are wildcards that match to any subexpression.\nIn the following example we try to match the pattern `f(w1_,w2_)`:\n\n```python\nfrom symbolica import *\nx, y, w1_, w2_, f = S('x','y','w1_','w2_', 'f')\ne = f(3,x)*y**2+5\nr = e.replace_all(f(w1_,w2_), f(w1_ - 1, w2_**2))\nprint(r)\n```\nwhich yields `y^2*f(2,x^2)+5`.\n\n### Solving a linear system\n\nSolve a linear system in `x` and `y` with a parameter `c`:\n\n```python\nfrom symbolica import *\n\nx, y, c, f = S('x', 'y', 'c', 'f')\n\nx_r, y_r = Expression.solve_linear_system(\n [f(c)*x + y + c, y + c**2], [x, y])\nprint('x =', x_r, ', y =', y_r)\n```\nwhich yields `x = (-c+c^2)*f(c)^-1` and `y = -c^2`.\n\n### Series expansion\n\nPerform a series expansion in `x`:\n\n```python\nfrom symbolica import *\ne = E('exp(5+x)/(1-x)').series(S('x'), 0, 3)\n\nprint(e)\n```\nwhich yields `(exp(5))+(2*exp(5))*x+(5/2*exp(5))*x^2+(8/3*exp(5))*x^3+\ud835\udcaa(x^4)`.\n\n### Rational arithmetic\n\nSymbolica is world-class in rational arithmetic, outperforming Mathematica, Maple, Form, Fermat, and other computer algebra packages. Simply convert an expression to a rational polynomial:\n```python\nfrom symbolica import *\np = E('(x*y^2*5+5)^2/(2*x+5)+(x+4)/(6*x^2+1)').to_rational_polynomial()\nprint(p)\n```\nwhich 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)`.\n\n## Development\n\nFollow the development and discussions on [Zulip](https://reform.zulipchat.com)!\n\n",
"bugtrack_url": null,
"license": null,
"summary": "Symbolica is a blazing fast computer algebra system",
"version": "0.13.0",
"project_urls": {
"homepage": "https://symbolica.io",
"repository": "https://github.com/benruijl/symbolica"
},
"split_keywords": [
"math",
" algebra",
" polynomial",
" expression",
" manipulation"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "ef819c95c76498a69414300216f62887f088f7bbe51533b00d5155292d24ac38",
"md5": "0cdf4cd31b7738ab9195883cc8723a88",
"sha256": "465124fe28fb589aa28c4fd1f5cd752bd24c6b1b5d54fb464f89d55841aa6167"
},
"downloads": -1,
"filename": "symbolica-0.13.0-cp37-abi3-macosx_10_12_x86_64.whl",
"has_sig": false,
"md5_digest": "0cdf4cd31b7738ab9195883cc8723a88",
"packagetype": "bdist_wheel",
"python_version": "cp37",
"requires_python": null,
"size": 8070747,
"upload_time": "2024-10-21T06:33:08",
"upload_time_iso_8601": "2024-10-21T06:33:08.208620Z",
"url": "https://files.pythonhosted.org/packages/ef/81/9c95c76498a69414300216f62887f088f7bbe51533b00d5155292d24ac38/symbolica-0.13.0-cp37-abi3-macosx_10_12_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "e4fd6165f2cfaf59842213de11fe12157c3d9093ef177f3aad0baf1b68279d25",
"md5": "2663226d2cf94a6fe7898eddfcef82a1",
"sha256": "0a31f028a49bd76e07fbd04198f3254dd2d04b453ab4c4f92f46798fc7564350"
},
"downloads": -1,
"filename": "symbolica-0.13.0-cp37-abi3-macosx_11_0_arm64.whl",
"has_sig": false,
"md5_digest": "2663226d2cf94a6fe7898eddfcef82a1",
"packagetype": "bdist_wheel",
"python_version": "cp37",
"requires_python": null,
"size": 6832762,
"upload_time": "2024-10-21T06:33:16",
"upload_time_iso_8601": "2024-10-21T06:33:16.470572Z",
"url": "https://files.pythonhosted.org/packages/e4/fd/6165f2cfaf59842213de11fe12157c3d9093ef177f3aad0baf1b68279d25/symbolica-0.13.0-cp37-abi3-macosx_11_0_arm64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "823e07fad1b5a095d67a8a7bca9c6f5e1e82a641b1028c303ccaeb248ac32e5c",
"md5": "d4e8e88b6d3da3e5ab1a945f3ed4da39",
"sha256": "8638378720f943255c66b0dae77a7131b27d761c7a7267ae7186f392d8802db6"
},
"downloads": -1,
"filename": "symbolica-0.13.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "d4e8e88b6d3da3e5ab1a945f3ed4da39",
"packagetype": "bdist_wheel",
"python_version": "cp37",
"requires_python": null,
"size": 8259996,
"upload_time": "2024-10-21T06:33:23",
"upload_time_iso_8601": "2024-10-21T06:33:23.207715Z",
"url": "https://files.pythonhosted.org/packages/82/3e/07fad1b5a095d67a8a7bca9c6f5e1e82a641b1028c303ccaeb248ac32e5c/symbolica-0.13.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "1fc8b19eabe9a37f6cae515543badf144565502af56625489f4f506f06a166ce",
"md5": "4466c4a5b3d570c950b71c01d5dc385c",
"sha256": "77cdc69a95c8706cc8b1e3cc7734ad89e6d5058bcb508aed23a903ddde77e578"
},
"downloads": -1,
"filename": "symbolica-0.13.0-cp37-abi3-win_amd64.whl",
"has_sig": false,
"md5_digest": "4466c4a5b3d570c950b71c01d5dc385c",
"packagetype": "bdist_wheel",
"python_version": "cp37",
"requires_python": null,
"size": 7973897,
"upload_time": "2024-10-21T06:35:02",
"upload_time_iso_8601": "2024-10-21T06:35:02.049142Z",
"url": "https://files.pythonhosted.org/packages/1f/c8/b19eabe9a37f6cae515543badf144565502af56625489f4f506f06a166ce/symbolica-0.13.0-cp37-abi3-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "e1305d0e2d0720043b7ee1338f18cdbc87158d8068808cae9186aadf05c3444f",
"md5": "c5c3b5d5d68324bc4b2636fa2bbcbf91",
"sha256": "7d6e39b4368f68484c32c837506d5ad560a895b1340e5b49548a3bec75c6bf55"
},
"downloads": -1,
"filename": "symbolica-0.13.0.tar.gz",
"has_sig": false,
"md5_digest": "c5c3b5d5d68324bc4b2636fa2bbcbf91",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 679499,
"upload_time": "2024-10-21T06:32:31",
"upload_time_iso_8601": "2024-10-21T06:32:31.768412Z",
"url": "https://files.pythonhosted.org/packages/e1/30/5d0e2d0720043b7ee1338f18cdbc87158d8068808cae9186aadf05c3444f/symbolica-0.13.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-21 06:32:31",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "benruijl",
"github_project": "symbolica",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "symbolica"
}