[Python-ideas] Complex rationals in Python.

Mark Dickinson dickinsm at gmail.com
Mon Nov 24 21:24:28 CET 2008


On Mon, Nov 24, 2008 at 8:01 PM, Rocco Orlando Rossi
<rocco.rossi at gmail.com> wrote:
> I appreciate the inclusion of the fractions module in Python 2.6 and
> therefore in Python 3.0. But I feel there's something missing: no
> possibility for complex rationals (or arbitrary precision) integers.

This seems like a specialist need to me---one that belongs in a Python
extension package or library, but not in core Python.

Another thought: the field Q(i) is just one of an infinite number
of quadratic extensions of the field of rationals.  Why implement
that one and not the others?  Put another way, the field of
complex numbers is a fairly natural object, but the choice to
represent it as reals adjoin sqrt(-1) is quite arbitrary---one
could just as easily adjoin sqrt(-2), or sqrt(-3), or
(-1+sqrt(-3))/2 instead.

Have you investigated sage? (www.sagemath.org)

Mark



More information about the Python-ideas mailing list