### Install pymittagleffler from PyPI Source: https://github.com/alexfikl/mittagleffler/blob/main/python/docs/index.rst Use this command to install the package directly from the Python Package Index. ```bash python -m pip install pymittagleffler ``` -------------------------------- ### Install pymittagleffler in Editable Mode Source: https://github.com/alexfikl/mittagleffler/blob/main/python/docs/index.rst Install the package in editable mode for development. This requires cloning the repository and navigating to the 'python' folder. It uses 'maturin' as the build system. ```bash python -m pip install --verbose --no-build-isolation --editable . ``` -------------------------------- ### Evaluate Mittag-Leffler Function Source: https://github.com/alexfikl/mittagleffler/blob/main/python/docs/index.rst Example script to evaluate the Mittag-Leffler function for complex parameters. This code is intended to demonstrate the library's functionality. ```python from pymittagleffler import E import numpy as np def main(): # Parameters for the Mittag-Leffler function alpha = 1.5 beta = 0.5 z = np.linspace(-5, 5, 256) + 1j * np.linspace(-5, 5, 256)[:, np.newaxis] # Evaluate the function E_alpha_beta_z = E(alpha, beta, z) # Plotting the results # (Plotting code omitted for brevity, refer to the original script for details) print(f"Shape of E({alpha}, {beta}, z): {E_alpha_beta_z.shape}") if __name__ == "__main__": main() ``` -------------------------------- ### Rust Crate - Specific Algorithm (Garrappa) Source: https://github.com/alexfikl/mittagleffler/blob/main/README.md Evaluate the Mittag-Leffler function using the specific Garrappa algorithm. This allows for fine-tuning of algorithm parameters. ```APIDOC ## Rust Crate - Specific Algorithm (Garrappa) ### Description Evaluate the Mittag-Leffler function using the specific Garrappa algorithm. This allows for fine-tuning of algorithm parameters. ### Method `use mittagleffler::GarrappaMittagLeffler;` ### Initialization `GarrappaMittagLeffler::new(eps: f64)` - `eps` (f64): A parameter for the Garrappa algorithm, typically a small epsilon value for convergence. ### Evaluation `ml.evaluate(z, alpha, beta)` - `ml`: An instance of `GarrappaMittagLeffler`. - `z` (Complex64): The complex number at which to evaluate the function. - `alpha` (f64): The first parameter of the Mittag-Leffler function. - `beta` (f64): The second parameter of the Mittag-Leffler function. ### Request Example ```rust use mittagleffler::GarrappaMittagLeffler; use num_complex::Complex64; let alpha = 0.75; let beta = 1.25; 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)); ``` ### Response - Returns the computed value of the Mittag-Leffler function using the Garrappa algorithm. ``` -------------------------------- ### Evaluate Mittag-Leffler Function with Garrappa Algorithm (Rust) Source: https://github.com/alexfikl/mittagleffler/blob/main/python/README.md Evaluates the two-parameter Mittag-Leffler function using the specific Garrappa (2015) algorithm. Allows for setting a custom epsilon for the algorithm. ```rust 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)); ``` -------------------------------- ### Evaluate Mittag-Leffler Function in Python Source: https://github.com/alexfikl/mittagleffler/blob/main/python/CHANGELOG.rst Demonstrates how to import and use the mittag_leffler function from the pymittagleffler library. Accepts real and complex numpy arrays. ```python from pymittagleffler import mittag_leffler z = np.linspace(0.0, 1.0) + 1j * np.linspace(0.0, 1.0) ml = mittag_leffler(z, alpha=1.0, beta=2.0) ``` -------------------------------- ### Rust Crate - General Evaluation Source: https://github.com/alexfikl/mittagleffler/blob/main/README.md Evaluate the Mittag-Leffler function using the general `mittag_leffler` method. This method automatically selects the best underlying algorithm and handles special cases. ```APIDOC ## Rust Crate - General Evaluation ### Description Evaluate the Mittag-Leffler function using the general `mittag_leffler` method. This method automatically selects the best underlying algorithm and handles special cases. ### Method `use mittagleffler::MittagLeffler;` ### Parameters - `alpha` (f64): The first parameter of the Mittag-Leffler function. - `beta` (f64): The second parameter of the Mittag-Leffler function. - `z` (Complex64 or f64): The complex or real number at which to evaluate the function. ### Request Example ```rust use mittagleffler::MittagLeffler; use num_complex::Complex64; 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)); ``` ### Response - Returns the computed value of the Mittag-Leffler function. ``` -------------------------------- ### Evaluate Mittag-Leffler Function (Rust) Source: https://github.com/alexfikl/mittagleffler/blob/main/python/README.md Evaluates the two-parameter Mittag-Leffler function using the best underlying algorithm. Handles special cases like alpha=1, beta=1. ```rust 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)); ``` -------------------------------- ### Evaluate Mittag-Leffler Function with NumPy Arrays (Python) Source: https://github.com/alexfikl/mittagleffler/blob/main/python/README.md Evaluates the two-parameter Mittag-Leffler function for scalar inputs and NumPy arrays. Requires importing the mittag_leffler function from pymittagleffler. ```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) ``` -------------------------------- ### Python Bindings - Scalar and Numpy Array Evaluation Source: https://github.com/alexfikl/mittagleffler/blob/main/README.md Evaluate the Mittag-Leffler function using the `pymittagleffler` Python package. This function works with both scalar inputs and NumPy arrays. ```APIDOC ## Python Bindings - Scalar and Numpy Array Evaluation ### Description Evaluate the Mittag-Leffler function using the `pymittagleffler` Python package. This function works with both scalar inputs and NumPy arrays. ### Method `from pymittagleffler import mittag_leffler` ### Parameters - `z` (float, complex, or numpy.ndarray): The input value(s) at which to evaluate the function. - `alpha` (float): The first parameter of the Mittag-Leffler function. - `beta` (float): The second parameter of the Mittag-Leffler function. ### Request 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) print(result) z_scalar = 1.5 + 0.5j result_scalar = mittag_leffler(z_scalar, alpha, beta) print(result_scalar) ``` ### Response - Returns the computed value(s) of the Mittag-Leffler function. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.