version 1.1.1.1, 2001/10/02 11:16:58 |
version 1.2, 2002/09/11 07:26:42 |
|
|
}$$ |
}$$ |
typing in \kbd{foo(6,4)} would give |
typing in \kbd{foo(6,4)} would give |
you \kbd{foo(6,4,3)}. In the rare case when you want to set some far away |
you \kbd{foo(6,4,3)}. In the rare case when you want to set some far away |
flag, and leave the defaults in between as they stand, you can use the |
argument, and leave the defaults in between as they stand, you can use the |
``empty arg'' trick alluded to above: \kbd{foo(6,,1)} would yield |
``empty arg'' trick alluded to above: \kbd{foo(6,,1)} would yield |
\kbd{foo(6,2,1)}. By the way, \kbd{foo()} by itself yields |
\kbd{foo(6,2,1)}. By the way, \kbd{foo()} by itself yields |
\kbd{foo(1,2,3)} as was to be expected. In this rather special case of a |
\kbd{foo(1,2,3)} as was to be expected. In this rather special case of a |
Line 50 to put optional arguments at the end of the argument l |
|
Line 50 to put optional arguments at the end of the argument l |
|
they would not make sense otherwise), and in order of decreasing usefulness |
they would not make sense otherwise), and in order of decreasing usefulness |
so that, most of the time, you will be able to ignore them. |
so that, most of the time, you will be able to ignore them. |
|
|
\misctitle{Binary Flags}.\sidx{binary flag} For some of these optional |
\misctitle{Flags}. A \tev{flag} is an argument which, rather than conveying |
flags, we adopted the customary binary notation as a compact way to |
actual information to the routine, intructs it to change its default |
represent many toggles with just one number. Letting $(p_0,\dots,p_n)$ be a |
behaviour, e.g.~return more or less information. All such |
list of switches (i.e.~of properties which can be assumed to take either |
flags are optional, and will be called \fl\ in the function descriptions to |
the value $0$ or~$1$), the number $2^3 + 2^5=40$ means that $p_3$ and $p_5$ |
follow. There are two different kind of flags |
|
|
|
$\bullet$ generic: all valid values for the flag are individually |
|
described (``If \fl\ is equal to $1$, then\dots''). |
|
|
|
$\bullet$ binary:\sidx{binary flag} use customary binary notation as a |
|
compact way to represent many toggles with just one number. Letting |
|
$(p_0,\dots,p_n)$ be a list of switches (i.e.~of properties which take either |
|
the value $0$ or~$1$), the number $2^3 + 2^5 = 40$ means that $p_3$ and $p_5$ |
have been set (that is, set to $1$), and none of the others were (that is, |
have been set (that is, set to $1$), and none of the others were (that is, |
they were set to 0). This will usually be announced as ``The binary digits |
they were set to $0$). This is announced as ``The binary digits of $\fl$ mean |
of $\fl$ mean 1: $p_0$, 2: $p_1$, 4: $p_2$'', and so on, using the |
1: $p_0$, 2: $p_1$, 4: $p_2$'', and so on, using the available consecutive |
available consecutive powers of~$2$. |
powers of~$2$. |
|
|
|
\misctitle{Mnemonics for flags}. Numeric flags as mentionned above are |
|
obscure, error-prone, and quite rigid: should the authors |
|
want to adopt a new flag numbering scheme (for instance when noticing |
|
flags with the same meaning but different numeric values), it would break |
|
backward compatibility. The only advantage of explicit numeric values is that |
|
they are fast to type, so their use is only advised when using the calculator |
|
GP. |
|
|
|
As an alternative, one can replace a numeric flag by a character string |
|
containing symbolic identifiers. For a generic flag, the mnemonic |
|
corresponding to the numeric identifier is given after it as in (taken from |
|
description of $\tet{log}(x,\{\fl=0\})$): |
|
|
|
\centerline{If \fl\ is equal to $1 = \kbd{AGM}$, use an agm formula\dots} |
|
|
|
\noindent which means that one can use indifferently \kbd{log($x$, 1)} or |
|
\kbd{log($x$, AGM)}. |
|
|
|
For a binary flag, mnemonics corresponding to the various toggles are given |
|
after each of them. They can be negated by prepending \kbd{no\_} to the |
|
mnemonic, or by removing such a prefix. These toggles are grouped together |
|
using any punctuation character (such as ',' or ';'). For instance (taken |
|
from description of $\tet{ploth}(X=a,b,\var{expr},\{\fl=0\},\{n=0\})$) |
|
|
|
\centerline{Binary digits of flags mean: $1=\kbd{Parametric}$, |
|
$2=\kbd{Recursive}$, \dots} |
|
|
|
\noindent so that, instead of $1$, one could use the mnemonic |
|
\kbd{"Parametric; no\_Recursive"}, or simply \kbd{"Parametric"} since |
|
\kbd{Recursive} is unset by default (default value of $\fl$ is $0$, |
|
i.e.~everything unset). |
|
|
\misctitle{Pointers}.\sidx{pointer} If a parameter in the function |
\misctitle{Pointers}.\sidx{pointer} If a parameter in the function |
prototype is prefixed with a \& sign, as in |
prototype is prefixed with a \& sign, as in |
|
|
Line 71 to be typed in explicitly. As of version \vers, this \ |
|
Line 111 to be typed in explicitly. As of version \vers, this \ |
|
is optional for all documented functions, hence the \& will always appear |
is optional for all documented functions, hence the \& will always appear |
between brackets as in \kbd{issquare}$(x,\{\&e\})$. |
between brackets as in \kbd{issquare}$(x,\{\&e\})$. |
|
|
\misctitle{About library programming}. To finish with our generic |
\misctitle{About library programming}. |
simple-minded example, the \var{library} function \kbd{foo}, as defined |
the \var{library} function \kbd{foo}, as defined |
above, is seen to have two mandatory arguments, $x$ and \fl (no PARI |
at the beginning of this section, is seen to have two mandatory arguments, |
mathematical function has been implemented so as to accept a variable |
$x$ and \fl: no PARI mathematical function has been implemented so as to |
number of arguments). When not mentioned otherwise, the result and |
accept a variable number of arguments, so all arguments are mandatory when |
arguments of a function are assumed implicitly to be of type \kbd{GEN}. |
programming with the library (often, variants are provided corresponding to |
Most other functions return an object of type \kbd{long} integer in C (see |
the various flag values). When not mentioned otherwise, the result and |
Chapter~4). The variable or parameter names \var{prec} and \fl\ always |
arguments of a function are assumed implicitly to be of type \kbd{GEN}. Most |
denote \kbd{long} integers. |
other functions return an object of type \kbd{long} integer in C (see |
|
Chapter~4). The variable or parameter names \var{prec} and \fl\ always denote |
|
\kbd{long} integers. |
|
|
The \tet{entree} type is used by the library to implement iterators (loops, |
The \tet{entree} type is used by the library to implement iterators (loops, |
sums, integrals, etc.) when a formal variable has to successively assume a |
sums, integrals, etc.) when a formal variable has to successively assume a |
Line 137 integers, add \kbd{O(p\pow k)} to the result; finally, |
|
Line 179 integers, add \kbd{O(p\pow k)} to the result; finally, |
|
|
|
\syn{gdiv}{x,y} for $x$ \kbd{/} $y$. |
\syn{gdiv}{x,y} for $x$ \kbd{/} $y$. |
|
|
\subseckbd{\bs}: The expression $x$ \kbd{\bs} $y$ is the |
\subseckbd{\bs}: The expression \kbd{$x$ \bs\ $y$} is the \idx{Euclidean |
% keep "Euclidean" and "quotient" on same line for gphelp |
quotient} of $x$ and $y$. If $y$ is a real scalar, this is defined as |
\idx{Euclidean quotient} of $x$ and $y$. The types must be either both |
\kbd{floor($x$/$y$)} if $y > 0$, and \kbd{ceil($x$/$y$)} if $y < 0$ and |
integer or both polynomials. The result is the Euclidean quotient. In the |
the division is not exact. Hence the remainder \kbd{$x$ - ($x$\bs$y$)*$y$} |
case of integer division, the quotient is such that the corresponding |
is in $[0, |y|[$. |
remainder is non-negative. |
|
|
|
|
Note that when $y$ is an integer and $x$ a polynomial, $y$ is first promoted |
|
to a polynomial of degree $0$. When $x$ is a vector or matrix, the operator |
|
is applied componentwise. |
|
|
\syn{gdivent}{x,y} for $x$ \kbd{\bs} $y$. |
\syn{gdivent}{x,y} for $x$ \kbd{\bs} $y$. |
|
|
\subseckbd{\bs/}: The expression $x$ \b{/} $y$ is the Euclidean |
\subseckbd{\bs/}: The expression $x$ \b{/} $y$ evaluates to the rounded |
quotient of $x$ and $y$. The types must be either both integer or both |
\idx{Euclidean quotient} of $x$ and $y$. This is the same as \kbd{$x$ \bs\ $y$} |
polynomials. The result is the rounded Euclidean quotient. In the case of |
except for scalar division: the quotient is such that the corresponding |
integer division, the quotient is such that the corresponding remainder is |
remainder is smallest in absolute value and in case of a tie the quotient |
smallest in absolute value and in case of a tie the quotient closest to |
closest to $+\infty$ is chosen (hence the remainder would belong to |
$+\infty$ is chosen. |
$]-|y|/2, |y|/2]$). |
|
|
|
When $x$ is a vector or matrix, the operator is applied componentwise. |
|
|
\syn{gdivround}{x,y} for $x$ \b{/} $y$. |
\syn{gdivround}{x,y} for $x$ \b{/} $y$. |
|
|
\subseckbd{\%}: The expression $x$ \kbd{\%} $y$ is the |
\subseckbd{\%}: The expression \kbd{$x$ \% $y$} evaluates to the modular |
% keep "Euclidean" and "remainder" on same line for gphelp |
\idx{Euclidean remainder} of $x$ and $y$, which we now define. If $y$ is an |
\idx{Euclidean remainder} of $x$ and $y$. The modulus $y$ must be of type |
integer, this is the smallest non-negative integer congruent to $x$ modulo |
integer or polynomial. The result is the remainder, always non-negative in |
$y$. If $y$ is a polynomial, this is the polynomial of smallest degree |
the case of integers. Allowed dividend types are scalar exact types when |
congruent to $x$ modulo $y$. When $y$ is a non-integral real number, |
the modulus is an integer, and polynomials, polmods and rational functions |
\kbd{$x$\%$y$} is defined as \kbd{$x$ - ($x$\bs$y$)*$y$}. This |
when the modulus is a polynomial. |
coincides with the definition for $y$ integer if and only if $x$ is an |
|
integer, but still belongs to $[0, |y|[$. For instance: |
|
\bprog |
|
? (1/2) % 3 |
|
%1 = 2 |
|
? 0.5 % 3 |
|
*** forbidden division t_REAL % t_INT. |
|
? (1/2) % 3.0 |
|
%2 = 1/2 |
|
@eprog |
|
Note that when $y$ is an integer and $x$ a polynomial, $y$ is first promoted |
|
to a polynomial of degree $0$. When $x$ is a vector or matrix, the operator |
|
is applied componentwise. |
|
|
\syn{gmod}{x,y} for $x$ \kbd{\%} $y$. |
\syn{gmod}{x,y} for $x$ \kbd{\%} $y$. |
|
|
\subsecidx{divrem}$(x,y)$: creates a column vector with two components, |
\subsecidx{divrem}$(x,y,\{v\})$: creates a column vector with two components, |
the first being the Euclidean quotient, the second the Euclidean remainder, |
the first being the Euclidean quotient (\kbd{$x$ \bs\ $y$}), the second the |
of the division of $x$ by $y$. This avoids the need to do two divisions if |
Euclidean remainder (\kbd{$x$ - ($x$\bs$y$)*$y$}), of the division of $x$ by |
one needs both the quotient and the remainder. The arguments must be both |
$y$. This avoids the need to do two divisions if one needs both the quotient |
integers or both polynomials; in the case of integers, the remainder is |
and the remainder. If $v$ is present, and $x$, $y$ are multivariate |
non-negative. |
polynomials, divide with respect to the variable $v$. |
|
|
\syn{gdiventres}{x,y}. |
Beware that \kbd{divrem($x$,$y$)[2]} is in general not the same as |
|
\kbd{$x$ \% $y$}; there is no operator to obtain it in GP: |
|
\bprog |
|
? divrem(1/2, 3)[2] |
|
%1 = 1/2 |
|
? (1/2) % 3 |
|
%2 = 2 |
|
? divrem(Mod(2,9), 3)[2] |
|
*** forbidden division t_INTMOD \ t_INT. |
|
? Mod(2,9) % 6 |
|
%3 = Mod(2,3) |
|
@eprog |
|
|
|
\syn{divrem}{x,y,v},where $v$ is a \kbd{long}. Also available as |
|
$\teb{gdiventres}(x,y)$ when $v$ is not needed. |
|
|
\subseckbd{\pow}: The expression $x\hbox{\kbd{\pow}}n$ is \idx{powering}. |
\subseckbd{\pow}: The expression $x\hbox{\kbd{\pow}}n$ is \idx{powering}. |
If the exponent is an integer, then exact operations are performed using |
If the exponent is an integer, then exact operations are performed using |
binary (left-shift) powering techniques. In particular, in this case $x$ |
binary (left-shift) powering techniques. In particular, in this case $x$ |
|
|
|
|
\syn{gpow}{x,n,\var{prec}} for $x\hbox{\kbd{\pow}}n$. |
\syn{gpow}{x,n,\var{prec}} for $x\hbox{\kbd{\pow}}n$. |
|
|
\subsecidx{shift}$(x,n)$ or $x$ \kbd{<<} $n$ (= $x$ \kbd{>>} $(-n)$): shifts |
\subsecidx{shift}$(x,n,\{\fl=0\})$ or $x$ \kbd{<<} $n$ (= $x$ \kbd{>>} $(-n)$): |
$x$ componentwise left by $n$ bits if $n\ge0$ and right by $|n|$ bits if |
shifts $x$ componentwise left by $n$ bits if $n\ge0$ and right by $|n|$ bits |
$n<0$. A left shift by $n$ corresponds to multiplication by $2^n$. A right |
if $n<0$. A left shift by $n$ corresponds to multiplication by $2^n$. A right |
shift of an integer $x$ by $|n|$ corresponds to a Euclidean division of |
shift of an integer $x$ by $|n|$ corresponds to a Euclidean division of $x$ |
$x$ by $2^{|n|}$ with a |
by $2^{|n|}$ with a remainder of the same sign as $x$, hence is not the same |
remainder of the same sign as $x$, hence is not the same (in general) as |
(when $x < 0$) as $x \kbd{\bs} 2^{|n|}$. If $\fl$ is non-zero, this behaviour |
$x \kbd{\bs} 2^n$. |
is modified and right shift of a negative $x$ \var{is} the same as $x |
|
\kbd{\bs} 2^{|n|}$ (which is consistent with $2$-complement semantic of |
|
negative numbers). |
|
|
\syn{gshift}{x,n} where $n$ is a \kbd{long}. |
\syn{gshift3}{x,n,\fl} where $n$ is a \kbd{long}. Also available is |
|
$\teb{gshift}(x,n)$ for the case $\fl=0$. |
|
|
\subsecidx{shiftmul}$(x,n)$: multiplies $x$ by $2^n$. The difference with |
\subsecidx{shiftmul}$(x,n)$: multiplies $x$ by $2^n$. The difference with |
\kbd{shift} is that when $n<0$, ordinary division takes place, hence for |
\kbd{shift} is that when $n<0$, ordinary division takes place, hence for |
Line 266 Also, \kbd{<>} is accepted as a synonym for \kbd{!=}. |
|
Line 342 Also, \kbd{<>} is accepted as a synonym for \kbd{!=}. |
|
assignment statement. |
assignment statement. |
|
|
\subsecidx{lex}$(x,y)$: gives the result of a lexicographic comparison |
\subsecidx{lex}$(x,y)$: gives the result of a lexicographic comparison |
between $x$ and $y$. This is to be interpreted in quite a wide sense. For |
between $x$ and $y$ (as $-1$, $0$ or $1$). This is to be interpreted in quite |
example, the vector $[1,3]$ will be considered smaller than the longer |
a wide sense: It is admissible to compare objects of different types |
vector $[1,3,-1]$ (but of course larger than $[1,2,5]$), |
(scalars, vectors, matrices), provided the scalars can be compared, as well |
i.e.~\kbd{lex([1,3], [1,3,-1])} will return $-1$. |
as vectors/matrices of different lengths. The comparison is recursive. |
|
|
|
In case all components are equal up to the smallest length of the operands, |
|
the more complex is considered to be larger. More precisely, the longest is |
|
the largest; when lengths are equal, we have matrix $>$ vector $>$ scalar. |
|
For example: |
|
\bprog |
|
? lex([1,3], [1,2,5]) |
|
%1 = 1 |
|
? lex([1,3], [1,3,-1]) |
|
%2 = -1 |
|
? lex([1], [[1]]) |
|
%3 = -1 |
|
? lex([1], [1]~) |
|
%4 = 0 |
|
@eprog |
|
|
\syn{lexcmp}{x,y}. |
\syn{lexcmp}{x,y}. |
|
|
\subsecidx{sign}$(x)$: \idx{sign} ($0$, $1$ or $-1$) of $x$, which must be of |
\subsecidx{sign}$(x)$: \idx{sign} ($0$, $1$ or $-1$) of $x$, which must be of |
Line 359 i.e.~it chops off the $O(X^k)$. If $x$ is a vector, th |
|
Line 450 i.e.~it chops off the $O(X^k)$. If $x$ is a vector, th |
|
the polynomial whose coefficients are given in $x$, with $x[1]$ being the |
the polynomial whose coefficients are given in $x$, with $x[1]$ being the |
leading coefficient (which can be zero). |
leading coefficient (which can be zero). |
|
|
Warning: this is \var{not} a substitution function. It is intended to be |
\misctitle{Warning:} this is \var{not} a substitution function. It is |
quick and dirty. So if you try \kbd{Pol(a,y)} on the polynomial \kbd{a = x+y}, |
intended to be quick and dirty. So if you try \kbd{Pol(a,y)} on the |
you will get \kbd{y+y}, which is not a valid PARI object. |
polynomial \kbd{a = x+y}, you will get \kbd{y+y}, which is not a valid PARI |
|
object. |
|
|
\syn{gtopoly}{x,v}, where $v$ is a variable number. |
\syn{gtopoly}{x,v}, where $v$ is a variable number. |
|
|
Line 479 Negative numbers behave as if modulo a huge power of $ |
|
Line 571 Negative numbers behave as if modulo a huge power of $ |
|
|
|
\syn{gbitnegimply}{x,y}. |
\syn{gbitnegimply}{x,y}. |
|
|
\subsecidx{bitor}$(x,y)$: bitwise (inclusive) \tet{or}\sidx{bitwise |
\subsecidx{bitor}$(x,y)$: \sidx{bitwise inclusive or}bitwise (inclusive) |
inclusive or} of two integers $x$ and $y$, that is the integer |
\tet{or} of two integers $x$ and $y$, that is the integer |
$$\sum (x_i~\kbd{or}~y_i) 2^i$$ |
$$\sum (x_i~\kbd{or}~y_i) 2^i$$ |
|
|
Negative numbers behave as if modulo a huge power of $2$. |
Negative numbers behave as if modulo a huge power of $2$. |
|
|
\syn{gbitor}{x,y}. |
\syn{gbitor}{x,y}. |
|
|
\subsecidx{bittest}$(x,n)$: outputs the $n^{\text{th}}$ bit of $|x|$ starting |
\subsecidx{bittest}$(x,n,\{c=1\})$: extracts $|c|$ bits starting from |
from the right (i.e.~the coefficient of $2^n$ in the binary expansion of $x$). |
number $n$ from the right in the development of $|x|$ (i.e.~the coefficient |
The result is 0 or 1. To extract several bits at once as a vector, pass a |
of $2^n$ in the binary expansion of $x$), returning the bits as an integer |
vector for $n$. |
bitmap. That is, if $x = \sum x_i 2^i$ with the $x_i$ in $\{0,1\}$, this |
|
routine returns the integer |
|
$$ \sum_{0\leq i < |c|} x_{n + i} 2^i $$ |
|
Bits at negative offsets are 0. A negative value of $c$ means that negative |
|
values of $x$ are treated in the spirit of $2$-complement arithmetic (i.e |
|
modulo a big power of $2$). To extract several bits (or groups of bits if |
|
$|c|>1$) separately at once as a vector, pass a vector for $n$. |
|
|
\syn{bittest}{x,n}, where $n$ and the result are \kbd{long}s. |
\syn{gbittest3}{x,n,c}. Also available are $\teb{gbittest}(x,n)$ |
|
(default case $c=1$) and for simple cases $\teb{bittest}(x,n)$, where $n$ |
|
and the result are \kbd{long}s. |
|
|
\subsecidx{bitxor}$(x,y)$: bitwise (exclusive) \tet{or}\sidx{bitwise |
\subsecidx{bitxor}$(x,y)$: bitwise (exclusive) \tet{or}\sidx{bitwise |
exclusive or} of two integers $x$ and $y$, that is the integer |
exclusive or} of two integers $x$ and $y$, that is the integer |
Line 633 the degree of a polynomial is equal to its length minu |
|
Line 733 the degree of a polynomial is equal to its length minu |
|
|
|
\subsecidx{lift}$(x,\{v\})$: lifts an element $x=a \bmod n$ of $\Z/n\Z$ to |
\subsecidx{lift}$(x,\{v\})$: lifts an element $x=a \bmod n$ of $\Z/n\Z$ to |
$a$ in $\Z$, and similarly lifts a polmod to a polynomial if $v$ is omitted. |
$a$ in $\Z$, and similarly lifts a polmod to a polynomial if $v$ is omitted. |
Otherwise, lifts only polmods with main variable $v$ (if $v$ does not occur |
Otherwise, lifts only polmods whose modulus has main variable $v$ (if $v$ |
in $x$, lifts only intmods). If $x$ is of type fraction, complex, quadratic, |
does not occur in $x$, lifts only intmods). If $x$ is of recursive (non |
polynomial, power series, rational function, vector or matrix, the lift is |
modular) type, the lift is done coefficientwise. For $p$-adics, this routine |
done for each coefficient. For $p$-adics, this routine acts as |
acts as \tet{truncate}. It is not allowed to have $x$ of type \typ{REAL}. |
\tet{truncate}. It is not allowed to have $x$ of type \typ{REAL}. |
|
|
|
|
\bprog |
|
? lift(Mod(5,3)) |
|
%1 = 2 |
|
? lift(3 + O(3^9)) |
|
%2 = 3 |
|
? lift(Mod(x,x^2+1)) |
|
%3 = x |
|
? lift(x * Mod(1,3) + Mod(2,3)) |
|
%4 = x + 2 |
|
? lift(x * Mod(y,y^2+1) + Mod(2,3)) |
|
%5 = y*x + Mod(2, 3) \\@com do you understand this one ? |
|
? lift(x * Mod(y,y^2+1) + Mod(2,3), x) |
|
%6 = Mod(y, y^2+1) * x + Mod(2, y^2+1) |
|
@eprog |
|
|
\syn{lift0}{x,v}, where $v$ is a \kbd{long} and an omitted $v$ is coded as |
\syn{lift0}{x,v}, where $v$ is a \kbd{long} and an omitted $v$ is coded as |
$-1$. Also available is \teb{lift}$(x)$ = \kbd{lift0($x$,-1)}. |
$-1$. Also available is \teb{lift}$(x)$ = \kbd{lift0($x$,-1)}. |
|
|
|
|
|
|
\subsecidx{besselk}$(\var{nu},x,\{\fl=0\})$: $K$-Bessel function of index |
\subsecidx{besselk}$(\var{nu},x,\{\fl=0\})$: $K$-Bessel function of index |
\var{nu} (which can be complex) and argument $x$. Only real and positive |
\var{nu} (which can be complex) and argument $x$. Only real and positive |
arguments |
arguments $x$ are allowed in the present version \vers. If $\fl$ is equal to |
$x$ are allowed in the present version \vers. If $\fl$ is equal to 1, |
1, uses another implementation of this function which is often faster. In the |
uses another implementation of this function which is often faster. |
present version \vers, this function is not very accurate when $x$ is small. |
|
|
\syn{kbessel}{\var{nu},x,\var{prec}} and |
\syn{kbessel}{\var{nu},x,\var{prec}} and |
$\teb{kbessel2}(\var{nu},x,\var{prec})$ respectively. |
$\teb{kbessel2}(\var{nu},x,\var{prec})$ respectively. |
Line 1047 repeatedly calling \kbd{eint1($i$ * x)}. |
|
Line 1161 repeatedly calling \kbd{eint1($i$ * x)}. |
|
$\teb{eint1}(x,\var{prec})$. |
$\teb{eint1}(x,\var{prec})$. |
|
|
\subsecidx{erfc}$(x)$: complementary error function |
\subsecidx{erfc}$(x)$: complementary error function |
$(2/\sqrt\pi)\int_x^\infty e^{-t^2}\,dt$. |
$(2/\sqrt\pi)\int_x^\infty e^{-t^2}\,dt$ ($x\in\R$). |
|
|
\syn{erfc}{x,\var{prec}}. |
\syn{erfc}{x,\var{prec}}. |
|
|
Line 1111 $\ln(p)=0$. Hence in particular $\exp(\ln(x))/x$ will |
|
Line 1225 $\ln(p)=0$. Hence in particular $\exp(\ln(x))/x$ will |
|
equal to 1 but to a $(p-1)$-th root of unity (or $\pm1$ if $p=2$) |
equal to 1 but to a $(p-1)$-th root of unity (or $\pm1$ if $p=2$) |
times a power of $p$. |
times a power of $p$. |
|
|
If $\fl$ is equal to 1, use an agm formula suggested by Mestre, when $x$ is |
If $\fl$ is equal to $1 = \kbd{AGM}$, use an agm formula suggested by Mestre, |
real, otherwise identical to \kbd{log}. |
when $x$ is real, otherwise identical to \kbd{log}. |
|
|
\syn{glog}{x,\var{prec}} or $\teb{glogagm}(x,\var{prec})$. |
\syn{glog}{x,\var{prec}} or $\teb{glogagm}(x,\var{prec})$. |
|
|
Line 1370 Here $y$ must be an integer, but $x$ can be any PARI o |
|
Line 1484 Here $y$ must be an integer, but $x$ can be any PARI o |
|
|
|
\syn{binome}{x,y}, where $y$ must be a \kbd{long}. |
\syn{binome}{x,y}, where $y$ must be a \kbd{long}. |
|
|
\subsecidx{chinese}$(x,y)$: if $x$ and $y$ are both integermods or both |
\subsecidx{chinese}$(x,\{y\})$: if $x$ and $y$ are both integermods or both |
polmods, creates (with the same type) a $z$ in the same residue class |
polmods, creates (with the same type) a $z$ in the same residue class |
as $x$ and in the same residue class as $y$, if it is possible. |
as $x$ and in the same residue class as $y$, if it is possible. |
|
|
This function also allows vector and matrix arguments, in which case the |
This function also allows vector and matrix arguments, in which case the |
operation is recursively applied to each component of the vector or matrix. |
operation is recursively applied to each component of the vector or matrix. |
For polynomial arguments, it is applied to each coefficient. Finally |
For polynomial arguments, it is applied to each coefficient. |
$\kbd{chinese}(x,x) = x$ regardless of the type of $x$; this allows vector |
|
arguments to contain other data, so long as they are identical in both |
If $y$ is omitted, and $x$ is a vector, \kbd{chinese} is applied recursively |
|
to the components of $x$, yielding a residue belonging to the same class as all |
|
components of $x$. |
|
|
|
Finally $\kbd{chinese}(x,x) = x$ regardless of the type of $x$; this allows |
|
vector arguments to contain other data, so long as they are identical in both |
vectors. |
vectors. |
|
|
\syn{chinois}{x,y}. |
\syn{chinois}{x,y}. |
|
|
\subsecidx{content}$(x)$: computes the gcd of all the coefficients of $x$, |
\subsecidx{content}$(x)$: computes the gcd of all the coefficients of $x$, |
when this gcd makes sense. If $x$ is a scalar, this simply returns $x$. If $x$ |
when this gcd makes sense. If $x$ is a scalar, this simply returns the |
is a polynomial (and by extension a power series), it gives the usual content |
absolute value of $x$ if $x$ is rationnal (\typ{INT}, \typ{FRAC} or |
of $x$. If $x$ is a rational function, it gives the ratio of the contents of |
\typ{FRACN}), and $x$ otherwise. If $x$ is a polynomial (and by extension a |
the numerator and the denominator. Finally, if $x$ is a vector or a matrix, |
power series), it gives the usual content of $x$. If $x$ is a rational |
it gives the gcd of all the entries. |
function, it gives the ratio of the contents of the numerator and the |
|
denominator. Finally, if $x$ is a vector or a matrix, it gives the gcd of all |
|
the entries. |
|
|
\syn{content}{x}. |
\syn{content}{x}. |
|
|
\subsecidx{contfrac}$(x,\{b\},\{lmax\})$: creates the row vector whose |
\subsecidx{contfrac}$(x,\{b\},\{nmax\})$: creates the row vector whose |
components are the partial quotients of the \idx{continued fraction} |
components are the partial quotients of the \idx{continued fraction} |
expansion of $x$, the number of partial quotients being limited to $lmax$. |
expansion of $x$. That is a result $[a_0,\dots,a_n]$ means that |
If $x$ is a real number, the expansion stops at the last significant partial |
$x \approx a_0+1/(a_1+\dots+1/a_n)\dots)$. The output is normalized so that |
quotient if $lmax$ is omitted. $x$ can also be a rational function or a power |
$a_n \neq 1$ (unless we also have $n = 0$). |
series. |
|
|
|
|
The number of partial quotients $n$ is limited to $nmax$. If $x$ is a real |
|
number, the expansion stops at the last significant partial quotient if $nmax$ |
|
is omitted. $x$ can also be a rational function or a power series. |
|
|
If a vector $b$ is supplied, the numerators will be equal to the coefficients |
If a vector $b$ is supplied, the numerators will be equal to the coefficients |
of $b$. The length of the result is then equal to the length of $b$, unless a |
of $b$ (instead of all equal to $1$ as above). The length of the result is |
partial remainder is encountered which is equal to zero. In which case the |
then equal to the length of $b$, unless a partial remainder is encountered |
expansion stops. In the case of real numbers, the stopping criterion is thus |
which is equal to zero, in which case the expansion stops. In the case of real |
different from the one mentioned above since, if $b$ is too long, some partial |
numbers, the stopping criterion is thus different from the one mentioned above |
quotients may not be significant. |
since, if $b$ is too long, some partial quotients may not be significant. |
|
|
If $b$ is an integer, the command is understood as \kbd{contfrac($x,lmax$)}. |
If $b$ is an integer, the command is understood as \kbd{contfrac($x,nmax$)}. |
|
|
\syn{contfrac0}{x,b,lmax}. Also available are |
\syn{contfrac0}{x,b,nmax}. Also available are |
$\teb{gboundcf}(x,lmax)$, $\teb{gcf}(x)$, or $\teb{gcf2}(b,x)$, where $lmax$ |
$\teb{gboundcf}(x,nmax)$, $\teb{gcf}(x)$, or $\teb{gcf2}(b,x)$, where $nmax$ |
is a C integer. |
is a C integer. |
|
|
\subsecidx{contfracpnqn}$(x)$: when $x$ is a vector or a one-row matrix, $x$ |
\subsecidx{contfracpnqn}$(x)$: when $x$ is a vector or a one-row matrix, $x$ |
Line 1522 Also available are |
|
Line 1646 Also available are |
|
$\teb{factor}(x)$ (= $\teb{factor0}(x,-1)$), |
$\teb{factor}(x)$ (= $\teb{factor0}(x,-1)$), |
$\teb{smallfact}(x)$ (= $\teb{factor0}(x,0)$). |
$\teb{smallfact}(x)$ (= $\teb{factor0}(x,0)$). |
|
|
\subsecidx{factorback}$(f,\{nf\})$: $f$ being any factorization, gives back |
\subsecidx{factorback}$(f,\{e\},\{nf\})$: gives back the factored object |
the factored object. If a second argument $\var{nf}$ is supplied, $f$ is |
corresponding to a factorization. If the last argument is of number field |
assumed to be a prime ideal factorization in the number field $\var{nf}$. |
type (e.g.~created by \kbd{nfinit} or \kbd{bnfinit}), assume we are dealing |
The resulting ideal is given in HNF\sidx{Hermite normal form} form. |
with an ideal factorization in the number field. The resulting ideal product is |
|
given in HNF\sidx{Hermite normal form} form. |
|
|
\syn{factorback}{f,\var{nf}}, where an omitted |
If $e$ is present, $e$ and $f$ must be vectors of the same length ($e$ being |
|
integral), and the corresponding factorization is the product of the |
|
$f[i]^{e[i]}$. |
|
|
|
If not, and $f$ is vector, it is understood as in the preceding case with |
|
$e$ a vector of 1 (the product of the $f[i]$ is returned). Finally, |
|
$f$ can be a regular factorization, as produced with any \kbd{factor} |
|
command. A few examples: |
|
\bprog |
|
? factorback([2,2; 3,1]) |
|
%1 = 12 |
|
? factorback([2,2], [3,1]) |
|
%2 = 12 |
|
? factorback([5,2,3]) |
|
%3 = 30 |
|
? factorback([2,2], [3,1], nfinit(x^3+2)) |
|
%4 = |
|
[16 0 0] |
|
|
|
[0 16 0] |
|
|
|
[0 0 16] |
|
? nf = nfinit(x^2+1); fa = idealfactor(nf, 10) |
|
%5 = |
|
[[2, [1, 1]~, 2, 1, [1, 1]~] 2] |
|
|
|
[[5, [-2, 1]~, 1, 1, [2, 1]~] 1] |
|
|
|
[[5, [2, 1]~, 1, 1, [-2, 1]~] 1] |
|
? factorback(fa) |
|
*** forbidden multiplication t_VEC * t_VEC. |
|
? factorback(fa, nf) |
|
%6 = |
|
[10 0] |
|
|
|
[0 10] |
|
|
|
@eprog |
|
In the fourth example, $2$ and $3$ are interpreted as principal ideals in a |
|
cubic field. In the fifth one, \kbd{factorback(fa)} is meaningless since we |
|
forgot to indicate the number field, and the entries in the first column of |
|
\kbd{fa} can't be multiplied. |
|
|
|
\syn{factorback0}{f,e,\var{nf}}, where an omitted |
|
$\var{nf}$ or $e$ is entered as \kbd{NULL}. Also available is |
|
\tet{factorback}$(f,\var{nf})$ (case $e = \kbd{NULL}$) where an omitted |
$\var{nf}$ is entered as \kbd{NULL}. |
$\var{nf}$ is entered as \kbd{NULL}. |
|
|
\subsecidx{factorcantor}$(x,p)$: factors the polynomial $x$ modulo the |
\subsecidx{factorcantor}$(x,p)$: factors the polynomial $x$ modulo the |
Line 1607 $\teb{simplefactmod}(x,p)$ (= $\teb{factormod}(x,p,1)$ |
|
Line 1777 $\teb{simplefactmod}(x,p)$ (= $\teb{factormod}(x,p,1)$ |
|
\subsecidx{ffinit}$(p,n,\{v=x\})$: computes a monic polynomial of degree |
\subsecidx{ffinit}$(p,n,\{v=x\})$: computes a monic polynomial of degree |
$n$ which is irreducible over $\F_p$. For instance if |
$n$ which is irreducible over $\F_p$. For instance if |
\kbd{P = ffinit(3,2,y)}, you can represent elements in $\F_{3^2}$ as polmods |
\kbd{P = ffinit(3,2,y)}, you can represent elements in $\F_{3^2}$ as polmods |
modulo \kbd{P}. |
modulo \kbd{P}. Starting with version 2.2.3 this function use a fast variant |
|
of Adleman--Lenstra algorithm, and is much faster than in earlier versions. |
|
|
\syn{ffinit}{p,n,v}, where $v$ is a variable number. |
\syn{ffinit}{p,n,v}, where $v$ is a variable number. |
|
|
\subsecidx{gcd}$(x,y,\{\fl=0\})$: creates the greatest common divisor of $x$ |
\subsecidx{gcd}$(x,\{y\},\{\fl=0\})$: creates the greatest common divisor of $x$ |
and $y$. $x$ and $y$ can be of quite general types, for instance both |
and $y$. $x$ and $y$ can be of quite general types, for instance both |
rational numbers. Vector/matrix types are also accepted, in which case |
rational numbers. Vector/matrix types are also accepted, in which case |
the GCD is taken recursively on each component. Note that for these |
the GCD is taken recursively on each component. Note that for these |
types, \kbd{gcd} is not commutative. |
types, \kbd{gcd} is not commutative. \fl\ is obsolete and should not be used. |
|
|
If $\fl=0$, use \idx{Euclid}'s algorithm. |
If $y$ is omitted and $x$ is a vector, return the $\text{gcd}$ of all |
|
components of $x$. The algorithm used is a naive \idx{Euclid} except for the |
|
following inputs: |
|
|
If $\fl=1$, use the modular gcd algorithm ($x$ and $y$ have to be |
$\bullet$ integers: use modified right-shift binary (``plus-minus'' |
polynomials, with integer coefficients). |
variant). |
|
|
If $\fl=2$, use the \idx{subresultant algorithm}. |
$\bullet$ univariate polynomials with coeffients in the same number |
|
field (in particular rational): use modular gcd algorithm. |
|
|
\syn{gcd0}{x,y,\fl}. Also available are |
$\bullet$ general polynomials: use the \idx{subresultant algorithm} if |
$\teb{ggcd}(x,y)$, $\teb{modulargcd}(x,y)$, and $\teb{srgcd}(x,y)$ |
coefficient explosion is likely (exact, non modular, coefficients). |
corresponding to $\fl=0$, $1$ and $2$ respectively. |
|
|
|
|
\syn{ggcd}{x,y}. For general polynomial inputs, $\teb{srgcd}(x,y)$ is also |
|
available. For univariate {\it rational} polynomials, one also has |
|
$\teb{modulargcd}(x,y)$. |
|
|
\subsecidx{hilbert}$(x,y,\{p\})$: \idx{Hilbert symbol} of $x$ and $y$ modulo |
\subsecidx{hilbert}$(x,y,\{p\})$: \idx{Hilbert symbol} of $x$ and $y$ modulo |
$p$. If $x$ and $y$ are of type integer or fraction, an explicit third |
$p$. If $x$ and $y$ are of type integer or fraction, an explicit third |
parameter $p$ must be supplied, $p=0$ meaning the place at infinity. |
parameter $p$ must be supplied, $p=0$ meaning the place at infinity. |
Otherwise, $p$ needs not be given, and $x$ and $y$ can be of compatible types |
Otherwise, $p$ needs not be given, and $x$ and $y$ can be of compatible types |
integer, fraction, real, integermod or $p$-adic. |
integer, fraction, real, integermod a prime (result is undefined if the |
|
modulus is not prime), or $p$-adic. |
|
|
\syn{hil}{x,y,p}. |
\syn{hil}{x,y,p}. |
|
|
Line 1643 discriminant of a quadratic field, false (0) otherwise |
|
Line 1821 discriminant of a quadratic field, false (0) otherwise |
|
simpler function $\teb{isfundamental}(x)$ which returns a \kbd{long} |
simpler function $\teb{isfundamental}(x)$ which returns a \kbd{long} |
should be used if $x$ is known to be of type integer. |
should be used if $x$ is known to be of type integer. |
|
|
\subsecidx{isprime}$(x,\{\fl=0\})$: if $\fl=0$ (default), true (1) if $x$ is a strong pseudo-prime |
\subsecidx{isprime}$(x,\{\fl=0\})$: true (1) if $x$ is a (proven) prime |
for 10 randomly chosen bases, false (0) otherwise. |
number, false (0) otherwise. This can be very slow when $x$ is indeed |
|
prime and has more than $1000$ digits, say. Use \tet{ispseudoprime} to |
|
quickly check for pseudo primality. |
|
|
If $\fl=1$, use Pocklington-Lehmer ``P-1'' test. true (1) if $x$ is |
If $\fl=0$, use a combination of Baillie-PSW pseudo primality test (see |
prime, false (0) otherwise. |
\tet{ispseudoprime}), Selfridge ``$p-1$'' test if $x-1$ is smooth enough, and |
|
Adleman-Pomerance-Rumely-Cohen-Lenstra (APRCL) for general $x$. |
|
|
If $\fl=2$, use Pocklington-Lehmer ``P-1'' test and output a primality |
If $\fl=1$, use Selfridge-Pocklington-Lehmer ``$p-1$'' test and output a |
certificate as follows: return 0 if $x$ is composite, 1 if $x$ is a |
primality certificate as follows: return 0 if $x$ is composite, 1 if $x$ is |
small prime (currently strictly less than $341 550 071 728 321$), and |
small enough that passing Baillie-PSW test guarantees its primality |
a matrix if $x$ is a large prime. The matrix has three columns. The |
(currently $x < 10^{13}$), $2$ if $x$ is a large prime whose primality could |
first contains the prime factors $p$, the second the corresponding |
only sensibly be proven (given the algorithms implemented in PARI) using the |
elements $a_p$ as in Proposition~8.3.1 in GTM~138, and the third the |
APRCL test. Otherwise ($x$ is large and $x-1$ is smooth) output a three |
output of isprime(p,2). |
column matrix as a primality certificate. The first column contains the prime |
|
factors $p$ of $x-1$, the second the corresponding elements $a_p$ as in |
|
Proposition~8.3.1 in GTM~138, and the third the output of isprime(p,1). The |
|
algorithm fails if one of the pseudo-prime factors is not prime, which is |
|
exceedingly unlikely (and well worth a bug report). |
|
|
In the two last cases, the algorithm fails if one of the (strong |
If $\fl=2$, use APRCL. |
pseudo-)prime factors is not prime, but it should be exceedingly rare. |
|
|
|
|
|
\syn{gisprime}{x,\fl}, but the simpler function $\teb{isprime}(x)$ |
\syn{gisprime}{x,\fl}, but the simpler function $\teb{isprime}(x)$ |
which returns a \kbd{long} should be used if $x$ is known to be of |
which returns a \kbd{long} should be used if $x$ is known to be of |
type integer. Also available is $\teb{plisprime}(N,\fl)$, |
|
corresponding to $\teb{gisprime}(x,\fl+1)$ if $x$ is known to be of |
|
type integer. |
type integer. |
|
|
|
|
\subsecidx{ispseudoprime}$(x)$: true (1) if $x$ is a strong |
\subsecidx{ispseudoprime}$(x,\{\fl\})$: true (1) if $x$ is a strong pseudo |
pseudo-prime for a randomly chosen base, false (0) otherwise. |
prime (see below), false (0) otherwise. If this function returns false, $x$ |
|
is not prime; if, on the other hand it returns true, it is only highly likely |
|
that $x$ is a prime number. Use \tet{isprime} (which is of course much |
|
slower) to prove that $x$ is indeed prime. |
|
|
\syn{gispsp}{x}, but the |
If $\fl = 0$, checks whether $x$ is a Baillie-Pomerance-Selfridge-Wagstaff |
simpler function $\teb{ispsp}(x)$ which returns a \kbd{long} |
pseudo prime (strong Rabin-Miller pseudo prime for base $2$, with |
should be used if $x$ is known to be of type integer. |
end-matching to catch square roots of $-1$, followed by strong Lucas test for |
|
the sequence $(P,-1)$, $P$ smallest positive integer such that $P^2 - 4$ is |
|
not a square mod $x$). |
|
|
|
There are no known composite numbers passing this test, although it is |
|
expected that infinitely such numbers exist. |
|
|
|
If $\fl > 0$, checks whether $x$ is a strong Miller-Rabin pseudo prime (with |
|
end-matching) for $\fl$ randomly chosen bases. |
|
|
|
\syn{gispseudoprime}{x,\fl}, but the simpler function $\teb{ispseudoprime}(x)$ |
|
which returns a \kbd{long} should be used if $x$ is known to be of type |
|
integer. |
|
|
\subsecidx{issquare}$(x,\{\&n\})$: true (1) if $x$ is square, false (0) if |
\subsecidx{issquare}$(x,\{\&n\})$: true (1) if $x$ is square, false (0) if |
not. $x$ can be of any type. If $n$ is given and an exact square root had to |
not. $x$ can be of any type. If $n$ is given and an exact square root had to |
be computed in the checking process, puts that square root in $n$. This is in |
be computed in the checking process, puts that square root in $n$. This is in |
Line 1700 must be of type integer. |
|
Line 1896 must be of type integer. |
|
|
|
\syn{kronecker}{x,y}, the result ($0$ or $\pm 1$) is a \kbd{long}. |
\syn{kronecker}{x,y}, the result ($0$ or $\pm 1$) is a \kbd{long}. |
|
|
\subsecidx{lcm}$(x,y)$: least common multiple of $x$ and $y$, i.e.~such |
\subsecidx{lcm}$(x,\{y\})$: least common multiple of $x$ and $y$, i.e.~such |
that $\text{lcm}(x,y)*\text{gcd}(x,y)=\text{abs}(x*y)$. |
that $\text{lcm}(x,y)*\text{gcd}(x,y)=\text{abs}(x*y)$. |
|
|
|
If $y$ is omitted and $x$ is a vector, return the $\text{lcm}$ of all |
|
components of $x$. |
|
|
\syn{glcm}{x,y}. |
\syn{glcm}{x,y}. |
|
|
\subsecidx{moebius}$(x)$: \idx{Moebius} $\mu$-function of $|x|$. $x$ must |
\subsecidx{moebius}$(x)$: \idx{Moebius} $\mu$-function of $|x|$. $x$ must |
Line 1717 this function returns $x$ and not the smallest prime s |
|
Line 1916 this function returns $x$ and not the smallest prime s |
|
\syn{nextprime}{x}. |
\syn{nextprime}{x}. |
|
|
\subsecidx{numdiv}$(x)$: number of divisors of $|x|$. $x$ must be of type |
\subsecidx{numdiv}$(x)$: number of divisors of $|x|$. $x$ must be of type |
integer, and the result is a \kbd{long}. |
integer. |
|
|
\syn{numbdiv}{x}. |
\syn{numbdiv}{x}. |
|
|
Line 1743 are the first $x$ prime numbers, which must be among t |
|
Line 1942 are the first $x$ prime numbers, which must be among t |
|
|
|
\syn{primes}{x}. $x$ must be a \kbd{long}. |
\syn{primes}{x}. $x$ must be a \kbd{long}. |
|
|
\subsecidx{qfbclassno}$(x,\{\fl=0\})$: class number of the quadratic field |
\subsecidx{qfbclassno}$(D,\{\fl=0\})$: ordinary class number of the quadratic |
of discriminant $x$. In the present version \vers, a simple algorithm is used |
order of discriminant $D$. In the present version \vers, a $O(D^{1/2})$ |
for $x>0$, so $x$ should not be too large (say $x<10^7$) for the time to be |
algorithm is used for $D > 0$ (using Euler product and the functional |
reasonable. On the other hand, for $x<0$ one can reasonably compute |
equation) so $D$ should not be too large, say $D < 10^8$, for the time to be |
classno($x$) for $|x|<10^{25}$, since the method used is \idx{Shanks}' method |
reasonable. On the other hand, for $D < 0$ one can reasonably compute |
which is in $O(|x|^{1/4})$. For larger values of $|D|$, see |
\kbd{qfbclassno($D$)} for $|D|<10^{25}$, since the routine uses |
\kbd{quadclassunit}. |
\idx{Shanks}'method which is in $O(|D|^{1/4})$. For larger values of $|D|$, |
|
see \kbd{quadclassunit}, which unfortunately works reliably only for |
|
fundamental discriminants. |
|
|
If $\fl=1$, compute the class number using \idx{Euler product}s and the |
If $\fl=1$, compute the class number using \idx{Euler product}s and the |
functional equation. However, it is in $O(|x|^{1/2})$. |
functional equation. However, it is in $O(|D|^{1/2})$. |
|
|
\misctitle{Important warning.} For $D<0$, this function often gives |
\misctitle{Important warning.} For $D < 0$, this function often gives |
incorrect results when the class group is non-cyclic, because the authors |
incorrect results when the class group is non-cyclic, because the authors |
were too lazy to implement \idx{Shanks}' method completely. It is therefore |
were too lazy to implement \idx{Shanks}' method completely. It is therefore |
strongly recommended to use either the version with $\fl=1$, the function |
strongly recommended to use either the version with $\fl = 1$, the function |
$\kbd{qfhclassno}(-x)$ if $x$ is known to be a fundamental discriminant, or |
$\kbd{qfbhclassno}(-D)$ if $D$ is known to be a fundamental discriminant, or |
the function \kbd{quadclassunit}. |
the function \kbd{quadclassunit}. |
|
|
\syn{qfbclassno0}{x,\fl}. Also available are |
\misctitle{Warning.} contrary to what its name implies, this routine does not |
$\teb{classno}(x)$ (= $\teb{qfbclassno}(x)$), |
compute the number of classes of binary primitive forms of discriminant $D$, |
$\teb{classno2}(x)$ (= $\teb{qfbclassno}(x,1)$), and finally |
which is equal to the \var{narrow} class number. The two notions are the same |
there exists the function $\teb{hclassno}(x)$ which computes the class |
when $D < 0$ or the fundamental unit $\varepsilon$ has negative norm; when $D |
number of an imaginary quadratic field by counting reduced forms, an $O(|x|)$ |
> 0$ and $N\varepsilon > 0$, the number of classes of forms is twice the |
|
ordinary class number. This is a problem which we cannot fix for backward |
|
compatibility reasons. Use the following routine if you are only interested |
|
in the number of classes of form: |
|
\bprog |
|
QFBclassno(D) = |
|
qfbclassno(D) * if (D < 0 || norm(quadunit(D)) < 0, 1, 2) |
|
@eprog |
|
\noindent Here are a few examples, including an erroneous answer: |
|
\bprog |
|
? qfbclassno(400000028) |
|
time = 3,140 ms. |
|
%1 = 1 |
|
? quadclassunit(400000028).no |
|
time = 20 ms. \\@com{ much faster} |
|
%2 = 1 |
|
? qfbclassno(-400000028) |
|
time = 0 ms. |
|
%3 = 7253 \\@com{ correct, and fast enough} |
|
? quadclassunit(-400000028).no |
|
*** Warning: not a fundamental discriminant in quadclassunit. |
|
time = 0 ms. |
|
%4 = 7253 |
|
? qfbclassno(-2878367) |
|
time = 0 ms. |
|
%6 = 1056 \\@com{ This is wrong! Correct answer is $1152$} |
|
(14:40) gp > quadclassunit(-2878367) |
|
time = 10 ms. |
|
%7 = [1152, [48, 24], [Qfb(647, 189, 1126), Qfb(2, 1, 359796)], 1, 1.000250] |
|
@eprog |
|
|
|
\syn{qfbclassno0}{D,\fl}. Also available: |
|
$\teb{classno}(D)$ (= $\teb{qfbclassno}(D)$), |
|
$\teb{classno2}(D)$ (= $\teb{qfbclassno}(D,1)$), and finally |
|
there exists the function $\teb{hclassno}(D)$ which computes the class |
|
number of an imaginary quadratic field by counting reduced forms, an $O(|D|)$ |
algorithm. See also \kbd{qfbhclassno}. |
algorithm. See also \kbd{qfbhclassno}. |
|
|
\subsecidx{qfbcompraw}$(x,y)$ \idx{composition} of the binary quadratic forms |
\subsecidx{qfbcompraw}$(x,y)$ \idx{composition} of the binary quadratic forms |
Line 1783 non-negative and congruent to 0 or 3 modulo 4. See als |
|
Line 2019 non-negative and congruent to 0 or 3 modulo 4. See als |
|
definite binary quadratic forms $x$ and $y$ using the NUCOMP and NUDUPL |
definite binary quadratic forms $x$ and $y$ using the NUCOMP and NUDUPL |
algorithms of \idx{Shanks} (\`a la Atkin). $l$ is any positive constant, |
algorithms of \idx{Shanks} (\`a la Atkin). $l$ is any positive constant, |
but for optimal speed, one should take $l=|D|^{1/4}$, where $D$ is the common |
but for optimal speed, one should take $l=|D|^{1/4}$, where $D$ is the common |
discriminant of $x$ and $y$. |
discriminant of $x$ and $y$. When $x$ and $y$ do not have the same |
|
discriminant, the result is undefined. |
|
|
\syn{nucomp}{x,y,l}. The auxiliary function |
\syn{nucomp}{x,y,l}. The auxiliary function |
$\teb{nudupl}(x,l)$ should be used instead for speed when $x=y$. |
$\teb{nudupl}(x,l)$ should be used instead for speed when $x=y$. |
Line 2060 only available for curves defined over $\Q_p$.\smallsk |
|
Line 2297 only available for curves defined over $\Q_p$.\smallsk |
|
|
|
Some functions, in particular those relative to height computations (see |
Some functions, in particular those relative to height computations (see |
\kbd{ellheight}) require also that the curve be in minimal Weierstrass |
\kbd{ellheight}) require also that the curve be in minimal Weierstrass |
form. This is achieved by the function \kbd{ellglobalred}. |
form. This is achieved by the function \kbd{ellminimalmodel}. |
|
|
All functions related to elliptic curves share the prefix \kbd{ell}, and the |
All functions related to elliptic curves share the prefix \kbd{ell}, and the |
precise curve we are interested in is always the first argument, in either |
precise curve we are interested in is always the first argument, in either |
Line 2082 known to hold in full generality thanks to the work of |
|
Line 2319 known to hold in full generality thanks to the work of |
|
medium or long vector of the type given by \kbd{ellinit}. For this function |
medium or long vector of the type given by \kbd{ellinit}. For this function |
to work for every $n$ and not just those prime to the conductor, $E$ must |
to work for every $n$ and not just those prime to the conductor, $E$ must |
be a minimal Weierstrass equation. If this is not the case, use the |
be a minimal Weierstrass equation. If this is not the case, use the |
function \kbd{ellglobalred} first before using \kbd{ellak}. |
function \kbd{ellminimalmodel} first before using \kbd{ellak}. |
|
|
\syn{akell}{E,n}. |
\syn{akell}{E,n}. |
|
|
Line 2157 minimal model of $E$ and the global \idx{Tamagawa numb |
|
Line 2394 minimal model of $E$ and the global \idx{Tamagawa numb |
|
elliptic curve given by a medium or long vector of the type given by |
elliptic curve given by a medium or long vector of the type given by |
\kbd{ellinit}, {\it and is supposed to have all its coefficients $a_i$ in} |
\kbd{ellinit}, {\it and is supposed to have all its coefficients $a_i$ in} |
$\Q$. The result is a 3 component vector $[N,v,c]$. $N$ is the arithmetic |
$\Q$. The result is a 3 component vector $[N,v,c]$. $N$ is the arithmetic |
conductor of the curve, $v$ is itself a vector $[u,r,s,t]$ with rational |
conductor of the curve. $v$ gives the coordinate change for $E$ over $\Q$ to |
components. It gives a coordinate change for $E$ over $\Q$ such that the |
the minimal integral model (see \tet{ellminimalmodel}). Finally $c$ is the |
resulting model has integral coefficients, is everywhere minimal, $a_1$ is 0 |
product of the local Tamagawa numbers $c_p$, a quantity which enters in the |
or 1, $a_2$ is 0, 1 or $-1$ and $a_3$ is 0 or 1. Such a model is unique, and |
\idx{Birch and Swinnerton-Dyer conjecture}.\sidx{minimal model} |
the vector $v$ is unique if we specify that $u$ is positive. To get the new |
|
model, simply type \kbd{ellchangecurve(E,v)}. Finally $c$ is the product of |
|
the local Tamagawa numbers $c_p$, a quantity which enters in the |
|
\idx{Birch and Swinnerton-Dyer conjecture}. |
|
|
|
\syn{globalreduction}{E}. |
\syn{globalreduction}{E}. |
|
|
Line 2297 $O(N^{1/2})$ algorithm. |
|
Line 2530 $O(N^{1/2})$ algorithm. |
|
\syn{lseriesell}{E,s,A,\var{prec}} where $\var{prec}$ is a \kbd{long} and an |
\syn{lseriesell}{E,s,A,\var{prec}} where $\var{prec}$ is a \kbd{long} and an |
omitted $A$ is coded as \kbd{NULL}. |
omitted $A$ is coded as \kbd{NULL}. |
|
|
|
\subsecidx{ellminimalmodel}$(E,\{\&v\})$: return the standard minimal |
|
integral model of the rational elliptic curve $E$. If present, sets $v$ to the |
|
corresponding change of variables, which is a vector $[u,r,s,t]$ with |
|
rational components. The return value is identical to that of |
|
\kbd{ellchangecurve(E, v)}. |
|
|
|
The resulting model has integral coefficients, is everywhere minimal, $a_1$ |
|
is 0 or 1, $a_2$ is 0, 1 or $-1$ and $a_3$ is 0 or 1. Such a model is unique, |
|
and the vector $v$ is unique if we specify that $u$ is positive, which we do. |
|
\sidx{minimal model} |
|
|
|
\syn{ellminimalmodel}{E,\&v}, where an omitted $v$ is coded as \kbd{NULL}. |
|
|
\subsecidx{ellorder}$(E,z)$: gives the order of the point $z$ on the elliptic |
\subsecidx{ellorder}$(E,z)$: gives the order of the point $z$ on the elliptic |
curve $E$ if it is a torsion point, zero otherwise. In the present version |
curve $E$ if it is a torsion point, zero otherwise. In the present version |
\vers, this is implemented only for elliptic curves defined over $\Q$. |
\vers, this is implemented only for elliptic curves defined over $\Q$. |
Line 2364 $H/\Gamma_0(N)$ where $N$ is the conductor of the curv |
|
Line 2610 $H/\Gamma_0(N)$ where $N$ is the conductor of the curv |
|
the power series for $u$ and $v$ is $x$, which is implicitly understood to be |
the power series for $u$ and $v$ is $x$, which is implicitly understood to be |
equal to $\exp(2i\pi z)$. It is assumed that the curve is a \var{strong} |
equal to $\exp(2i\pi z)$. It is assumed that the curve is a \var{strong} |
\idx{Weil curve}, and the Manin constant is equal to 1. The equation of |
\idx{Weil curve}, and the Manin constant is equal to 1. The equation of |
the curve $E$ must be minimal (use \kbd{ellglobalred} to get a minimal |
the curve $E$ must be minimal (use \kbd{ellminimalmodel} to get a minimal |
equation). |
equation). |
|
|
\syn{taniyama}{E}, and the precision of the result is determined by the |
\syn{taniyama}{E}, and the precision of the result is determined by the |
Line 2445 associated to the number field: signature, maximal ord |
|
Line 2691 associated to the number field: signature, maximal ord |
|
$\bullet$ $\tev{bnf}$ denotes a big number field, i.e.~a 10-component |
$\bullet$ $\tev{bnf}$ denotes a big number field, i.e.~a 10-component |
vector in the format output by \tet{bnfinit}. This contains $\var{nf}$ and |
vector in the format output by \tet{bnfinit}. This contains $\var{nf}$ and |
the deeper invariants of the field: units, class groups, as well as a lot of |
the deeper invariants of the field: units, class groups, as well as a lot of |
technical data necessary for some complex fonctions like \kbd{bnfisprincipal}. |
technical data necessary for some complex functions like \kbd{bnfisprincipal}. |
|
|
$\bullet$ $\tev{bnr}$ denotes a big ``ray number field'', i.e.~some data |
$\bullet$ $\tev{bnr}$ denotes a big ``ray number field'', i.e.~some data |
structure output by \kbd{bnrinit}, even more complicated than $\var{bnf}$, |
structure output by \kbd{bnrinit}, even more complicated than $\var{bnf}$, |
Line 2531 determinant of a pseudo-matrix is the determinant of a |
|
Line 2777 determinant of a pseudo-matrix is the determinant of a |
|
module it generates. |
module it generates. |
|
|
Finally, when defining a relative extension, the base field should be |
Finally, when defining a relative extension, the base field should be |
defined by a variable having a lower priority (i.e.~a higher number) |
defined by a variable having a lower priority (i.e.~a higher number, see |
than the variable defining the extension. For example, under GP you can |
\secref{se:priority}) than the variable defining the extension. For example, |
use the variable name $y$ (or $t$) to define the base field, and the |
under GP you can use the variable name $y$ (or $t$) to define the base field, |
variable name $x$ to define the relative extension. |
and the variable name $x$ to define the relative extension. |
|
|
Now a last set of definitions concerning the way big ray number fields |
Now a last set of definitions concerning the way big ray number fields |
(or \var{bnr}) are input, using class field theory. |
(or \var{bnr}) are input, using class field theory. |
Line 2615 fundamental units, $w$ generates the torsion.\cr |
|
Line 2861 fundamental units, $w$ generates the torsion.\cr |
|
\+\tet{reg} &(\var{bnr},& \var{bnf},&&)&: & regulator.\cr |
\+\tet{reg} &(\var{bnr},& \var{bnf},&&)&: & regulator.\cr |
|
|
\+\tet{roots}&(\var{bnr},& \var{bnf},& \var{nf}&)&: & roots of the |
\+\tet{roots}&(\var{bnr},& \var{bnf},& \var{nf}&)&: & roots of the |
polnomial generating the field.\cr |
polynomial generating the field.\cr |
|
|
\+\tet{sign} &(\var{bnr},& \var{bnf},& \var{nf}&)&: & $[r_1,r_2]$ the |
\+\tet{sign} &(\var{bnr},& \var{bnf},& \var{nf}&)&: & $[r_1,r_2]$ the |
signature of the field. This means that the field has $r_1$ real \cr |
signature of the field. This means that the field has $r_1$ real \cr |
Line 2653 finding class and unit groups under \idx{GRH}, due to |
|
Line 2899 finding class and unit groups under \idx{GRH}, due to |
|
The general call to the functions concerning class groups of general number |
The general call to the functions concerning class groups of general number |
fields (i.e.~excluding \kbd{quadclassunit}) involves a polynomial $P$ and a |
fields (i.e.~excluding \kbd{quadclassunit}) involves a polynomial $P$ and a |
technical vector |
technical vector |
$$\var{tech} = [c,c2,\var{nrel},\var{borne},\var{nrpid},\var{minsfb}],$$ |
$$\var{tech} = [c,c2,\var{nrel},\var{small\_norm},\var{nrpid},\var{minsfb}],$$ |
where the parameters are to be understood as follows: |
where the parameters are to be understood as follows: |
|
|
$P$ is the defining polynomial for the number field, which must be in |
$P$ is the defining polynomial for the number field, which must be in |
Line 2670 quadratic case, but then you should use the much faste |
|
Line 2916 quadratic case, but then you should use the much faste |
|
\kbd{quadclassunit}). Reasonable values for $c$ are between $0.1$ and |
\kbd{quadclassunit}). Reasonable values for $c$ are between $0.1$ and |
$2$. (The defaults are $c=c2=0.3$). |
$2$. (The defaults are $c=c2=0.3$). |
|
|
$\var{nrel}$ is the number of initial extra relations requested in |
$\var{nrel}$ is the number of initial extra relations requested in computing |
computing the |
the relation matrix. Reasonable values are between 5 and 20. (The default is |
relation matrix. Reasonable values are between 5 and 20. (The default is 5). |
5). |
|
|
$\var{borne}$ is a multiplicative coefficient of the Minkowski bound which |
$\var{small\_norm}$ is a toggle used to disable the search for small norm |
controls |
relations. If this parameter is set equal to $0$, the program does not search |
the search for small norm relations. If this parameter is set equal to 0, the |
for small norm relations (default value is $1$). {\sl This is obsolete and |
program does not search for small norm relations. Otherwise reasonable values |
should not be used. Set $\var{nrpid} = 0$ instead}. |
are between $0.5$ and $2.0$. (The default is $1.0$). |
|
|
|
$\var{nrpid}$ is the maximal number of small norm relations associated to each |
$\var{nrpid}$ is the maximal number of small norm relations associated to each |
ideal in the factor base. Irrelevant when $\var{borne}=0$. Otherwise, |
ideal in the factor base. Irrelevant when $\var{small\_norm}=0$. Otherwise, |
reasonable values are between 4 and 20. (The default is 4). |
reasonable values are between 4 and 20. (The default is 4). |
|
|
$\var{minsfb}$ is the minimal number of elements in the ``sub-factorbase''. |
$\var{minsfb}$ is the minimal number of elements in the ``sub-factorbase''. |
If the |
If the program does not seem to succeed in finding a full rank matrix (which |
program does not seem to succeed in finding a full rank matrix (which you can |
you can see in GP by typing \kbd{\bs g 2}), increase this number. Reasonable |
see in GP by typing \kbd{\bs g 2}), increase this number. Reasonable values |
values are between 2 and 5. (The default is 3). |
are between 2 and 5. (The default is 3). |
|
|
|
\misctitle{Remarks.} |
\misctitle{Remarks.} |
|
|
Line 2815 Theory}, Graduate Texts in Maths \key{138}, Springer-V |
|
Line 3059 Theory}, Graduate Texts in Maths \key{138}, Springer-V |
|
|
|
$\var{bnf}[1]$ contains the matrix $W$, i.e.~the matrix in Hermite normal |
$\var{bnf}[1]$ contains the matrix $W$, i.e.~the matrix in Hermite normal |
form giving relations for the class group on prime ideal generators |
form giving relations for the class group on prime ideal generators |
$(\p_i)_{1\le i\le r}$. |
$(\wp_i)_{1\le i\le r}$. |
|
|
$\var{bnf}[2]$ contains the matrix $B$, i.e.~the matrix containing the |
$\var{bnf}[2]$ contains the matrix $B$, i.e.~the matrix containing the |
expressions of the prime ideal factorbase in terms of the $\p_i$. It is an |
expressions of the prime ideal factorbase in terms of the $\wp_i$. It is an |
$r\times c$ matrix. |
$r\times c$ matrix. |
|
|
$\var{bnf}[3]$ contains the complex logarithmic embeddings of the system of |
$\var{bnf}[3]$ contains the complex logarithmic embeddings of the system of |
Line 2831 relations of the matrix $(W|B)$. |
|
Line 3075 relations of the matrix $(W|B)$. |
|
$\var{bnf}[5]$ contains the prime factor base, i.e.~the list of prime |
$\var{bnf}[5]$ contains the prime factor base, i.e.~the list of prime |
ideals used in finding the relations. |
ideals used in finding the relations. |
|
|
$\var{bnf}[6]$ contains the permutation of the prime factor base which was |
$\var{bnf}[6]$ used to contain a permutation of the prime factor base, but |
necessary to reduce the relation matrix to the form explained in subsection |
has been obsoleted. It contains a dummy $0$. |
6.5.5 of GTM~138 (i.e.~with a big $c\times c$ identity matrix on the lower |
|
right). Note that in the above mentioned book, the need to permute the rows |
|
of the relation matrices which occur was not emphasized. |
|
|
|
$\var{bnf}[9]$ is a 3-element row vector used in \tet{bnfisprincipal} only |
$\var{bnf}[9]$ is a 3-element row vector used in \tet{bnfisprincipal} only |
and obtained as follows. Let $D = U W V$ obtained by applying the |
and obtained as follows. Let $D = U W V$ obtained by applying the |
\idx{Smith normal form} algorithm to the matrix $W$ (= $\var{bnf}[1]$) and |
\idx{Smith normal form} algorithm to the matrix $W$ (= $\var{bnf}[1]$) and |
let $U_r$ be the reduction of $U$ modulo $D$. The first elements of the |
let $U_r$ be the reduction of $U$ modulo $D$. The first elements of the |
factorbase are given (in terms of \kbd{bnf.gen}) by the columns of $U_r$, |
factorbase are given (in terms of \kbd{bnf.gen}) by the columns of $U_r$, |
with archimedian component $g_a$; let also $GD_a$ be the archimedian |
with Archimedean component $g_a$; let also $GD_a$ be the Archimedean |
components of the generators of the (principal) ideals defined by the |
components of the generators of the (principal) ideals defined by the |
\kbd{bnf.gen[i]\pow bnf.cyc[i]}. Then $\var{bnf}[9]=[U_r, g_a, GD_a]$. |
\kbd{bnf.gen[i]\pow bnf.cyc[i]}. Then $\var{bnf}[9]=[U_r, g_a, GD_a]$. |
|
|
Line 2947 simple true/false answer: it gives a row vector $[v_1, |
|
Line 3188 simple true/false answer: it gives a row vector $[v_1, |
|
|
|
$v_1$ is the vector of components $c_i$ of the class of the ideal $x$ in the |
$v_1$ is the vector of components $c_i$ of the class of the ideal $x$ in the |
class group, expressed on the generators $g_i$ given by \kbd{bnfinit} |
class group, expressed on the generators $g_i$ given by \kbd{bnfinit} |
(specifically \kbd{\var{bnf}.clgp.gen} which is the same as |
(specifically \kbd{\var{bnf}.gen}). The $c_i$ are chosen so that $0\le c_i<n_i$ |
\kbd{\var{bnf}[8][1][3]}). The $c_i$ are chosen so that $0\le c_i<n_i$ |
where $n_i$ is the order of $g_i$ (the vector of $n_i$ being \kbd{\var{bnf}.cyc}). |
where $n_i$ is the order of $g_i$ (the vector of $n_i$ being |
|
\kbd{\var{bnf}.clgp.cyc}, that is \kbd{\var{bnf}[8][1][2]}). |
|
|
|
$v_2$ gives on the integral basis the components of $\alpha$ such that |
$v_2$ gives on the integral basis the components of $\alpha$ such that |
$x=\alpha\prod_ig_i^{c_i}$. In particular, $x$ is principal if and only if |
$x=\alpha\prod_ig_i^{c_i}$. In particular, $x$ is principal if and only if |
$v_1$ is equal to the zero vector, and if this the case $x=\alpha\Z_K$ where |
$v_1$ is equal to the zero vector. In the latter case, $x = \alpha\Z_K$ where |
$\alpha$ is given by $v_2$. Note that if $\alpha$ is too large to be given, a |
$\alpha$ is given by $v_2$. Note that if $\alpha$ is too large to be given, a |
warning message will be printed and $v_2$ will be set equal to the empty |
warning message will be printed and $v_2$ will be set equal to the empty |
vector. |
vector. |
Line 3021 special case of \kbd{bnrclass}. |
|
Line 3260 special case of \kbd{bnrclass}. |
|
\subsecidx{bnfsignunit}$(\var{bnf})$: $\var{bnf}$ being a big number field |
\subsecidx{bnfsignunit}$(\var{bnf})$: $\var{bnf}$ being a big number field |
output by \kbd{bnfinit}, this computes an $r_1\times(r_1+r_2-1)$ matrix |
output by \kbd{bnfinit}, this computes an $r_1\times(r_1+r_2-1)$ matrix |
having $\pm1$ components, giving the signs of the real embeddings of the |
having $\pm1$ components, giving the signs of the real embeddings of the |
fundamental units. |
fundamental units. The following functions compute generators for the totally |
|
positive units: |
|
|
|
\bprog |
|
/* exponents of totally positive units generators on bnf.tufu */ |
|
tpuexpo(bnf)= |
|
{ local(S,d,K); |
|
|
|
S = bnfsignunit(bnf); d = matsize(S); |
|
S = matrix(d[1],d[2], i,j, if (S[i,j] < 0, 1,0)); |
|
S = concat(S, vectorv(d[1],i,1)); \\ sign(-1) |
|
K = lift(matker(S * Mod(1,2))); |
|
if (K, mathnfmodid(K, 2), 2*matid(d[1])) |
|
} |
|
|
|
/* totally positive units */ |
|
tpu(bnf)= |
|
{ local(vu, ex = tpuexpo(bnf)); |
|
|
|
vu = nfbasistoalg(bnf, bnf.tufu); |
|
vector(length(ex)-1, i, factorback([vu, ex[,i+1]])) \\ ex[,1] is 1 |
|
} |
|
@eprog |
|
|
\syn{signunits}{\var{bnf}}. |
\syn{signunits}{\var{bnf}}. |
|
|
\subsecidx{bnfreg}$(\var{bnf})$: $\var{bnf}$ being a big number field |
\subsecidx{bnfreg}$(\var{bnf})$: $\var{bnf}$ being a big number field |
Line 3057 $v[6]$ is a copy of $S$. |
|
Line 3318 $v[6]$ is a copy of $S$. |
|
\syn{bnfsunit}{\var{bnf},S,\var{prec}}. |
\syn{bnfsunit}{\var{bnf},S,\var{prec}}. |
|
|
\subsecidx{bnfunit}$(\var{bnf})$: $\var{bnf}$ being a big number field as |
\subsecidx{bnfunit}$(\var{bnf})$: $\var{bnf}$ being a big number field as |
output by |
output by \kbd{bnfinit}, outputs a two-component row vector giving in the |
\kbd{bnfinit}, outputs a two-component row vector giving in the first |
first component the vector of fundamental units of the number field, and in |
component the vector of fundamental units of the number field, and in the |
the second component the number of bit of accuracy which remained in the |
second component the number of bit of accuracy which remained in the |
|
computation (which is always correct, otherwise an error message is printed). |
computation (which is always correct, otherwise an error message is printed). |
This function is mainly for people who used the wrong flag in \kbd{bnfinit} |
This function is mainly for people who used the wrong flag in \kbd{bnfinit} |
and would like to skip part of a lengthy \kbd{bnfinit} computation. |
and would like to skip part of a lengthy \kbd{bnfinit} computation. |
|
|
\syn{buchfu}{\var{bnf}}. |
\syn{buchfu}{\var{bnf}}. |
|
|
\subsecidx{bnrL1}$(\var{bnr},\var{subgroup},\{\fl=0\})$: |
\subsecidx{bnrL1}$(\var{bnr},\{\var{subgroup}\},\{\fl=0\})$: |
\var{bnr} being the number field data which is output by |
\var{bnr} being the number field data which is output by |
\kbd{bnrinit(,,1)} and \var{subgroup} being a square matrix defining a |
\kbd{bnrinit(,,1)} and \var{subgroup} being a square matrix defining a |
congruence subgroup of the ray class group corresponding to \var{bnr} |
congruence subgroup of the ray class group corresponding to \var{bnr} |
(or $0$ for the trivial congruence subgroup), returns for each |
(the trivial congruence subgroup if omitted), returns for each |
\idx{character} $\chi$ of the ray class group which is trivial on this |
\idx{character} $\chi$ of the ray class group which is trivial on this |
subgroup, the value at $s = 1$ (or $s = 0$) of the abelian |
subgroup, the value at $s = 1$ (or $s = 0$) of the abelian |
$L$-function associated to $\chi$. For the value at $s = 0$, the |
$L$-function associated to $\chi$. For the value at $s = 0$, the |
|
|
\bprog |
\bprog |
bnf = bnfinit(x^2 - 229); |
bnf = bnfinit(x^2 - 229); |
bnr = bnrinit(bnf,1,1); |
bnr = bnrinit(bnf,1,1); |
bnrL1(bnr, 0) |
bnrL1(bnr) |
@eprog\noindent |
@eprog\noindent |
returns the order and the first non-zero term of the abelian |
returns the order and the first non-zero term of the abelian |
$L$-functions $L(s, \chi)$ at $s = 0$ where $\chi$ runs through the |
$L$-functions $L(s, \chi)$ at $s = 0$ where $\chi$ runs through the |
characters of the class group of $\Q(\sqrt{229})$. Then |
characters of the class group of $\Q(\sqrt{229})$. Then |
\bprog |
\bprog |
bnr2 = bnrinit(bnf,2,1); |
bnr2 = bnrinit(bnf,2,1); |
bnrL1(bnr2,0,2) |
bnrL1(bnr2,,2) |
@eprog\noindent |
@eprog\noindent |
returns the order and the first non-zero terms of the abelian |
returns the order and the first non-zero terms of the abelian |
$L$-functions $L_S(s, \chi)$ at $s = 0$ where $\chi$ runs through the |
$L$-functions $L_S(s, \chi)$ at $s = 0$ where $\chi$ runs through the |
Line 3112 $2$ (note that the ray class group modulo $2$ is in fa |
|
Line 3372 $2$ (note that the ray class group modulo $2$ is in fa |
|
group, so \kbd{bnrL1(bnr2,0)} returns exactly the same answer as |
group, so \kbd{bnrL1(bnr2,0)} returns exactly the same answer as |
\kbd{bnrL1(bnr,0)}!). |
\kbd{bnrL1(bnr,0)}!). |
|
|
\syn{bnrL1}{\var{bnr},\var{subgroup},\fl,\var{prec}} |
\syn{bnrL1}{\var{bnr},\var{subgroup},\fl,\var{prec}}, where an omitted |
|
\var{subgroup} is coded as \kbd{NULL}. |
|
|
\subsecidx{bnrclass}$(\var{bnf},\var{ideal},\{\fl=0\})$: |
\subsecidx{bnrclass}$(\var{bnf},\var{ideal},\{\fl=0\})$: |
$\var{bnf}$ being a big number field |
$\var{bnf}$ being a big number field |
Line 3170 the conductor of this character as a modulus. |
|
Line 3431 the conductor of this character as a modulus. |
|
\syn{bnrconductorofchar}{\var{bnr},\var{chi}}. |
\syn{bnrconductorofchar}{\var{bnr},\var{chi}}. |
|
|
\subsecidx{bnrdisc}$(a1,\{a2\},\{a3\},\{\fl=0\})$: $a1$, $a2$, $a3$ |
\subsecidx{bnrdisc}$(a1,\{a2\},\{a3\},\{\fl=0\})$: $a1$, $a2$, $a3$ |
defining a big ray number field $L$ over a groud field $K$ (see \kbd{bnr} |
defining a big ray number field $L$ over a ground field $K$ (see \kbd{bnr} |
at the beginning of this section for the |
at the beginning of this section for the |
meaning of $a1$, $a2$, $a3$), outputs a 3-component row vector $[N,R_1,D]$, |
meaning of $a1$, $a2$, $a3$), outputs a 3-component row vector $[N,R_1,D]$, |
where $N$ is the (absolute) degree of $L$, $R_1$ the number of real places of |
where $N$ is the (absolute) degree of $L$, $R_1$ the number of real places of |
Line 3285 field and $\zeta = e^{2i\pi/N}$ where $N$ is the order |
|
Line 3546 field and $\zeta = e^{2i\pi/N}$ where $N$ is the order |
|
|
|
\syn{bnrrootnumber}{\var{bnf},\var{chi},\fl} |
\syn{bnrrootnumber}{\var{bnf},\var{chi},\fl} |
|
|
\subsecidx{bnrstark}${(\var{bnr},\var{subgroup},\{\fl=0\})}$: \var{bnr} |
\subsecidx{bnrstark}${(\var{bnr},\{\var{subgroup}\},\{\fl=0\})}$: \var{bnr} |
being as output by \kbd{bnrinit(,,1)}, finds a relative equation for the |
being as output by \kbd{bnrinit(,,1)}, finds a relative equation for the |
class field corresponding to the modulus in \var{bnr} and the given |
class field corresponding to the modulus in \var{bnr} and the given |
congruence subgroup using \idx{Stark units} (set $\var{subgroup}=0$ if you |
congruence subgroup using \idx{Stark units} (omit $\var{subgroup}=0$ if you |
want the whole ray class group). The main variable of \var{bnr} must not be |
want the whole ray class group). The main variable of \var{bnr} must not be |
$x$, and the ground field and the class field must be totally real and not |
$x$, and the ground field and the class field must be totally real. When the |
isomorphic to $\Q$ (over the rationnals, use \tet{polsubcyclo} or |
base field is $\Q$, the vastly simpler \tet{galoissubcyclo} is used instead. |
\tet{galoissubcyclo}). \fl\ is optional and may be set to 0 to obtain a |
|
reduced relative polynomial, 1 to be satisfied with any relative |
|
polynomial, 2 to obtain an absolute polynomial and 3 to obtain the |
|
irreducible relative polynomial of the Stark unit, 0 being default. |
|
Example: |
|
|
|
|
\fl\ is optional and may be set to 0 (default) to obtain a reduced relative |
|
polynomial, 1 to be satisfied with any relative polynomial, 2 to obtain an |
|
absolute polynomial and 3 to obtain the irreducible relative polynomial of |
|
the Stark unit. Example: |
\bprog |
\bprog |
bnf = bnfinit(y^2 - 3); |
bnf = bnfinit(y^2 - 3); |
bnr = bnrinit(bnf, 5, 1); |
bnr = bnrinit(bnf, 5, 1); |
Line 3319 In this case, the corresponding congruence group is a |
|
Line 3579 In this case, the corresponding congruence group is a |
|
groups and, for the time being, the class field has to be obtained by |
groups and, for the time being, the class field has to be obtained by |
splitting this group into its cyclic components. |
splitting this group into its cyclic components. |
|
|
\syn{bnrstark}{\var{bnr},\var{subgroup},\fl}. |
\syn{bnrstark}{\var{bnr},\var{subgroup},\fl}, where an omitted \var{subgroup} |
|
is coded by \kbd{NULL}. |
|
|
\subsecidx{dirzetak}$(\var{nf},b)$: gives as a vector the first $b$ |
\subsecidx{dirzetak}$(\var{nf},b)$: gives as a vector the first $b$ |
coefficients of the \idx{Dedekind} zeta function of the number field $\var{nf}$ |
coefficients of the \idx{Dedekind} zeta function of the number field $\var{nf}$ |
Line 3330 considered as a \idx{Dirichlet series}. |
|
Line 3591 considered as a \idx{Dirichlet series}. |
|
\subsecidx{factornf}$(x,t)$: factorization of the univariate polynomial $x$ |
\subsecidx{factornf}$(x,t)$: factorization of the univariate polynomial $x$ |
over the number field defined by the (univariate) polynomial $t$. $x$ may |
over the number field defined by the (univariate) polynomial $t$. $x$ may |
have coefficients in $\Q$ or in the number field. The main variable of |
have coefficients in $\Q$ or in the number field. The main variable of |
$t$ must be of \var{lower} priority than that of $x$ (in other words the |
$t$ must be of \var{lower} priority than that of $x$ (see |
variable number of $t$ must be \var{greater} than that of $x$). However if |
\secref{se:priority}). However if |
the coefficients of the number field occur explicitly (as polmods) as |
the coefficients of the number field occur explicitly (as polmods) as |
coefficients of $x$, the variable of these polmods \var{must} be the same as |
coefficients of $x$, the variable of these polmods \var{must} be the same as |
the main variable of $t$. For example |
the main variable of $t$. For example |
Line 3360 If $\fl=1$ return only the polynomial $P$. |
|
Line 3621 If $\fl=1$ return only the polynomial $P$. |
|
If $\fl=2$ return $[P,x,F]$ where $P$ and $x$ are as above and $F$ is the |
If $\fl=2$ return $[P,x,F]$ where $P$ and $x$ are as above and $F$ is the |
factorization of $\var{gal}.pol$ over the field defined by $P$, where |
factorization of $\var{gal}.pol$ over the field defined by $P$, where |
variable $v$ ($y$ by default) stands for a root of $P$. The priority of $v$ |
variable $v$ ($y$ by default) stands for a root of $P$. The priority of $v$ |
must be less than the priority of the variable of $\var{gal}.pol$. |
must be less than the priority of the variable of $\var{gal}.pol$ (see |
|
\secref{se:priority}). Example: |
|
|
Example: |
|
|
|
\bprog |
\bprog |
G = galoisinit(x^4+1); |
G = galoisinit(x^4+1); |
galoisfixedfield(G,G.group[2],2) |
galoisfixedfield(G,G.group[2],2) |
Line 3374 computes the factorization $x^4+1=(x^2-\sqrt{-2}x-1)( |
|
Line 3634 computes the factorization $x^4+1=(x^2-\sqrt{-2}x-1)( |
|
\syn{galoisfixedfield}{\var{gal},\var{perm},p}. |
\syn{galoisfixedfield}{\var{gal},\var{perm},p}. |
|
|
\subsecidx{galoisinit}$(\var{pol},\{den\})$: computes the Galois group |
\subsecidx{galoisinit}$(\var{pol},\{den\})$: computes the Galois group |
and all neccessary information for computing the fixed fields of the |
and all necessary information for computing the fixed fields of the |
Galois extension $K/\Q$ where $K$ is the number field defined by |
Galois extension $K/\Q$ where $K$ is the number field defined by |
$\var{pol}$ (monic irreducible polynomial in $\Z[X]$ or |
$\var{pol}$ (monic irreducible polynomial in $\Z[X]$ or |
a number field as output by \tet{nfinit}). The extension $K/\Q$ must be |
a number field as output by \tet{nfinit}). The extension $K/\Q$ must be |
Line 3444 If present $den$ must be a suitable value for $\var{ga |
|
Line 3704 If present $den$ must be a suitable value for $\var{ga |
|
|
|
\syn{galoisinit}{\var{gal},\var{den}}. |
\syn{galoisinit}{\var{gal},\var{den}}. |
|
|
|
\subsecidx{galoisisabelian}$(\var{gal},{fl=0})$: \var{gal} being as output by \kbd{galoisinit}, return $0$ if |
|
\var{gal} is not an abelian group, and the HNF matrix of \var{gal} over \kbd{gal.gen} if $fl=0$, $1$ if |
|
$fl=1$. |
|
|
|
\syn{galoisisabelian}{\var{gal},\var{fl}} where \var{fl} is a C long integer. |
|
|
\subsecidx{galoispermtopol}$(\var{gal},\var{perm})$: \var{gal} being a |
\subsecidx{galoispermtopol}$(\var{gal},\var{perm})$: \var{gal} being a |
Galois field as output by \kbd{galoisinit} and \var{perm} a element of |
Galois field as output by \kbd{galoisinit} and \var{perm} a element of |
$\var{gal}.group$, return the polynomial defining the Galois |
$\var{gal}.group$, return the polynomial defining the Galois |
Line 3462 is greater or equal to $2$. |
|
Line 3728 is greater or equal to $2$. |
|
|
|
\syn{galoispermtopol}{\var{gal},\var{perm}}. |
\syn{galoispermtopol}{\var{gal},\var{perm}}. |
|
|
\subsecidx{galoissubcyclo}$(n,H,\{Z\},\{v\},\{fl=0\})$: If $fl=0$, compute a polynomial |
\subsecidx{galoissubcyclo}$(N,H,\{fl=0\},\{v\})$: computes the subextension |
defining the subfield of $\Q(\zeta_n)$ fixed by the subgroup \var{H} of |
of $\Q(\zeta_n)$ fixed by the subgroup $H \subset (\Z/n\Z)^*$. By the |
$(\Z/n\Z)^*$. The subgroup \var{H} can be given by a generator, a set of |
Kronecker-Weber theorem, all abelian number fields can be generated in this |
generators given by a vector or a HNF matrix. If present \kbd{Z} must be |
way (uniquely if $n$ is taken to be minimal). |
\kbd{znstar(n)}, and is currently only used when \var{H} is a HNF matrix. If |
|
\var{v} is given, the polynomial is given in the variable \var{v}. |
|
|
|
If $fl=1$, compute only the (finite part of) conductor of the abelian extension. |
\noindent The pair $(n, H)$ is deduced from the parameters $(N, H)$ as follows |
|
|
If $fl=2$, output $[pol, f_0]$, where $pol$ is the polynomial as output when $fl=0$ and $f_0$ the conductor as output when $fl=1$. |
$\bullet$ $N$ an integer: then $n = N$; $H$ is a generator, i.e. an |
|
integer or an integer modulo $n$; or a vector of generators. |
|
|
The following function can be used to compute all subfields of |
$\bullet$ $N$ the output of \kbd{znstar($n$)}. $H$ as in the first case |
$\Q(\zeta_n)$ (of order less than \kbd{d}, if \kbd{d} is set): |
above, or a matrix, taken to be a HNF left divisor of the SNF for $(\Z/n\Z)^*$ |
|
(of type \kbd{$N$.cyc}), giving the generators of $H$ in terms of \kbd{$N$.gen}. |
|
|
|
$\bullet$ $N$ the output of \kbd{bnrinit(bnfinit(y), $m$, 1)} where $m$ is a |
|
module. $H$ as in the first case, or a matrix taken to be a HNF left |
|
divisor of the SNF for the ray class group modulo $m$ |
|
(of type \kbd{$N$.cyc}), giving the generators of $H$ in terms of \kbd{$N$.gen}. |
|
|
|
In this last case, beware that $H$ is understood relatively to $N$; in |
|
particular, if the infinite place does not divide the module, e.g if $m$ is |
|
an integer, then it is not a subgroup of $(\Z/n\Z)^*$, but of its quotient by |
|
$\{\pm 1\}$. |
|
|
|
If $fl=0$, compute a polynomial (in the variable \var{v}) defining the |
|
the subfield of $\Q(\zeta_n)$ fixed by the subgroup \var{H} of $(\Z/n\Z)^*$. |
|
|
|
If $fl=1$, compute only the conductor of the abelian extension, as a module. |
|
|
|
If $fl=2$, output $[pol, N]$, where $pol$ is the polynomial as output when |
|
$fl=0$ and $N$ the conductor as output when $fl=1$. |
|
|
|
The following function can be used to compute all subfields of |
|
$\Q(\zeta_n)$ (of exact degree \kbd{d}, if \kbd{d} is set): |
\bprog |
\bprog |
subcyclo(n, d = -1)= |
subcyclo(n, d = -1)= |
{ |
{ |
local(Z,G,S); |
local(bnr,L,IndexBound); |
if (d < 0, d = n); |
IndexBound = if (d < 0, n, [d]); |
Z = znstar(n); |
bnr = bnrinit(bnfinit(y), [n,[1]], 1); |
G = matdiagonal(Z[2]); |
L = subgrouplist(bnr, IndexBound, 1); |
S = []; |
vector(#L,i, galoissubcyclo(bnr,L[i])); |
forsubgroup(H = G, d, |
|
S = concat(S, galoissubcyclo(n, mathnf(concat(G,H)),Z)); |
|
); |
|
S |
|
} |
} |
@eprog |
@eprog\noindent |
|
Setting \kbd{L = subgrouplist(bnr, [d])} would produce subfields of exact |
|
conductor $n\infty$. |
|
|
\misctitle{Note:} The interface to this function needs to be cleaned up, and |
\syn{galoissubcyclo}{N,H,fl,v} where \var{fl} is a C long integer, and |
so is subject to change. |
\var{v} a variable number. |
|
|
\syn{galoissubcyclo}{n,H,Z,v} where n is a C long integer. |
\subsecidx{galoissubfields}$(G,\{fl=0\},\{v\})$: Output all the subfields of the Galois group \var{G}, |
|
as a vector. |
|
This works by applying \kbd{galoisfixedfield} to all subgroups. The meaning of the flag \var{fl} is |
|
the same as for \kbd{galoisfixedfield}. |
|
|
|
\syn{galoissubfields}{\var{G},fl,v}, where \var{fl} is a long and \var{v} a variable number. |
|
|
|
\subsecidx{galoissubgroups}$(G)$: Output all the subgroups of the Galois group \kbd{G}. |
|
A subgroup is a vector $[gen, orders]$, with the same meaning as for $\var{gal}.gen$ |
|
and $\var{gal}.orders$. Hence \var{gen} is a vector of permutations generating the |
|
subgroup, and \var{orders} is the relatives orders of the generators. The cardinal |
|
of a subgroup is the product of the relative orders. |
|
|
|
\syn{galoissubgroups}{\var{G}}. |
|
|
\subsecidx{idealadd}$(\var{nf},x,y)$: sum of the two ideals $x$ and $y$ in the |
\subsecidx{idealadd}$(\var{nf},x,y)$: sum of the two ideals $x$ and $y$ in the |
number field $\var{nf}$. When $x$ and $y$ are given by $\Z$-bases, this does |
number field $\var{nf}$. When $x$ and $y$ are given by $\Z$-bases, this does |
not depend on $\var{nf}$ and can be used to compute the sum of any two |
not depend on $\var{nf}$ and can be used to compute the sum of any two |
Line 3517 $1\le i\le k$ and $\sum_{1\le i\le k}e[i]=1$. |
|
Line 3814 $1\le i\le k$ and $\sum_{1\le i\le k}e[i]=1$. |
|
|
|
\subsecidx{idealappr}$(\var{nf},x,\{\fl=0\})$: if $x$ is a fractional ideal |
\subsecidx{idealappr}$(\var{nf},x,\{\fl=0\})$: if $x$ is a fractional ideal |
(given in any form), gives an element $\alpha$ in $\var{nf}$ such that for |
(given in any form), gives an element $\alpha$ in $\var{nf}$ such that for |
all prime ideals $\p$ such that the valuation of $x$ at $\p$ is non-zero, we |
all prime ideals $\wp$ such that the valuation of $x$ at $\wp$ is non-zero, we |
have $v_{\p}(\alpha)=v_{\p}(x)$, and. $v_{\p}(\alpha)\ge0$ for all other |
have $v_{\wp}(\alpha)=v_{\wp}(x)$, and. $v_{\wp}(\alpha)\ge0$ for all other |
${\p}$. |
${\wp}$. |
|
|
If $\fl$ is non-zero, $x$ must be given as a prime ideal factorization, as |
If $\fl$ is non-zero, $x$ must be given as a prime ideal factorization, as |
output by \kbd{idealfactor}, but possibly with zero or negative exponents. |
output by \kbd{idealfactor}, but possibly with zero or negative exponents. |
This yields an element $\alpha$ such that for all prime ideals $\p$ occurring |
This yields an element $\alpha$ such that for all prime ideals $\wp$ occurring |
in $x$, $v_{\p}(\alpha)$ is equal to the exponent of $\p$ in $x$, and for all |
in $x$, $v_{\wp}(\alpha)$ is equal to the exponent of $\wp$ in $x$, and for all |
other prime ideals, $v_{\p}(\alpha)\ge0$. This generalizes |
other prime ideals, $v_{\wp}(\alpha)\ge0$. This generalizes |
$\kbd{idealappr}(\var{nf},x,0)$ since zero exponents are allowed. Note that |
$\kbd{idealappr}(\var{nf},x,0)$ since zero exponents are allowed. Note that |
the algorithm used is slightly different, so that |
the algorithm used is slightly different, so that |
\kbd{idealappr(\var{nf},idealfactor(\var{nf},x))} may not be the same as |
\kbd{idealappr(\var{nf},idealfactor(\var{nf},x))} may not be the same as |
Line 3538 the algorithm used is slightly different, so that |
|
Line 3835 the algorithm used is slightly different, so that |
|
column integral exponents), $y$ a vector of elements in $\var{nf}$ indexed by |
column integral exponents), $y$ a vector of elements in $\var{nf}$ indexed by |
the ideals in $x$, computes an element $b$ such that |
the ideals in $x$, computes an element $b$ such that |
|
|
$v_\p(b - y_\p) \geq v_\p(x)$ for all prime ideals in $x$ and $v_\p(b)\geq 0$ |
$v_\wp(b - y_\wp) \geq v_\wp(x)$ for all prime ideals in $x$ and $v_\wp(b)\geq 0$ |
for all other $\p$. |
for all other $\wp$. |
|
|
\syn{idealchinese}{\var{nf},x,y}. |
\syn{idealchinese}{\var{nf},x,y}. |
|
|
\subsecidx{idealcoprime}$(\var{nf},x,y)$: given two integral ideals $x$ and $y$ |
\subsecidx{idealcoprime}$(\var{nf},x,y)$: given two integral ideals $x$ and $y$ |
in the number field $\var{nf}$, finds a $\beta$ in the field, expressed on the |
in the number field $\var{nf}$, finds a $\beta$ in the field, expressed on the |
integral basis $\var{nf}[7]$, such that $\beta\cdot y$ is an integral ideal |
integral basis $\var{nf}[7]$, such that $\beta\cdot x$ is an integral ideal |
coprime to $x$. |
coprime to $y$. |
|
|
\syn{idealcoprime}{\var{nf},x}. |
\syn{idealcoprime}{\var{nf},x,y}. |
|
|
\subsecidx{idealdiv}$(\var{nf},x,y,\{\fl=0\})$: quotient $x\cdot y^{-1}$ of the |
\subsecidx{idealdiv}$(\var{nf},x,y,\{\fl=0\})$: quotient $x\cdot y^{-1}$ of the |
two ideals $x$ and $y$ in the number field $\var{nf}$. The result is given in |
two ideals $x$ and $y$ in the number field $\var{nf}$. The result is given in |
Line 3839 entries are expressed as a column vector on the integr |
|
Line 4136 entries are expressed as a column vector on the integr |
|
|
|
\syn{algtobasis}{\var{nf},x}. |
\syn{algtobasis}{\var{nf},x}. |
|
|
\subsecidx{nfbasis}$(x,\{\fl=0\},\{p\})$: \idx{integral basis} of the number |
\subsecidx{nfbasis}$(x,\{\fl=0\},\{fa\})$: \idx{integral basis} of the number |
field defined by the irreducible, preferably monic, polynomial $x$, |
field defined by the irreducible, preferably monic, polynomial $x$, using a |
using a modified version of the \idx{round 4} algorithm by |
modified version of the \idx{round 4} algorithm by default, due to David |
default. The binary digits of $\fl$ have the following meaning: |
\idx{Ford}, Sebastian \idx{Pauli} and Xavier \idx{Roblot}. The binary digits |
|
of $\fl$ have the following meaning: |
|
|
1: assume that no square of a prime greater than the default \kbd{primelimit} |
1: assume that no square of a prime greater than the default \kbd{primelimit} |
divides the discriminant of $x$, i.e.~that the index of $x$ has only small |
divides the discriminant of $x$, i.e.~that the index of $x$ has only small |
prime divisors. |
prime divisors. |
|
|
2: use \idx{round 2} algorithm. For small degrees and coefficient size, this is |
2: use \idx{round 2} algorithm. For small degrees and coefficient size, this |
sometimes a little faster. (This program is the translation into C of a program |
is sometimes a little faster. (This program is the translation into C of a |
written by David \idx{Ford} in Algeb.) |
program written by David \idx{Ford} in Algeb.) |
|
|
Thus for instance, if $\fl=3$, this uses the round 2 algorithm and outputs |
Thus for instance, if $\fl=3$, this uses the round 2 algorithm and outputs |
an order which will be maximal at all the small primes. |
an order which will be maximal at all the small primes. |
|
|
If $p$ is present, we assume (without checking!) that it is the two-column |
If $fa$ is present, we assume (without checking!) that it is the two-column |
matrix of the factorization of the discriminant of the polynomial $x$. Note |
matrix of the factorization of the discriminant of the polynomial $x$. Note |
that it does \var{not} have to be a complete factorization. This is |
that it does \var{not} have to be a complete factorization. This is |
especially useful if only a local integral basis for some small set of places |
especially useful if only a local integral basis for some small set of places |
is desired: only factors with exponents greater or equal to 2 will be |
is desired: only factors with exponents greater or equal to 2 will be |
considered. |
considered. |
|
|
\syn{nfbasis0}{x,\fl,p}. An extended version |
\syn{nfbasis0}{x,\fl,fa}. An extended version |
is $\teb{nfbasis}(x,\&d,\fl,p)$, where $d$ will receive the discriminant of |
is $\teb{nfbasis}(x,\&d,\fl,fa)$, where $d$ will receive the discriminant of |
the number field (\var{not} of the polynomial $x$), and an omitted $p$ should |
the number field (\var{not} of the polynomial $x$), and an omitted $fa$ should |
be input as \kbd{gzero}. Also available are $\teb{base}(x,\&d)$ ($\fl=0$), |
be input as \kbd{NULL}. Also available are $\teb{base}(x,\&d)$ ($\fl=0$), |
$\teb{base2}(x,\&d)$ ($\fl=2$) and $\teb{factoredbase}(x,p,\&d)$. |
$\teb{base2}(x,\&d)$ ($\fl=2$) and $\teb{factoredbase}(x,fa,\&d)$. |
|
|
\subsecidx{nfbasistoalg}$(\var{nf},x)$: this is the inverse function of |
\subsecidx{nfbasistoalg}$(\var{nf},x)$: this is the inverse function of |
\kbd{nfalgtobasis}. Given an object $x$ whose entries are expressed on the |
\kbd{nfalgtobasis}. Given an object $x$ whose entries are expressed on the |
Line 3881 is particularly useful in conjunction with \kbd{nfhnfm |
|
Line 4179 is particularly useful in conjunction with \kbd{nfhnfm |
|
|
|
\syn{nfdetint}{\var{nf},x}. |
\syn{nfdetint}{\var{nf},x}. |
|
|
\subsecidx{nfdisc}$(x,\{\fl=0\},\{p\})$: \idx{field discriminant} of the |
\subsecidx{nfdisc}$(x,\{\fl=0\},\{fa\})$: \idx{field discriminant} of the |
number field defined by the integral, preferably monic, irreducible |
number field defined by the integral, preferably monic, irreducible |
polynomial $x$. $\fl$ and $p$ are exactly as in \kbd{nfbasis}. That is, $p$ |
polynomial $x$. $\fl$ and $fa$ are exactly as in \kbd{nfbasis}. That is, $fa$ |
provides the matrix of a partial factorization of the discriminant of $x$, |
provides the matrix of a partial factorization of the discriminant of $x$, |
and binary digits of $\fl$ are as follows: |
and binary digits of $\fl$ are as follows: |
|
|
1: assume that no square of a prime greater than \kbd{primelimit} |
1: assume that no square of a prime greater than \kbd{primelimit} |
divides the discriminant. |
divides the discriminant. |
|
|
2: use the round 2 algorithm, instead of the default \idx{round 4}. |
2: use the round 2 algorithm, instead of the default \idx{round 4}. This |
This should be |
should be slower except maybe for polynomials of small degree and |
slower except maybe for polynomials of small degree and coefficients. |
coefficients. |
|
|
\syn{nfdiscf0}{x,\fl,p} where, to omit $p$, you should input \kbd{gzero}. You |
\syn{nfdiscf0}{x,\fl,fa} where, to omit $fa$, you should input \kbd{NULL}. You |
can also use $\teb{discf}(x)$ ($\fl=0$). |
can also use $\teb{discf}(x)$ ($\fl=0$). |
|
|
\subsecidx{nfeltdiv}$(\var{nf},x,y)$: given two elements $x$ and $y$ in |
\subsecidx{nfeltdiv}$(\var{nf},x,y)$: given two elements $x$ and $y$ in |
Line 3967 an element $x$ of the number field $\var{nf}$ and a pr |
|
Line 4265 an element $x$ of the number field $\var{nf}$ and a pr |
|
\kbd{modpr} format compute a canonical representative for the class of $x$ |
\kbd{modpr} format compute a canonical representative for the class of $x$ |
modulo \var{pr}. |
modulo \var{pr}. |
|
|
\syn{nfreducemodpr2}{\var{nf},x,\var{pr}}. |
\syn{nfreducemodpr}{\var{nf},x,\var{pr}}. |
|
|
\subsecidx{nfeltval}$(\var{nf},x,\var{pr})$: given an element $x$ in |
\subsecidx{nfeltval}$(\var{nf},x,\var{pr})$: given an element $x$ in |
\var{nf} and a prime ideal \var{pr} in the format output by |
\var{nf} and a prime ideal \var{pr} in the format output by |
Line 3982 principal ideal), but it would be less efficient. |
|
Line 4280 principal ideal), but it would be less efficient. |
|
polynomial $x$ over the number field $\var{nf}$ given by \kbd{nfinit}. $x$ |
polynomial $x$ over the number field $\var{nf}$ given by \kbd{nfinit}. $x$ |
has coefficients in $\var{nf}$ (i.e.~either scalar, polmod, polynomial or |
has coefficients in $\var{nf}$ (i.e.~either scalar, polmod, polynomial or |
column vector). The main variable of $\var{nf}$ must be of \var{lower} |
column vector). The main variable of $\var{nf}$ must be of \var{lower} |
priority than that of $x$ (in other words, the variable number of $\var{nf}$ |
priority than that of $x$ (see \secref{se:priority}). However if |
must be \var{greater} than that of $x$). However if the polynomial defining |
the polynomial defining the number field occurs explicitly in the |
the number field occurs explicitly in the coefficients of $x$ (as modulus of |
coefficients of $x$ (as modulus of a \typ{POLMOD}), its main variable must be |
a \typ{POLMOD}), its main variable must be \var{the same} as the main |
\var{the same} as the main variable of $x$. For example, |
variable of $x$. For example, |
|
\bprog |
\bprog |
? nf = nfinit(y^2 + 1); |
? nf = nfinit(y^2 + 1); |
? nffactor(nf, x^2 + y); \\@com OK |
? nffactor(nf, x^2 + y); \\@com OK |
Line 4003 polmod, polynomial, column vector) or modulo the prime |
|
Line 4300 polmod, polynomial, column vector) or modulo the prime |
|
modulo the rational prime under \var{pr}, polmod or polynomial with |
modulo the rational prime under \var{pr}, polmod or polynomial with |
integermod coefficients, column vector of integermod). The prime ideal |
integermod coefficients, column vector of integermod). The prime ideal |
\var{pr} \var{must} be in the format output by \kbd{idealprimedec}. The |
\var{pr} \var{must} be in the format output by \kbd{idealprimedec}. The |
main variable of $\var{nf}$ must be of lower priority than that of $x$ (in |
main variable of $\var{nf}$ must be of lower priority than that of $x$ |
other words the variable number of $\var{nf}$ must be greater than that of |
(see \secref{se:priority}). However if the coefficients of the number |
$x$). However if the coefficients of the number field occur explicitly (as |
field occur explicitly (as polmods) as coefficients of $x$, the variable of |
polmods) as coefficients of $x$, the variable of these polmods \var{must} |
these polmods \var{must} be the same as the main variable of $t$ (see |
be the same as the main variable of $t$ (see \kbd{nffactor}). |
\kbd{nffactor}). |
|
|
\syn{nffactormod}{\var{nf},x,\var{pr}}. |
\syn{nffactormod}{\var{nf},x,\var{pr}}. |
|
|
Line 4101 preferably monic, irreducible polynomial in $\Z[X]$, i |
|
Line 4398 preferably monic, irreducible polynomial in $\Z[X]$, i |
|
by \var{pol}. As such, it's a technical object passed as the first argument |
by \var{pol}. As such, it's a technical object passed as the first argument |
to most \kbd{nf}\var{xxx} functions, but it contains some information which |
to most \kbd{nf}\var{xxx} functions, but it contains some information which |
may be directly useful. Access to this information via \var{member |
may be directly useful. Access to this information via \var{member |
functions} is prefered since the specific data organization specified below |
functions} is preferred since the specific data organization specified below |
may change in the future. Currently, \kbd{nf} is a row vector with 9 |
may change in the future. Currently, \kbd{nf} is a row vector with 9 |
components: |
components: |
|
|
Line 4115 $\var{nf}[3]$ contains the discriminant $d(K)$ (\kbd{\ |
|
Line 4412 $\var{nf}[3]$ contains the discriminant $d(K)$ (\kbd{\ |
|
$\var{nf}[4]$ contains the index of $\var{nf}[1]$, |
$\var{nf}[4]$ contains the index of $\var{nf}[1]$, |
i.e.~$[\Z_K : \Z[\theta]]$, where $\theta$ is any root of $\var{nf}[1]$. |
i.e.~$[\Z_K : \Z[\theta]]$, where $\theta$ is any root of $\var{nf}[1]$. |
|
|
$\var{nf}[5]$ is a vector containing 7 matrices $M$, $MC$, $T2$, $T$, |
$\var{nf}[5]$ is a vector containing 7 matrices $M$, $G$, $T2$, $T$, |
$MD$, $TI$, $MDI$ useful for certain computations in the number field $K$. |
$MD$, $TI$, $MDI$ useful for certain computations in the number field $K$. |
|
|
\quad$\bullet$ $M$ is the $(r1+r2)\times n$ matrix whose columns represent |
\quad$\bullet$ $M$ is the $(r1+r2)\times n$ matrix whose columns represent |
the numerical values of the conjugates of the elements of the integral |
the numerical values of the conjugates of the elements of the integral |
basis. |
basis. |
|
|
\quad$\bullet$ $MC$ is essentially the conjugate of the transpose of $M$, |
\quad$\bullet$ $G$ is such that $T2 = {}^t G G$, where $T2$ is the quadratic |
except that the last $r2$ columns are also multiplied by 2. |
form $T_2(x) = \sum |\sigma(x)|^2$, $\sigma$ running over the embeddings of |
|
$K$ into $\C$. |
|
|
\quad$\bullet$ $T2$ is an $n\times n$ matrix equal to the real part of the |
\quad$\bullet$ The $T2$ component is deprecated and currently unused. |
product $MC\cdot M$ (which is a real positive definite symmetric matrix), the |
|
so-called $T_2$-matrix (\kbd{\var{nf}.t2}). |
|
|
|
\quad$\bullet$ $T$ is the $n\times n$ matrix whose coefficients are |
\quad$\bullet$ $T$ is the $n\times n$ matrix whose coefficients are |
$\text{Tr}(\omega_i\omega_j)$ where the $\omega_i$ are the elements of the |
$\text{Tr}(\omega_i\omega_j)$ where the $\omega_i$ are the elements of the |
integral basis. Note that $T=\overline{MC}\cdot M$ and in particular that |
integral basis. Note also that $\det(T)$ is equal to the discriminant of the |
$T=T_2$ if the field is totally real (in practice $T_2$ will have real |
field $K$. |
approximate entries and $T$ will have integer entries). Note also that |
|
$\det(T)$ is equal to the discriminant of the field $K$. |
|
|
|
\quad$\bullet$ The columns of $MD$ (\kbd{\var{nf}.diff}) express a $\Z$-basis |
\quad$\bullet$ The columns of $MD$ (\kbd{\var{nf}.diff}) express a $\Z$-basis |
of the different of $K$ on the integral basis. |
of the different of $K$ on the integral basis. |
Line 4153 $\var{nf}[6]$ is the vector containing the $r1+r2$ roo |
|
Line 4447 $\var{nf}[6]$ is the vector containing the $r1+r2$ roo |
|
embeddings of the number field into $\C$ (the first $r1$ components are real, |
embeddings of the number field into $\C$ (the first $r1$ components are real, |
the next $r2$ have positive imaginary part). |
the next $r2$ have positive imaginary part). |
|
|
$\var{nf}[7]$ is an integral basis in Hermite normal form for $\Z_K$ |
$\var{nf}[7]$ is an integral basis for $\Z_K$ (\kbd{\var{nf}.zk}) expressed |
(\kbd{\var{nf}.zk}) expressed on the powers of~$\theta$. |
on the powers of~$\theta$. Its first element is guaranteed to be $1$. This |
|
basis is LLL-reduced with respect to $T_2$ (strictly speaking, it is a |
|
permutation of such a basis, due to the condition that the first element be |
|
$1$). |
|
|
$\var{nf}[8]$ is the $n\times n$ integral matrix expressing the power |
$\var{nf}[8]$ is the $n\times n$ integral matrix expressing the power |
basis in terms of the integral basis, and finally |
basis in terms of the integral basis, and finally |
Line 4168 useful given the existence of \tet{nfnewprec}, to inpu |
|
Line 4465 useful given the existence of \tet{nfnewprec}, to inpu |
|
\kbd{bnf} instead of a polynomial. |
\kbd{bnf} instead of a polynomial. |
|
|
The special input format $[x,B]$ is also accepted where $x$ is a polynomial |
The special input format $[x,B]$ is also accepted where $x$ is a polynomial |
as above and $B$ is the integer basis, as computed by \tet{nfbasis}. This can |
as above and $B$ is the integer basis, as would be computed by \tet{nfbasis}. |
be useful since \kbd{nfinit} uses the round 4 algorithm by default, which can |
This can be useful if the integer basis is known in advance. |
be very slow in pathological cases where round 2 (\kbd{nfbasis(x,2)}) would |
|
succeed very quickly. |
|
|
|
If $\fl=2$: \var{pol} is changed into another polynomial $P$ defining the same |
If $\fl=2$: \var{pol} is changed into another polynomial $P$ defining the same |
number field, which is as simple as can easily be found using the |
number field, which is as simple as can easily be found using the |
Line 4246 $d$ of the number field defined by the (monic, integra |
|
Line 4541 $d$ of the number field defined by the (monic, integra |
|
\var{pol} (all subfields if $d$ is null or omitted). The result is a vector |
\var{pol} (all subfields if $d$ is null or omitted). The result is a vector |
of subfields, each being given by $[g,h]$, where $g$ is an absolute equation |
of subfields, each being given by $[g,h]$, where $g$ is an absolute equation |
and $h$ expresses one of the roots of $g$ in terms of the root $x$ of the |
and $h$ expresses one of the roots of $g$ in terms of the root $x$ of the |
polynomial defining $\var{nf}$. This routine uses J.~Kl\"uners's algorithm, |
polynomial defining $\var{nf}$. This routine uses J.~Kl\"uners's algorithm |
our naïve implementation would be very slow when no sufficiently inert primes |
in the general case, and B.~Allombert's \tet{galoissubfields} when \var{nf} |
can be found, e.g.~when \var{nf} is a compositum of many quadratic fields. So |
is Galois (with weakly supersolvable Galois group).\sidx{Galois}\sidx{subfield} |
it may abort with an error message (\kbd{too many block systems}) if it looks |
|
like the computation is hopeless. This shall eventually be |
|
corrected, using the ideas from \kbd{nfgaloisconj}.\sidx{Galois}\sidx{subfield} |
|
|
|
%If the field is abelian, you can circonvene the problem by using |
|
%\tet{galoisinit} and \tet{galoisfixedfield}, as in |
|
%\bprog |
|
% subf(pol) = |
|
% { |
|
% local(gal,G,H,h,l,gen, L = []); |
|
% gl = galoisinit(pol); |
|
% G = matdiagonal(Vec(g.orders)); |
|
% l = length(G); gen = Mat(vectorv(l,i, g.gen[i])); |
|
% forsubgroup(H = G,, |
|
% h = mathnf(concat(H,G)); |
|
% perm = vector(l,i, factorback(concat(gen, h[,i]))); |
|
% L = concat(L, [galoisfixedfield(g, perm)]) |
|
% ); L |
|
% } |
|
%@eprog |
|
%which returns the same output as \kbd{nfsubfields(pol)}. For non-abelian |
|
%Galois fields, you can still use \tet{galoisinit} and \teb{galoisfixedfield}, |
|
%but you will have to use another package than PARI to compute the subgroup |
|
%lattice, since \tet{forsubgroup} is restricted to the abelian case. |
|
|
|
\syn{subfields}{\var{nf},d}. |
\syn{subfields}{\var{nf},d}. |
|
|
\subsecidx{nfroots}$(\var{nf},x)$: roots of the polynomial $x$ in the number |
\subsecidx{nfroots}$(\var{nf},x)$: roots of the polynomial $x$ in the number |
field $\var{nf}$ given by \kbd{nfinit} without multiplicity. $x$ has |
field $\var{nf}$ given by \kbd{nfinit} without multiplicity. $x$ has |
coefficients in the number field (scalar, polmod, polynomial, column |
coefficients in the number field (scalar, polmod, polynomial, column |
vector). The main variable of $\var{nf}$ must be of lower priority than that |
vector). The main variable of $\var{nf}$ must be of lower priority than that |
of $x$ (in other words the variable number of $\var{nf}$ must be greater than |
of $x$ (see \secref{se:priority}). However if the coefficients of the |
that of $x$). However if the coefficients of the number field occur |
number field occur explicitly (as polmods) as coefficients of $x$, the |
explicitly (as polmods) as coefficients of $x$, the variable of these |
variable of these polmods \var{must} be the same as the main variable of $t$ |
polmods \var{must} be the same as the main variable of $t$ (see |
(see \kbd{nffactor}). |
\kbd{nffactor}). |
|
|
|
\syn{nfroots}{\var{nf},x}. |
\syn{nfroots}{\var{nf},x}. |
|
|
Line 4364 are also implemented. |
|
Line 4634 are also implemented. |
|
|
|
The output is a 3-component vector $[n,s,k]$ with the following meaning: $n$ |
The output is a 3-component vector $[n,s,k]$ with the following meaning: $n$ |
is the cardinality of the group, $s$ is its signature ($s=1$ if the group is |
is the cardinality of the group, $s$ is its signature ($s=1$ if the group is |
a subgroup of the alternating group $A_n$, $s=-1$ otherwise), and $k$ is the |
a subgroup of the alternating group $A_n$, $s=-1$ otherwise). |
number of the group corresponding to a given pair $(n,s)$ ($k=1$ except in 2 |
|
cases). Specifically, the groups are coded as follows, using standard |
$k$ is more arbitrary and the choice made up to version~2.2.3 of PARI is rather |
notations (see GTM 138, quoted at the beginning of this section; see also |
unfortunate: for $n > 7$, $k$ is the numbering of the group among all |
``The transitive groups of degree up to eleven'', by G.~Butler and J.~McKay |
transitive subgroups of $S_n$, as given in ``The transitive groups of degree up |
in Communications in Algebra, vol.~11, 1983, pp.~863--911): |
to eleven'', G.~Butler and J.~McKay, Communications in Algebra, vol.~11, 1983, |
|
pp.~863--911 (group $k$ is denoted $T_k$ there). And for $n \leq 7$, it was ad |
|
hoc, so as to ensure that a given triple would design a unique group. |
|
Specifically, for polynomials of degree $\leq 7$, the groups are coded as |
|
follows, using standard notations |
\smallskip |
\smallskip |
In degree 1: $S_1=[1,-1,1]$. |
In degree 1: $S_1=[1,1,1]$. |
\smallskip |
\smallskip |
In degree 2: $S_2=[2,-1,1]$. |
In degree 2: $S_2=[2,-1,1]$. |
\smallskip |
\smallskip |
Line 4393 In degree 7: $C_7=[7,1,1]$, $D_7=[14,-1,1]$, $M_{21}=[ |
|
Line 4667 In degree 7: $C_7=[7,1,1]$, $D_7=[14,-1,1]$, $M_{21}=[ |
|
$M_{42}=[42,-1,1]$, $PSL_2(7)=PSL_3(2)=[168,1,1]$, $A_7=[2520,1,1]$, |
$M_{42}=[42,-1,1]$, $PSL_2(7)=PSL_3(2)=[168,1,1]$, $A_7=[2520,1,1]$, |
$S_7=[5040,-1,1]$. |
$S_7=[5040,-1,1]$. |
\smallskip |
\smallskip |
The method used is that of resolvent polynomials and is sensitive to the |
This is deprecated and obsolete, but for reasons of backward compatibility, |
current precision. The precision is updated internally but, in very rare |
we cannot change this behaviour yet. So you can use the default |
cases, a wrong result may be returned if the initial precision was not |
\tet{newgaloisformat} to switch to a consistent naming scheme, namely $k$ is |
sufficient. |
always the standard numbering of the group among all transitive subgroups of |
|
$S_n$. If this default is in effect, the above groups will be coded as: |
|
\smallskip |
|
In degree 1: $S_1=[1,1,1]$. |
|
\smallskip |
|
In degree 2: $S_2=[2,-1,1]$. |
|
\smallskip |
|
In degree 3: $A_3=C_3=[3,1,1]$, $S_3=[6,-1,2]$. |
|
\smallskip |
|
In degree 4: $C_4=[4,-1,1]$, $V_4=[4,1,2]$, $D_4=[8,-1,3]$, $A_4=[12,1,4]$, |
|
$S_4=[24,-1,5]$. |
|
\smallskip |
|
In degree 5: $C_5=[5,1,1]$, $D_5=[10,1,2]$, $M_{20}=[20,-1,3]$, |
|
$A_5=[60,1,4]$, $S_5=[120,-1,5]$. |
|
\smallskip |
|
In degree 6: $C_6=[6,-1,1]$, $S_3=[6,-1,2]$, $D_6=[12,-1,3]$, $A_4=[12,1,4]$, |
|
$G_{18}=[18,-1,5]$, $A_4\times C_2=[24,-1,6]$, $S_4^+=[24,1,7]$, |
|
$S_4^-=[24,-1,8]$, $G_{36}^-=[36,-1,9]$, $G_{36}^+=[36,1,10]$, |
|
$S_4\times C_2=[48,-1,11]$, $A_5=PSL_2(5)=[60,1,12]$, $G_{72}=[72,-1,13]$, |
|
$S_5=PGL_2(5)=[120,-1,14]$, $A_6=[360,1,15]$, $S_6=[720,-1,16]$. |
|
\smallskip |
|
In degree 7: $C_7=[7,1,1]$, $D_7=[14,-1,2]$, $M_{21}=[21,1,3]$, |
|
$M_{42}=[42,-1,4]$, $PSL_2(7)=PSL_3(2)=[168,1,5]$, $A_7=[2520,1,6]$, |
|
$S_7=[5040,-1,7]$. |
|
\smallskip |
|
|
\syn{galois}{x,\var{prec}}. |
\misctitle{Warning} The method used is that of resolvent polynomials and is |
|
sensitive to the current precision. The precision is updated internally but, |
|
in very rare cases, a wrong result may be returned if the initial precision |
|
was not sufficient. |
|
|
\subsecidx{polred}$(x,\{\fl=0\},\{p\})$: finds polynomials with reasonably |
\syn{galois}{x,\var{prec}}. To enable the new format in library mode, set the |
|
global variable \tet{new_galois_format} to $1$. |
|
|
|
\subsecidx{polred}$(x,\{\fl=0\},\{fa\})$: finds polynomials with reasonably |
small coefficients defining subfields of the number field defined by $x$. |
small coefficients defining subfields of the number field defined by $x$. |
One of the polynomials always defines $\Q$ (hence is equal to $x-1$), |
One of the polynomials always defines $\Q$ (hence is equal to $x-1$), |
and another always defines the same number field as $x$ if $x$ is irreducible. |
and another always defines the same number field as $x$ if $x$ is irreducible. |
Line 4409 polynomials, \kbd{nf}, \kbd{bnf}, \kbd{[x,Z\_K\_basis] |
|
Line 4713 polynomials, \kbd{nf}, \kbd{bnf}, \kbd{[x,Z\_K\_basis] |
|
|
|
The following binary digits of $\fl$ are significant: |
The following binary digits of $\fl$ are significant: |
|
|
1: does a partial reduction only. This means that only a suborder of the |
1: possibly use a suborder of the maximal order. The primes dividing the |
maximal order may be used. |
index of the order chosen are larger than \tet{primelimit} or divide integers |
|
stored in the \tet{addprimes} table. |
|
|
2: gives also elements. The result is a two-column matrix, the first column |
2: gives also elements. The result is a two-column matrix, the first column |
giving the elements defining these subfields, the second giving the |
giving the elements defining these subfields, the second giving the |
corresponding minimal polynomials. |
corresponding minimal polynomials. |
|
|
If $p$ is given, it is assumed that it is the two-column matrix of the |
If $fa$ is given, it is assumed that it is the two-column matrix of the |
factorization of the discriminant of the polynomial $x$. |
factorization of the discriminant of the polynomial $x$. |
|
|
\syn{polred0}{x,\fl,p,\var{prec}}, where an omitted $p$ is |
\syn{polred0}{x,\fl,fa}, where an omitted $fa$ is coded by \kbd{NULL}. Also |
coded by $gzero$. Also available are $\teb{polred}(x,\var{prec})$ and |
available are $\teb{polred}(x)$ and $\teb{factoredpolred}(x,fa)$, both |
$\teb{factoredpolred}(x,p,\var{prec})$, both corresponding to $\fl=0$. |
corresponding to $\fl=0$. |
|
|
\subsecidx{polredabs}$(x,\{\fl=0\})$: finds one of the polynomial defining |
\subsecidx{polredabs}$(x,\{\fl=0\})$: finds one of the polynomial defining |
the same number field as the one defined by $x$, and such that the sum of the |
the same number field as the one defined by $x$, and such that the sum of the |
Line 4429 squares of the modulus of the roots (i.e.~the $T_2$-no |
|
Line 4734 squares of the modulus of the roots (i.e.~the $T_2$-no |
|
All $x$ accepted by \tet{nfinit} are also allowed here (e.g. non-monic |
All $x$ accepted by \tet{nfinit} are also allowed here (e.g. non-monic |
polynomials, \kbd{nf}, \kbd{bnf}, \kbd{[x,Z\_K\_basis]}). |
polynomials, \kbd{nf}, \kbd{bnf}, \kbd{[x,Z\_K\_basis]}). |
|
|
|
\misctitle{Warning:} this routine uses an exponential-time algorithm to |
|
enumerate all potential generators, and may be exceedingly slow when the |
|
number field has many subfields, hence a lot of elements of small $T_2$-norm. |
|
E.g. do not try it on the compositum of many quadratic fields, use |
|
\tet{polred} instead. |
|
|
The binary digits of $\fl$ mean |
The binary digits of $\fl$ mean |
|
|
1: outputs a two-component row vector $[P,a]$, where $P$ is the default |
1: outputs a two-component row vector $[P,a]$, where $P$ is the default |
Line 4438 whose minimal polynomial is equal to $x$. |
|
Line 4749 whose minimal polynomial is equal to $x$. |
|
4: gives \var{all} polynomials of minimal $T_2$ norm (of the two polynomials |
4: gives \var{all} polynomials of minimal $T_2$ norm (of the two polynomials |
$P(x)$ and $P(-x)$, only one is given). |
$P(x)$ and $P(-x)$, only one is given). |
|
|
\syn{polredabs0}{x,\fl,\var{prec}}. |
16: possibly use a suborder of the maximal order. The primes dividing the |
|
index of the order chosen are larger than \tet{primelimit} or divide integers |
|
stored in the \tet{addprimes} table. In that case it may happen that the |
|
output polynomial does not have minimal $T_2$ norm.\label{se:polredabs} |
|
|
|
\syn{polredabs0}{x,\fl}. |
|
|
\subsecidx{polredord}$(x)$: finds polynomials with reasonably small |
\subsecidx{polredord}$(x)$: finds polynomials with reasonably small |
coefficients and of the same degree as that of $x$ defining suborders of the |
coefficients and of the same degree as that of $x$ defining suborders of the |
order defined by $x$. One of the polynomials always defines $\Q$ (hence |
order defined by $x$. One of the polynomials always defines $\Q$ (hence |
Line 4496 where \var{conductor} is the conductor of the extensio |
|
Line 4812 where \var{conductor} is the conductor of the extensio |
|
class group corresponding to the conductor given as a 3-component |
class group corresponding to the conductor given as a 3-component |
vector [h,cyc,gen] as usual for a group, and \var{subgroup} is a |
vector [h,cyc,gen] as usual for a group, and \var{subgroup} is a |
matrix in HNF defining the subgroup of the ray class group on the |
matrix in HNF defining the subgroup of the ray class group on the |
given generators gen. If $\fl$ is non-zero, check under GRH that |
given generators gen. If $\fl$ is non-zero, check that \var{pol} indeed |
\var{pol} indeed defines an Abelian extension, return 0 if it does not. |
defines an Abelian extension, return 0 if it does not. |
|
|
\syn{rnfconductor}{\var{rnf},\var{pol},\fl}. |
\syn{rnfconductor}{\var{rnf},\var{pol},\fl}. |
|
|
|
|
discriminant of $L$. This is a two-element row vector $[D,d]$, where $D$ is |
discriminant of $L$. This is a two-element row vector $[D,d]$, where $D$ is |
the relative ideal discriminant and $d$ is the relative discriminant |
the relative ideal discriminant and $d$ is the relative discriminant |
considered as an element of $\var{nf}^*/{\var{nf}^*}^2$. The main variable of |
considered as an element of $\var{nf}^*/{\var{nf}^*}^2$. The main variable of |
$\var{nf}$ \var{must} be of lower priority than that of \var{pol}. |
$\var{nf}$ \var{must} be of lower priority than that of \var{pol}, see |
|
\secref{se:priority}. |
|
|
Note: As usual, $\var{nf}$ can be a $\var{bnf}$ as output by \kbd{nfinit}. |
Note: As usual, $\var{nf}$ can be a $\var{bnf}$ as output by \kbd{nfinit}. |
|
|
Line 4587 $\theta = \beta+k\alpha$ where $\theta$ is a root of $ |
|
Line 4904 $\theta = \beta+k\alpha$ where $\theta$ is a root of $ |
|
of $\var{pol}$. |
of $\var{pol}$. |
|
|
The main variable of $\var{nf}$ \var{must} be of lower priority than that |
The main variable of $\var{nf}$ \var{must} be of lower priority than that |
of \var{pol}. Note that for efficiency, this does not check whether the |
of \var{pol} (see \secref{se:priority}). Note that for efficiency, this does |
relative equation is irreducible over $\var{nf}$, but only if it is |
not check whether the relative equation is irreducible over $\var{nf}$, but |
squarefree. If it is reducible but squarefree, the result will be the |
only if it is squarefree. If it is reducible but squarefree, the result will |
absolute equation of the \'etale algebra defined by \var{pol}. If \var{pol} |
be the absolute equation of the \'etale algebra defined by \var{pol}. If |
is not squarefree, an error message will be issued. |
\var{pol} is not squarefree, an error message will be issued. |
|
|
\syn{rnfequation0}{\var{nf},\var{pol},\fl}. |
\syn{rnfequation0}{\var{nf},\var{pol},\fl}. |
|
|
Line 4690 the ideal list starts with $x$, all the other ideals b |
|
Line 5007 the ideal list starts with $x$, all the other ideals b |
|
format considered as base field, and \var{pol} a polynomial defining a relative |
format considered as base field, and \var{pol} a polynomial defining a relative |
extension over $\var{nf}$, this computes all the necessary data to work in the |
extension over $\var{nf}$, this computes all the necessary data to work in the |
relative extension. The main variable of \var{pol} must be of higher priority |
relative extension. The main variable of \var{pol} must be of higher priority |
(i.e.~lower number) than that of $\var{nf}$, and the coefficients of \var{pol} |
(i.e.~lower number, see \secref{se:priority}) than that of $\var{nf}$, and |
must be in $\var{nf}$. |
the coefficients of \var{pol} must be in $\var{nf}$. |
|
|
The result is an 11-component row vector as follows (most of the components |
The result is an 11-component row vector as follows (most of the components |
are technical), the numbering being very close to that of \kbd{nfinit}. In |
are technical), the numbering being very close to that of \kbd{nfinit}. In |
Line 4708 are the number of real and complex places of $L$ above |
|
Line 5025 are the number of real and complex places of $L$ above |
|
$K$ so that $r_{j,1}=0$ and $r_{j,2}=n$ if $j$ is a complex place, while if |
$K$ so that $r_{j,1}=0$ and $r_{j,2}=n$ if $j$ is a complex place, while if |
$j$ is a real place we have $r_{j,1}+2r_{j,2}=n$. |
$j$ is a real place we have $r_{j,1}+2r_{j,2}=n$. |
|
|
$\var{rnf}[3]$ is a two-component row vector $[\d(L/K),s]$ where $\d(L/K)$ |
$\var{rnf}[3]$ is a two-component row vector $[\goth{d}(L/K),s]$ where |
is the relative ideal discriminant of $L/K$ and $s$ is the discriminant of |
$\goth{d}(L/K)$ is the relative ideal discriminant of $L/K$ and $s$ is the |
$L/K$ viewed as an element of $K^*/(K^*)^2$, in other words it is the output |
discriminant of $L/K$ viewed as an element of $K^*/(K^*)^2$, in other words it is |
of \kbd{rnfdisc}. |
the output of \kbd{rnfdisc}. |
|
|
$\var{rnf}[4]$ is the ideal index $\f$, i.e.~such that |
$\var{rnf}[4]$ is the ideal index $\goth{f}$, i.e.~such that |
$d(pol)\Z_K=\f^2\d(L/K)$. |
$d(pol)\Z_K=\goth{f}^2\goth{d}(L/K)$. |
|
|
$\var{rnf}[5]$ is a vector \var{vm} with 7 entries useful for certain |
$\var{rnf}[5]$ is a vector \var{vm} with 7 entries useful for certain |
computations in the relative extension $L/K$. $\var{vm}[1]$ is a vector of |
computations in the relative extension $L/K$. $\var{vm}[1]$ is a vector of |
Line 4786 free, false (0) if not. |
|
Line 5103 free, false (0) if not. |
|
|
|
\syn{rnfisfree}{\var{bnf},x}, and the result is a \kbd{long}. |
\syn{rnfisfree}{\var{bnf},x}, and the result is a \kbd{long}. |
|
|
\subsecidx{rnfisnorm}$(\var{bnf},\var{ext},\var{el},\{\fl=1\})$: similar to |
\subsecidx{rnfisnorm}$(\var{T},\var{a},\{\fl=0\})$: similar to |
\kbd{bnfisnorm} but in the relative case. This tries to decide whether the |
\kbd{bnfisnorm} but in the relative case. $T$ is as output by |
element \var{el} in \var{bnf} is the norm of some $y$ in \var{ext}. |
\tet{rnfisnorminit} applied to the extension $L/K$. This tries to decide |
$\var{bnf}$ is as output by \kbd{bnfinit}. |
whether the element $a$ in $K$ is the norm of some $x$ in the extension |
|
$L/K$. |
|
|
$\var{ext}$ is a relative extension which has to be a row vector whose |
The output is a vector $[x,q]$, where $\var{a}=\var{Norm}(x)*q$. The |
components are: |
algorithm looks for a solution $x$ which is an $S$-integer, with $S$ a list |
|
of places of $K$ containing at least the ramified primes, the generators of |
|
the class group of $L$, as well as those primes dividing \var{a}. If $L/K$ is |
|
Galois, then this is enough; otherwise, $\fl$ is used to add more primes to |
|
$S$: all the places above the primes $p \leq \fl$ (resp.~$p|\fl$) if $\fl>0$ |
|
(resp.~$\fl<0$). |
|
|
$\var{ext}[1]$: a relative equation of the number field \var{ext} over |
The answer is guaranteed (i.e.~\var{a} is a norm iff $q = 1$) if the field is |
\var{bnf}. As usual, the priority of the variable of the polynomial |
Galois, or, under \idx{GRH}, if $S$ contains all primes less than |
defining the ground field \var{bnf} (say $y$) must be lower than the |
$12\log^2\left|\text{disc}(\var{M})\right|$, where \var{M} is the normal |
main variable of $\var{ext}[1]$, say $x$. |
closure of $L/K$. |
|
|
$\var{ext}[2]$: the generator $y$ of the base field as a polynomial in $x$ (as |
If \tet{rnfisnorminit} has determined (or was told) that $L/K$ is |
given by \kbd{rnfequation} with $\fl = 1$). |
\idx{Galois}, and $\fl \neq 0$, a Warning is issued (so that you can set |
|
$\fl = 1$ to check whether $L/K$ is known to be Galois, according to $T$). |
|
|
$\var{ext}[3]$: is the \kbd{bnfinit} of the absolute extension $\var{ext}/\Q$. |
Example: |
|
|
This returns a vector $[a,b]$, where $\var{el}=\var{Norm}(a)*b$. It looks for a |
|
solution which is an $S$-integer, with $S$ a list of places (of \var{bnf}) |
|
containing the ramified primes, the generators of the class group of |
|
\var{ext}, as well as those primes dividing \var{el}. If $\var{ext}/\var{bnf}$ |
|
is known to be \idx{Galois}, set $\fl=0$ (here \var{el} is a norm iff $b=1$). |
|
If $\fl$ is non zero add to $S$ all the places above the primes which: divide |
|
$\fl$ if $\fl<0$, or are less than $\fl$ if $\fl>0$. The answer is guaranteed |
|
(i.e.~\var{el} is a norm iff $b=1$) under \idx{GRH}, if $S$ contains all |
|
primes less than $12\log^2\left|\text{disc}(\var{Ext})\right|$, where |
|
\var{Ext} is the normal closure of $\var{ext} / \var{bnf}$. Example: |
|
|
|
\bprog |
\bprog |
bnf = bnfinit(y^3 + y^2 - 2*y - 1); |
bnf = bnfinit(y^3 + y^2 - 2*y - 1); |
p = x^2 + Mod(y^2 + 2*y + 1, bnf.pol); |
p = x^2 + Mod(y^2 + 2*y + 1, bnf.pol); |
rnf = rnfequation(bnf,p,1); |
T = rnfisnorminit(bnf, p); |
ext = [p, rnf[2], bnfinit(rnf[1])]; |
rnfisnorm(T, 17) |
rnfisnorm(bnf,ext,17, 1) |
|
@eprog |
@eprog |
\noindent checks whether $17$ is a norm in the Galois extension $\Q(\beta) / |
\noindent checks whether $17$ is a norm in the Galois extension $\Q(\beta) / |
\Q(\alpha)$, where $\alpha^3 + \alpha^2 - 2\alpha - 1 = 0$ and $\beta^2 + |
\Q(\alpha)$, where $\alpha^3 + \alpha^2 - 2\alpha - 1 = 0$ and $\beta^2 + |
\alpha^2 + 2*\alpha + 1 = 0$ (it is). |
\alpha^2 + 2\alpha + 1 = 0$ (it is). |
|
|
\syn{rnfisnorm}{\var{bnf},ext,x,\fl,\var{prec}}. |
\syn{rnfisnorm}{\var{T},x,\fl}. |
|
|
\subsecidx{rnfkummer}$(\var{bnr},\var{subgroup},\{deg=0\})$: \var{bnr} |
\subsecidx{rnfisnorminit}$(\var{pol},\var{polrel},\{\fl=2\})$: |
|
let $K$ be defined by a root of \var{pol}, and $L/K$ the extension defined by |
|
the polynomial \var{polrel}. As usual, \var{pol} can in fact be an \var{nf}, |
|
or \var{bnf}, etc; if \var{pol} has degree $1$ (the base field is $\Q$), |
|
polrel is also allowed to be an \var{nf}, etc. Computes technical data needed |
|
by \tet{rnfisnorm} to solve norm equations $Nx = a$, for $x$ in $L$, and $a$ |
|
in $K$. |
|
|
|
If $\fl = 0$, do not care whether $L/K$ is Galois or not. |
|
|
|
If $\fl = 1$, $L/K$ is assumed to be Galois (unchecked), which speeds up |
|
\tet{rnfisnorm}. |
|
|
|
If $\fl = 2$, let the routine determine whether $L/K$ is Galois. |
|
|
|
\syn{rnfisnorminit}{\var{pol},\var{polrel},\fl}. |
|
|
|
\subsecidx{rnfkummer}$(\var{bnr},\{\var{subgroup}\},\{deg=0\})$: \var{bnr} |
being as output by \kbd{bnrinit}, finds a relative equation for the |
being as output by \kbd{bnrinit}, finds a relative equation for the |
class field corresponding to the module in \var{bnr} and the given |
class field corresponding to the module in \var{bnr} and the given |
congruence subgroup. If \var{deg} is positive, outputs the list of all |
congruence subgroup (the full ray class field if \var{subgroup} is omitted). |
relative equations of degree \var{deg} contained in the ray class field |
If \var{deg} is positive, outputs the list of all relative equations of |
defined by \var{bnr}. |
degree \var{deg} contained in the ray class field defined by \var{bnr}, with |
|
the same conductor as $(\var{bnr}, \var{subgroup})$. |
|
|
(THIS PROGRAM IS STILL IN DEVELOPMENT STAGE) |
\misctitle{Warning:} this routine only works for subgroups of prime index. It |
|
uses Kummer theory, adjoining necessary roots of unity (it needs to compute a |
|
tough \kbd{bnfinit} here), and finds a generator via Hecke's characterization |
|
of ramification in Kummer extensions of prime degree. If your extension does |
|
not have prime degree, for the time being, you have to split it by hand as a |
|
tower of such extensions. |
|
|
\syn{rnfkummer}{\var{bnr},\var{subgroup},\var{deg},\var{prec}}, |
\syn{rnfkummer}{\var{bnr},\var{subgroup},\var{deg},\var{prec}}, where |
where \var{deg} is a \kbd{long}. |
\var{deg} is a \kbd{long} and an omitted \var{subgroup} is coded as |
|
\kbd{NULL} |
|
|
\subsecidx{rnflllgram}$(\var{nf},\var{pol},\var{order})$: given a polynomial |
\subsecidx{rnflllgram}$(\var{nf},\var{pol},\var{order})$: given a polynomial |
\var{pol} with coefficients in \var{nf} defining a relative extension $L$ and |
\var{pol} with coefficients in \var{nf} defining a relative extension $L$ and |
Line 4854 class field as output by \kbd{bnrinit} and \var{pol} a |
|
Line 5190 class field as output by \kbd{bnrinit} and \var{pol} a |
|
defining an \idx{Abelian extension}, computes the norm group (alias Artin |
defining an \idx{Abelian extension}, computes the norm group (alias Artin |
or Takagi group) corresponding to the Abelian extension of $\var{bnf}=bnr[1]$ |
or Takagi group) corresponding to the Abelian extension of $\var{bnf}=bnr[1]$ |
defined by \var{pol}, where the module corresponding to \var{bnr} is assumed |
defined by \var{pol}, where the module corresponding to \var{bnr} is assumed |
to be a multiple of the conductor (i.e.~polrel defines a subextension of |
to be a multiple of the conductor (i.e.~\var{pol} defines a subextension of |
bnr). The result is the HNF defining the norm group on the given generators |
bnr). The result is the HNF defining the norm group on the given generators |
of $\var{bnr}[5][3]$. Note that neither the fact that \var{pol} defines an |
of $\var{bnr}[5][3]$. Note that neither the fact that \var{pol} defines an |
Abelian extension nor the fact that the module is a multiple of the conductor |
Abelian extension nor the fact that the module is a multiple of the conductor |
Line 4866 is checked. The result is undefined if the assumption |
|
Line 5202 is checked. The result is undefined if the assumption |
|
Given a monic polynomial \var{pol} with coefficients in $\var{nf}$, finds a |
Given a monic polynomial \var{pol} with coefficients in $\var{nf}$, finds a |
list of relative polynomials defining some subfields, hopefully simpler and |
list of relative polynomials defining some subfields, hopefully simpler and |
containing the original field. In the present version \vers, this is slower |
containing the original field. In the present version \vers, this is slower |
than \kbd{rnfpolredabs}. |
and less efficient than \kbd{rnfpolredabs}. |
|
|
\syn{rnfpolred}{\var{nf},\var{pol},\var{prec}}. |
\syn{rnfpolred}{\var{nf},\var{pol},\var{prec}}. |
|
|
\subsecidx{rnfpolredabs}$(\var{nf},\var{pol},\{\fl=0\})$: relative version of |
\subsecidx{rnfpolredabs}$(\var{nf},\var{pol},\{\fl=0\})$: relative version of |
\kbd{polredabs}. Given a monic polynomial \var{pol} with coefficients in |
\kbd{polredabs}. Given a monic polynomial \var{pol} with coefficients in |
$\var{nf}$, finds a simpler relative polynomial defining the same field. If |
$\var{nf}$, finds a simpler relative polynomial defining the same field. The |
$\fl=1$, returns $[P,a]$ where $P$ is the default output and $a$ is an |
binary digits of $\fl$ mean |
|
|
|
1: returns $[P,a]$ where $P$ is the default output and $a$ is an |
element expressed on a root of $P$ whose characteristic polynomial is |
element expressed on a root of $P$ whose characteristic polynomial is |
\var{pol}, if $\fl=2$, returns an absolute polynomial (same as |
\var{pol} |
|
|
|
2: returns an absolute polynomial (same as |
{\tt rnfequation(\var{nf},rnfpolredabs(\var{nf},\var{pol}))} |
{\tt rnfequation(\var{nf},rnfpolredabs(\var{nf},\var{pol}))} |
|
but faster). |
|
|
\noindent but faster). |
16: possibly use a suborder of the maximal order. This is slower than the |
|
default when the relative discriminant is smooth, and much faster otherwise. |
|
See \secref{se:polredabs}. |
|
|
\misctitle{Remark.} In the present implementation, this is both faster and |
\misctitle{Remark.} In the present implementation, this is both faster and |
much more efficient than \kbd{rnfpolred}, the difference being more |
much more efficient than \kbd{rnfpolred}, the difference being more |
Line 4899 a four-element row vector $[A,I,D,d]$, where $D$ is th |
|
Line 5241 a four-element row vector $[A,I,D,d]$, where $D$ is th |
|
discriminant and $d$ is the relative discriminant considered as an element of |
discriminant and $d$ is the relative discriminant considered as an element of |
$\var{nf}^*/{\var{nf}^*}^2$. |
$\var{nf}^*/{\var{nf}^*}^2$. |
|
|
Note: As usual, $\var{nf}$ can be a $\var{bnf}$ as output by \kbd{bnfinit}. |
|
|
|
\syn{rnfpseudobasis}{\var{nf},\var{pol}}. |
\syn{rnfpseudobasis}{\var{nf},\var{pol}}. |
|
|
\subsecidx{rnfsteinitz}$(\var{nf},x)$: given a number field $\var{nf}$ as |
\subsecidx{rnfsteinitz}$(\var{nf},x)$: given a number field $\var{nf}$ as |
Line 4914 as in \kbd{rnfpseudobasis}. The name of this function |
|
Line 5254 as in \kbd{rnfpseudobasis}. The name of this function |
|
that the ideal class of the last ideal of $I$ (which is well defined) is |
that the ideal class of the last ideal of $I$ (which is well defined) is |
called the \idx{Steinitz class} of the module $\Z_L$. |
called the \idx{Steinitz class} of the module $\Z_L$. |
|
|
Note: $\var{nf}$ can be a $\var{bnf}$ as output by \kbd{bnfinit}. |
|
|
|
\syn{rnfsteinitz}{\var{nf},x}. |
\syn{rnfsteinitz}{\var{nf},x}. |
|
|
\subsecidx{subgrouplist}$(\var{bnr},\{\var{bound}\},\{\fl=0\})$: |
\subsecidx{subgrouplist}$(\var{bnr},\{\var{bound}\},\{\fl=0\})$: |
\var{bnr} being as output by \kbd{bnrinit} or a list of cyclic components |
\var{bnr} being as output by \kbd{bnrinit} or a list of cyclic components |
of a finite Abelian group $G$, outputs the list of subgroups of $G$ |
of a finite Abelian group $G$, outputs the list of subgroups of $G$. Subgroups |
(of index bounded by \var{bound}, if not omitted). Subgroups are given |
are given as HNF\sidx{Hermite normal form} left divisors of the |
as HNF\sidx{Hermite normal form} left divisors of the |
SNF\sidx{Smith normal form} matrix corresponding to $G$. |
SNF\sidx{Smith normal form} matrix corresponding to $G$. If $\fl=0$ |
|
(default) and \var{bnr} is as output by |
|
\kbd{bnrinit}, gives only the subgroups whose modulus is the conductor. |
|
|
|
\syn{subgrouplist0}{\var{bnr},\var{bound},\fl}, where \var{bound} and $\fl$ |
\misctitle{Warning:} the present implementation cannot treat a group $G$ |
are long integers. |
where any cyclic factor has more than $2^{31}$, resp.~$2^{63}$ elements on a |
|
$32$-bit, resp.~$64$-bit architecture. \tet{forsubgroup} is a bit more |
|
general and can handle $G$ if all $p$-Sylow subgroups of $G$ satisfy the |
|
condition above. |
|
|
|
If $\fl=0$ (default) and \var{bnr} is as output by $\kbd{bnrinit}(,,1)$, gives |
|
only the subgroups whose modulus is the conductor. Otherwise, the modulus is |
|
not taken into account. |
|
|
|
If \var{bound} is present, and is a positive integer, restrict the output to |
|
subgroups of index less than \var{bound}. If \var{bound} is a vector |
|
containing a single positive integer $B$, then only subgroups of index |
|
exactly equal to $B$ are computed. For instance |
|
\bprog |
|
? subgrouplist([6,2]) |
|
%1 = [[6, 0; 0, 2], [2, 0; 0, 2], [6, 3; 0, 1], [2, 1; 0, 1], [3, 0; 0, 2], |
|
[1, 0; 0, 2], [6, 0; 0, 1], [2, 0; 0, 1], [3, 0; 0, 1], [1, 0; 0, 1]] |
|
? subgrouplist([6,2],3) \\@com index less than 3 |
|
%2 = [[2, 1; 0, 1], [1, 0; 0, 2], [2, 0; 0, 1], [3, 0; 0, 1], [1, 0; 0, 1]] |
|
? subgrouplist([6,2],[3]) \\@com index 3 |
|
%3 = [[3, 0; 0, 1]] |
|
? bnr = bnrinit(bnfinit(x), [120,[1]], 1); |
|
? L = subgrouplist(bnr, [8]); |
|
@eprog\noindent |
|
In the last example, $L$ corresponds to the 24 subfields of |
|
$\Q(\zeta_{120})$, of degree $8$ and conductor $120\infty$ (by setting \fl, |
|
we see there are a total of $43$ subgroups of degree $8$). |
|
\bprog |
|
? vector(#L, i, galoissubcyclo(bnr, L[i])) |
|
@eprog\noindent |
|
will produce their equations. (For a general base field, you would |
|
have to rely on \tet{bnrstark}, or \tet{rnfkummer}.) |
|
|
|
\syn{subgrouplist0}{\var{bnr},\var{bound},\fl}, where $\fl$ |
|
is a long integer, and an omitted \var{bound} is coded by \kbd{NULL}. |
|
|
\subsecidx{zetak}$(\var{znf},x,\{\fl=0\})$: \var{znf} being a number |
\subsecidx{zetak}$(\var{znf},x,\{\fl=0\})$: \var{znf} being a number |
field initialized by \kbd{zetakinit} (\var{not} by \kbd{nfinit}), |
field initialized by \kbd{zetakinit} (\var{not} by \kbd{nfinit}), |
computes the value of the \idx{Dedekind} zeta function of the number |
computes the value of the \idx{Dedekind} zeta function of the number |
Line 5037 the same extension of $\Q_p$ as $a$. |
|
Line 5406 the same extension of $\Q_p$ as $a$. |
|
|
|
\subsecidx{polcoeff}$(x,s,\{v\})$: coefficient of degree $s$ of the |
\subsecidx{polcoeff}$(x,s,\{v\})$: coefficient of degree $s$ of the |
polynomial $x$, with respect to the main variable if $v$ is omitted, with |
polynomial $x$, with respect to the main variable if $v$ is omitted, with |
respect to $v$ otherwise. |
respect to $v$ otherwise. Also applies to power series, scalars (polynomial |
|
of degree $0$), and to rational functions provided the denominator is a |
|
monomial. |
|
|
\syn{polcoeff0}{x,s,v}, where $v$ is a \kbd{long} and an omitted $v$ is coded |
\syn{polcoeff0}{x,s,v}, where $v$ is a \kbd{long} and an omitted $v$ is coded |
as $-1$. Also available is \teb{truecoeff}$(x,v)$. |
as $-1$. Also available is \teb{truecoeff}$(x,v)$. |
Line 5141 GP it is kept in the variable \kbd{realprecision} and |
|
Line 5512 GP it is kept in the variable \kbd{realprecision} and |
|
user, but it must be explicitly given as a second argument in library mode. |
user, but it must be explicitly given as a second argument in library mode. |
|
|
The algorithm used is a modification of A.~Sch\"onhage\sidx{Sch\"onage}'s |
The algorithm used is a modification of A.~Sch\"onhage\sidx{Sch\"onage}'s |
remarkable root-finding algorithm, due to and implemented by X.~Gourdon. |
root-finding algorithm, due to and implemented by X.~Gourdon. Barring bugs, it |
Barring bugs, it is guaranteed to converge and to give the roots to the |
is guaranteed to converge and to give the roots to the required accuracy. |
required accuracy. |
|
|
|
If $\fl=1$, use a variant of the Newton-Raphson method, which is \var{not} |
If $\fl=1$, use a variant of the Newton-Raphson method, which is \var{not} |
guaranteed to converge, but is rather fast. If you get the messages ``too |
guaranteed to converge, but is rather fast. If you get the messages ``too |
many iterations in roots'' or ``INTERNAL ERROR: incorrect result in roots'', |
many iterations in roots'' or ``INTERNAL ERROR: incorrect result in roots'', |
use the default function (i.e.~no flag or $\fl=0$). This used to be the |
use the default algorithm. This used to be the default root-finding function in |
default root-finding function in PARI until version 1.39.06. |
PARI until version 1.39.06. |
|
|
\syn{roots}{\var{pol},\var{prec}} or $\teb{rootsold}(\var{pol},\var{prec})$. |
\syn{roots}{\var{pol},\var{prec}} or $\teb{rootsold}(\var{pol},\var{prec})$. |
|
|
Line 5166 $\teb{rootmod2}(\var{pol},p)$ ($\fl=1$). |
|
Line 5536 $\teb{rootmod2}(\var{pol},p)$ ($\fl=1$). |
|
|
|
\subsecidx{polrootspadic}$(\var{pol},p,r)$: row vector of $p$-adic roots of the |
\subsecidx{polrootspadic}$(\var{pol},p,r)$: row vector of $p$-adic roots of the |
polynomial \var{pol} with $p$-adic precision equal to $r$. Multiple roots are |
polynomial \var{pol} with $p$-adic precision equal to $r$. Multiple roots are |
\var{not} repeated. $p$ is assumed to be a prime. |
\var{not} repeated. $p$ is assumed to be a prime, and \var{pol} to be |
|
non-zero modulo $p$. |
|
|
\syn{rootpadic}{\var{pol},p,r}, where $r$ is a \kbd{long}. |
\syn{rootpadic}{\var{pol},p,r}, where $r$ is a \kbd{long}. |
|
|
Line 5178 polynomial \var{pol} in the interval $]a,b]$, using St |
|
Line 5549 polynomial \var{pol} in the interval $]a,b]$, using St |
|
\teb{sturm}\kbd{(\var{pol})} is equivalent to |
\teb{sturm}\kbd{(\var{pol})} is equivalent to |
\key{sturmpart}\kbd{(\var{pol},NULL,NULL)}. The result is a \kbd{long}. |
\key{sturmpart}\kbd{(\var{pol},NULL,NULL)}. The result is a \kbd{long}. |
|
|
\subsecidx{polsubcyclo}$(n,d,\{v=x\})$: gives a polynomial (in variable |
\subsecidx{polsubcyclo}$(n,d,\{v=x\})$: gives polynomials (in variable |
$v$) defining the sub-Abelian extension of degree $d$ of the cyclotomic |
$v$) defining the sub-Abelian extensions of degree $d$ of the cyclotomic |
field $\Q(\zeta_n)$, where $d\mid \phi(n)$. $(\Z/n\Z)^*$ has to be cyclic |
field $\Q(\zeta_n)$, where $d\mid \phi(n)$. |
(i.e.~$n=2$, $4$, $p^k$ or $2p^k$ for an odd prime $p$). The function |
|
\tet{galoissubcyclo} covers the general case. |
|
|
|
\syn{subcyclo}{n,d,v}, where $v$ is a variable number. |
If there is exactly one such extension the output is a polynomial, else it is |
|
a vector of polynomials, eventually empty. |
|
|
|
To be sure to get a vector, you can use \kbd{concat([],polsubcyclo(n,d))} |
|
|
|
The function \tet{galoissubcyclo} allows to specify more closely which sub-Abelian extension should be computed. |
|
|
|
\syn{polsubcyclo}{n,d,v}, where $n$, $d$ and $v$ are \kbd{long} and $v$ is a |
|
variable number. When $(\Z/n\Z)^*$ is cyclic, you can use |
|
\teb{subcyclo}$(n,d,v)$, where $n$, $d$ and $v$ are \kbd{long} and $v$ is a |
|
variable number. |
|
|
\subsecidx{polsylvestermatrix}$(x,y)$: forms the Sylvester matrix |
\subsecidx{polsylvestermatrix}$(x,y)$: forms the Sylvester matrix |
corresponding to the two polynomials $x$ and $y$, where the coefficients of |
corresponding to the two polynomials $x$ and $y$, where the coefficients of |
the polynomials are put in the columns of the matrix (which is the natural |
the polynomials are put in the columns of the matrix (which is the natural |
|
|
\subsecidx{thueinit}$(P,\{\fl=0\})$: initializes the \var{tnf} |
\subsecidx{thueinit}$(P,\{\fl=0\})$: initializes the \var{tnf} |
corresponding to $P$. It is meant to be used in conjunction with \tet{thue} |
corresponding to $P$. It is meant to be used in conjunction with \tet{thue} |
to solve Thue equations $P(x,y) = a$, where $a$ is an integer. If $\fl$ is |
to solve Thue equations $P(x,y) = a$, where $a$ is an integer. If $\fl$ is |
non-zero, certify the result unconditionnaly, Otherwise, assume \idx{GRH}, |
non-zero, certify the result unconditionnally, Otherwise, assume \idx{GRH}, |
this being much faster of course. |
this being much faster of course. |
|
|
\syn{thueinit}{P,\fl,\var{prec}}. |
\syn{thueinit}{P,\fl,\var{prec}}. |
Line 5311 guaranteed to be irreducible!). One can check the clos |
|
Line 5690 guaranteed to be irreducible!). One can check the clos |
|
polynomial evaluation or substitution, or by computing the roots of the |
polynomial evaluation or substitution, or by computing the roots of the |
polynomial given by algdep. |
polynomial given by algdep. |
|
|
If $x$ is padic, $\fl$ is meaningless and the algorithm LLL-reduces the |
If $x$ is $p$-adic, $\fl$ is meaningless and the algorithm LLL-reduces the |
``dual lattice'' corresponding to the powers of $x$. |
``dual lattice'' corresponding to the powers of $x$. |
|
|
Otherwise, if $\fl$ is zero, the algorithm used is a variant of the \idx{LLL} |
Otherwise, if $\fl$ is zero, the algorithm used is a variant of the \idx{LLL} |
Line 5414 If $\fl>0$, uses the LLL algorithm. $\fl$ is a paramet |
|
Line 5793 If $\fl>0$, uses the LLL algorithm. $\fl$ is a paramet |
|
between one half the number of decimal digits of precision and that number |
between one half the number of decimal digits of precision and that number |
(see \kbd{algdep}). |
(see \kbd{algdep}). |
|
|
If $\fl<0$, returns as soon as one relation has been found. |
If $\fl<0$, $x$ is allowed to be (and in any case interpreted as) a matrix. |
|
Returns a non trivial element of the kernel of $x$, or $0$ if $x$ has trivial |
|
kernel. |
|
|
\syn{lindep0}{x,\fl,\var{prec}}. Also available is |
\syn{lindep0}{x,\fl,\var{prec}}. Also available is |
$\teb{lindep}(x,\var{prec})$ ($\fl=0$). |
$\teb{lindep}(x,\var{prec})$ ($\fl=0$). |
|
|
|
|
If $x$ is known to have integral entries, set $\fl=1$. |
If $x$ is known to have integral entries, set $\fl=1$. |
|
|
\noindent Note: The library function $\tet{ker_mod_p}(x, p)$, where $x$ has |
\noindent Note: The library function $\tet{FpM_ker}(x, p)$, where $x$ has |
integer entries and $p$ is prime, which is equivalent to but many orders of |
integer entries and $p$ is prime, which is equivalent to but many orders of |
magnitude faster than \kbd{matker(x*Mod(1,p))} and needs much less stack |
magnitude faster than \kbd{matker(x*Mod(1,p))} and needs much less stack |
space. To use it under GP, type \kbd{install(ker\_mod\_p, GG)} first. |
space. To use it under GP, type \kbd{install(FpM\_ker, GG)} first. |
|
|
\syn{matker0}{x,\fl}. Also available are $\teb{ker}(x)$ ($\fl=0$), |
\syn{matker0}{x,\fl}. Also available are $\teb{ker}(x)$ ($\fl=0$), |
$\teb{keri}(x)$ ($\fl=1$) and $\kbd{ker\_mod\_p}(x,p)$. |
$\teb{keri}(x)$ ($\fl=1$) and $\kbd{ker\_mod\_p}(x,p)$. |
Line 5640 If $\fl=0$, uses a modified integer LLL algorithm. |
|
Line 6021 If $\fl=0$, uses a modified integer LLL algorithm. |
|
If $\fl=1$, uses $\kbd{matrixqz}(x,-2)$. If LLL reduction of the final result |
If $\fl=1$, uses $\kbd{matrixqz}(x,-2)$. If LLL reduction of the final result |
is not desired, you can save time using \kbd{matrixqz(matker(x),-2)} instead. |
is not desired, you can save time using \kbd{matrixqz(matker(x),-2)} instead. |
|
|
If $\fl=2$, uses another modified LLL. In the present version \vers, only |
|
independent rows are allowed in this case. |
|
|
|
\syn{matkerint0}{x,\fl}. Also available is |
\syn{matkerint0}{x,\fl}. Also available is |
$\teb{kerint}(x)$ ($\fl=0$). |
$\teb{kerint}(x)$ ($\fl=0$). |
|
|
Line 5788 result is a transformation matrix $T$ such that $x\cdo |
|
Line 6166 result is a transformation matrix $T$ such that $x\cdo |
|
basis of the lattice generated by the column vectors of $x$. |
basis of the lattice generated by the column vectors of $x$. |
|
|
If $\fl=0$ (default), the computations are done with real numbers (i.e.~not |
If $\fl=0$ (default), the computations are done with real numbers (i.e.~not |
with rational numbers) hence are fast but as presently programmed (version |
with rational numbers), using Householder matrices for orthogonalization |
\vers) are numerically unstable. |
(as presently programmed: slow but stable). |
|
|
If $\fl=1$, it is assumed that the corresponding Gram matrix is integral. |
If $\fl=1$, it is assumed that the corresponding Gram matrix is integral. |
The computation is done entirely with integers and the algorithm is both |
The computation is done entirely with integers and the algorithm is both |
Line 5805 two distinct basis vectors $v_i, \, v_j$.] |
|
Line 6183 two distinct basis vectors $v_i, \, v_j$.] |
|
This can be significantly faster than $\fl=1$ when one row is huge compared |
This can be significantly faster than $\fl=1$ when one row is huge compared |
to the other rows. |
to the other rows. |
|
|
If $\fl=3$, all computations are done in rational numbers. This does not |
|
incur numerical instability, but is extremely slow. This function is |
|
essentially superseded by case 1, so will soon disappear. |
|
|
|
If $\fl=4$, $x$ is assumed to have integral entries, but needs not be of |
If $\fl=4$, $x$ is assumed to have integral entries, but needs not be of |
maximal rank. The result is a two-component vector of matrices~: the |
maximal rank. The result is a two-component vector of matrices~: the |
columns of the first matrix represent a basis of the integer kernel of $x$ |
columns of the first matrix represent a basis of the integer kernel of $x$ |
Line 5818 of the matrix $x$. |
|
Line 6192 of the matrix $x$. |
|
|
|
If $\fl=5$, case as case $4$, but $x$ may have polynomial coefficients. |
If $\fl=5$, case as case $4$, but $x$ may have polynomial coefficients. |
|
|
If $\fl=7$, uses an older version of case $0$ above. |
|
|
|
If $\fl=8$, same as case $0$, where $x$ may have polynomial coefficients. |
If $\fl=8$, same as case $0$, where $x$ may have polynomial coefficients. |
|
|
If $\fl=9$, variation on case $1$, using content. |
|
|
|
\syn{qflll0}{x,\fl,\var{prec}}. Also available are |
\syn{qflll0}{x,\fl,\var{prec}}. Also available are |
$\teb{lll}(x,\var{prec})$ ($\fl=0$), $\teb{lllint}(x)$ ($\fl=1$), and |
$\teb{lll}(x,\var{prec})$ ($\fl=0$), $\teb{lllint}(x)$ ($\fl=1$), and |
$\teb{lllkerim}(x)$ ($\fl=4$). |
$\teb{lllkerim}(x)$ ($\fl=4$). |
Line 5843 $\fl=4$: $x$ has integer entries, gives the kernel and |
|
Line 6213 $\fl=4$: $x$ has integer entries, gives the kernel and |
|
|
|
$\fl=5$: same as $4$ for generic $x$. |
$\fl=5$: same as $4$ for generic $x$. |
|
|
$\fl=7$: an older version of case $0$. |
|
|
|
\syn{qflllgram0}{x,\fl,\var{prec}}. Also available are |
\syn{qflllgram0}{x,\fl,\var{prec}}. Also available are |
$\teb{lllgram}(x,\var{prec})$ ($\fl=0$), $\teb{lllgramint}(x)$ ($\fl=1$), and |
$\teb{lllgram}(x,\var{prec})$ ($\fl=0$), $\teb{lllgramint}(x)$ ($\fl=1$), and |
$\teb{lllgramkerim}(x)$ ($\fl=4$). |
$\teb{lllgramkerim}(x)$ ($\fl=4$). |
Line 6006 For example, \kbd{vecextract(x, vecsort(x,,1))} is equ |
|
Line 6374 For example, \kbd{vecextract(x, vecsort(x,,1))} is equ |
|
$\bullet$ 2: sorts $x$ by ascending lexicographic order (as per the |
$\bullet$ 2: sorts $x$ by ascending lexicographic order (as per the |
\kbd{lex} comparison function). |
\kbd{lex} comparison function). |
|
|
$\bullet$ 4: use decreasing instead of ascending order. |
$\bullet$ 4: use descending instead of ascending order. |
|
|
\syn{vecsort0}{x,k,flag}. To omit $k$, use \kbd{NULL} instead. You can also |
\syn{vecsort0}{x,k,flag}. To omit $k$, use \kbd{NULL} instead. You can also |
use the simpler functions |
use the simpler functions |
Line 6030 last two arguments is omitted, fill the vector with ze |
|
Line 6398 last two arguments is omitted, fill the vector with ze |
|
|
|
\synt{vecteur}{GEN nmax, entree *ep, char *expr}. |
\synt{vecteur}{GEN nmax, entree *ep, char *expr}. |
|
|
|
\subsecidx{vectorsmall}$(n,\{X\},\{\var{expr}=0\})$: creates a row vector of small integers (type |
|
\typ{VECSMALL}) with $n$ components whose components are the expression |
|
\var{expr} evaluated at the integer points between 1 and $n$. If one of the |
|
last two arguments is omitted, fill the vector with zeroes. |
|
|
|
\synt{vecteursmall}{GEN nmax, entree *ep, char *expr}. |
|
|
\subsecidx{vectorv}$(n,X,\var{expr})$: as \tet{vector}, but returns a |
\subsecidx{vectorv}$(n,X,\var{expr})$: as \tet{vector}, but returns a |
column vector (type \typ{COL}). |
column vector (type \typ{COL}). |
|
|
Line 6207 the positive divisors of $n$. |
|
Line 6582 the positive divisors of $n$. |
|
Arithmetic functions like \tet{sigma} use the multiplicativity of the |
Arithmetic functions like \tet{sigma} use the multiplicativity of the |
underlying expression to speed up the computation. In the present version |
underlying expression to speed up the computation. In the present version |
\vers, there is no way to indicate that \var{expr} is multiplicative in |
\vers, there is no way to indicate that \var{expr} is multiplicative in |
$n$, hence specialized functions should be prefered whenever possible. |
$n$, hence specialized functions should be preferred whenever possible. |
|
|
\synt{divsum}{entree *ep, GEN num, char *expr}. |
\synt{divsum}{entree *ep, GEN num, char *expr}. |
|
|
Line 6363 Overlapping regions will thus be drawn twice, and the |
|
Line 6738 Overlapping regions will thus be drawn twice, and the |
|
transparent. Then display the whole drawing in a special window on your |
transparent. Then display the whole drawing in a special window on your |
screen. |
screen. |
|
|
\subsecidx{plotfile}$(s)$: set the output file for plotting output. Special |
\subsecidx{plotfile}$(s)$: set the output file for plotting output. The |
filename \kbd{-} redirects to the same place as PARI output. |
special filename \kbd{"-"} redirects to the same place as PARI output. This |
|
is only taken into account by the \kbd{gnuplot} interface. |
|
|
\subsecidx{ploth}$(X=a,b,\var{expr},\{\fl=0\},\{n=0\})$: high precision |
\subsecidx{ploth}$(X=a,b,\var{expr},\{\fl=0\},\{n=0\})$: high precision |
plot of the function $y=f(x)$ represented by the expression \var{expr}, $x$ |
plot of the function $y=f(x)$ represented by the expression \var{expr}, $x$ |
Line 6388 the same window. |
|
Line 6764 the same window. |
|
|
|
\noindent The binary digits of $\fl$ mean: |
\noindent The binary digits of $\fl$ mean: |
|
|
$\bullet$ 1: \tev{parametric plot}. Here \var{expr} must be a vector with |
$\bullet$ $1 = \kbd{Parametric}$: \tev{parametric plot}. Here \var{expr} must |
an even number of components. Successive pairs are then understood as the |
be a vector with an even number of components. Successive pairs are then |
parametric coordinates of a plane curve. Each of these are then drawn. |
understood as the parametric coordinates of a plane curve. Each of these are |
|
then drawn. |
|
|
For instance: |
For instance: |
|
|
|
|
$y=x$. |
$y=x$. |
|
|
|
|
$\bullet$ 2: \tev{recursive plot}. If this flag is set, only \var{one} |
$\bullet$ $2 = \kbd{Recursive}$: \tev{recursive plot}. If this flag is set, |
curve can be drawn at time, i.e.~\var{expr} must be either a two-component |
only \var{one} curve can be drawn at time, i.e.~\var{expr} must be either a |
vector (for a single parametric curve, and the parametric flag \var{has} to |
two-component vector (for a single parametric curve, and the parametric flag |
be set), or a scalar function. The idea is to choose pairs of successive |
\var{has} to be set), or a scalar function. The idea is to choose pairs of |
reference points, and if their middle point is not too far away from the |
successive reference points, and if their middle point is not too far away |
segment joining them, draw this as a local approximation to the curve. |
from the segment joining them, draw this as a local approximation to the |
Otherwise, add the middle point to the reference points. This is very fast, |
curve. Otherwise, add the middle point to the reference points. This is very |
and usually more precise than usual plot. Compare the results of |
fast, and usually more precise than usual plot. Compare the results of |
$$\kbd{ploth(X=-1,1,sin(1/X),2)}\quad |
$$\kbd{ploth(X=-1,1,sin(1/X),2)}\quad |
\text{and}\quad\kbd{ploth(X=-1,1,sin(1/X))}$$ |
\text{and}\quad\kbd{ploth(X=-1,1,sin(1/X))}$$ |
for instance. But beware that if you are extremely unlucky, or choose too few |
for instance. But beware that if you are extremely unlucky, or choose too few |
Line 6425 curve with slightly different parameters. |
|
Line 6802 curve with slightly different parameters. |
|
|
|
The other values toggle various display options: |
The other values toggle various display options: |
|
|
$\bullet$ 4: do not rescale plot according to the computed extrema. This is |
$\bullet$ $4 = \kbd{no\_Rescale}$: do not rescale plot according to the |
meant to be used when graphing multiple functions on a rectwindow (as a |
computed extrema. This is meant to be used when graphing multiple functions |
\tet{plotrecth} call), in conjuction with \tet{plotscale}. |
on a rectwindow (as a \tet{plotrecth} call), in conjunction with |
|
\tet{plotscale}. |
|
|
$\bullet$ 8: do not print the $x$-axis. |
$\bullet$ $8 = \kbd{no\_X\_axis}$: do not print the $x$-axis. |
|
|
$\bullet$ 16: do not print the $y$-axis. |
$\bullet$ $16 = \kbd{no\_Y\_axis}$: do not print the $y$-axis. |
|
|
$\bullet$ 32: do not print frame. |
$\bullet$ $32 = \kbd{no\_Frame}$: do not print frame. |
|
|
$\bullet$ 64: only plot reference points, do not join them. |
$\bullet$ $64 = \kbd{no\_Lines}$: only plot reference points, do not join them. |
|
|
$\bullet$ 256: use splines to interpolate the points. |
$\bullet$ $128 = \kbd{Points_too}$: plot both lines and points. |
|
|
$\bullet$ 512: plot no $x$-ticks. |
$\bullet$ $256 = \kbd{Splines}$: use splines to interpolate the points. |
|
|
$\bullet$ 1024: plot no $y$-ticks. |
$\bullet$ $512 = \kbd{no\_X\_ticks}$: plot no $x$-ticks. |
|
|
$\bullet$ 2048: plot all ticks with the same length. |
$\bullet$ $1024 = \kbd{no\_Y\_ticks}$: plot no $y$-ticks. |
|
|
|
$\bullet$ $2048 = \kbd{Same\_ticks}$: plot all ticks with the same length. |
|
|
\subsecidx{plothraw}$(\var{listx},\var{listy},\{\fl=0\})$: given |
\subsecidx{plothraw}$(\var{listx},\var{listy},\{\fl=0\})$: given |
\var{listx} and \var{listy} two vectors of equal length, plots (in high |
\var{listx} and \var{listy} two vectors of equal length, plots (in high |
precision) the points whose $(x,y)$-coordinates are given in \var{listx} |
precision) the points whose $(x,y)$-coordinates are given in \var{listx} |
Line 6468 must be between $0$ and $1$) and internally converted |
|
Line 6848 must be between $0$ and $1$) and internally converted |
|
The plotting device imposes an upper bound for $x$ and $y$, for instance the |
The plotting device imposes an upper bound for $x$ and $y$, for instance the |
number of pixels for screen output. These bounds are available through the |
number of pixels for screen output. These bounds are available through the |
\tet{plothsizes} function. The following sequence initializes in a portable |
\tet{plothsizes} function. The following sequence initializes in a portable |
way (i.e independant of the output device) a window of maximal size, accessed |
way (i.e independent of the output device) a window of maximal size, accessed |
through coordinates in the $[0,1000] \times [0,1000]$ range~: |
through coordinates in the $[0,1000] \times [0,1000]$ range~: |
|
|
\bprog |
\bprog |
Line 6479 plotscale(0, 0,1000, 0,1000); |
|
Line 6859 plotscale(0, 0,1000, 0,1000); |
|
|
|
\subsecidx{plotkill}$(w)$: erase rectwindow $w$ and free the corresponding |
\subsecidx{plotkill}$(w)$: erase rectwindow $w$ and free the corresponding |
memory. Note that if you want to use the rectwindow $w$ again, you have to |
memory. Note that if you want to use the rectwindow $w$ again, you have to |
use \kbd{initrect} first to specify the new size. So it's better in this case |
use \kbd{plotinit} first to specify the new size. So it's better in this case |
to use \kbd{initrect} directly as this throws away any previous work in the |
to use \kbd{plotinit} directly as this throws away any previous work in the |
given rectwindow. |
given rectwindow. |
|
|
\subsecidx{plotlines}$(w,X,Y,\{\fl=0\})$: draw on the rectwindow $w$ |
\subsecidx{plotlines}$(w,X,Y,\{\fl=0\})$: draw on the rectwindow $w$ |
Line 6544 rectwindow $w$ the curve output of \kbd{ploth}$(w,X=a, |
|
Line 6924 rectwindow $w$ the curve output of \kbd{ploth}$(w,X=a, |
|
|
|
\var{data} is a vector of vectors, each corresponding to a list a coordinates. |
\var{data} is a vector of vectors, each corresponding to a list a coordinates. |
If parametric plot is set, there must be an even number of vectors, each |
If parametric plot is set, there must be an even number of vectors, each |
successive pair corresponding to a curve. Otherwise, the first one containe |
successive pair corresponding to a curve. Otherwise, the first one contains |
the $x$ coordinates, and the other ones contain the $y$-coordinates |
the $x$ coordinates, and the other ones contain the $y$-coordinates |
of curves to plot. |
of curves to plot. |
|
|
Line 6688 HNF\sidx{Hermite normal form} form), one can for insta |
|
Line 7068 HNF\sidx{Hermite normal form} form), one can for insta |
|
[1, 0; 0, 2] |
[1, 0; 0, 2] |
[2, 0; 0, 1] |
[2, 0; 0, 1] |
[1, 0; 0, 1] |
[1, 0; 0, 1] |
@eprog |
@eprog\noindent |
Note that in this last representation, the index $[G:H]$ is given by the |
Note that in this last representation, the index $[G:H]$ is given by the |
determinant. See \tet{galoissubcyclo} and \tet{galoisfixedfield} for |
determinant. See \tet{galoissubcyclo} and \tet{galoisfixedfield} for |
\tet{nfsubfields} applications to \idx{Galois} theory. |
\tet{nfsubfields} applications to \idx{Galois} theory. |
|
|
|
\misctitle{Warning:} the present implementation cannot treat a group $G$, if |
|
one of its $p$-Sylow subgroups has a cyclic factor has more than $2^{31}$, |
|
resp.~$2^{63}$ elements on a $32$-bit, resp.~$64$-bit architecture. |
|
|
\subsubsecidx{forvec}$(X=v,\var{seq},\{\fl=0\})$: $v$ being an $n$-component |
\subsubsecidx{forvec}$(X=v,\var{seq},\{\fl=0\})$: $v$ being an $n$-component |
vector (where $n$ is arbitrary) of two-component vectors $[a_i,b_i]$ |
vector (where $n$ is arbitrary) of two-component vectors $[a_i,b_i]$ |
for $1\le i\le n$, the \var{seq} is evaluated with the formal variable |
for $1\le i\le n$, the \var{seq} is evaluated with the formal variable |
Line 6725 statement is \var{not} a loop (obviously!). |
|
Line 7109 statement is \var{not} a loop (obviously!). |
|
|
|
\subsubsecidx{next}$(\{n=1\})$: interrupts execution of current $seq$, |
\subsubsecidx{next}$(\{n=1\})$: interrupts execution of current $seq$, |
resume the next iteration of the innermost enclosing loop, within the |
resume the next iteration of the innermost enclosing loop, within the |
current fonction call (or top level loop). If $n$ is specified, resume at |
current function call (or top level loop). If $n$ is specified, resume at |
the $n$-th enclosing loop. If $n$ is bigger than the number of enclosing |
the $n$-th enclosing loop. If $n$ is bigger than the number of enclosing |
loops, all enclosing loops are exited. |
loops, all enclosing loops are exited. |
|
|
\subsubsecidx{return}$(\{x=0\})$: returns from current subroutine, with |
\subsubsecidx{return}$(\{x=0\})$: returns from current subroutine, with |
result $x$. |
result $x$. If $x$ is omitted, return the \kbd{(void)} value (return no |
|
result, like \kbd{print}). |
|
|
\subsubsecidx{until}$(a,\var{seq})$: evaluates expression sequence \var{seq} |
\subsubsecidx{until}$(a,\var{seq})$: evaluates expression sequence \var{seq} |
until $a$ is not equal to 0 (i.e.~until $a$ is true). If $a$ is initially |
until $a$ is not equal to 0 (i.e.~until $a$ is true). If $a$ is initially |
Line 7030 result of the evaluation of \var{rec}, and the control |
|
Line 7415 result of the evaluation of \var{rec}, and the control |
|
GP prompt. In particular, current computation is then lost. |
GP prompt. In particular, current computation is then lost. |
|
|
The following error handler prints the list of all user variables, then |
The following error handler prints the list of all user variables, then |
stores in a file their name and their values: |
stores in a file their name and their values:\sidx{writebin} |
\bprog |
\bprog |
? { trap( , |
? { trap( , |
print(reorder); |
print(reorder); |
write("crash", reorder); |
writebin("crash")) } |
write("crash", eval(reorder))) } |
|
@eprog |
@eprog |
|
|
If no recovery code is given (\var{rec} is omitted) a so-called |
If no recovery code is given (\var{rec} is omitted) a so-called |
Line 7134 the corresponding user variable to the saved value. E. |
|
Line 7518 the corresponding user variable to the saved value. E. |
|
x = 1; writebin("log") |
x = 1; writebin("log") |
@eprog |
@eprog |
\noindent reading \kbd{log} into a clean session will set \kbd{x} to $1$. |
\noindent reading \kbd{log} into a clean session will set \kbd{x} to $1$. |
The relative variables priorities of new variables set in this way remain the |
The relative variables priorities (see \secref{se:priority}) of new variables |
same (preset variables retain their former priority, but are set to the new |
set in this way remain the same (preset variables retain their former |
value). In particular, reading such a session log into a clean session will |
priority, but are set to the new value). In particular, reading such a |
restore all variables exactly as they were in the original one. |
session log into a clean session will restore all variables exactly as they |
|
were in the original one. |
|
|
User functions, installed functions and history objects can not be saved via |
User functions, installed functions and history objects can not be saved via |
this function. Just as a regular input file, a binary file can be compressed |
this function. Just as a regular input file, a binary file can be compressed |
using \tet{gzip}, provided the file name has the standard \kbd{.gz} |
using \tet{gzip}, provided the file name has the standard \kbd{.gz} |
extension. \label{se:writebin}\sidx{binary file} |
extension. \label{se:writebin}\sidx{binary file} |
|
|
|
In the present implementation, the binary files are architecture dependant |
|
and compatibility with future versions of GP is not guaranteed. Hence |
|
binary files should not be used for long term storage (also, they are |
|
larger and harder to compress than text files). |
|
|
\subsubsecidx{writetex}$(\var{filename},\{\var{str}*\})$: as \kbd{write}, |
\subsubsecidx{writetex}$(\var{filename},\{\var{str}*\})$: as \kbd{write}, |
in \TeX\ format.\label{se:writetex} |
in \TeX\ format.\label{se:writetex} |