Skip to main content

High performance implementation of the Mittag-Leffler function

Project description


mittagleffler

Build Status REUSE PyPI crates.io readthedocs.io docs.rs

This library implements the two-parameter Mittag-Leffler function.

Currently only the algorithm described in the paper by Roberto Garrapa (2015) is implemented. This seems to be the most accurate and computationally efficient method to date for evaluating the Mittag-Leffler function.

Links

Other implementations

  • ml.m (MATLAB): implements the three-parameter Mittag-Leffler function.
  • ml_matrix.m (MATLAB): implements the matrix-valued two-parameter Mittag-Leffler function.
  • MittagLeffler.jl (Julia): implements the two-parameter Mittag-Leffler function and its derivative.
  • MittagLeffler (R): implements the three-parameter Mittag-Leffler function.
  • mittag-leffler (Python): implements the three-parameter Mittag-Leffler function.
  • mlf (Fortran 90): implements the three-parameter Mittag-Leffler function.
  • mlpade (MATLAB): implements the two-parameter Mittag-Leffler function.
  • MittagLeffler (Stata): implements the three-parameter Mittag-Leffler function.
  • MittagLefflerE (Mathematica): implements the two-parameter Mittag-Leffler function.

Rust Crate

The library is available as a Rust crate that implements the main algorithms. Evaluating the Mittag-Leffler function can be performed directly by

use mittagleffler::MittagLeffler;

let alpha = 0.75;
let beta = 1.25;
let z = Complex64::new(1.0, 2.0);
println!("E({}; {}, {}) = {}", z, alpha, beta, z.mittag_leffler(alpha, beta));

let z: f64 = 3.1415;
println!("E({}; {}, {}) = {}", z, alpha, beta, z.mittag_leffler(alpha, beta));

This method will call the best underlying algorithm and takes care of any special cases that are known in the literature, e.g. for (alpha, beta) = (1, 1) we know that the Mittag-Leffler function is equivalent to the standard exponential. To call a specific algorithm, we can do

use mittagleffler::GarrappaMittagLeffler

let eps = 1.0e-8;
let ml = GarrappaMittagLeffler::new(eps);

let z = Complex64::new(1.0, 2.0);
println!("E({}; {}, {}) = {}",z,  alpha, beta, ml.evaluate(z, alpha, beta));

The algorithm from Garrappa (2015) has several parameters that can be tweaked for better performance or accuracy. They can be found in the documentation of the structure, but should not be changed unless there is good reason!

Python Bindings

The library also has Python bindings (using pyo3) that can be found in the python directory. The bindings are written to work with scalars and with numpy arrays equally. For example

import numpy as np
from pymittagleffler import mittag_leffler

alpha, beta = 2.0, 2.0
z = np.linspace(0.0, 1.0, 128)
result = mittag_leffler(z, alpha, beta)

These are available on PyPI under the name pymittagleffler.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pymittagleffler-0.1.9.tar.gz (263.7 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pymittagleffler-0.1.9-cp310-abi3-win_amd64.whl (195.8 kB view details)

Uploaded CPython 3.10+Windows x86-64

pymittagleffler-0.1.9-cp310-abi3-manylinux_2_24_aarch64.whl (281.8 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.24+ ARM64

pymittagleffler-0.1.9-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (303.6 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ x86-64

pymittagleffler-0.1.9-cp310-abi3-macosx_11_0_arm64.whl (262.9 kB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

File details

Details for the file pymittagleffler-0.1.9.tar.gz.

File metadata

  • Download URL: pymittagleffler-0.1.9.tar.gz
  • Upload date:
  • Size: 263.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pymittagleffler-0.1.9.tar.gz
Algorithm Hash digest
SHA256 601d1a00025c3c6717ea0183ff6b563cd9b4fee85ac46e239824a1f26d120134
MD5 56095289e8a22e8616a8e10332a8eeea
BLAKE2b-256 605bf3513253f27f791fe703b01afba36908bb6a5dfde411b90f6aa6b97284a8

See more details on using hashes here.

Provenance

The following attestation bundles were made for pymittagleffler-0.1.9.tar.gz:

Publisher: wheels.yml on alexfikl/mittagleffler

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pymittagleffler-0.1.9-cp310-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for pymittagleffler-0.1.9-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 571b9e984da548a09d36f7d26c7550d721cff18fb26ed7450f7e2436062a678b
MD5 8ce389182d23bc97e927c5dad91bb39f
BLAKE2b-256 a590b675b455fcf55da4cf8ebc3e14df5632f79af5839e6b09ad4c25a1ffad19

See more details on using hashes here.

Provenance

The following attestation bundles were made for pymittagleffler-0.1.9-cp310-abi3-win_amd64.whl:

Publisher: wheels.yml on alexfikl/mittagleffler

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pymittagleffler-0.1.9-cp310-abi3-manylinux_2_24_aarch64.whl.

File metadata

File hashes

Hashes for pymittagleffler-0.1.9-cp310-abi3-manylinux_2_24_aarch64.whl
Algorithm Hash digest
SHA256 25dcdf9feeb735b02c66b6dc89ca7f2836f5e91613fd689ff7e95da4085959f7
MD5 4530795d18c06803486dfee3f90d2075
BLAKE2b-256 a912d2d9ac7a679d891379637fa2034aab6294f386a7219372668c68f80b4b45

See more details on using hashes here.

Provenance

The following attestation bundles were made for pymittagleffler-0.1.9-cp310-abi3-manylinux_2_24_aarch64.whl:

Publisher: wheels.yml on alexfikl/mittagleffler

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pymittagleffler-0.1.9-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pymittagleffler-0.1.9-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c1dd77c48753c44bc85c113edda19806d51b5e32f084e0dfe3538d5a32f5c580
MD5 2fc19a2ff760ceb8c6cf1214f0d1356e
BLAKE2b-256 5049e9a6f46cec0a5ad40be105f2a19f0471b245e699980b62d0c12bad09cd24

See more details on using hashes here.

Provenance

The following attestation bundles were made for pymittagleffler-0.1.9-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: wheels.yml on alexfikl/mittagleffler

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pymittagleffler-0.1.9-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pymittagleffler-0.1.9-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0590500dedf96300bb1e768b74232cf0081416c00190077934fd26364d6e29bf
MD5 596dca1f2bb3b7ebd90a86d0108fddfb
BLAKE2b-256 c657614c0d57b8598e4c8274f2b7fa292da821ddce0efc1e37ba02fbabbbcae9

See more details on using hashes here.

Provenance

The following attestation bundles were made for pymittagleffler-0.1.9-cp310-abi3-macosx_11_0_arm64.whl:

Publisher: wheels.yml on alexfikl/mittagleffler

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page