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

implement fricas integrator #9427

Closed
sagetrac-whuss mannequin opened this issue Jul 5, 2010 · 23 comments
Closed

implement fricas integrator #9427

sagetrac-whuss mannequin opened this issue Jul 5, 2010 · 23 comments

Comments

@sagetrac-whuss
Copy link
Mannequin

sagetrac-whuss mannequin commented Jul 5, 2010

The attached patch adds the option algorithm="fricas" to the integrate
command.

CC: @hemmecke

Component: symbolics

Keywords: integrate, fricas

Author: Wilfried Huss, Frédéric Chapoton

Branch/Commit: c5bd849

Reviewer: Burcin Erocal, Ralf Stephan

Issue created by migration from https://trac.sagemath.org/ticket/9427

@sagetrac-whuss sagetrac-whuss mannequin added this to the sage-4.7 milestone Jul 5, 2010
@sagetrac-whuss sagetrac-whuss mannequin assigned burcin Jul 5, 2010
@sagetrac-whuss
Copy link
Mannequin Author

sagetrac-whuss mannequin commented Jul 5, 2010

comment:1

Attachment: trac_9427-fricas-integrate.patch.gz

@sagetrac-whuss sagetrac-whuss mannequin added the s: needs review label Jul 5, 2010
@burcin
Copy link

burcin commented Jul 5, 2010

Changed author from whuss to Wilfried Huss

@burcin
Copy link

burcin commented Jul 5, 2010

Reviewer: Burcin Erocal

@burcin
Copy link

burcin commented Jul 5, 2010

comment:2

This looks great. Thanks for the quick patch!

I have a few minor comments:

  • the conversion of different infinities on line 95-103 should be moved to the _fricas_init_() method of the corresponding classes. Then this would work:
sage: infinity._fricas_init_()
"%plusInfinity"

and we can just do af = a.fricas().

  • Similarly, I suggest moving the code for converting the result back to the _sage_() method of the fricas interface.

@sagetrac-whuss
Copy link
Mannequin Author

sagetrac-whuss mannequin commented Jul 5, 2010

comment:3

Attachment: fricas_infinity.patch.gz

Replying to @burcin:

  • the conversion of different infinities on line 95-103 should be moved to the _fricas_init_() method of the corresponding classes. Then this would work:
sage: infinity._fricas_init_()
"%plusInfinity"

I tried this (see fricas_infinity.patch), but for some reason that I don't understand the output of
fricas_init() changes into something which is not a valid fricas expression.

sage: oo._fricas_init_()
'%plusInfinity'

but

sage: oo._fricas_()
+ infinity

I have no idea what is going on here.

@sagetrac-drkirkby
Copy link
Mannequin

sagetrac-drkirkby mannequin commented Jul 6, 2010

comment:4

Is "algorithm" the most appropiate word here? To me, Fricas, Aximom, Maxima etc are software packages, not algorithms. They implement many differerent algorithms.

I'm not a mathmatician, but certainly my mathematical training would never have suggested that Fricas was an algorithm.

I would have thought something like

integrate(f(x), x, use="fricas") 
integrate(f(x), x, software="fricas") 
integrate(f(x), x, method="fricas") 

would be better than

integrate(f(x), x, algorithm="fricas") 

I don't claim any of my choices are optimal, but I think all of them are better than "algorithm".

Dave

@sagetrac-whuss
Copy link
Mannequin Author

sagetrac-whuss mannequin commented Jul 7, 2010

comment:5

Replying to @sagetrac-drkirkby:

If I do

sage: search_def('algorithm=')

I get 150 results. So the 'algorithm' convention is widely
used in Sage, I don't think it makes sense to change this
at this point.

@burcin
Copy link

burcin commented May 10, 2011

comment:6

Replying to @sagetrac-whuss:

Replying to @burcin:

  • the conversion of different infinities on line 95-103 should be moved to the _fricas_init_() method of the corresponding classes. Then this would work:
sage: infinity._fricas_init_()
"%plusInfinity"

I tried this (see fricas_infinity.patch), but for some reason that I don't understand the output of
fricas_init() changes into something which is not a valid fricas expression.

sage: oo._fricas_init_()
'%plusInfinity'

but

sage: oo._fricas_()
+ infinity

I have no idea what is going on here.

This seems to be how fricas prints %plusInfinity. Ralf, can you help us with this?

