# Translating Gamma from fricas to sage causes exception

hello;

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 close merge delete

Sort by » oldest newest most voted

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

sage: fricas.Gamma(3/2)
3
Gamma(-)
2
sage: fricas.Gamma(3/2).sage()
1/2*sqrt(pi)

sage: fricas.Gamma(3/2,2)
3
Gamma(-,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

more