Feature #627
Gaussian integer and rationals ZZi, QQi
Description
Ulrich would like to have an easy way to compute with (approximations to) complex numbers.
Currently, it is possible to create QQ[i]
and ZZ[i]
as quotients of polynomial extensions, but the procedure is cumbersome, and the resulting ring could be implemented more efficiently.
Related issues
History
#1 Updated by John Abbott almost 10 years ago
QQ[i]
?
- a pair of
BigRat
values (real and imag parts) - a triple of
BigInt
values (real, imag and common denom) - a 4-tuple of
BigInt
values (real & imag of numerator, real & imag of denominator)
Representation (3) is unnormalized, i.e. the same value has many different representations; division is very simple; addition and multiplication are more costly than in repr (2).
Repr (2) is the most "specialized"; I would expect it to be faster at run-time than the other two reprs.
Repr (1) is perhaps the most natural, but having two separate denominators is likely to be a disadvantage at run-time (more memory space, and slower computation than repr (1))
#2 Updated by John Abbott almost 10 years ago
Recalling that every ring (except RingZZ
) in CoCoALib has a BaseRing
and an "extension type". What should the BaseRing
and "extension type" of QQ[i]
be?
Ideally it should behave as if it were a quotient of a polynomial extension. But if we do this then it must be possible to obtain a "representative" being a univariate polynomial in the polynomial ring QQ[i]
.
Perhaps there should be a special "simple algebraic extension" type whose BaseRing
is the coeff ring, and the intermediate polynomial ring is not accessible?
#3 Updated by John Abbott over 7 years ago
- Related to Feature #993: New function: RingQQi()? extension of QQ with imaginary unit added