Skip to content
/ QiPy Public
forked from ranea/QiPy

A Python library to work with elements, ideals, ideal classes and class groups from quadratic integer rings.

License

Notifications You must be signed in to change notification settings

waamm/QiPy

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

QiPy

QiPy is a Python library to work with quadratic integers. Well-known examples are Gaussian integers and Eisenstein integers. Besides, QiPy implements ideals, ideal classes and class groups of quadratic integer rings.

This library has been exhaustively tested with unit tests and property testing.

A complete documentation of QiPy, including examples of all its funcionalities, can be found in the GitHub Page of the repository.

Installation

QiPy is written in Python 3 and uses the Python library SymPy. Therefore, Python 3 and SymPy must be installed in your computer.

The easiest way to install QiPy is with pip :

pip3 install qipy

Examples of usage

Computing frac in Zi:

>>> Zi = QuadraticIntegerRing(-1)
>>> Zi("1 + I") / Zi("1 - I")
I

Factoring 2 in Zi:

>>> Zi = QuadraticIntegerRing(-1)
>>> Zi(2).factor()
[1 + I, 1 - I]

Testing whether the ideal twogen in 5 is principal:

>>> O = QuadraticIntegerRing(-5)
>>> Ideal(O(3), O("1 + sqrt(-5)")).is_principal()
False

Factoring the ideal 2 in Zi:

>>> Zi = QuadraticIntegerRing(-1)
>>> Ideal(Zi(2)).factor()
[<1 + I,2*I>, <1 + I,2*I>]

Computing the order of the ideal class with representative twogen in 5:

>>> O = QuadraticIntegerRing(-5)
>>> a = IdealClass(Ideal(O(3), O("1 + sqrt(-5)")))
>>> a.order
2

Computing the class number of 5:

>>> G = ClassGroup(-5)
>>> G.class_number
2

About

A Python library to work with elements, ideals, ideal classes and class groups from quadratic integer rings.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%