Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sagemath/conway-polynomials
Python interface to Frank Lübeck's Conway polynomial database
https://github.com/sagemath/conway-polynomials
algebra conway-polynomials mathematics
Last synced: about 8 hours ago
JSON representation
Python interface to Frank Lübeck's Conway polynomial database
- Host: GitHub
- URL: https://github.com/sagemath/conway-polynomials
- Owner: sagemath
- License: gpl-3.0
- Created: 2023-11-22T23:51:37.000Z (12 months ago)
- Default Branch: master
- Last Pushed: 2024-01-13T03:16:38.000Z (10 months ago)
- Last Synced: 2024-04-13T21:53:27.720Z (7 months ago)
- Topics: algebra, conway-polynomials, mathematics
- Language: Python
- Homepage:
- Size: 253 KB
- Stars: 1
- Watchers: 9
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: COPYING
Awesome Lists containing this project
README
Python interface to Frank Lübeck's Conway polynomial database
Introduction
============Frank Lübeck maintains a list of pre-computed Conway polynomial
coefficients at,https://www.math.rwth-aachen.de/~Frank.Luebeck/data/ConwayPol/index.html
These are used in several computer algebra systems such as GAP and
SageMath to provide quick access to those Conway polynomials. The aim
of this package is to make them available through a generic python
interface. The package consists of a single module containing a single
function that returns a dict of dicts, ``conway_polynomials.database()``.
The dictionary's format is ``{p: {n: coefficients}}``, where ``p``
represents your prime and ``n`` your degree. The tuple of coefficients
is returned in ascending order; that is, the first coefficient (at
index zero) is for the constant (degree zero) term.This package is an evolution of the SageMath *conway_polynomials*
package hosted at,http://files.sagemath.org/spkg/upstream/conway_polynomials/
and is maintained by the same team of developers. We have kept the
versioning scheme consistent to reflect that.Examples
========Retrieve the coefficients of the Conway polynomial for prime p=2 and
degree n=5::>>> import conway_polynomials
>>> cpdb = conway_polynomials.database()
>>> cpdb[2][5]
(1, 0, 1, 0, 0, 1)The result is cached, so subsequent computations should be fast even
if you call the function again::>>> conway_polynomials.database() is conway_polynomials.database()
TrueHowever, the result is also mutable, so if you need to modify it for
some reason then you should create a copy; otherwise your changes will
affect future calls::>>> cpdb = conway_polynomials.database()
>>> cpdb[5][5]
(3, 4, 0, 0, 0, 1)
>>> cpdb[5][5] = (8, 6, 7, 5, 3, 0, 9)
>>> conway_polynomials.database()[5][5]
(8, 6, 7, 5, 3, 0, 9)Testing
=======A few doctests within the module (and this README) ensure that
everything is working. You can run them from the repository or from a
release tarball using::PYTHONPATH=src python -m doctest \
README.rst \
src/conway_polynomials/__init__.pyOr, if you have pytest installed, with simply::
pytest