FastHartleyTransform.jl

ColPrac: Contributor's Guide on Collaborative Practices for Community Packages

Fast real-to-real Hartley transforms for Julia, backed by FFTW on CPU, with optional CUDA and Reactant extensions.

Start here

A first transform

using FastHartleyTransform
x = [1.0, 2.0, 3.0, 4.0]
y = fht(x)
@assert ifht(y) ≈ x
y
4-element Vector{Float64}:
 10.0
 -4.0
 -2.0
  0.0

fht is unnormalized; ifht includes the inverse scale. The default multidimensional transform uses one cosine-plus-sine kernel, rather than a product of one-dimensional Hartley kernels. See Transform conventions before substituting another DHT implementation.

The common interface and optional CPU Enzyme rules are supplied by AbstractFastHartleyTransforms.jl. Install this package to obtain a concrete transform implementation.