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.7.tar.gz (262.0 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.7-cp310-abi3-win_amd64.whl (195.8 kB view details)

Uploaded CPython 3.10+Windows x86-64

pymittagleffler-0.1.7-cp310-abi3-manylinux_2_24_aarch64.whl (284.9 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.24+ ARM64

pymittagleffler-0.1.7-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (305.0 kB view details)

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

pymittagleffler-0.1.7-cp310-abi3-macosx_11_0_arm64.whl (266.8 kB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: pymittagleffler-0.1.7.tar.gz
  • Upload date:
  • Size: 262.0 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.7.tar.gz
Algorithm Hash digest
SHA256 3fb570a21edbfdd02167b077dbc2329b29ed07f30f307f966c670b1d26637bb5
MD5 e1b0b2a2cd76cada3d735706ea239f53
BLAKE2b-256 ea721dfceb4f0bb839d40fb9f4f83676368fa1cfa73295ee02419a9494a036fb

See more details on using hashes here.

Provenance

The following attestation bundles were made for pymittagleffler-0.1.7.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.7-cp310-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for pymittagleffler-0.1.7-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 3dd08471e213beca597e69b521385912158ca0eff8bee2778edb545320be59db
MD5 e5ddd9977db6db59261acb6563a9eb40
BLAKE2b-256 78aef738349c7a37d5a1aa87576381760b4b1e5fed7a88b08dbb2b62da666085

See more details on using hashes here.

Provenance

The following attestation bundles were made for pymittagleffler-0.1.7-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.7-cp310-abi3-manylinux_2_24_aarch64.whl.

File metadata

File hashes

Hashes for pymittagleffler-0.1.7-cp310-abi3-manylinux_2_24_aarch64.whl
Algorithm Hash digest
SHA256 a9f7c558fa00a75657c5853cc846e76e063c6f6459b5f7e1f2457002c0f06e5f
MD5 875a39637b4c52acc25a955dbc94955d
BLAKE2b-256 86a1f362439b3a180427d3996ec04d8d88e9f766ab6bf5f2c63912f594202c1b

See more details on using hashes here.

Provenance

The following attestation bundles were made for pymittagleffler-0.1.7-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.7-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pymittagleffler-0.1.7-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 65661d75040aba6e16e1e5893fb5809f19ecd8f09af80465ed078aa59a676bf5
MD5 085a58954eaca9fd8557da3782c4e770
BLAKE2b-256 761ff14309eb32a2d930606dd15e006c72e61c50e877a898fd46fffc2b79f066

See more details on using hashes here.

Provenance

The following attestation bundles were made for pymittagleffler-0.1.7-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.7-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pymittagleffler-0.1.7-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0d7250b060eb16e4b474b61fa004c7c4241aa10a219fc0f7a9687785c0490894
MD5 0c0a0a76e07e69fad055d4d50a2474b5
BLAKE2b-256 52c7f2d5e644df4dc292fcb571aad49980ee969aead4cac5a61b0124d53765ba

See more details on using hashes here.

Provenance

The following attestation bundles were made for pymittagleffler-0.1.7-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