From bc1d66efab841c4670bc9e07f6b5c0e4a580e0dd Mon Sep 17 00:00:00 2001 From: Nils Bruin Date: Sun, 13 Apr 2014 23:48:37 -0700 Subject: [PATCH] trac 2516: fix maxima_lib to properly translate hypergeometric --- src/sage/interfaces/maxima_lib.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/sage/interfaces/maxima_lib.py b/src/sage/interfaces/maxima_lib.py index b1180bd37bf..bca00fd2e4f 100644 --- a/src/sage/interfaces/maxima_lib.py +++ b/src/sage/interfaces/maxima_lib.py @@ -1045,6 +1045,7 @@ def reduce_load_MaximaLib(): cadadr=EclObject("cadadr") meval=EclObject("meval") NIL=EclObject("NIL") +lisp_length=EclObject("length") ## Dictionaries for standard operators sage_op_dict = { @@ -1363,7 +1364,8 @@ def dummy_integrate(expr): sage.functions.log.polylog : lambda N,X : [[mqapply],[[max_li, max_array],N],X], sage.functions.other.psi1 : lambda X : [[mqapply],[[max_psi, max_array],0],X], sage.functions.other.psi2 : lambda N,X : [[mqapply],[[max_psi, max_array],N],X], - sage.functions.log.lambert_w : lambda N,X : [[max_lambert_w], X] if N==EclObject(0) else [[mqapply],[[max_lambert_w, max_array],N],X] + sage.functions.log.lambert_w : lambda N,X : [[max_lambert_w], X] if N==EclObject(0) else [[mqapply],[[max_lambert_w, max_array],N],X], + sage.functions.hypergeometric.hypergeometric : lambda A, B, X : [[mqapply],[[max_hyper, max_array],lisp_length(A.cdr()),lisp_length(B.cdr())],A,B,X] } @@ -1486,7 +1488,7 @@ def sr_to_max(expr): elif (op in special_sage_to_max): return EclObject(special_sage_to_max[op](*[sr_to_max(o) for o in expr.operands()])) elif op == tuple: - return maxima(expr.operands()).ecl() + return EclObject( ([mlist],tuple(sr_to_max(op) for op in expr.operands())) ) elif not (op in sage_op_dict): # Maxima does some simplifications automatically by default # so calling maxima(expr) can change the structure of expr