Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gcd of rationals is trouble #8111

Closed
pdehaye mannequin opened this issue Jan 28, 2010 · 19 comments
Closed

gcd of rationals is trouble #8111

pdehaye mannequin opened this issue Jan 28, 2010 · 19 comments

Comments

@pdehaye
Copy link
Mannequin

pdehaye mannequin commented Jan 28, 2010

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().

K.<k>= QQ[];
print(gcd(64,256))
print(gcd(K(64),K(256)))
print(gcd(64*k^2+128,64*k^3+256))
frac = (64*k^2+128)/(64*k^3+256)
frac.reduce()
print(frac)

gives

64
1
1
(64*k^2 + 128)/(64*k^3 + 256)

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

@pdehaye pdehaye mannequin added this to the sage-5.11 milestone Jan 28, 2010
@pdehaye pdehaye mannequin assigned aghitza Jan 28, 2010
@burcin
Copy link

burcin commented Jan 29, 2010

comment:1

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().

@kcrisman
Copy link
Member

comment:2

#10771 is probably related/same thing.

@simon-king-jena
Copy link
Member

comment:3

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.

@simon-king-jena
Copy link
Member

comment:4

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.

@jdemeyer jdemeyer modified the milestones: sage-5.11, sage-5.12 Aug 13, 2013
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.1, sage-6.2 Jan 30, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.2, sage-6.3 May 6, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.3, sage-6.4 Aug 10, 2014
@kcrisman
Copy link
Member

comment:9

Possibly related: this discussion.

@sagetrac-jakobkroeker
Copy link
Mannequin

sagetrac-jakobkroeker mannequin commented Aug 20, 2015

Stopgaps: todo

@kliem

This comment has been minimized.

@kliem
Copy link
Contributor

kliem commented May 27, 2020

Changed keywords from none to sd109

@kliem
Copy link
Contributor

kliem commented May 27, 2020

Author: Jonathan Kliem

@kliem kliem removed this from the sage-6.4 milestone May 27, 2020
@kcrisman
Copy link
Member

Changed author from Jonathan Kliem to none

@kcrisman
Copy link
Member

comment:12

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.

@kcrisman kcrisman added this to the sage-9.3 milestone May 27, 2020
@kliem
Copy link
Contributor

kliem commented May 27, 2020

Commit: bed3abb

@kliem
Copy link
Contributor

kliem commented May 27, 2020

New commits:

bed3abbadd doctest for 8111

@kliem

This comment has been minimized.

@kliem
Copy link
Contributor

kliem commented May 27, 2020

Branch: public/8111

@kliem
Copy link
Contributor

kliem commented May 27, 2020

Author: Jonathan Kliem

@mkoeppe mkoeppe modified the milestones: sage-9.3, sage-9.2 Jun 14, 2020
@mkoeppe
Copy link
Member

mkoeppe commented Jun 14, 2020

Reviewer: Matthias Koeppe

@kliem
Copy link
Contributor

kliem commented Jun 14, 2020

comment:16

Thank you.

@vbraun
Copy link
Member

vbraun commented Jul 8, 2020

Changed branch from public/8111 to bed3abb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants