Function: nfroots
Section: number_fields
C-Name: nfroots
Prototype: DGG
Help: nfroots({nf},x): roots of polynomial x belonging to nf (Q if
omitted) without multiplicity.
Doc: roots of the polynomial $x$ in the
number field $\var{nf}$ given by \kbd{nfinit} without multiplicity (in $\Q$
if $\var{nf}$ is omitted). $x$ has coefficients in the number field (scalar,
polmod, polynomial, column vector). The main variable of $\var{nf}$ must be
of lower priority than that of $x$ (see \secref{se:priority}). However if the
coefficients of the number field occur explicitly (as polmods) as
coefficients of $x$, the variable of these polmods \emph{must} be the same as
the main variable of $t$ (see \kbd{nffactor}).
It is possible to input a defining polynomial for \var{nf}
instead, but this is in general less efficient since parts of an \kbd{nf}
structure will then be computed internally. This is useful in two
situations: when you do not need the \kbd{nf} elsewhere, or when you cannot
initialize an \kbd{nf} due to integer factorization difficulties when
attempting to compute the field discriminant and maximal order.
\misctitle{Caveat} \kbd{nfinit([T, listP])} allows to compute in polynomial
time a conditional \var{nf} structure, which sets \kbd{nf.zk} to an order
which is not guaranteed to be maximal at all primes. Always either use
\kbd{nfcertify} first (which may not run in polynomial time) or make sure
to input \kbd{nf.pol} instead of the conditional \var{nf}: \kbd{nfroots} is
able to recover in polynomial time in this case, instead of potentially
missing a factor.
Variant: See also \fun{GEN}{nfrootsQ}{GEN x},
corresponding to $\kbd{nf} = \kbd{NULL}$.