Integrals and Derivatives

The HPFRACC library provides a comprehensive collection of fractional calculus operators, from classical definitions to cutting-edge advanced methods. This guide covers all available operators, their mathematical foundations, and practical usage.

For complete API documentation, see Derivatives and Integrals API Reference.

Classical Fractional Derivatives

Riemann-Liouville Derivative

Definition:

\[D^\alpha_{RL} f(t) = \frac{1}{\Gamma(n-\alpha)} \frac{d^n}{dt^n} \int_0^t (t-\tau)^{n-\alpha-1} f(\tau) d\tau\]

Usage:

from hpfracc.core.derivatives import create_fractional_derivative

# Create Riemann-Liouville derivative with α = 0.5
rl_derivative = create_fractional_derivative('riemann_liouville', 0.5)

# Compute derivative of f(x) = x^2 at x = 2.0
def f(x): return x**2
result = rl_derivative.compute(f, 2.0)

Characteristics: - Most fundamental fractional derivative definition - Well-suited for initial value problems - Computationally efficient with optimized algorithms

Caputo Derivative

Definition:

\[D^\alpha_C f(t) = \frac{1}{\Gamma(n-\alpha)} \int_0^t (t-\tau)^{n-\alpha-1} f^{(n)}(\tau) d\tau\]

Usage:

caputo_derivative = create_fractional_derivative('caputo', 0.5)
result = caputo_derivative.compute(f, 2.0)

Characteristics: - Better behavior for initial value problems - Preserves classical derivative properties - Widely used in physics and engineering

Grünwald-Letnikov Derivative

Definition:

\[D^\alpha_{GL} f(t) = \lim_{h \to 0} h^{-\alpha} \sum_{k=0}^\infty (-1)^k \binom{\alpha}{k} f(t-kh)\]

Usage:

gl_derivative = create_fractional_derivative('grunwald_letnikov', 0.5)
result = gl_derivative.compute(f, 2.0)

Characteristics: - Discrete approximation approach - Good for numerical computations - Memory-efficient implementation

Novel Fractional Derivatives

Caputo-Fabrizio Derivative

Definition:

