The rational field Q is automatically created when Magma is started up.
Nevertheless, it may be necessary
to formally create the rational field, for instance if it is to be used
as the coefficient ring for a polynomial ring.
There is a unique rational field structure in Magma, that is, multiple
calls to the creation function RationalField() will return
the same object (and not an isomorphic copy), so no memory will be wasted.
Rationals() : Null -> FldRat
Create the field Q of rational numbers.
Create the field Z of rational integers.
The function FieldOfFractions returns the field Q when R is either the ring Z of rational integers, or the field Q itself.
Unlike elements of other structures, rational numbers and integers can be created as literals without the need to define the parent field Q or the parent ring Z first, since these structures are loaded whenever Magma is started up.
Given integers a and b != 0, form the rational number a/b (in reduced form). Of course a and be are allowed to be given as expressions defining integers.
Given the rational field Q, and integers a, b (with b != 0), construct the rational number a / b, in reduced form.
Given the rational field Q, and an integer a, create the rational number a=a/1 in Q. Also, any element from a quadratic, cyclotomic or number field (or an order of such) that is rational can be coerced into the rational field this way.
This function returns, in general, for a positive integer n and a cyclotomic field Q a primitive n-th root of unity in Q; if Q is the rational field, n must be 1 or 2, and the result will be 1 or -1 in Q accordingly.[Next] [Prev] [Right] [Left] [Up] [Index] [Root]