Opened 12 months ago

Last modified 7 weeks ago

#28647 needs_review defect

conversion of Symbolic Ring to FriCAS Expression Integer

Reported by: mantepse Owned by:
Priority: major Milestone: sage-9.3
Component: interfaces: optional Keywords: FriCAS
Cc: chapoton Merged in:
Authors: Martin Rubey Reviewers:
Report Upstream: N/A Work issues:
Branch: u/mantepse/conversion_of_symbolic_ring_to_fricas_expression_integer (Commits) Commit: 09bee2611190ef2d5071427ac69b6a8927e4fece
Dependencies: Stopgaps:

Description (last modified by mantepse)

This ticket modifies the FriCAS interface so that symbolic ring elements are always converted to FriCAS Expression Integer or Expression Complex Integer, depending on whether the complex unit appears. Doing so, we fix the failure below.

see https://ask.sagemath.org/question/48431/why-this-integral-fail-using-fricas-algorithm/

for the original bug report:

integrate(sqrt(2)*x^2 + 2*x,x, algorithm="fricas")

Change History (19)

comment:1 Changed 12 months ago by mantepse

  • Branch set to u/mantepse/conversion_of_symbolic_ring_to_fricas_expression_integer

comment:2 Changed 12 months ago by mantepse

  • Authors set to Martin Rubey
  • Cc chapoton added
  • Commit set to 4c672a0d25b00b0f33c873a71164d5b6e6ac5916
  • Component changed from PLEASE CHANGE to interfaces: optional
  • Description modified (diff)
  • Status changed from new to needs_review
  • Type changed from PLEASE CHANGE to defect

New commits:

4c672a0make sagemath SR convert to FriCAS EXPR INT

comment:3 follow-up: Changed 12 months ago by tmonteil

Possible collision with #28641 which refers to the same ask.sagemath.org question.

comment:4 in reply to: ↑ 3 Changed 12 months ago by mantepse

Replying to tmonteil:

Possible collision with #28641 which refers to the same ask.sagemath.org question.

Yes, but the solutions are orthogonal to each other. In other words: after applying this branch, #28641 solves a different problem.

comment:5 Changed 12 months ago by chapoton

some failing doctests in src/sage/functions/generalized.py and src/sage/functions/exp_integral.py

comment:6 Changed 12 months ago by mantepse

There are unfortunately more problems. In particular, fricas(I) calls FriCASConverter.pyobject(I, I) (as it should). But this now returns I instead of %i.

comment:7 Changed 12 months ago by mantepse

I'm afraid my approach won't work, because FriCAS distinguishes between Expression Integer and Expression Complex Integer.

Put differently, the complex unit I is not an element of Expression Integer, but would have to be expressed as sqrt(-1). I see the following options:

  1. rewrite I as sqrt(-1),
  2. always use Expression Complex Integer,
  3. detect whether I appears and distinguish accordingly,
  4. somehow let FriCAS decide

I tend towards option 1., but I am not sure at all.

comment:8 Changed 12 months ago by mantepse

  • Status changed from needs_review to needs_work

help appreciated

comment:9 Changed 11 months ago by git

  • Commit changed from 4c672a0d25b00b0f33c873a71164d5b6e6ac5916 to 8948d3883678895a95fcc67f72801375e3f23832

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

8948d38try to fix conversion of complex expressions to fricas

comment:10 Changed 11 months ago by mantepse

  • Description modified (diff)
  • Status changed from needs_work to needs_review

comment:11 Changed 11 months ago by mantepse

  • Status changed from needs_review to needs_work

I think I have to make an exception for the conversion of symbols, because otherwise fricas.integrate(ex, x) won't work anymore.

comment:12 Changed 11 months ago by git

  • Commit changed from 8948d3883678895a95fcc67f72801375e3f23832 to d1b449088d9423f1f8faadd0d6e09a1ed873ca30

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

8601700fix doctests
4205759Merge branch 'u/mantepse/conversion_of_symbolic_ring_to_fricas_expression_integer' of git://trac.sagemath.org/sage into t/28647/conversion_of_symbolic_ring_to_fricas_expression_integer
d1b4490Merge branch 'develop' into t/28647/conversion_of_symbolic_ring_to_fricas_expression_integer

comment:13 Changed 11 months ago by mantepse

  • Keywords FriCAS added

comment:14 Changed 11 months ago by git

  • Commit changed from d1b449088d9423f1f8faadd0d6e09a1ed873ca30 to b95f2a46b2a7eecdc3c42d042fae1031b3ade548

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

b95f2a4make an exception for symbols

comment:15 Changed 11 months ago by mantepse

  • Status changed from needs_work to needs_review

comment:16 Changed 11 months ago by git

  • Commit changed from b95f2a46b2a7eecdc3c42d042fae1031b3ade548 to 09bee2611190ef2d5071427ac69b6a8927e4fece

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

09bee26fix doctests

comment:17 Changed 10 months ago by embray

  • Milestone changed from sage-9.0 to sage-9.1

Ticket retargeted after milestone closed

comment:18 Changed 6 months ago by mkoeppe

  • Milestone changed from sage-9.1 to sage-9.2

Moving tickets to milestone sage-9.2 based on a review of last modification date, branch status, and severity.

comment:19 Changed 7 weeks ago by mkoeppe

  • Milestone changed from sage-9.2 to sage-9.3
Note: See TracTickets for help on using tickets.