symbolica


Namesymbolica JSON
Version 0.16.0 PyPI version JSON
download
home_pageNone
SummarySymbolica is a blazing fast computer algebra system
upload_time2025-03-20 13:38:05
maintainerNone
docs_urlNone
authorBen Ruijl
requires_pythonNone
licenseNone
keywords math algebra polynomial expression manipulation
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <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://zulip.symbolica.io"><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.16"
```

# 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/b5/64/869370a61d4095e1a9a6cd7eabf921ec3740bdb9992100e0cd85054336f7/symbolica-0.16.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://zulip.symbolica.io\"><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.16\"\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.16.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": "5507bf8322bd68b98c99d14139822cddf525e974b00c1302db9d5e029543f6af",
                "md5": "ac3dd079d87ebc8d06f59cbebbaf50ab",
                "sha256": "30265f90569897ef41b7c01df68fd2d8e363151a5eed5359a4163f01e02f5836"
            },
            "downloads": -1,
            "filename": "symbolica-0.16.0-cp37-abi3-macosx_10_12_x86_64.whl",
            "has_sig": false,
            "md5_digest": "ac3dd079d87ebc8d06f59cbebbaf50ab",
            "packagetype": "bdist_wheel",
            "python_version": "cp37",
            "requires_python": null,
            "size": 9611367,
            "upload_time": "2025-03-20T13:43:13",
            "upload_time_iso_8601": "2025-03-20T13:43:13.851045Z",
            "url": "https://files.pythonhosted.org/packages/55/07/bf8322bd68b98c99d14139822cddf525e974b00c1302db9d5e029543f6af/symbolica-0.16.0-cp37-abi3-macosx_10_12_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "a9b2a85ec5979ee11e7b5f0023969f4fa8b5b343ba0f89fa003e3c78dcd33789",
                "md5": "d08369dadcba4031fd25f94302353df3",
                "sha256": "73108e0cb23047a9bfddf6b8bedd7b7e78d71843e4090da6cbd436680dcb9fef"
            },
            "downloads": -1,
            "filename": "symbolica-0.16.0-cp37-abi3-macosx_11_0_arm64.whl",
            "has_sig": false,
            "md5_digest": "d08369dadcba4031fd25f94302353df3",
            "packagetype": "bdist_wheel",
            "python_version": "cp37",
            "requires_python": null,
            "size": 7967542,
            "upload_time": "2025-03-20T13:43:20",
            "upload_time_iso_8601": "2025-03-20T13:43:20.671528Z",
            "url": "https://files.pythonhosted.org/packages/a9/b2/a85ec5979ee11e7b5f0023969f4fa8b5b343ba0f89fa003e3c78dcd33789/symbolica-0.16.0-cp37-abi3-macosx_11_0_arm64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "35d685d6323d9e4fbdf93ab446169eb326b7853dea864ad767102e74cb672d47",
                "md5": "401d112ff19735b784f99bf425e39922",
                "sha256": "24a88663060ac6406bade1f0114a86bb46a3c46fba99f74e3bee988f04138ea3"
            },
            "downloads": -1,
            "filename": "symbolica-0.16.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "has_sig": false,
            "md5_digest": "401d112ff19735b784f99bf425e39922",
            "packagetype": "bdist_wheel",
            "python_version": "cp37",
            "requires_python": null,
            "size": 9626506,
            "upload_time": "2025-03-20T13:38:26",
            "upload_time_iso_8601": "2025-03-20T13:38:26.938838Z",
            "url": "https://files.pythonhosted.org/packages/35/d6/85d6323d9e4fbdf93ab446169eb326b7853dea864ad767102e74cb672d47/symbolica-0.16.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "b564869370a61d4095e1a9a6cd7eabf921ec3740bdb9992100e0cd85054336f7",
                "md5": "29a59b3a2aa8fbd4a74b10317fca1d1e",
                "sha256": "3deb5f77b39a1ce4fd2a81c8716e845fd3c66bf4f56e590bec48d147ac7be839"
            },
            "downloads": -1,
            "filename": "symbolica-0.16.0.tar.gz",
            "has_sig": false,
            "md5_digest": "29a59b3a2aa8fbd4a74b10317fca1d1e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 751400,
            "upload_time": "2025-03-20T13:38:05",
            "upload_time_iso_8601": "2025-03-20T13:38:05.437240Z",
            "url": "https://files.pythonhosted.org/packages/b5/64/869370a61d4095e1a9a6cd7eabf921ec3740bdb9992100e0cd85054336f7/symbolica-0.16.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-03-20 13:38:05",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "benruijl",
    "github_project": "symbolica",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "symbolica"
}
        
Elapsed time: 0.79074s