A tiny computer algebra system for Python.
Project description
░░█ ▄▀█ █▀▀ ▄▀█ █▀▄▀█ ▄▀█ █▀█
█▄█ █▀█ █▄▄ █▀█ █░▀░█ █▀█ █▀▄
Jacamar.
A lightweight framework for computer algebra using FLINT and Python-FLINT.
What it is.
Jacamaris designed to provide a minimal layer of abstraction, giving aSAGE-like feel toPython-FLINT. The goal is for parity toPython-FLINTin terms of speed.- Its audience is mathematicians and computer scientists who need to use algebraic objects (commutative rings, polynomials, chain complexes, and categories) to easily build new algebraic objects.
- A
Pythonpackage, which plays well with the ecosystem of packages. Eventually, this will include wheel builds andpip installcapabilities. - Built for parallelizability?
- Mathematical.
- Fundamental principle: no automatic coercions.
Coercion model.
We more or less inherit some basic coercions from Python-FLINT. Where it
makes sense, binary operations like __add__(self,other) or
__mul__(self,other) return elements of type other.__class__. Thus, the
constructor for this class must be able to take the output of the underlying
data self._data + other._data and construct a new element with it. In
practice, this corresponds to pretending like all such operations correspond to
a left action of the ring of self on the ring or module of other.
We try for this to fail whenever something non-obvious is happening.
In particular, all arithmetic operations should fail when mixing Jacamar
classes with bare Python classes.
Python integers are not automatically coerced. Thus, if n is an int and x
is an element in some ring, x**n will raise a TypeError.
In general, __truediv__ is not defined for non-fields. Similarly, powering by
non-integer (Integer or IntegerPy) elements in polynomial rings raises a TypeError.
Powering by rational numbers or real numbers might eventually be well-defined
in certain Puiseux or power series rings.
What it is not.
Jacamaris not meant to be a replacement forSAGEorSymPy. It has a tiny fraction of the capabilities ofSAGE, a tiny fraction of the lifetime of tests thatSAGEhas passed, and none of the printing and display options.
Remarks.
- We do not provide a universal element-parent approach as in
SAGE. Rather, instances of rings point to element classes viaself.element_classand instances of ring elements haveself.ring. We use this as well for objects like polynomial rings or matrices. - We prefer to access immutable characteristics of elements, like
self.ringfor an element, orself.codomainfor some kind of morphism, as attributes (or @properties) rather than as functions. - We do not automatically coerce numbers into Integers. A number such as
7in the Python prompt will always still produce anint, so it can be used as an index in lists, etc.
Tools.
- pygount
- ruff
- black
- pylint
- coverage
- python environments
Style.
from art import *
tprint("JACAMAR", font="tarty2")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file jacamar-0.1.0.tar.gz.
File metadata
- Download URL: jacamar-0.1.0.tar.gz
- Upload date:
- Size: 48.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bb6419912daf12a0b3000ff7379d38683b67937718743bc0f894d68e3bd4bdbf
|
|
| MD5 |
6e6d07d00502d0d548c05ee63892211b
|
|
| BLAKE2b-256 |
9bfaab8b0fe517a0be57781b3ea1d56b9aa75052862ffcfa04dce898660183cc
|
File details
Details for the file jacamar-0.1.0-py2.py3-none-any.whl.
File metadata
- Download URL: jacamar-0.1.0-py2.py3-none-any.whl
- Upload date:
- Size: 56.4 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a1a5db4ad70deace58e57df0098112f39b1dfeb26c82cb79373f0fb181ad56f0
|
|
| MD5 |
8e3f08bb6dc6f2e66459ed7a20d27985
|
|
| BLAKE2b-256 |
614b4ce818167f650731caa8e8bebf8af88956220972fe71f29a1f60ba20f036
|