Skip to main content

A tiny computer algebra system for Python.

Project description

░░█ ▄▀█ █▀▀ ▄▀█ █▀▄▀█ ▄▀█ █▀█ 
█▄█ █▀█ █▄▄ █▀█ █░▀░█ █▀█ █▀▄

Jacamar.

A lightweight framework for computer algebra using FLINT and Python-FLINT.

What it is.

  • Jacamar is designed to provide a minimal layer of abstraction, giving a SAGE-like feel to Python-FLINT. The goal is for parity to Python-FLINT in 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 Python package, which plays well with the ecosystem of packages. Eventually, this will include wheel builds and pip install capabilities.
  • 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.

  • Jacamar is not meant to be a replacement for SAGE or SymPy. It has a tiny fraction of the capabilities of SAGE, a tiny fraction of the lifetime of tests that SAGE has 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 via self.element_class and instances of ring elements have self.ring. We use this as well for objects like polynomial rings or matrices.
  • We prefer to access immutable characteristics of elements, like self.ring for an element, or self.codomain for some kind of morphism, as attributes (or @properties) rather than as functions.
  • We do not automatically coerce numbers into Integers. A number such as 7 in the Python prompt will always still produce an int, 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jacamar-0.1.0.tar.gz (48.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jacamar-0.1.0-py2.py3-none-any.whl (56.4 kB view details)

Uploaded Python 2Python 3

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

Hashes for jacamar-0.1.0.tar.gz
Algorithm Hash digest
SHA256 bb6419912daf12a0b3000ff7379d38683b67937718743bc0f894d68e3bd4bdbf
MD5 6e6d07d00502d0d548c05ee63892211b
BLAKE2b-256 9bfaab8b0fe517a0be57781b3ea1d56b9aa75052862ffcfa04dce898660183cc

See more details on using hashes here.

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

Hashes for jacamar-0.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 a1a5db4ad70deace58e57df0098112f39b1dfeb26c82cb79373f0fb181ad56f0
MD5 8e3f08bb6dc6f2e66459ed7a20d27985
BLAKE2b-256 614b4ce818167f650731caa8e8bebf8af88956220972fe71f29a1f60ba20f036

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page