Yes, the current strategy is that any expression in FriCAS that sage does 
not know is turned into a symbolic function with the same name:

        try:
            fun = symbol_table["fricas"][(fun_string, len(args))]
        except KeyError:
            try:
                # to handle the case of "construct"
                fun = symbol_table["fricas"][(fun_string, -1)]
            except KeyError:
                fun = function(fun_string)

On Friday 19 January 2024 at 14:29:10 UTC+1 Nasser M. Abbasi wrote:

> Should sagemath translate any special function name returned by external 
> CAS to sagemath known name?
>
> Fricas returns result from integrate using special 
> function weierstrassPInverse. This is returned to sagemath as is. But 
> sagemath says this function is not defined when trying it inside sagemath.
>
> =======================================
> sage
> │ SageMath version 10.2, Release Date: 2023-12-03                    │
> │ Using Python 3.11.6. Type "help()" for help.                       │
> sage: var('x,a')
> (x, a)
> sage: anti=integrate(1/x^(1/2)/(-a^2*x^2+1)^(1/2),x,algorithm="fricas")
> sage: anti
> 2*weierstrassPInverse(4/a^2, 0, x)/sqrt(-a^2)
>
> sage: weierstrassPInverse(4/a^2, 0, x)
> ---------------------------------------------------------------------------
> NameError                                 Traceback (most recent call last)
> Cell In [4], line 1
> ----> 1 weierstrassPInverse(Integer(4)/a**Integer(2), Integer(0), x)
>
> NameError: name 'weierstrassPInverse' is not defined
>
> ========================
>
> fricas
>                       FriCAS Computer Algebra System 
>                 Version: FriCAS 1.3.10 built with sbcl 2.3.11
>
> (1) -> integrate(1/x^(1/2)/(-a^2*x^2+1)^(1/2),x)
>                                4
>         2 weierstrassPInverse(--,0,x)
>                                2
>                               a
>    (1)  -----------------------------
>                     +----+
>                     |   2
>                    \|- a
> ================================
>
> Just wondering what is the protocol here. If sagemath does not know a 
> special function returned by external CAS, what should happen then?
>
> --Nasser
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/69ea8719-d561-4608-9625-18849893b0e6n%40googlegroups.com.

Reply via email to