\[^{CF}D^\alpha f(t) = \frac{M(\alpha)}{1-\alpha} \int_0^t f'(\tau) \exp\left(-\frac{\alpha(t-\tau)}{1-\alpha}\right) d\tau\]

Usage:

cf_derivative = create_fractional_derivative('caputo_fabrizio', 0.5)
result = cf_derivative.compute(f, 2.0)

Characteristics: - Non-singular exponential kernel - Better numerical stability - Ideal for biological systems and viscoelasticity

Atangana-Baleanu Derivative

Definition:

\[^{AB}D^\alpha f(t) = \frac{B(\alpha)}{1-\alpha} \int_0^t f'(\tau) E_\alpha\left(-\frac{\alpha(t-\tau)^\alpha}{1-\alpha}\right) d\tau\]

Usage:

ab_derivative = create_fractional_derivative('atangana_baleanu', 0.5)
result = ab_derivative.compute(f, 2.0)

Characteristics: - Mittag-Leffler kernel - Enhanced memory effects - Advanced applications in complex systems

Advanced Methods

Weyl Derivative

Definition:

\[D^\alpha_W f(x) = \frac{1}{\Gamma(n-\alpha)} \left(\frac{d}{dx}\right)^n \int_x^\infty (\tau-x)^{n-\alpha-1} f(\tau) d\tau\]

Usage:

weyl_derivative = create_fractional_derivative('weyl', 0.5)
result = weyl_derivative.compute(f, 2.0)

Characteristics: - FFT convolution implementation - Parallel processing optimization - Suitable for functions on entire real line

Marchaud Derivative

Definition:

\[D^\alpha_M f(x) = \frac{\alpha}{\Gamma(1-\alpha)} \int_0^\infty \frac{f(x) - f(x-\tau)}{\tau^{\alpha+1}} d\tau\]

Usage:

marchaud_derivative = create_fractional_derivative('marchaud', 0.5)
result = marchaud_derivative.compute(f, 2.0)

Characteristics: - Difference quotient convolution - Memory optimization - General kernel support

Hadamard Derivative

Definition:

\[D^\alpha_H f(x) = \frac{1}{\Gamma(n-\alpha)} \left(x\frac{d}{dx}\right)^n \int_1^x \left(\ln\frac{x}{t}\right)^{n-\alpha-1} \frac{f(t)}{t} dt\]

Usage:

hadamard_derivative = create_fractional_derivative('hadamard', 0.5)
result = hadamard_derivative.compute(f, 2.0)

Characteristics: - Logarithmic kernels - Geometric interpretation - Applications in geometric analysis

Riesz-Feller Derivative

Definition:

\[D^\alpha_{RF} f(x) = \frac{1}{2\pi} \int_{\mathbb{R}} |\xi|^\alpha \mathcal{F}[f](\xi) e^{i\xi x} d\xi\]

Usage:

rf_derivative = create_fractional_derivative('reiz_feller', 0.5)
result = rf_derivative.compute(f, 2.0)

Characteristics: - Spectral method implementation - Fourier domain computation - High accuracy for smooth functions

Special Operators

Fractional Laplacian

Definition:

\[(-\Delta)^{\alpha/2} f(x) = \left(\frac{1}{2\pi}\right)^n \int_{\mathbb{R}^n} |\xi|^\alpha \mathcal{F}[f](\xi) e^{i\xi \cdot x} d\xi\]

Usage:

laplacian = create_fractional_derivative('fractional_laplacian', 0.5)
result = laplacian.compute(f, x_array)

Characteristics: - Spatial fractional derivatives - Multi-dimensional support - Applications in PDEs and image processing

Fractional Fourier Transform

Definition:

\[\mathcal{F}^\alpha[f](u) = \int_{\mathbb{R}} f(x) K_\alpha(x,u) dx\]

Usage:

fft = create_fractional_derivative('fractional_fourier_transform', 0.5)
result = fft.compute(f, x_array)

Characteristics: - Generalized Fourier transform - Signal processing applications - Time-frequency analysis

Riesz-Fisher Operator

Definition:

\[R^\alpha f(x) = \frac{1}{2} \left[D^\alpha_+ f(x) + D^\alpha_- f(x)\right]\]

Usage:

from hpfracc.core.fractional_implementations import create_riesz_fisher_operator

# For derivative behavior (α > 0)
rf_derivative = create_riesz_fisher_operator(0.5)
result = rf_derivative.compute(f, x)

# For integral behavior (α < 0)
rf_integral = create_riesz_fisher_operator(-0.5)
result = rf_integral.compute(f, x)

# For identity behavior (α = 0)
rf_identity = create_riesz_fisher_operator(0.0)
result = rf_identity.compute(f, x)

Characteristics: - Unified derivative/integral operator - Smooth transition between operations - Perfect for signal processing and image analysis

Fractional Integrals

Available Integral Types

  1. Riemann-Liouville Integral (“RL”)

  2. Caputo Integral (“Caputo”) - Now supports all orders α ≥ 0 - For 0 < α < 1: Equals Riemann-Liouville integral - For α ≥ 1: Uses decomposition method I^α = I^n * I^β

  3. Weyl Integral (“Weyl”)

  4. Hadamard Integral (“Hadamard”)

  5. Miller-Ross Integral (“MillerRoss”)

  6. Marchaud Integral (“Marchaud”)

Usage:

from hpfracc.core.integrals import create_fractional_integral

# Create Riemann-Liouville integral
rl_integral = create_fractional_integral("RL", 0.5)
result = rl_integral(f, x)

# Create Weyl integral
weyl_integral = create_fractional_integral("Weyl", 0.5)
result = weyl_integral(f, x)

Usage Examples

Basic Usage Pattern

from hpfracc.core.derivatives import create_fractional_derivative
import numpy as np

# Define function
def f(x): return x**2

# Create derivative
derivative = create_fractional_derivative('riemann_liouville', 0.5)

# Single point computation
result = derivative.compute(f, 2.0)

# Array computation
x_array = np.linspace(0, 5, 100)
result_array = derivative.compute(f, x_array)

# Numerical computation from function values
f_values = f(x_array)
result_numerical = derivative.compute_numerical(f_values, x_array)

Advanced Usage with Parallel Processing

# Use parallel-optimized methods for large computations
parallel_derivative = create_fractional_derivative('parallel_riemann_liouville', 0.5)

# Large array computation
x_large = np.linspace(0, 100, 10000)
result_large = parallel_derivative.compute(f, x_large)

Autograd Fractional Derivatives (ML)

The ML module provides autograd-friendly fractional derivatives that preserve the computation graph.

import torch
from hpfracc.ml.fractional_autograd import fractional_derivative, FractionalDerivativeLayer

x = torch.randn(2, 64, 128, requires_grad=True)  # (batch, channels, time)

# RL/GL
y_rl = fractional_derivative(x, alpha=0.5, method="RL")

# Caputo
y_caputo = fractional_derivative(x, alpha=0.5, method="Caputo")

# Caputo-Fabrizio (exponential kernel)
y_cf = fractional_derivative(x, alpha=0.5, method="CF")

# Atangana-Baleanu (blended kernel)
y_ab = fractional_derivative(x, alpha=0.5, method="AB")

# Layer wrapper
layer = FractionalDerivativeLayer(alpha=0.5, method="RL")
out = layer(torch.randn(4, 16, 256, requires_grad=True))

Performance Considerations

Method Selection Guidelines

  1. For small computations (< 1000 points): Use classical methods

  2. For medium computations (1000-10000 points): Use advanced methods

  3. For large computations (> 10000 points): Use parallel-optimized methods

  4. For real-time applications: Use optimized methods with JAX/Numba

  5. For memory-constrained systems: Use memory-optimized methods

Optimization Tips

# Enable JAX acceleration when available
derivative = create_fractional_derivative('riemann_liouville', 0.5, use_jax=True)

# Enable Numba optimization
derivative = create_fractional_derivative('riemann_liouville', 0.5, use_numba=True)

# Use parallel processing for large arrays
parallel_derivative = create_fractional_derivative('parallel_riemann_liouville', 0.5)

Mathematical Properties

Key Properties

  1. Linearity: \(D^\alpha(af + bg) = aD^\alpha f + bD^\alpha g\)

  2. Leibniz Rule: \(D^\alpha(fg) = \sum_{k=0}^\infty \binom{\alpha}{k} D^{\alpha-k}f D^k g\)

  3. Chain Rule: \(D^\alpha(f \circ g) = \sum_{k=1}^\infty \binom{\alpha}{k} (D^k f \circ g) (D^\alpha g)^k\)

  4. Semigroup Property: \(D^\alpha(D^\beta f) = D^{\alpha+\beta} f\)

Convergence and Stability

  • Riemann-Liouville: Stable for 0 < α < 1, may have boundary effects

  • Caputo: Better initial value behavior, stable for all α > 0

  • Grünwald-Letnikov: Numerical stability depends on step size

  • Novel Methods: Enhanced stability with non-singular kernels

Summary

The HPFRACC library provides a comprehensive suite of fractional calculus operators suitable for a wide range of applications. From classical definitions to cutting-edge advanced methods, users can choose the most appropriate operator for their specific needs.

Available Operators: - ✅ Classical: Riemann-Liouville, Caputo, Grünwald-Letnikov - ✅ Novel: Caputo-Fabrizio, Atangana-Baleanu - ✅ Advanced: Weyl, Marchaud, Hadamard, Riesz-Feller - ✅ Special: Fractional Laplacian, Fractional Fourier Transform - ✅ Integrals: RL, Caputo, Weyl, Hadamard, Miller-Ross, Marchaud

For complete API reference, see Derivatives and Integrals API Reference.

Next Steps