Closed ffc49b07-0ea9-4bb7-be61-8d0cf4baa5a0 closed 4 years ago
I think the trouble here is our generic fraction field code, not how we define the gcd of rational numbers.
For efficiency, we should represent QQ(x) as Frac(ZZ[x]), and do the necessary normalisation of the denominator (it should be monic) when the user accesses it with .denominator()
.
Replying to @kcrisman:
10771 is probably related/same thing.
It may be related, but my patch from #10771 does not touch the gcd for QQ['x']
(perhaps it should?). So far, the two tickets are about different issues.
Replying to @simon-king-jena:
Replying to @kcrisman:
10771 is probably related/same thing.
It may be related, but my patch from #10771 does not touch the gcd for
QQ['x']
(perhaps it should?). So far, the two tickets are about different issues.
PS: It seems to me that for changing gcd for univariate polynomials over the rationals, one has to dive into flint. I'll not do that, it'd be too far off topic for me. BTW, the doc string explicitly states that gcd in QQ['x']
returns the monic gcd.
Possibly related: this discussion.
Stopgaps: todo
Description changed:
---
+++
@@ -1,13 +1,26 @@
+This appears to be solved by now.
+
+The output is now
+
+```
+64
+1
+1
+(k^2 + 2)/(k^3 + 4)
+```
+
+Original description (updated to python3):
+
The GCD of rationals is still unclear (see trac 3214), and leads to definite problems with reduce().
K.
gives
Changed keywords from none to sd109
Author: Jonathan Kliem
Changed author from Jonathan Kliem to none
If this is fixed, we should probably have a doctest then. Unless it wasn't an error to begin with? Or it's possible it was fixed elsewhere and doctested, which is fine too.
Description changed:
---
+++
@@ -1,15 +1,4 @@
-This appears to be solved by now.
-
-The output is now
-
-```
-64
-1
-1
-(k^2 + 2)/(k^3 + 4)
-```
-
-Original description (updated to python3):
+The following was solved along the way. We add a doctest.
The GCD of rationals is still unclear (see trac 3214), and leads to definite problems with reduce().
Branch: public/8111
Author: Jonathan Kliem
Reviewer: Matthias Koeppe
Thank you.
Changed branch from public/8111 to bed3abb
The following was solved along the way. We add a doctest.
The GCD of rationals is still unclear (see trac 3214), and leads to definite problems with reduce().
gives
The last line in particular is false, according to me.
Component: basic arithmetic
Keywords: sd109
Stopgaps: todo
Author: Jonathan Kliem
Branch/Commit:
bed3abb
Reviewer: Matthias Koeppe
Issue created by migration from https://trac.sagemath.org/ticket/8111