[GAP Forum] cyclotomic number

Alexander Konovalov alexk at mcs.st-and.ac.uk
Tue Jun 11 20:31:56 BST 2013


On 5 Jun 2013, at 16:08, Flisphy wrote:

> Dear gap developers,
> 
>  Could I convert cyclotomic number into complex number using gap?
> 
>  yours,
> 
>  Peng Long


Dear Peng Long,

cyclotomic numbers *are* complex numbers - I guess what you may have in 
mind is getting a floating-point approximation of the real and imaginary
parts of a cyclotomic number. This can be achieved using the GAP package
Float by Laurent Bartholdi: see 

	http://laurentbartholdi.github.io/float/chap0.html

For example,

gap> LoadPackage("float");
Loading FLOAT 0.5.10 ...
true
gap> SetFloats(MPC);                                                  
gap> Float(E(6));
.5e0+.866025e0ⅈ
gap> x:=E(3)+E(5)^2;
-E(15)-E(15)^2-E(15)^8-2*E(15)^11-E(15)^14
gap> y:=Float(x);                                               
-.130902e1+.145381e1ⅈ
gap> Norm(y);
.382709e1
gap> RealPart(y);
-.130902e1
gap> ImaginaryPart(y);
.145381e1
gap> ComplexConjugate(y);
-.130902e1-.145381e1ⅈ

See the documentation for the Float package for installation requirements
and further details. In particular, I am not aware of Float being usable
under Windows. 

Hope this helps,
Alexander









More information about the Forum mailing list