Closed bhutz closed 11 years ago
Description changed:
---
+++
@@ -1,18 +1,15 @@
The .reduce() function for a polynomial ring can return an 'int' type when the base field is a p-adic field.
-R.<y1,y2>=PolynomialRing(Qp(5),2, order='lex')
-G=[y1^2 + y2^2, y1*y2 + y2^2, y2^3]
-type((y2^3).reduce(G))
-
+```
+R.<y1,y2>=PolynomialRing(Qp(5),2, order='lex') G=[y1^2^ + y2^2^, y1*y2 + y2^2^, y2^3^] type((y2^3^).reduce(G))
+```
It should be returning an element of the polynomial ring.
This was noticed since it causes .variety() to fail.
-R.<y1,y2>=PolynomialRing(Qp(5),2, order='lex')
-G=[y1^2 + y2^2, y1*y2 + y2^2, y2^3]
+```
+R.<y1,y2>=PolynomialRing(Qp(5),2, order='lex') G=[y1^2^ + y2^2^, y1*y2 + y2^2^, y2^3^]
I=ideal(G)
I.variety()
-
-
+```
Some discussion at: https://groups.google.com/forum/?fromgroups=#!topic/sage-support/Ar7z2b5cOic
-
I fixed some formatting issues with the ticket description.
Description changed:
---
+++
@@ -1,14 +1,17 @@
The .reduce() function for a polynomial ring can return an 'int' type when the base field is a p-adic field.
-R.<y1,y2>=PolynomialRing(Qp(5),2, order='lex') G=[y1^2^ + y2^2^, y1y2 + y2^2^, y2^3^] type((y2^3^).reduce(G)) +R.<y1,y2>=PolynomialRing(Qp(5),2, order='lex') +G=[y1^2 + y2^2, y1y2 + y2^2, y2^3] +type((y2^3).reduce(G))
It should be returning an element of the polynomial ring.
This was noticed since it causes .variety() to fail.
-R.<y1,y2>=PolynomialRing(Qp(5),2, order='lex') G=[y1^2^ + y2^2^, y1y2 + y2^2^, y2^3^] +R.<y1,y2>=PolynomialRing(Qp(5),2, order='lex') +G=[y1^2 + y2^2, y1y2 + y2^2, y2^3] I=ideal(G) I.variety()
And promptly broke them, as well. (It looked good before I hit submit, honest!) Okay, I'll try again...
I can work on this, if no one else has their heart set on it.
Changed author from Ben Hutz to none
Please do! If it's a simple fix of type, maybe I can review it for you.
Replying to @kcrisman:
Please do! If it's a simple fix of type, maybe I can review it for you.
It would be very easy if I could figure out how I pooched my development environment. I have a working fix, but mercurial doesn't seem to notice the changes. I hate it when this happens.
Attachment: trac_13903.patch.gz
simple patch + doctest
I said it was an easy fix. This bug has burned me in other contexts, so it wasn't hard to find and fix.
Description changed:
---
+++
@@ -16,3 +16,7 @@
I.variety()
Some discussion at: https://groups.google.com/forum/?fromgroups=#!topic/sage-support/Ar7z2b5cOic + +Apply: + +* attachment: trac_13903.patch
I still get
sage: I=ideal(G)
sage: I.variety()
verbose 0 (3482: multi_polynomial_ideal.py, groebner_basis) Warning: falling back to very slow toy implementation.
verbose 0 (1359: multi_polynomial_ideal.py, dimension) Warning: falling back to very slow toy implementation.
verbose 0 (2365: multi_polynomial_ideal.py, variety) Warning: falling back to very slow toy implementation.
verbose 0 (3482: multi_polynomial_ideal.py, groebner_basis) Warning: falling back to very slow toy implementation.
[{y1: O(5^20), y2: O(5^20)}]
but presumably that's okay. I'm uploading a slight refresh of your patch to use our new(ish) :trac:
markup, and fixed the other non-occurrence of that in the file (there were several with the new markup already).
Attachment: trac_13903-reviewed.patch.gz
Apply only this
Patchbot, apply trac_13903-reviewed.patch
Reviewer: Karl-Dieter Crisman
Author: John Perry
Description changed:
---
+++
@@ -19,4 +19,4 @@
**Apply**:
-* [attachment: trac_13903.patch](https://github.com/sagemath/sage-prod/files/10656872/trac_13903.patch.gz)
+* [attachment: trac_13903-reviewed.patch](https://github.com/sagemath/sage-prod/files/10656873/trac_13903-reviewed.patch.gz)
Replying to @kcrisman:
I still get
sage: I=ideal(G) sage: I.variety() verbose 0 (3482: multi_polynomial_ideal.py, groebner_basis) Warning: falling back to very slow toy implementation. verbose 0 (1359: multi_polynomial_ideal.py, dimension) Warning: falling back to very slow toy implementation. verbose 0 (2365: multi_polynomial_ideal.py, variety) Warning: falling back to very slow toy implementation. verbose 0 (3482: multi_polynomial_ideal.py, groebner_basis) Warning: falling back to very slow toy implementation. [{y1: O(5^20), y2: O(5^20)}]
but presumably that's okay.
If you mean that the warnings are bothering you, then yes, that's okay. Unless I misread the Singular manual, it doesn't deal with Qp, though I could be wrong (I know next to nothing about p-adics, and Singular does deal with Zp). If Singular DOES implement Qp, then we haven't yet implemented that interface. That should be another ticket, though, because this bug would likely pop up even if we weren't in Qp.
I'm uploading a slight refresh of your patch to use our new(ish) :trac: markup...
Hunh. I didn't know about that. I wonder if I can remember it for the future... ;-)
Thanks. This looked good on my tests as well.
Yes, that result from .variety() is the correct final answer, well really the result is the point (1:0:0) in projective space Qp, but up to precision that is what is returned. The warnings I ignored ;)
Merged: sage-5.6.beta3
The .reduce() function for a polynomial ring can return an 'int' type when the base field is a p-adic field.
It should be returning an element of the polynomial ring.
This was noticed since it causes .variety() to fail.
Some discussion at: https://groups.google.com/forum/?fromgroups=#!topic/sage-support/Ar7z2b5cOic
Apply:
* attachment: trac_13903-reviewed.patch
Component: algebra
Keywords: polynomial reduce
Author: John Perry
Reviewer: Karl-Dieter Crisman
Merged: sage-5.6.beta3
Issue created by migration from https://trac.sagemath.org/ticket/13903