You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Possible followup to #31756 : trying to enhance our interface to Mathematica by simple means.
Mathematica has many functions not implemented in Sage. Some of them are (semi-)trivial possible additions (e.g. Mathematica's HypergeometriPFQRegularized, which is but). the normalized versin of Sage's hypergeometric. They are not in the scope of this ticket, and adding them should be discussed on a case-by-case basis
Mathematica also has many "special-case" functions where Sage has only a "general case" ; for example, Sage's hypergeometric translates Mathematica's HypergeometricPFQ, but should also translate Mathematica's Hypergeometric0F1, Hypergeometric1F1 and Hypergeometric2F1 (it currently doesn't).
Such functions are a first scope of the present ticket : adding these translations add to the ability of using in Sage sime Mathematica's results.
But the most pressing enhancements are as follow : many Mathematica functions, which do have Sage equivalents, are ill-translated by the current interface. A prime example is :
This (seriously) limits the ability to delecate some calculations to Mathematica when it migh be better than Sage.
Detecting such cases is not trivial. A first approximation restricted to Symbolic Functions can be obtained by :
from sage.symbolic.function import Function
Funs=[eval(u) for u in dir(sage.functions.all) if u in globals() and isinstance(eval(u), Function)]
X=var("x", n=6)
DFuns={u:u.number_of_arguments() for u in Funs}
TransOK={}
for u in DFuns.keys():
try:
TransOK.update({u:bool(u(*X[:DFuns[u]]).diff(x0)._mathematica_() ==\
mathematica.D(u(*X[:DFuns[u]]), x0))})
except:
TransOK.update({u:"Doesn't (back?)translate."})
BadTrans = [u for u in TransOK.keys() if not TransOK[u]]
NoTrans = [u for u in TransOK.keys() if type(TransOK[u]) is str]
The result is edifying :
sage: len(dir(sage.functions.all))
197
sage: len([u for u in dir(sage.functions.all) if u[0]!="_"])
189
sage: len(DFuns)
130
sage: len(BadTrans)
43
sage: len(NoTrans)
50
Doing the same work for the 59 functions not derived from Symbolic Function isn't as trivial. Suggestions welcome.
Suggestions also welcome on how to attack this not-trivially-sized problem...
Possible followup to #31756 : trying to enhance our interface to Mathematica by simple means.
Mathematica has many functions not implemented in Sage. Some of them are (semi-)trivial possible additions (e.g. Mathematica's
HypergeometriPFQRegularized
, which is but). the normalized versin of Sage'shypergeometric
. They are not in the scope of this ticket, and adding them should be discussed on a case-by-case basisMathematica also has many "special-case" functions where Sage has only a "general case" ; for example, Sage's
hypergeometric
translates Mathematica'sHypergeometricPFQ
, but should also translate Mathematica'sHypergeometric0F1
,Hypergeometric1F1
andHypergeometric2F1
(it currently doesn't).Such functions are a first scope of the present ticket : adding these translations add to the ability of using in Sage sime Mathematica's results.
But the most pressing enhancements are as follow : many Mathematica functions, which do have Sage equivalents, are ill-translated by the current interface. A prime example is :
This (seriously) limits the ability to delecate some calculations to Mathematica when it migh be better than Sage.
Detecting such cases is not trivial. A first approximation restricted to Symbolic Functions can be obtained by :
The result is edifying :
Doing the same work for the 59 functions not derived from Symbolic Function isn't as trivial. Suggestions welcome.
Suggestions also welcome on how to attack this not-trivially-sized problem...
Component: interfaces
Keywords: Mathematica
Issue created by migration from https://trac.sagemath.org/ticket/31902
The text was updated successfully, but these errors were encountered: