This chapter describes multivariate polynomial rings in Magma. Multivariate polynomial rings in any number of variables n >= 1 can be created over an arbitrary coefficient ring R, and we will denote it by P=R[x_1, ..., x_n]. Certain functions however will only apply for coefficient rings satisfying certain conditions.
Polynomials in Magma are currently stored internally in one of two different
ways: as vectors of coefficients; or in distributive form.
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.).
See the previous chapter for univariate polynomial rings.
Multivariate polynomials can be stored efficiently in distributive form,
using linked lists of coefficients and monomials,
but the arithmetic operations on polynomials of one variable stored in
this way may be considerably slower. It is possible but not advised
to use distributive `multivariate' polynomials in one single variable.
Homomorphisms
In its general form a ring homomorphism taking a polynomial ring R[x_1, ..., x_n] as domain requires n + 1 pieces of information, namely,
a map (homomorphism) telling how to map the coefficient ring R together
with the images of the n indeterminates.
hom< P -> S | f, y_1, ..., y_n > : RngDPol, Rng -> Map
Given a polynomial ring P=R[x_1, ..., x_n], a ring S, a map f : R -> S and n elements y_1, ..., y_n in S, create the homomorphism g : P -> S by applying the rules that g(rx_i^(a_1) ... x_n^(a_n))=f(r)y_1^(a_1) ... y_n^(a_n) for monomials and linearity, that is, g(M + N)=g(M) + g(N).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 images y_i are allowed to be from a structure that allows automatic coercion into S.
> Q := RationalField(); > R<x, y> := PolynomialRing(Q, 2); > A<a> := PolynomialRing(Integers()); > N<z, w> := NumberField([a^3-2, a^2+5]); > h := hom< R -> N | z, w >; > print h(x^11*y^3-x+4/5*y-13/4); -40*w*z^2 - z + 4/5*w - 13/4
The AssignNames and Name functions can be used to associate
names with the indeterminates of polynomial rings after creation.
AssignNames(~P, s) : RngDPol, [ MonStgElt ]) ->
Procedure to change the name of the indeterminates of a polynomial ring P. The i-th indeterminate will be given the name of the i-th element of the sequence of strings s (for 1 <= i <= #s); the sequence may have length less than the number of indeterminates of P, in which case the remaining indeterminate names remain unchanged.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]