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

In non-euclidean ZZ[:x], calls to gcdx result in infinite loop #1474

Open
mgkurtz opened this issue May 20, 2023 · 1 comment
Open

In non-euclidean ZZ[:x], calls to gcdx result in infinite loop #1474

mgkurtz opened this issue May 20, 2023 · 1 comment

Comments

@mgkurtz
Copy link
Contributor

mgkurtz commented May 20, 2023

Accidentally somewhere in my code, I called gcdx for polynomials in ZZ[:x] instead of QQ[:x]. This led to my tests not terminating 😞 Here some example code:

ZZx, x = ZZ[:x]
gcdx(x, x+2) # does not terminate

Is this non-terminating behavior intended?

In AbstractAlgebra instead, the call to divrem(x, 2) in gcdx fails, while in Nemo it gives (0, x).

Confusingly, both AbstractAlgebra and Nemo compute gcd(x, x+2) as 1.

@fieker
Copy link
Contributor

fieker commented Jun 2, 2023

mathematically, the gcd is well defined in ZZx as it is a UFD, but the gcdx is not possible in ZZx for this example, we have
<x, x+2> cap ZZ = <2>
the gcd computation in Nemo is done in C (flint). Due to Gauss, this is "correct"
This cannot be detected easily as we don't seem to have a euclidean function as part of the ring interface

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

No branches or pull requests

2 participants