[GAP Forum] EuclideanRemainder returns strange error

Alexander Hulpke hulpke at math.colostate.edu
Tue May 5 17:37:07 BST 2009



Dear Forum, Dear Philipp Schneider,

On May 2, 2009, at 5/2/09 5:30, Philipp Schneider wrote:

> the following error is driving me crazy: [...]
> Well the problem seems to be that I define the ring twice.

Thank you for this bug report. We will fix this in the next release.  
Let me know privately if you want to have a temporary patch already now.

To preserve your sanity, let me explain what is happening -- it is the  
interplay of two issues:
Internally, GAP describes indeterminates by an index number. The first  
variable is assigned number 1, the second number 2, and so on.

As you define the polynomial ring a second time (even though the name  
of the variable is ``x'' both times), you are working with variable  
number 2. (This has been the source of confusion. Future releases will  
therefore trigger a warning when doing this, requiring an indication  
whether the same, or a new variable should be defined.)

Univariate polynomials sim,ply store a coefficient list and the  
`IndeterminateNumberOfUnivariateRationalFunction' for which they are  
defined.

The second issue is multivariate polynomial code (which you get into,  
as you call ``LeadingTermOfPolynomial'', which is inherently  
multivariate). For One(R) it therefore returns the constant one  
polynomial in multivariate storage format.

``EuclideanRemainder'' now needs to consider the polynomial as  
univariate. The conversion code defaults to indeterminate number 1,  
which causes the problem.
Changing the variable number will not ultimately help, the fix has to  
consider constant polynomials as univariate in *any* variable.

(A second (but not the only) problem is your calling of  
`EuclideanRemainder' without a polynomial ring, the code then takes  
the multivariate ring with variables 1 and 2 as default, which is not  
Euclidean any longer. This default behaviour also will be fixed.).

Best,

     Alexander Hulpke

-- Colorado State University, Department of Mathematics,
Weber Building, 1874 Campus Delivery, Fort Collins, CO 80523-1874, USA
email: hulpke at math.colostate.edu, Phone: ++1-970-4914288
http://www.math.colostate.edu/~hulpke





More information about the Forum mailing list