Skip to main content

Crate hankrs

Crate hankrs 

Source
Expand description

A library for performing quasi-discrete Hankel transforms.

This crate provides tools for efficiently computing Hankel transforms of various orders using a quasi-discrete approximation. It operates seamlessly on ndarray arrays and natively supports both real (f64) and complex (num_complex::Complex64) numbers via the HankelScalar trait.

§Compatibility

  • hankrs 2.x targets ndarray 0.17.
  • For projects using ndarray 0.16, use hankrs 1.x.

§Examples and Guides

Comprehensive examples and theoretical demonstrations can be found in the online hankrs book.

§Quick Start

use hankrs::HankelTransform;
use ndarray::{Array1, Axis};

// 1. Create a transformer for order 0 up to radius 10.0 with 256 points
let transformer = HankelTransform::new(0, 10.0, 256).unwrap();

// 2. Define a function on the generated radial grid `transformer.radius()`
let r = transformer.radius();
let f = r.mapv(|rad| (-rad * rad).exp()); // Gaussian function

// 3. Compute the quasi-discrete Hankel transform (QDHT)
let ht = transformer.qdht(&f, Axis(0));

// The transformed values are evaluated at `transformer.kr()` (or `transformer.frequency()`)

Modules§

one_shot
Convenience functions for performing one-off Hankel transforms.

Structs§

HankelTransform
The primary struct used for computing Hankel transforms. The primary struct used for computing Hankel transforms. The primary struct used for computing Hankel transforms. The main struct for performing Hankel Transforms

Enums§

HankelError
The primary struct used for computing Hankel transforms. The primary struct used for computing Hankel transforms. The primary struct used for computing Hankel transforms. An error that occurs during Hankel transform operations.
TransformType
The primary struct used for computing Hankel transforms. The primary struct used for computing Hankel transforms. The primary struct used for computing Hankel transforms. Indicates the type of Hankel transform that a HankelTransform object will perform.

Traits§

HankelScalar
The primary struct used for computing Hankel transforms. The primary struct used for computing Hankel transforms. The primary struct used for computing Hankel transforms. A trait for scalar types that can be processed by the Hankel transform.