Opened 6 years ago

Closed 6 years ago

#17736 closed defect (fixed)

not all fractions get converted with ex.fraction()

Reported by: rws Owned by:
Priority: major Milestone: sage-6.7
Component: symbolics Keywords:
Cc: Merged in:
Authors: Ralf Stephan Reviewers: Martin Albrecht
Report Upstream: N/A Work issues:
Branch: b46d1df (Commits, GitHub, GitLab) Commit: b46d1df5a328fd39b2d6fa47e09deb2f8619b8e5
Dependencies: Stopgaps:

Status badges

Description

sage: a = var('a')
sage: b = (1/a).fraction(QQ)
...
TypeError: unsupported operand parent(s) for '/': 'Univariate Polynomial Ring in x over Rational Field' and 'Univariate Polynomial Ring in a over Rational Field'

The 1 apparently gets coerced into the x-ring, so we need to ensure equal rings somehow.

Change History (8)

comment:1 Changed 6 years ago by rws

  • Branch set to u/rws/not_all_fractions_get_converted_with_ex_fraction__

comment:2 Changed 6 years ago by rws

  • Authors set to Ralf Stephan
  • Commit set to b46d1df5a328fd39b2d6fa47e09deb2f8619b8e5
  • Milestone changed from sage-6.5 to sage-6.6
  • Status changed from new to needs_review

New commits:

b46d1df17736: not all fractions get converted with ex.fraction()

comment:3 Changed 6 years ago by rws

Passes all patchbot tests.

comment:4 Changed 6 years ago by malb

  • Milestone changed from sage-6.6 to sage-6.7
  • Reviewers set to Martin Albrecht
  • Status changed from needs_review to positive_review

Looks good to me. A potential feature request could be to allow the user to specify the ordering of variables, but perhaps that's overkill?

comment:5 Changed 6 years ago by rws

I'm not so familiar with algebra. Would you suggest specific orderings or is there a convention?

comment:6 follow-up: Changed 6 years ago by malb

Hi, sorry for not being clear:

I merely meant the ordering of variable (names), where you currently call sort(). But as I said: it's an optional feature request which could go into a separate ticket.

Of course, arbitrary term ordering ("lex" and "deglex" etc.) could also be considered. But I'd say a user should do the conversion by hand perhaps in this case.

comment:7 in reply to: ↑ 6 Changed 6 years ago by rws

Replying to malb:

I merely meant the ordering of variable (names), where you currently call sort(). But as I said: it's an optional feature request which could go into a separate ticket.

Ah but yes, I agree. Thanks for the review.

comment:8 Changed 6 years ago by vbraun

  • Branch changed from u/rws/not_all_fractions_get_converted_with_ex_fraction__ to b46d1df5a328fd39b2d6fa47e09deb2f8619b8e5
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.