Opened 11 years ago
Closed 7 months ago
#3330 closed enhancement (fixed)
multivariate polynomial GCD should work over more base rings
Reported by:  cwitty  Owned by:  malb 

Priority:  major  Milestone:  sage8.5 
Component:  commutative algebra  Keywords:  
Cc:  gaetan.bisson@…  Merged in:  
Authors:  Thierry Monteil  Reviewers:  Vincent Delecroix 
Report Upstream:  N/A  Work issues:  
Branch:  74cdf73 (Commits)  Commit:  74cdf733c940cf5a0dbe7a51f95eb87b997a9188 
Dependencies:  Stopgaps: 
Description
Consider this example:
R.<a,b> = NumberField(x^23,'g').extension(x^27,'h')[] h = R.base_ring().gen() S.<y> = R.fraction_field()[] xgcd(y^2, a*h*y+b)
(reported by Gaëtan Bisson here: http://groups.google.com/group/sagesupport/browse_thread/thread/5338608bd7508b00/cd1d6555592e472f#cd1d6555592e472f)
This fails because Sage attempts to find the GCD of multivariate polynomials over a relative number field using Singular, and Singular does not support relative number fields. This should be implemented in Sage (probably by converting the relative number field into an absolute field, performing the computation, and converting back).
See also #3329, which is about the exact same test case, but requests only a better error message.
Change History (8)
comment:1 Changed 10 years ago by
comment:2 followup: ↓ 3 Changed 10 years ago by
 Cc gaetan.bisson@… added
And now:
  Sage Version 3.4, Release Date: 20090311   Type notebook() for the GUI, and license() for information.   sage: R.<a,b> = NumberField(x^23,'g').extension(x^27,'h')[] sage: h = R.base_ring().gen() sage: S.<y> = R.fraction_field()[] sage: xgcd(y^2, a*h*y+b) (b^2/(7*a^2), 1, ((1)/(h*a))*y + b/(7*a^2))
This actually looks correct to me. I'm ccing the original poster so he can comment on it.
comment:3 in reply to: ↑ 2 ; followup: ↓ 5 Changed 10 years ago by
Replying to AlexGhitza:
This actually looks correct to me. I'm ccing the original poster so he can comment on it.
Thanks for letting me know this issue has been fixed, and many thanks to the people who fixed it.
Something a little bit weird happens if I try to verify Sage's output:
sage: R.<a,b> = NumberField(x^23,'g').extension(x^27,'h')[] sage: h = R.base_ring().gen() sage: S.<y> = R.fraction_field()[] sage: xgcd(y^2, a*h*y+b) (b^2/(7*a^2), 1, ((1)/(h*a))*y + b/(7*a^2)) sage: y^2+(((1)/(h*a))*y + b/(7*a^2))*(a*h*y+b) h*a*b^2/(7*h*a^3)
As you see, the output is not simplified as b^{2}/(7a^{2}); is there a reason for that?
I am not opening a new ticket because I would like to have your opinion on whether it really is a bug or not before possibly doing so.
comment:4 Changed 7 months ago by
 Branch set to u/tmonteil/multivariate_polynomial_gcd_should_work_over_more_base_rings
comment:5 in reply to: ↑ 3 Changed 7 months ago by
 Commit set to 74cdf733c940cf5a0dbe7a51f95eb87b997a9188
 Report Upstream set to N/A
 Status changed from new to needs_review
It seems indeed to work perfectly well now, so let us add a doctest to prevent its comeback.
By the way, replying to bisson:
sage: y^2+(((1)/(h*a))*y + b/(7*a^2))*(a*h*y+b) h*a*b^2/(7*h*a^3)As you see, the output is not simplified as b^{2}/(7a^{2}); is there a reason for that?
Note that we now have:
sage: y^2+(((1)/(h*a))*y + b/(7*a^2))*(a*h*y+b) b^2/(7*a^2)
as expected.
New commits:
74cdf73  #3330 : add doctest for xgcd for polynomials over relative number fields.

comment:6 Changed 7 months ago by
 Reviewers set to Vincent Delecroix
 Status changed from needs_review to positive_review
comment:7 Changed 7 months ago by
 Milestone changed from sagewishlist to sage8.5
comment:8 Changed 7 months ago by
 Branch changed from u/tmonteil/multivariate_polynomial_gcd_should_work_over_more_base_rings to 74cdf733c940cf5a0dbe7a51f95eb87b997a9188
 Resolution set to fixed
 Status changed from positive_review to closed
It does something now: