Opened 5 years ago

Closed 5 years ago

#23845 closed defect (fixed)

Doctest improvements to symbolic GCD

Reported by: Ralf Stephan Owned by:
Priority: major Milestone: sage-8.2
Component: symbolics Keywords:
Cc: Merged in:
Authors: Ralf Stephan Reviewers: Travis Scrimshaw
Report Upstream: N/A Work issues:
Branch: 41ea681 (Commits, GitHub, GitLab) Commit: 41ea6818fb163a2f17cb8152c686f25a384f0edf
Dependencies: #23950 Stopgaps:

Status badges

Description

The following all give errors:

sage: gcd(I-I*x, x^2-1)
sage: gcd(I+I*x, x^2-1)
sage: alg = SR(QQbar(sqrt(2)+I*sqrt(3)))
sage: gcd(alg+alg*x, x^2-1)
sage: gcd(alg-alg*x, x^2-1)
sage: sqrt2 = SR(QQbar(sqrt(2)))
sage: gcd(sqrt2+sqrt2*x, x^2-1)
sage: gcd(sqrt2-sqrt2*x, x^2-1)

This is fixed in Pynac master and should be doctested here.

Note that although Singular supports algebraic GCD Pynac uses Singular only in rational mode. Use a dedicated polynomial ring instead of symbolics if you want algebraic GCD.

Change History (14)

comment:1 Changed 5 years ago by Ralf Stephan

Dependencies: pynac-0.7.12#23950
Report Upstream: Fixed upstream, in a later stable release.N/A

comment:2 Changed 5 years ago by Han Frederic

Can you reproduce this, I have with 8.1beta9:

sage: x=SR('x')
sage: P=(x+1)^2+1
sage: gcd(P,P.expand())
1

comment:3 Changed 5 years ago by Ralf Stephan

Confirmed. We don't expand automatically because products allow quick solutions and need time to expand. I should add this to the ex.gcd docstring.

comment:4 Changed 5 years ago by Ralf Stephan

Maybe this can be fixed. If so, this ticket will add doctests.

comment:5 Changed 5 years ago by Ralf Stephan

Dependencies: #23950#23950, #24262
Milestone: sage-8.1sage-8.2

comment:6 Changed 5 years ago by Emmanuel Charpentier

#24262 fixes the problem. No doctests yet, as far as I can tell...

comment:7 Changed 5 years ago by Ralf Stephan

Branch: u/rws/doctest_improvements_to_symbolic_gcd

comment:8 Changed 5 years ago by git

Commit: 0aa6a9875f09aa668972c58c1bc5d69e3a461179

Branch pushed to git repo; I updated commit sha1. New commits:

0aa6a9823845: Doctest GCD bug fix

comment:9 Changed 5 years ago by Ralf Stephan

Authors: Ralf Stephan
Status: newneeds_review

comment:10 Changed 5 years ago by Travis Scrimshaw

Reviewers: Travis Scrimshaw

Trivial typo: kind -> kinds. You can set a positive review once done.

comment:11 Changed 5 years ago by git

Commit: 0aa6a9875f09aa668972c58c1bc5d69e3a46117941ea6818fb163a2f17cb8152c686f25a384f0edf

Branch pushed to git repo; I updated commit sha1. New commits:

41ea68123845: cosmetics

comment:12 Changed 5 years ago by Ralf Stephan

Status: needs_reviewpositive_review

Thanks.

comment:13 Changed 5 years ago by Volker Braun

Dependencies: #23950, #24262#23950

comment:14 Changed 5 years ago by Volker Braun

Branch: u/rws/doctest_improvements_to_symbolic_gcd41ea6818fb163a2f17cb8152c686f25a384f0edf
Resolution: fixed
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.