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

Correct AlgebraicElement.denominator #1008

Closed
skirpichev opened this issue Apr 21, 2020 · 1 comment
Closed

Correct AlgebraicElement.denominator #1008

skirpichev opened this issue Apr 21, 2020 · 1 comment
Labels
domains wrong answer if mathematically wrong result was obtained
Milestone

Comments

@skirpichev
Copy link
Collaborator

For example,

In [22]: a = RootOf(4*x**2 + 2*x + 1, 0)

In [23]: A = QQ.algebraic_field(a)

In [24]: A.from_expr(a)
Out[24]: 
        ___  
  1   ╲╱ 3
-- ───────
  4      4   

In [25]: _.denominator
Out[25]: mpz(4)

In [26]: a
Out[26]: 
        ___  
  1   ╲╱ 3
-- ───────
  4      4   

Correct answer is 2. E.g. see the Mathematica:

In[1]:= AlgebraicNumberDenominator[-1/4 - 1/4*3^(1/2)*I]

Out[1]= 2

Refs Arno1996alg has correct implementation.

It worth also investigating if making the primitive element to be an algebraic integer - a good idea.

@skirpichev skirpichev added wrong answer if mathematically wrong result was obtained needs decision domains labels Apr 21, 2020
@skirpichev skirpichev added this to the 0.12 milestone Apr 21, 2020
skirpichev added a commit to skirpichev/diofant that referenced this issue Oct 27, 2020
@skirpichev
Copy link
Collaborator Author

Or we might try to drop the need for this (numerator/denominator are for the rootisolation, which invokes clear_denoms()).

skirpichev added a commit to skirpichev/diofant that referenced this issue Oct 27, 2020
@skirpichev skirpichev modified the milestones: 0.12, 0.13 Jan 15, 2021
skirpichev added a commit to skirpichev/diofant that referenced this issue Jul 19, 2021
skirpichev added a commit to skirpichev/diofant that referenced this issue Jul 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domains wrong answer if mathematically wrong result was obtained
Development

No branches or pull requests

1 participant