Algebra
Algebraic structures
Note: Algebra requires Python 3.6 or higher.
Requirements and Installation
pip install algebra
See also the instructions here.
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.
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.
>>> 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.
Metadata
Release files for algebra 1.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| algebra-1.2.1.tar.gz | 19.9 kB | Without provenance | Details for algebra-1.2.1.tar.gz |
Release files / algebra-1.2.1.tar.gz
| Download URL | algebra-1.2.1.tar.gz |
|---|---|
| Size | 19.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bd479a00bfb2b33120377bb6ad089c1909b1a10fa2606add0f81f4733d8ed356
|
|
BLAKE2b-256 checksum How to use checksums |
eb75d45e5e69b762a9932faa7befea68f5493eb0505f9f3579649efca1cf7ad1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.10.4
|
Security for algebra 1.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.