Christelle Vincent on Sat, 20 Jul 2013 03:17:20 +0200

 Help with algebraic numbers

```Hi!

I am having some trouble writing code dealing with algebraic numbers, basically because I can't anticipate if Pari will return a t_INT or a t_COL to describe the algebraic number. Is there an easy way to coerce one into the other mechanically, no matter which one comes out? Alternatively, is there a way to ensure that one of the two always comes out (whichever one, as long as I know which one in advance)?

More precisely, I am looking at the output of rnfidealreltoabs. The relative matrix A which is the first component of the output might have entries that are either integers (if the element is rational) or a vector giving me the element in terms of the relative basis. I want to take an entry of the matrix, and have it as an algebraic number. If I get a vector I can do this by multiplying on the left by K.zk (where K is my field), and if I get an integer, I don't have to do that (and in fact multiplying by K.zk gives a vector which is not even the right number). Having to handle the two cases differently is a problem, because I want to be able to make the computation automatic. In other words, I need to be able to handle both occurrences in the same way. Is that possible?

Please don't hesitate to write me back if you need further clarifications on what I am asking; I am very new at using Pari so it's possible I am not explaining this in the best way.

Je parle aussi franÃais alors si vous voulez rÃpondre en franÃais ou si vous voulez que je recopie ma question en franÃais, n'hÃsitez pas!

Thank you,
Christelle

```