pymittagleffler


Namepymittagleffler JSON
Version 0.1.3 PyPI version JSON
download
home_pagehttps://github.com/alexfikl/mittagleffler
SummaryHigh performance implementation of the Mittag-Leffler function
upload_time2025-02-01 09:34:13
maintainerNone
docs_urlNone
authorAlexandru Fikl <alexfikl@gmail.com>
requires_python>=3.10
licenseMIT
keywords fractional-calculus special-functions
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <div align="center">
<img width="600" src="https://raw.githubusercontent.com/alexfikl/mittagleffler/refs/heads/main/python/docs/_static/mittag-leffler-accuracy-contour.png"/><br>
</div>

# mittagleffler

[![Build Status](https://github.com/alexfikl/mittagleffler/workflows/CI/badge.svg)](https://github.com/alexfikl/mittagleffler/actions?query=branch%3Amain+workflow%3ACI)
[![REUSE](https://api.reuse.software/badge/github.com/alexfikl/mittagleffler)](https://api.reuse.software/info/github.com/alexfikl/mittagleffler)
[![PyPI](https://badge.fury.io/py/pymittagleffler.svg)](https://pypi.org/project/pymittagleffler/)
[![crates.io](https://img.shields.io/crates/v/mittagleffler)](https://crates.io/crates/mittagleffler)
[![readthedocs.io](https://img.shields.io/readthedocs/mittagleffler?label=rtd.io&color=%234280B2)](https://mittagleffler.readthedocs.io/en/latest)
[![docs.rs](https://img.shields.io/docsrs/mittagleffler?label=docs.rs&color=%23F58042)](https://docs.rs/mittagleffler/latest/mittagleffler/)

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

Currently only the algorithm described in the paper by [Roberto Garrapa (2015)](<https://doi.org/10.1137/140971191>)
is implemented. This seems to be the most accurate and computationally efficient
method to date for evaluating the Mittag-Leffler function.

**Links**

* *Documentation*: [Rust (docs.rs)](https://docs.rs/mittagleffler/latest/mittagleffler/)
  and [Python (readthedocs.io)](https://mittagleffler.readthedocs.io).
* *Code*: [Github](https://github.com/alexfikl/mittagleffler).
* *License*: [MIT](https://spdx.org/licenses/MIT.html) (see `LICENSES/MIT.txt`).

**Other implementations**

* [ml.m](https://www.mathworks.com/matlabcentral/fileexchange/48154-the-mittag-leffler-function) (MATLAB):
  implements three-parameter Mittag-Leffler function.
* [ml_matrix.m](https://www.mathworks.com/matlabcentral/fileexchange/66272-mittag-leffler-function-with-matrix-arguments) (MATLAB):
  implements the matrix-valued two-parameter Mittag-Leffler function.
* [MittagLeffler.jl](https://github.com/JuliaMath/MittagLeffler.jl) (Julia):
  implements the two-parameter Mittag-Leffler function and its derivative.
* [MittagLeffler](https://github.com/gurteksinghgill/MittagLeffler) (R):
  implements the three-parameter Mittag-Leffler function.
* [mittag-leffler](https://github.com/khinsen/mittag-leffler) (Python):
  implements the three-parameter Mittag-Leffler function.
* [mlf](https://github.com/tranqv/Mittag-Leffler-function-and-its-derivative) (Fortran 90):
  implements the three-parameter Mittag-Leffler function.
* [mlpade](https://github.com/matt-black/mlpade) (MATLAB):
  implements the two-parameter Mittag-Leffler function.
* [MittagLeffler](https://github.com/droodman/Mittag-Leffler-for-Stata) (Stata):
  implements the three-parameter Mittag-Leffler function.
* [MittagLefflerE](https://reference.wolfram.com/language/ref/MittagLefflerE.html.en) (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

```rust
use mittagleffler::MittagLeffler;

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

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

This method will call the best underlying algorithm and take 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

```rust
use mittagleffler::GarrappaMittagLeffler

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

let z = Complex64::new(1.0, 2.0);
println!("E_{}_{}({}) = {}", alpha, beta, z, 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](https://github.com/PyO3/pyo3))
that can be found in the `python` directory. The bindings are written to work
with scalars and with `numpy` arrays equally. For example

```python
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`.


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/alexfikl/mittagleffler",
    "name": "pymittagleffler",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": "Alexandru Fikl <alexfikl@gmail.com>",
    "keywords": "fractional-calculus, special-functions",
    "author": "Alexandru Fikl <alexfikl@gmail.com>",
    "author_email": "Alexandru Fikl <alexfikl@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/77/67/01b395a37037caf28463746c00da17d9a0ed3131a0af5feb3fd4b2a6231c/pymittagleffler-0.1.3.tar.gz",
    "platform": null,
    "description": "<div align=\"center\">\n<img width=\"600\" src=\"https://raw.githubusercontent.com/alexfikl/mittagleffler/refs/heads/main/python/docs/_static/mittag-leffler-accuracy-contour.png\"/><br>\n</div>\n\n# mittagleffler\n\n[![Build Status](https://github.com/alexfikl/mittagleffler/workflows/CI/badge.svg)](https://github.com/alexfikl/mittagleffler/actions?query=branch%3Amain+workflow%3ACI)\n[![REUSE](https://api.reuse.software/badge/github.com/alexfikl/mittagleffler)](https://api.reuse.software/info/github.com/alexfikl/mittagleffler)\n[![PyPI](https://badge.fury.io/py/pymittagleffler.svg)](https://pypi.org/project/pymittagleffler/)\n[![crates.io](https://img.shields.io/crates/v/mittagleffler)](https://crates.io/crates/mittagleffler)\n[![readthedocs.io](https://img.shields.io/readthedocs/mittagleffler?label=rtd.io&color=%234280B2)](https://mittagleffler.readthedocs.io/en/latest)\n[![docs.rs](https://img.shields.io/docsrs/mittagleffler?label=docs.rs&color=%23F58042)](https://docs.rs/mittagleffler/latest/mittagleffler/)\n\nThis library implements the two-parameter Mittag-Leffler function.\n\nCurrently only the algorithm described in the paper by [Roberto Garrapa (2015)](<https://doi.org/10.1137/140971191>)\nis implemented. This seems to be the most accurate and computationally efficient\nmethod to date for evaluating the Mittag-Leffler function.\n\n**Links**\n\n* *Documentation*: [Rust (docs.rs)](https://docs.rs/mittagleffler/latest/mittagleffler/)\n  and [Python (readthedocs.io)](https://mittagleffler.readthedocs.io).\n* *Code*: [Github](https://github.com/alexfikl/mittagleffler).\n* *License*: [MIT](https://spdx.org/licenses/MIT.html) (see `LICENSES/MIT.txt`).\n\n**Other implementations**\n\n* [ml.m](https://www.mathworks.com/matlabcentral/fileexchange/48154-the-mittag-leffler-function) (MATLAB):\n  implements three-parameter Mittag-Leffler function.\n* [ml_matrix.m](https://www.mathworks.com/matlabcentral/fileexchange/66272-mittag-leffler-function-with-matrix-arguments) (MATLAB):\n  implements the matrix-valued two-parameter Mittag-Leffler function.\n* [MittagLeffler.jl](https://github.com/JuliaMath/MittagLeffler.jl) (Julia):\n  implements the two-parameter Mittag-Leffler function and its derivative.\n* [MittagLeffler](https://github.com/gurteksinghgill/MittagLeffler) (R):\n  implements the three-parameter Mittag-Leffler function.\n* [mittag-leffler](https://github.com/khinsen/mittag-leffler) (Python):\n  implements the three-parameter Mittag-Leffler function.\n* [mlf](https://github.com/tranqv/Mittag-Leffler-function-and-its-derivative) (Fortran 90):\n  implements the three-parameter Mittag-Leffler function.\n* [mlpade](https://github.com/matt-black/mlpade) (MATLAB):\n  implements the two-parameter Mittag-Leffler function.\n* [MittagLeffler](https://github.com/droodman/Mittag-Leffler-for-Stata) (Stata):\n  implements the three-parameter Mittag-Leffler function.\n* [MittagLefflerE](https://reference.wolfram.com/language/ref/MittagLefflerE.html.en) (Mathematica):\n  implements the two-parameter Mittag-Leffler function.\n\n# Rust Crate\n\nThe library is available as a Rust crate that implements the main algorithms.\nEvaluating the Mittag Leffler function can be performed directly by\n\n```rust\nuse mittagleffler::MittagLeffler;\n\nlet alpha = 0.75;\nlet beta = 1.25;\nlet z = Complex64::new(1.0, 2.0);\nprintln!(\"E_{}_{}({}) = {}\", alpha, beta, z, z.mittag_leffler(alpha, beta));\n\nlet z: f64 = 3.1415;\nprintln!(\"E_{}_{}({}) = {}\", alpha, beta, z, z.mittag_leffler(alpha, beta));\n```\n\nThis method will call the best underlying algorithm and take care of any special\ncases that are known in the literature, e.g. for `(alpha, beta) = (1, 1)` we\nknow that the Mittag-Leffler function is equivalent to the standard exponential.\nTo call a specific algorithm, we can do\n\n```rust\nuse mittagleffler::GarrappaMittagLeffler\n\nlet eps = 1.0e-8;\nlet ml = GarrappaMittagLeffler::new(eps);\n\nlet z = Complex64::new(1.0, 2.0);\nprintln!(\"E_{}_{}({}) = {}\", alpha, beta, z, ml.evaluate(z, alpha, beta));\n```\n\nThe algorithm from Garrappa (2015) has several parameters that can be tweaked\nfor better performance or accuracy. They can be found in the documentation of the\nstructure, but should not be changed unless there is good reason!\n\nPython Bindings\n===============\n\nThe library also has Python bindings (using [pyo3](https://github.com/PyO3/pyo3))\nthat can be found in the `python` directory. The bindings are written to work\nwith scalars and with `numpy` arrays equally. For example\n\n```python\nimport numpy as np\nfrom pymittagleffler import mittag_leffler\n\nalpha, beta = 2.0, 2.0\nz = np.linspace(0.0, 1.0, 128)\nresult = mittag_leffler(z, alpha, beta)\n```\n\nThese are available on PyPI under the name `pymittagleffler`.\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "High performance implementation of the Mittag-Leffler function",
    "version": "0.1.3",
    "project_urls": {
        "Documentation": "https://mittagleffler.readthedocs.io",
        "Homepage": "https://github.com/alexfikl/mittagleffler",
        "Repository": "https://github.com/alexfikl/mittagleffler"
    },
    "split_keywords": [
        "fractional-calculus",
        " special-functions"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "31da6fdce0b20aead9433315d269e22afe242660b4d39e7157994eadbfa3624f",
                "md5": "c91dfa21f2f58a3ee4704ec928a392d8",
                "sha256": "39257a2d9c8b1664a1ecf3c8b780a0f8a1979aac3dffe202a476113c6e7a0d31"
            },
            "downloads": -1,
            "filename": "pymittagleffler-0.1.3-cp310-abi3-macosx_10_12_x86_64.whl",
            "has_sig": false,
            "md5_digest": "c91dfa21f2f58a3ee4704ec928a392d8",
            "packagetype": "bdist_wheel",
            "python_version": "cp310",
            "requires_python": ">=3.10",
            "size": 310807,
            "upload_time": "2025-02-01T09:34:04",
            "upload_time_iso_8601": "2025-02-01T09:34:04.159447Z",
            "url": "https://files.pythonhosted.org/packages/31/da/6fdce0b20aead9433315d269e22afe242660b4d39e7157994eadbfa3624f/pymittagleffler-0.1.3-cp310-abi3-macosx_10_12_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "c7e160c5d71e180705e3801ac279761a07a25eea35c41444c0742db859163655",
                "md5": "c3935cfb1077b53bd80041047dccbe28",
                "sha256": "2db00c52746b95837f6a4c93a0f50ee84cbf3022c7044ff824d986ffe97f5a58"
            },
            "downloads": -1,
            "filename": "pymittagleffler-0.1.3-cp310-abi3-macosx_11_0_arm64.whl",
            "has_sig": false,
            "md5_digest": "c3935cfb1077b53bd80041047dccbe28",
            "packagetype": "bdist_wheel",
            "python_version": "cp310",
            "requires_python": ">=3.10",
            "size": 299733,
            "upload_time": "2025-02-01T09:34:06",
            "upload_time_iso_8601": "2025-02-01T09:34:06.390572Z",
            "url": "https://files.pythonhosted.org/packages/c7/e1/60c5d71e180705e3801ac279761a07a25eea35c41444c0742db859163655/pymittagleffler-0.1.3-cp310-abi3-macosx_11_0_arm64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "33ba641d31557d350060fc369c137774df9a12cc8b70cf430d1c45c1712c1200",
                "md5": "5bfadf3a479bb246fabf30dc09470d7f",
                "sha256": "6148b5e6a228f36b4d91bc5603f1ee67dfc56146e4d01cea568e82f44aa14a97"
            },
            "downloads": -1,
            "filename": "pymittagleffler-0.1.3-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "has_sig": false,
            "md5_digest": "5bfadf3a479bb246fabf30dc09470d7f",
            "packagetype": "bdist_wheel",
            "python_version": "cp310",
            "requires_python": ">=3.10",
            "size": 339581,
            "upload_time": "2025-02-01T09:34:07",
            "upload_time_iso_8601": "2025-02-01T09:34:07.722681Z",
            "url": "https://files.pythonhosted.org/packages/33/ba/641d31557d350060fc369c137774df9a12cc8b70cf430d1c45c1712c1200/pymittagleffler-0.1.3-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "8424b6beefd542c7a456b02897995db93f6c2891dbc08b8199be93e353d997c6",
                "md5": "02ab4682a9b2421cee59ca02d82f5ab6",
                "sha256": "02445dfbe2be6ee11d10c899da6e9c34911433ee409d4602df527ebcfd93ca6a"
            },
            "downloads": -1,
            "filename": "pymittagleffler-0.1.3-cp310-abi3-manylinux_2_24_aarch64.whl",
            "has_sig": false,
            "md5_digest": "02ab4682a9b2421cee59ca02d82f5ab6",
            "packagetype": "bdist_wheel",
            "python_version": "cp310",
            "requires_python": ">=3.10",
            "size": 333342,
            "upload_time": "2025-02-01T09:34:09",
            "upload_time_iso_8601": "2025-02-01T09:34:09.913178Z",
            "url": "https://files.pythonhosted.org/packages/84/24/b6beefd542c7a456b02897995db93f6c2891dbc08b8199be93e353d997c6/pymittagleffler-0.1.3-cp310-abi3-manylinux_2_24_aarch64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "c30150c7db58e2ae82f6ccc85befa9b0a0fad183e5313c650cd359d97128bd55",
                "md5": "fd7f99d6dd75ea4c030c8d34bbd47acb",
                "sha256": "73c8cd5ebf28188aeeb0b3fa1961128d1b401e67cd55fd60aa1c564fa99e62a0"
            },
            "downloads": -1,
            "filename": "pymittagleffler-0.1.3-cp310-abi3-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "fd7f99d6dd75ea4c030c8d34bbd47acb",
            "packagetype": "bdist_wheel",
            "python_version": "cp310",
            "requires_python": ">=3.10",
            "size": 193234,
            "upload_time": "2025-02-01T09:34:11",
            "upload_time_iso_8601": "2025-02-01T09:34:11.331354Z",
            "url": "https://files.pythonhosted.org/packages/c3/01/50c7db58e2ae82f6ccc85befa9b0a0fad183e5313c650cd359d97128bd55/pymittagleffler-0.1.3-cp310-abi3-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "776701b395a37037caf28463746c00da17d9a0ed3131a0af5feb3fd4b2a6231c",
                "md5": "5d832d42b328e94c2360a4b9204bd252",
                "sha256": "1e32c8debdea97e929b30d54c14206a8ebfb1d384006bc14c86c3e0d98cf8fca"
            },
            "downloads": -1,
            "filename": "pymittagleffler-0.1.3.tar.gz",
            "has_sig": false,
            "md5_digest": "5d832d42b328e94c2360a4b9204bd252",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 266931,
            "upload_time": "2025-02-01T09:34:13",
            "upload_time_iso_8601": "2025-02-01T09:34:13.484895Z",
            "url": "https://files.pythonhosted.org/packages/77/67/01b395a37037caf28463746c00da17d9a0ed3131a0af5feb3fd4b2a6231c/pymittagleffler-0.1.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-02-01 09:34:13",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "alexfikl",
    "github_project": "mittagleffler",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "pymittagleffler"
}
        
Elapsed time: 1.74049s