Ask Your Question

Translating Gamma from fricas to sage causes exception

asked 2018-06-17 06:57:59 -0500

Nasser gravatar image

updated 2018-06-17 07:15:25 -0500


I just started trying sage to test Fricas integrate, but for some results, it fails, even though Fricas actually is able to do the integration.

It fails because it can't translate Fricas result to sage syntax, so it gives an exception. I record this as failed integrate, since for any exception thrown, I assume it failed. But this is not fair for Fricas since it actually did not fail.

Here is an example

   sage: var('t, n')
   anti=integrate(log(t)^(-n - 1),t, algorithm="fricas")

exception trapped is

NotImplementedError: The translation of the FriCAS  
Expression cos((n+1)*pi )*Gamma((-1)*n,(-1)*log(t)) to sage is not yet implemented.

Why it can't translate it, since Maxima result has a gamma in it. Is it the UpperCase Gamma that is the problem?

    integrate(log(t)^(-n - 1),t, algorithm="maxima")
     -(-log(t))^n*log(t)^(-n)*gamma(-n, -log(t))

No error. I am using

      SageMath version 8.3.beta5, Release Date: 2018-06-09

ps. Output from Fricas itself matches what is shown above OK.

     FriCAS Computer Algebra System 
                        Version: FriCAS 1.3.3
               Timestamp: Sun Jun 17 01:20:37 CDT 2018

      (1) -> integrate(log(t)^(-n - 1),t)

             (1)  cos((n + 1)%pi)Gamma(- n,- log(t))
                                     Type: Union(Expression(Integer),...)
edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted

answered 2018-06-17 09:14:23 -0500

tmonteil gravatar image

updated 2018-06-17 09:29:11 -0500

The conversion between Fricas and Sage (ginac) gamma functions has been implemented, but not for bivariate gamma:

sage: fricas.Gamma(3/2)
sage: fricas.Gamma(3/2).sage()

sage: fricas.Gamma(3/2,2)
sage: fricas.Gamma(3/2,2).sage()
NotImplementedError: The translation of the FriCAS Expression Gamma(3/2,2) to sage is not yet implemented.

Thanks for reporting, this is now trac ticket 25597

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2018-06-17 06:57:59 -0500

Seen: 50 times

Last updated: Jun 17