Skip to main content

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()
True

However, 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__.py

Or, if you have pytest installed, with simply:

pytest

Metadata

Release files for conway-polynomials 0.10

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for conway-polynomials 0.10
File Size Uploaded Provenance Actions
conway_polynomials-0.10.tar.gz 307.4 kB Without provenance Details for conway_polynomials-0.10.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for conway-polynomials 0.10
File Interpreter ABI Platform Actions
conway_polynomials-0.10-py3-none-any.whl Python 3 none any Details for conway_polynomials-0.10-py3-none-any.whl

Total release size: 520.1 kB

Release files / conway_polynomials-0.10.tar.gz

Download URL conway_polynomials-0.10.tar.gz
Size 307.4 kB
Tags Source
SHA-256 checksum
How to use checksums
4f619f64f81a3eb16c4e26c5a284feeec27a6f4aad647643e79af289801ae0f3
BLAKE2b-256 checksum
How to use checksums
a4732601b755e76fa1d90f19541d80d43b97bfa1d5c9bc284e79c8f8180ba317
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.3

Release files / conway_polynomials-0.10-py3-none-any.whl

Download URL conway_polynomials-0.10-py3-none-any.whl
Size 212.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a354b4ac0a9985da75e2ac6ec6d7de2902396eff48913eeed86a962486171c28
BLAKE2b-256 checksum
How to use checksums
339f78052da6bda316d5105ea027de9978e92d81552dac8f87ca4267488a40d3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.3

Security for conway-polynomials 0.10

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page