# Mittag-Leffler

Are Mittag-Leffler function implemented in Sagemath ?

edit retag close merge delete

Sort by » oldest newest most voted

There does not seem to be an implementation in Sage.

There is an implementation in R in the MittagLeffleR R package.

It can be used from Sage.

To install this R package for Sage's R, run this in a terminal:

$sage --R  Then at the R prompt (>) type: > install.packages('MittagLeffleR')  and choose a download mirror in the numbered list. Once the installation is complete, quit R: > q()  Next time you launch Sage: $ sage


you can load the MittagLeffleR R package:

sage: r.library('MittagLeffleR')


Then you can run commands such as:

sage: r('mlf(2, 0.7)')
 20.96643
sage: r('dml(1, 0.8)')
 0.2557438
sage: r('dml(1, 0.6, second.type=TRUE)')
 0.4832354
sage: r('pml(2, 0.7, 1.5)')
 0.6597308
sage: r('qml(p = c(0.25, 0.5, 0.75), tail = 0.6, scale = 100)')
  11.64327  60.56854 284.67928
sage: r('rml(10, 0.7, 1)')
 2.863445e-01 2.189476e+00 1.013715e+00 2.465789e+00 4.260511e-01
 4.568785e-01 7.676349e-02 6.497517e-05 5.912041e-01 5.403624e-01


Here is a Mittag-Leffler function based on that:

def mittag_leffler(z, a, b=1, g=1):
r"""
Return the Mittag-Leffler function for these arguments.
"""
r.library('MittagLeffleR')
return r(f'mlf({z}, {a}, b={b}, g={g})').sage()


Usage:

sage: mittag_leffler(2, 0.7)
20.966433131482

more

In the same vein :

sage: mathematica.MittagLefflerE?
Signature:   mathematica.MittagLefflerE(*args, **kwds)
Type:        MathematicaFunction
String form: MittagLefflerE
File:        /usr/local/sage-9/src/sage/interfaces/mathematica.py
Docstring:
MittagLefflerE[α, z] gives the Mittag–Leffler function E  (z).
α

MittagLefflerE[α, β, z] gives the generalized Mittag–Leffler function
E      (z).
α, β


which uses either a local Mathematica install or the (gratis, if not free) Wolfram engine.