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

poly(((x - 1)**2 + 1)*((x - 1)**2 + 2)*(x - 1)).all_roots() hangs #14291

Closed
skirpichev opened this Issue Feb 20, 2018 · 6 comments

Comments

Projects
None yet
3 participants
@skirpichev
Copy link
Contributor

skirpichev commented Feb 20, 2018

bisected to 73fafba

@vishalg2235

This comment has been minimized.

Copy link
Contributor

vishalg2235 commented Feb 22, 2018

I found that the infinite loop occurs here. I am having some difficulty in understanding the code/work of this function. @skirpichev @jksuom can you show me some examples that what _refine_complexes do ?

@smichr

This comment has been minimized.

Copy link
Member

smichr commented Feb 22, 2018

what _refine_complexes do

Isn't this the routine that tries to locate each root within a rectangle that is horizontally and vertically distinct from every other root's rectangle?

@smichr

This comment has been minimized.

Copy link
Member

smichr commented Feb 23, 2018

The problem is that the complex roots of two equations may share the same real value so the roots will never be isolated to satisfy the assumptions of the routine (which wrongly assumed this would not be the case).

@vishalg2235

This comment has been minimized.

Copy link
Contributor

vishalg2235 commented Feb 24, 2018

@smichr I couldn't locate where in code it is checking the same real value of roots? please help!
And complexes in _refine_complexes() is:

[((0, 6) x (-6, 0), Poly(x**2 - 2*x + 3, x, domain='ZZ'), 1), ((0, 6) x (0, 6), Poly(x**2 - 2*x + 3, x, domain='ZZ'), 1), ((0, 4) x (-4, 0), Poly(x**2 - 2*x + 2, x, domain='ZZ'), 1), ((0, 4) x (0, 4), Poly(x**2 - 2*x + 2, x, domain='ZZ'), 1)]

What are those (0, 6), (0, -6)?

@skirpichev

This comment has been minimized.

Copy link
Contributor

skirpichev commented Feb 24, 2018

The problem is that the complex roots of two equations may share the same real value

Oh, again wrong (: Complex roots of one equation may share the same real part (actually, we care about different conjugated pairs of roots, if coefficients of the equation are real).

BTW, @vishalg2235, I wonder what you did to "locate where in code it is"?

@vishalg2235

This comment has been minimized.

Copy link
Contributor

vishalg2235 commented Feb 24, 2018

@skirpichev I was trying to understand _refine_complexes() but couldn't understand what logic is applied here. Can you please get me more familiar with this code ?

skirpichev added a commit to skirpichev/diofant that referenced this issue Mar 19, 2018

skirpichev added a commit to skirpichev/diofant that referenced this issue Mar 27, 2018

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