Univariate polynomial rings may be defined over any ring R. Let us denote the univariate polynomial ring in indeterminate x over the coefficient ring R by P=R[x].
There are two kinds of polynomials in Magma: univariate polynomials, represented as vectors of coefficients; and multivariate polynomials represented in distributive form (linear sums of coefficient-monomial pairs). In this chapter we discuss univariate polynomials.
The vector representation enables fast arithmetic on univariate polynomials,
but it requires considerable amounts of memory for multivariate polynomials;
therefore, only univariate polynomial rings using the vector representation
can be created directly (but, if one insists, it is possible to create
univariate polynomial rings over univariate polynomial rings, etc.).
Multivariate polynomials can be stored efficiently in distributive form,
but the arithmetic operations on polynomials of one variable stored in
this way may be considerably slower.
Homomorphisms
A ring homomorphism taking a polynomial ring R[x]
as its domain requires 2 pieces of information, namely,
a map (homomorphism) telling how to map the coefficient ring R, together
with the image of the indeterminate x. The map may be omitted.
hom< P -> S | f, y > : RngUPol, Rng, Map, RngElt -> Map
Given a polynomial ring P=R[x], a ring S, a map f : R -> S and an element y in S, create the homomorphism g : P -> S given by that g(sum s_ix^i)=sum f(s_i)y^(i).The coefficient ring map may be omitted, in which case the coefficients are mapped into S by the unitary homomorphism sending 1_R to 1_S. Also, the image y is allowed to be from a structure that allows automatic coercion into S.
> Z := Integers(); > P<x> := PolynomialRing(Z); > Re := RealField(20); > half := hom< P -> Re | 1/2 >; > half(x^3-3*x+5); 3.625
The AssignNames and Name functions can be used to associate
a name with the indeterminate of a polynomial ring after creation.
AssignNames(~P, s) : RngUPol, [ MonStgElt ]) ->
Procedure to change the name of the indeterminate of a polynomial ring P. The indeterminate will be given the name of the string in the sequence s.This procedure only changes the name used in printing the elements of P. It does not assign to identifiers corresponding to the strings the indeterminates in P; to do this, use an assignment statement, or use angle brackets when creating the field.
Note that since this is a procedure that modifies P, it is necessary to have a reference ~P to P in the call to this function.
Given a polynomial ring P, return the i-th indeterminate of P (as an element of P).[Next] [Prev] [Right] [____] [Up] [Index] [Root]