algebra-1.2.1
توضیحات
Algebraic structures
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | algebra-1.2.1 |
| نام | algebra |
| نسخه کتابخانه | 1.2.1 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Wessel Bruinsma |
| ایمیل نویسنده | wessel.p.bruinsma@gmail.com |
| آدرس صفحه اصلی | https://github.com/wesselb/algebra |
| آدرس اینترنتی | https://pypi.org/project/algebra/ |
| مجوز | MIT |
# [Algebra](http://github.com/wesselb/algebra)
[](https://github.com/wesselb/algebra/actions?query=workflow%3ACI)
[](https://coveralls.io/github/wesselb/algebra?branch=master)
[](https://user.github.io/algebra)
[](https://github.com/psf/black)
Algebraic structures
*Note:* Algebra requires Python 3.6 or higher.
## Requirements and Installation
```bash
pip install algebra
```
See also [the instructions here](https://gist.github.com/wesselb/4b44bf87f3789425f96e26c4308d0adc).
## Algebra
This package provides an algebra where the elements can be manipulated
in a natural way, with basic algebraic simplifications happening automatically.
It also support equality checking, which is conservative:
if `x == y`, then `x` is equal to `y`;
but if `x != y`, then either `x` is different from `y`, or it could not be
proven that `x` is equal to `y`.
As an example, let's create numbered elements.
```python
from algebra import Element
class Numbered(Element):
total = 0
def __init__(self):
self.num = Numbered.total
Numbered.total += 1
def render(self, formatter):
return f'x{self.num}'
```
Then instances of `Numbered` can be manipulated as follows.
```python
>>> x0 = Numbered()
>>> x1 = Numbered()
>>> x0 == x0
True
>>> x0 == x1
False
>>> x0 + x1
x0 + x1
>>> x0 + x0
2 * x0
>>> x0 + x1 == x1 + x0
True
>>> x0 - x0
0
>>> 2 + x0
2 * 1 + x0
>>> (2 + x0) * x1
(2 * 1 + x0) * x1
>>> (2 + x0) * x1 * 0
0
```
## Create Your Own Algebra
Coming soon.
## Function Algebra
Coming soon.
## Create Your Own Function Algebra
Coming soon.
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.6 | Python |
نحوه نصب
نصب پکیج whl algebra-1.2.1:
pip install algebra-1.2.1.whl
نصب پکیج tar.gz algebra-1.2.1:
pip install algebra-1.2.1.tar.gz