Skip to main content

![travis](https://travis-ci.org/louisabraham/algnuth.svg?branch=master)

Algebraic Number Theory package

Louis Abraham and Yassir Akram

Installation

pip install –upgrade algnuth

or get the development version with:

pip install –upgrade git+https://github.com/louisabraham/algnuth

Features

### Jacobi symbol

` pycon >>> from algnuth.jacobi import jacobi >>> jacobi(3763, 20353) -1 `

### Solovay-Strassen primality test

` pycon >>> from algnuth.jacobi import solovay_strassen >>> p = 12779877140635552275193974526927174906313992988726945426212616053383820179306398832891367199026816638983953765799977121840616466620283861630627224899026453 >>> q = 12779877140635552275193974526927174906313992988726945426212616053383820179306398832891367199026816638983953765799977121840616466620283861630627224899027521 >>> n = p * q >>> solovay_strassen(p) True >>> solovay_strassen(q) True >>> solovay_strassen(n) False `

### Quadratic forms

` pycon >>> from algnuth.quadratic import * >>> display_classes(-44) x^2 + 11⋅y^2 2⋅x^2 + 2⋅xy + 6⋅y^2 3⋅x^2 - 2⋅xy + 4⋅y^2 3⋅x^2 + 2⋅xy + 4⋅y^2 >>> display_primitive_forms(-44) x^2 + 11⋅y^2 3⋅x^2 - 2⋅xy + 4⋅y^2 3⋅x^2 + 2⋅xy + 4⋅y^2 >>> display_ambiguous_classes(-44) x^2 + 11⋅y^2 2⋅x^2 + 2⋅xy + 6⋅y^2 >>> display(*reduced(18, -10, 2)) 2⋅x^2 + 2⋅xy + 6⋅y^2 `

### Real polynomials

` pycon >>> from algnuth.polynom import Polynomial >>> P = Polynomial([0] * 10 + [-1, 0, 1]) >>> print(P) X^12-X^10 >>> P(2) 3072 >>> P.disc 0 >>> P.sturm() # Number of distinct real roots 3 >>> P.r1 # Number of real roots with multiplicity 12 `

### Modular arithmetic

` pycon >>> P = Polynomial([1, 2, 3]) >>> Pmodp = P % 41 >>> print(Pmodp ** 3) 27⋅X^6+13⋅X^5+22⋅X^4+3⋅X^3+21⋅X^2+6⋅X+1 >>> print((P ** 3) % 41) 27⋅X^6+13⋅X^5+22⋅X^4+3⋅X^3+21⋅X^2+6⋅X+1 `

### Polynomial division

` pycon >>> A = Polynomial([1, 2, 3, 4]) % 7 >>> B = Polynomial([0, 1, 2]) % 7 >>> print(A) 4⋅X^3+3⋅X^2+2⋅X+1 >>> print(B) 2⋅X^2+X >>> print(A % B) 5⋅X+1 >>> print(A // B) 2⋅X+4 >>> print((A // B) * B + A % B) 4⋅X^3+3⋅X^2+2⋅X+1 `

### Berlekamp’s factorization algorithm

` pycon >>> P = Polynomial([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]) >>> Pmodp = P % 41 >>> print(Polynomial.ppfactors(Pmodp.factor())) 12⋅(X+31)⋅X⋅(X^2+40⋅X+24)⋅(X^2+36⋅X+13)⋅(X^6+34⋅X^5+26⋅X^4+13⋅X^3+25⋅X^2+26⋅X+35) `

### Unique Factorization of Ideals

` pycon >>> from algnuth.ideals import factorIdeals >>> factorIdeals(Polynomial([4, 0, 0, 1])) X^3+4 mod 2 = X^3 (2) = (2, α)^3 X^3+4 mod 3 = (X+1)^3 (3) = (3, α+1)^3 X^3+4 mod 5 = (X+4)⋅(X^2+X+1) (5) = (5, α+4)⋅(5, α^2+α+1) `

Metadata

Release files for algnuth 0.0.3

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

Built distribution (wheel)

Table of built distributions (wheels) for algnuth 0.0.3
File Interpreter ABI Platform
algnuth-0.0.3-py3-none-any.whl Python 3 none any Details

Release files / algnuth-0.0.3-py3-none-any.whl

Download URL algnuth-0.0.3-py3-none-any.whl
Size 8.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f7c2c5b1e70ea7337dc36a4400a4320acfc4e54213024da5b26d77173c61d086
BLAKE2b-256 checksum
How to use checksums
a7e2a7d427276dc976c40637c818e95c62adb9846dd2ccb7101b57f0ffb65450
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.4

Security for algnuth 0.0.3

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.

Release history Release notifications | RSS feed

This release

0.0.3 This release

1 release file No provenance

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