Special operators vs mathematical special functions
Algorithms layer — fractional Laplacian, fractional Fourier / Z / Mellin transforms
(hpfracc.algorithms.fractional_operator_methods; legacy path special_methods).
Mathematical special functions — Γ, β, binomials, Mittag–Leffler (hpfracc.special).
Fractional operator extensions
Fractional operator extensions (Laplacian, FrFT, Z/Mellin transforms).
This is the algorithms-layer complement to hpfracc.special (Γ, β, binomial,
Mittag–Leffler). It implements operators used in PDEs and signal processing:
Fractional Laplacian
Fractional Fourier / Z / Mellin transforms
Canonical import: from hpfracc.algorithms.fractional_operator_methods import ....
The legacy path hpfracc.algorithms.special_methods remains a thin re-export shim.
- hpfracc.algorithms.fractional_operator_methods._numpy_trapezoid(y, x)[source]
Trapezoidal rule; prefers
numpy.trapezoid(NumPy 2+) over deprecatedtrapz.
- hpfracc.algorithms.fractional_operator_methods._factorial(n)
Simple factorial function for NUMBA compatibility.
- class hpfracc.algorithms.fractional_operator_methods.FractionalLaplacian(alpha, *, dimension=1, boundary_conditions=None)[source]
Bases:
objectFractional Laplacian operator implementation.
The fractional Laplacian is defined as: \((-\Delta)^{\alpha/2} f(x) = \mathcal{F}^{-1}\left(|\xi|^{\alpha}\, \mathcal{F}[f](\xi)\right)\)
This is a fundamental operator in fractional PDEs, diffusion processes, and many physical applications.
- Parameters:
alpha (float | FractionalOrder)
dimension (int)
boundary_conditions (str | None)
- __init__(alpha, *, dimension=1, boundary_conditions=None)[source]
Initialize fractional Laplacian calculator.
- Parameters:
order – Fractional order (0 < α < 2)
dimension (int) – Spatial dimension
boundary_conditions (str | None) – Boundary condition type
alpha (float | FractionalOrder)
- compute(f, x, h=None, method='spectral')[source]
Compute fractional Laplacian.
- Parameters:
- Returns:
Fractional Laplacian values
- Return type:
- _spectral_method(f, x, h)[source]
Spectral method using FFT.
- _finite_difference_method(f, x, h)[source]
Finite difference approximation.
- compute_numerical(f, x, h=None)[source]
Numerical convenience API used by tests.
Uses finite-difference approximation under the hood.
- _integral_method(f, x, h)[source]
Integral representation method.
- class hpfracc.algorithms.fractional_operator_methods.FractionalFourierTransform(alpha, *, method='spectral')[source]
Bases:
objectFractional Fourier Transform (FrFT) implementation.
The fractional Fourier transform is a generalization of the Fourier transform that depends on a parameter α. For α = π/2, it reduces to the standard Fourier transform.
FrFT[f](u) = ∫_{-∞}^∞ K_α(x, u) f(x) dx
where K_α is the fractional Fourier kernel.
- Parameters:
alpha (float | FractionalOrder)
method (str)
- __init__(alpha, *, method='spectral')[source]
Initialize fractional Fourier transform calculator.
- Parameters:
alpha (float | FractionalOrder)
method (str)
- transform(f, x, h=None, method='auto')[source]
Compute fractional Fourier transform.
- compute(f, x, h=None, method='auto')[source]
Compatibility wrapper returning only transformed values.
Some call sites expect a compute(…) API that returns the transformed values array directly. This method delegates to transform(…) and returns only the values component.
- _discrete_method(f, x, h)[source]
Discrete fractional Fourier transform using optimized FFT-based approach.
- _fft_based_method(f, x, u, h)[source]
Fast FFT-based fractional Fourier transform.
- _chirp_based_method(f, x, u, h)[source]
Chirp-based algorithm for fractional Fourier transform.
- _spectral_method(f, x, h)[source]
Spectral method using decomposition.
- compute_numerical(f, x, h=None)[source]
Numerical convenience API returning only values.
Maps to the discrete method for accuracy.
- _compute_transform_matrix(x, u, h)[source]
Compute the discrete fractional Fourier transform matrix.
- _hermite_decomposition(f, x, h)[source]
Decompose function into Hermite-Gaussian basis.
- _hermite_function(n, x)[source]
Compute Hermite-Gaussian function of order n.
- _fractional_hermite(n, u, alpha)[source]
Compute fractional Fourier transform of Hermite function.
- class hpfracc.algorithms.fractional_operator_methods.FractionalZTransform(alpha, *, method='spectral')[source]
Bases:
objectFractional Z-Transform implementation.
The fractional Z-transform is a generalization of the Z-transform that depends on a fractional parameter α. It’s useful for discrete-time systems and digital signal processing.
Z^α[f](z) = Σ_{n=0}^∞ f[n] z^(-αn)
- Parameters:
alpha (float | FractionalOrder)
method (str)
- __init__(alpha, *, method='spectral')[source]
Initialize fractional Z-transform calculator.
- Parameters:
alpha (float | FractionalOrder)
method (str)
- transform(f, z, method='direct')[source]
Compute fractional Z-transform.
- _direct_method(f, z)[source]
Direct computation of fractional Z-transform.
- _fft_method(f, z)[source]
FFT-based computation for unit circle evaluation.
- inverse_transform(F, z, N, method='contour')[source]
Compute inverse fractional Z-transform.
- _contour_integration(F, z, N)[source]
Contour integration method for inverse transform.
- class hpfracc.algorithms.fractional_operator_methods.FractionalMellinTransform(alpha)[source]
Bases:
objectFractional Mellin Transform implementation.
The fractional Mellin transform is defined as: M_α[f](s) = ∫₀^∞ f(x) x^(s-1+α) dx
This transform is useful for: - Scale-invariant signal processing - Fractional differential equations - Image processing and pattern recognition - Quantum mechanics applications
- Parameters:
alpha (float | FractionalOrder)
- __init__(alpha)[source]
Initialize fractional Mellin transform calculator.
- Parameters:
alpha (float | FractionalOrder)
- transform(f, x, s, method='numerical')[source]
Compute fractional Mellin transform.
- Parameters:
- Returns:
Transform values
- Return type:
- _numerical_method(f, x, s)[source]
Numerical integration method.
- _analytical_method(f, x, s)[source]
Analytical method for special functions.
- _fft_method(f, x, s)[source]
FFT-based method for efficient computation.
- inverse_transform(F, s, x, method='numerical')[source]
Compute inverse fractional Mellin transform.
- _inverse_numerical(F, s, x)[source]
Numerical inverse transform.
- hpfracc.algorithms.fractional_operator_methods.fractional_laplacian(f, x, alpha, h=None, method='spectral')[source]
Convenience function for fractional Laplacian.
- hpfracc.algorithms.fractional_operator_methods.fractional_fourier_transform(f, x, alpha, h=None, method='auto')[source]
Convenience function for fractional Fourier transform.
- hpfracc.algorithms.fractional_operator_methods.fractional_z_transform(f, z, alpha, method='direct')[source]
Convenience function for fractional Z-transform.
- hpfracc.algorithms.fractional_operator_methods.fractional_mellin_transform(f, x, s, alpha, method='numerical')[source]
Convenience function for fractional Mellin transform.
- class hpfracc.algorithms.fractional_operator_methods.SpecialMethodsConfig(optimized=True, parallel=False)[source]
Bases:
objectConfiguration for special methods optimization.
- class hpfracc.algorithms.fractional_operator_methods.SpecialOptimizedWeylDerivative(alpha, config=None)[source]
Bases:
objectWeyl derivative optimized using Fractional Fourier Transform.
This implementation replaces the standard FFT convolution approach with Fractional Fourier Transform for better performance, especially for large arrays and specific alpha values.
- Parameters:
alpha (float | FractionalOrder)
config (SpecialMethodsConfig | None)
- __init__(alpha, config=None)[source]
Initialize special optimized Weyl derivative calculator.
- Parameters:
alpha (float | FractionalOrder)
config (SpecialMethodsConfig | None)
- _determine_optimal_method()[source]
Determine the optimal computation method based on alpha value.
- compute(f, x, h=None, method=None)[source]
Compute Weyl derivative using optimized method.
- _compute_frft(f, x, h)[source]
Compute using Fractional Fourier Transform.
- _compute_standard_fft(f, x, h)[source]
Compute using standard FFT approach.
- _compute_hybrid(f, x, h)[source]
Compute using hybrid approach combining FRFT and standard FFT.
- class hpfracc.algorithms.fractional_operator_methods.SpecialOptimizedMarchaudDerivative(alpha, config=None)[source]
Bases:
objectMarchaud derivative optimized using Fractional Z-Transform.
This implementation replaces the difference quotient convolution with Fractional Z-Transform for better performance on discrete signals.
- Parameters:
alpha (float | FractionalOrder)
config (SpecialMethodsConfig | None)
- __init__(alpha, config=None)[source]
Initialize special optimized Marchaud derivative calculator.
- Parameters:
alpha (float | FractionalOrder)
config (SpecialMethodsConfig | None)
- compute(f, x, h=None, method='z_transform')[source]
Compute Marchaud derivative using optimized method.
- _compute_z_transform(f, x, h)[source]
Compute using Fractional Z-Transform.
- class hpfracc.algorithms.fractional_operator_methods.SpecialOptimizedReizFellerDerivative(alpha, config=None)[source]
Bases:
objectReiz-Feller derivative optimized using Fractional Laplacian.
This implementation uses the Fractional Laplacian for efficient computation of the Reiz-Feller derivative, especially for spectral methods and large-scale problems.
- Parameters:
alpha (float | FractionalOrder)
config (SpecialMethodsConfig | None)
- __init__(alpha, config=None)[source]
Initialize special optimized Reiz-Feller derivative calculator.
- Parameters:
alpha (float | FractionalOrder)
config (SpecialMethodsConfig | None)
- compute(f, x, h=None, method='laplacian')[source]
Compute Reiz-Feller derivative using optimized method.
- _compute_laplacian(f, x, h)[source]
Compute using Fractional Laplacian.
- class hpfracc.algorithms.fractional_operator_methods.UnifiedSpecialMethods(config=None)[source]
Bases:
objectUnified interface for all special methods with automatic method selection.
This class provides a unified API that automatically selects the best special method based on the problem characteristics.
- Parameters:
config (SpecialMethodsConfig | None)
- __init__(config=None)[source]
Initialize unified special methods interface.
- Parameters:
config (SpecialMethodsConfig | None)
- compute_derivative(f, x, alpha, h, method=None, problem_type='general')[source]
Compute fractional derivative using optimal special method.
- Parameters:
- Returns:
Derivative values
- Return type:
- hpfracc.algorithms.fractional_operator_methods.special_optimized_weyl_derivative(f, x, alpha, h=None, method=None)[source]
Convenience function for special optimized Weyl derivative.
- hpfracc.algorithms.fractional_operator_methods.special_optimized_marchaud_derivative(f, x, alpha, h=None, method='z_transform')[source]
Convenience function for special optimized Marchaud derivative.
- hpfracc.algorithms.fractional_operator_methods.special_optimized_reiz_feller_derivative(f, x, alpha, h=None, method='laplacian')[source]
Convenience function for special optimized Reiz-Feller derivative.
- hpfracc.algorithms.fractional_operator_methods.unified_special_derivative(f, x, alpha, h, method=None, problem_type='general')[source]
Convenience function for unified special derivative computation.
Mathematical special functions
Special Functions Module
This module provides special mathematical functions used in fractional calculus: - Gamma and Beta functions - Binomial coefficients - Mittag-Leffler functions
- hpfracc.special.gamma_function(x)[source]
Gamma function that is compatible with both JAX and NumPy/SciPy.
- hpfracc.special.beta_function(x, y)[source]
Beta function that is compatible with both JAX and NumPy/SciPy.
- hpfracc.special.gamma(x)[source]
Gamma function that is compatible with both JAX and NumPy/SciPy.
- hpfracc.special.beta(x, y)[source]
Beta function that is compatible with both JAX and NumPy/SciPy.
- hpfracc.special.log_gamma(z, use_jax=False)[source]
Convenience function to compute log Gamma function.
- hpfracc.special.binomial_coefficient(n, k, use_jax=False, use_numba=True)
Convenience function to compute binomial coefficient.
- Parameters:
- Returns:
Binomial coefficient value(s)
- Return type:
- hpfracc.special.generalized_binomial(alpha, k, use_jax=False, use_numba=True)
Convenience function to compute fractional binomial coefficient.
- Parameters:
- Returns:
Fractional binomial coefficient value(s)
- Return type:
- hpfracc.special.mittag_leffler_function(alpha, beta, z, use_jax=False, use_numba=True)[source]
Optimized Mittag-Leffler function. Legacy arg order: alpha, beta, z.
- hpfracc.special.mittag_leffler_derivative(alpha, beta, z, order=1)[source]
Compute the derivative of the Mittag-Leffler function.
- hpfracc.special.mittag_leffler_fast(z, alpha, beta=1.0)[source]
Fast Mittag-Leffler function optimized for fractional calculus.
- hpfracc.special.mittag_leffler(z, alpha, beta=1.0, use_jax=False, use_numba=True)[source]