@burcin burcin modified the milestones: sage-4.7, sage-4.7.1 May 10, 2011
@hemmecke
Copy link
Contributor

comment:7

Well, not quite right, as http://axiom-wiki.newsynthesis.org/PerCent shows. I've added

)set output algebra on

in order to also show the ascii output. Otherwise mathaction renders tex output of axiom. These things starting with a percent sign are only used for input. What exactly gets printed depends on the ')set output' settings.

@hemmecke
Copy link
Contributor

comment:8

Also look at the exports of OrderedCompletion.
https://github.com/hemmecke/fricas-svn/blob/master/src/algebra/complet.spad.pamphlet#L20
Obviously also 'plusInfinity()' and 'minusInfinity()' could be used as input.

The output is constructed in
https://github.com/hemmecke/fricas-svn/blob/master/src/algebra/complet.spad.pamphlet#L59
How the symbol infinity appears is hidden inside OutputForm and probably deeper.

)set output tex on
(1) -> plusInfinity()      

   (1)   + infinity
$$
+\infty 
\leqno(1)
$$

                                             Type: OrderedCompletion(Integer)

@burcin
Copy link

burcin commented May 10, 2011

comment:9

So the ascii output for plusInfinity is "+ infinity" and the _fricas_init_() method in attachment: fricas_infinity.patch works as intended.

Wilfried, will you have time to revise the patch? Note that when #9880 is merged (almost) all symbolics patches will need to be rebased.

@jdemeyer jdemeyer modified the milestones: sage-5.11, sage-5.12 Aug 13, 2013
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.1, sage-6.2 Jan 30, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.2, sage-6.3 May 6, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.3, sage-6.4 Aug 10, 2014
@videlec
Copy link
Contributor

videlec commented Dec 7, 2014

comment:14

Replying to @sagetrac-drkirkby:

Is "algorithm" the most appropiate word here? To me, Fricas, Aximom, Maxima etc are software packages, not algorithms. They implement many differerent algorithms.

I'm not a mathmatician, but certainly my mathematical training would never have suggested that Fricas was an algorithm.

I would have thought something like

integrate(f(x), x, use="fricas") 
integrate(f(x), x, software="fricas") 
integrate(f(x), x, method="fricas") 

would be better than

integrate(f(x), x, algorithm="fricas") 

I don't claim any of my choices are optimal, but I think all of them are better than "algorithm".

+1 for use, software or library
Moreover, in some situation, when we call the software (fricas, maxima, ...) we might want to feed it with an option algorithm.

Vincent

@fchapoton
Copy link
Contributor

comment:15

I have made a git branch with the attached files, rebased on 6.5.b2


New commits:

2b719dbImplement algorithm="fricas" for integration
5db0224convert infinities to fricas

@fchapoton
Copy link
Contributor

Commit: 5db0224

@fchapoton
Copy link
Contributor

Branch: public/ticket/9427

@rwst
Copy link

rwst commented Feb 2, 2015

comment:16

Replying to @videlec:

Moreover, in some situation, when we call the software (fricas, maxima, ...) we might want to feed it with an option algorithm.

First I agreed with this, but now I think it would be easy to allow something like algorithm=fricas-risch, and this would then be more convenient than software=fricas,algorithm=risch. Whereas changing algorithm to software would be annoying as hell.

@rwst
Copy link

rwst commented Feb 2, 2015

comment:17

Replying to @burcin:

  • Similarly, I suggest moving the code for converting the result back to the _sage_() method of the fricas interface.

I know this is how Sympy does it but I think such a decision is up to the Fricas developers.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Feb 2, 2015

Changed commit from 5db0224 to c5bd849

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Feb 2, 2015

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

25820dcMerge branch 'develop' into t/9427/public/ticket/9427
c5bd8499427 reviewer's patch: fix doctest

@rwst
Copy link

rwst commented Feb 2, 2015

Changed author from Wilfried Huss to Wilfried Huss, Frédéric Chapoton

@rwst
Copy link

rwst commented Feb 2, 2015

comment:19

This looks good and tests OK in symbolic and rings.

@rwst
Copy link

rwst commented Feb 2, 2015

Changed reviewer from Burcin Erocal to Burcin Erocal, Ralf Stephan

@rwst rwst modified the milestones: sage-6.4, sage-6.5 Feb 3, 2015
@vbraun
Copy link
Member

vbraun commented Feb 17, 2015

Changed branch from public/ticket/9427 to c5bd849

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

No branches or pull requests

7 participants