# Ticket #15057: trac15057_2.patch

File trac15057_2.patch, 7.5 KB (added by eviatarbach, 8 years ago)
• ## sage/functions/generalized.py

# HG changeset patch
# User Eviatar Bach <eviatarbach@gmail.com>
# Date 1376766516 25200
# Node ID cee69e758af138e94a8b672a79f4e7724092285e
diff --git a/sage/functions/generalized.py b/sage/functions/generalized.py
diff --git a/sage/functions/min_max.py b/sage/functions/min_max.py
diff --git a/sage/functions/other.py b/sage/functions/other.py
 a \mathrm{abs} sage: latex(abs(x)) {\left| x \right|} sage: abs(x)._sympy_() Abs(x) Test pickling:: sage: loads(dumps(abs(x))) abs(x) """ GinacFunction.__init__(self, "abs", latex_name=r"\mathrm{abs}") GinacFunction.__init__(self, "abs", latex_name=r"\mathrm{abs}", conversions=dict(sympy='Abs')) abs = abs_symbolic = Function_abs() sage: latex(ceil(x)) \left \lceil x \right \rceil sage: ceil(x)._sympy_() ceiling(x) :: ceil """ BuiltinFunction.__init__(self, "ceil", conversions=dict(maxima='ceiling')) conversions=dict(maxima='ceiling', sympy='ceiling')) def _print_latex_(self, x): r""" EXAMPLES:: 4.78749174278205 sage: log_gamma(CC(-2.5)) -0.0562437164976740 + 3.14159265358979*I sage: log_gamma(x)._sympy_() loggamma(x) conjugate(log_gamma(x))==log_gamma(conjugate(x)) unless on the branch cut, which runs along the negative real axis.:: +Infinity """ GinacFunction.__init__(self, "log_gamma", latex_name=r'\log\Gamma', conversions={'mathematica':'LogGamma','maxima':'log_gamma'}) conversions=dict(mathematica='LogGamma', maxima='log_gamma', sympy='loggamma')) log_gamma = Function_log_gamma() psi(x) sage: t.subs(x=.2) -5.28903989659219 sage: psi(x)._sympy_() polygamma(0, x) """ GinacFunction.__init__(self, "psi", nargs=1, latex_name='\psi', conversions=dict(maxima='psi[0]', mathematica='PolyGamma')) conversions=dict(mathematica='PolyGamma', maxima='psi[0]', sympy='digamma')) class Function_psi2(GinacFunction): def __init__(self): sage: psi2(2, .5).n(100) -16.828796644234319995596334261 Tests:: TESTS:: sage: psi2(n, x).derivative(n) Traceback (most recent call last): \psi\left(2, x\right) sage: loads(dumps(psi2(2,x)+1)) psi(2, x) + 1 sage: psi(2, x)._sympy_() polygamma(2, x) """ GinacFunction.__init__(self, "psi", nargs=2, latex_name='\psi', conversions=dict(mathematica='PolyGamma')) conversions=dict(mathematica='PolyGamma', sympy='polygamma')) def _maxima_init_evaled_(self, n, x): """ sage: loads(dumps(real_part)) real_part sage: real_part(x)._sympy_() re(x) Check if #6401 is fixed:: \Re \left( f\left(x\right) \right) """ GinacFunction.__init__(self, "real_part", conversions=dict(maxima='realpart')) conversions=dict(maxima='realpart', sympy='re')) def _eval_numpy_(self, x): """ 2 sage: loads(dumps(imag_part)) imag_part sage: imag_part(x)._sympy_() im(x) Check if #6401 is fixed:: \Im \left( f\left(x\right) \right) """ GinacFunction.__init__(self, "imag_part", conversions=dict(maxima='imagpart')) conversions=dict(maxima='imagpart', sympy='im')) def _eval_numpy_(self, x): """