Papers
Topics
Authors
Recent
Search
2000 character limit reached

PiecewiseHilbert: Analytical Hilbert Transforms

Updated 12 July 2026
  • PiecewiseHilbert is a Julia module that enables analytic Hilbert transforms by exploiting closed-form antiderivatives to avoid numerical quadrature.
  • It integrates with the Piecewise ecosystem to represent functions on segmented intervals using basis types such as POLY and LOG for efficient transformation.
  • The framework enhances numerical robustness for handling discontinuities and singularities, leading to precise evaluations in complex physical applications.

Searching arXiv for the primary paper and a few contextual Hilbert-transform references.

PiecewiseHilbert is a companion Julia module in the Piecewise ecosystem whose purpose is to add Hilbert-transform capabilities to the pre-defined Formula types provided by Piecewise, allowing the Hilbert transform of a PiecewiseFunction to be evaluated without resorting to numerical quadrature (Berthod, 23 Sep 2025). Within that ecosystem, a piecewise function of a real variable is represented on a union of intervals, each interval carrying a rule that is typically a linear combination of elementary formulas, and the central design principle is that, when closed-form antiderivatives are available for the kernel-dependent integrands, integral transforms reduce to evaluating primitives at interval boundaries rather than performing numerical integration (Berthod, 23 Sep 2025). PiecewiseHilbert specializes this principle to the Hilbert kernel, so that a fitted piecewise approximation built from supported basis formulas such as POLY and LOG can be transformed analytically, with the resulting transform represented again as a PiecewiseFunction (Berthod, 23 Sep 2025).

1. Position within the Piecewise ecosystem

The Piecewise Julia module provides a general infrastructure for 1D piecewise functions. Its core types are Formula, which holds a user-defined function of a real variable and parameters, Piece, which holds an interval, a rule, and formula parameters, and PiecewiseFunction, which holds a collection of Piece objects together with a parity flag such as :even or :odd (Berthod, 23 Sep 2025). The module also provides a fitting mechanism, exemplified by K(x,y)=1yx+i0+,K(x,y) = \frac{1}{y - x + i0^+},2 which constructs a PiecewiseFunction fitted to a target function with specified formulas and tolerance (Berthod, 23 Sep 2025).

The motivating application is fast evaluation of integral transforms for functions with critical points such as discontinuities, cusps, and logarithmic singularities, where polynomial interpolations and numerical quadratures are slow or inaccurate (Berthod, 23 Sep 2025). In the general formulation,

(Kf)(X)=dxf(x)K(x,X),(K \circ f)(\mathbf{X}) = \int_{-\infty}^{\infty} dx\, f(x)\, K(x, \mathbf{X}),

the transform becomes a boundary-evaluation problem whenever each elementary piece Fi(x)F_i(x) admits a closed-form antiderivative PiP_i satisfying

ddxPi(x,X)=Fi(x)K(x,X).\frac{d}{dx} P_i(x,\mathbf{X}) = F_i(x)\,K(x,\mathbf{X}).

The base Piecewise module defines seven pre-built Formula types with known moment integrals, the PiecewiseHilbert module supplements those formulas with methods for fast Hilbert transforms, and the PiecewiseLorentz module extends some formulas for a Lorentz-type transform (Berthod, 23 Sep 2025).

In this setting, PiecewiseHilbert is not a generic Hilbert-transform package for arbitrary user-defined formulas. Its fast path is tied to the subset of formulas for which analytic Hilbert-transform methods have been implemented. This suggests that its scope is deliberately kernel-specific and basis-specific rather than universal.

2. Mathematical formulation

The Hilbert transform is presented through the kernel

K(x,y)=1yx+i0+,K(x,y) = \frac{1}{y - x + i0^+},

or, more generally,

K(x,z)=1zx,zCR,K(x,z) = \frac{1}{z - x}, \quad z \in \mathbb{C} \setminus \mathbb{R},

with finite imaginary part (Berthod, 23 Sep 2025). In real-variable form, the standard transform is

H[f](y)=1πp.v.f(x)yxdx,\mathcal{H}[f](y) = \frac{1}{\pi} \, \operatorname{p.v.} \int_{-\infty}^{\infty} \frac{f(x)}{y - x} \, dx,

where p.v.\operatorname{p.v.} denotes the Cauchy principal value (Berthod, 23 Sep 2025).

For a piecewise representation

f(x)=kfk(x)χ(ak,bk)(x),f(x) = \sum_{k} f_k(x) \, \chi_{(a_k, b_k)}(x),

with each fkf_k a linear combination of supported formulas on Fi(x)F_i(x)0, the transform becomes

Fi(x)F_i(x)1

If Fi(x)F_i(x)2 lies outside Fi(x)F_i(x)3, the integral is regular; if Fi(x)F_i(x)4 lies inside Fi(x)F_i(x)5, the principal-value prescription is required (Berthod, 23 Sep 2025). PiecewiseHilbert exploits linearity by expressing

Fi(x)F_i(x)6

and precomputing

Fi(x)F_i(x)7

so that

Fi(x)F_i(x)8

is assembled analytically from basis contributions (Berthod, 23 Sep 2025).

For the polynomial basis POLY, the paper gives the decomposition

Fi(x)F_i(x)9

which reduces the transform of PiP_i0 on PiP_i1 to regular power integrals plus a logarithmic term, yielding an expression of the form

PiP_i2

with PiP_i3 and PiP_i4 polynomial (Berthod, 23 Sep 2025). For the logarithmic basis LOG, the transform of terms such as PiP_i5 on finite intervals is likewise treated analytically, with built-in expressions involving logarithmic or polylogarithmic structure (Berthod, 23 Sep 2025).

This analytic strategy differs sharply from FFT-based and quadrature-based Hilbert transforms. FFT methods typically assume a periodic, uniformly sampled grid, while quadrature-based approaches confront the principal-value singularity directly (Berthod, 23 Sep 2025). By contrast, PiecewiseHilbert avoids numerical quadrature entirely for supported formulas, and its cost is described as essentially proportional to the number of pieces and the number of evaluation points (Berthod, 23 Sep 2025).

3. Formula types, fitting, and transform construction

The Piecewise module ships with a small set of built-in Formula types, explicitly including POLY and LOG, and covers many practical cases (Berthod, 23 Sep 2025). PiecewiseHilbert supplements those formula types with Hilbert-transform methods, so that a fitted PiecewiseFunction can be mapped to another PiecewiseFunction representing its Hilbert transform (Berthod, 23 Sep 2025).

A typical workflow uses Piecewise to fit the target and PiecewiseHilbert to transform the fit: K(x,y)=1yx+i0+,K(x,y) = \frac{1}{y - x + i0^+},3 followed by K(x,y)=1yx+i0+,K(x,y) = \frac{1}{y - x + i0^+},4 after which Hpw(x) evaluates PiP_i6 analytically on the domain (Berthod, 23 Sep 2025).

The parity field in PiecewiseFunction is operational rather than decorative. Many physical problems are even or odd, and the :even or :odd flag allows symmetry exploitation to reduce domain size and improve accuracy and speed (Berthod, 23 Sep 2025). This is consistent with broader Hilbert-transform literature in which parity can determine whether singular contributions cancel or persist. For example, finite-part formulas on symmetric intervals show that the presence or absence of the singular term depends on the interval of integration and on the parity of the function under transformation about the origin (Blancas et al., 2022).

The supported formula repertoire is intentionally limited. The short article explicitly mentions POLY and LOG and states that PiecewiseHilbert only works “fast” for formulas carrying the extra Hilbert-transform methods; arbitrary user-defined formulas would need corresponding analytic primitives supplied by the user, or would fall back to numerical approaches or remain unsupported (Berthod, 23 Sep 2025). A plausible implication is that the module is best viewed as a framework for analytic transforms over a curated basis library rather than a symbolic engine for arbitrary kernels and rules.

4. Numerical behavior and comparison with alternative Hilbert-transform strategies

The paper does not provide explicit numerical tables in the short format, but it states the main performance rationale clearly (Berthod, 23 Sep 2025). Compared with quadrature-based Hilbert transforms, piecewise-analytic transforms require only evaluation of closed-form expressions at each point, with cost proportional to the number of pieces and basis functions, whereas quadrature typically scales with the number of grid points and may require adaptive refinement near singularities (Berthod, 23 Sep 2025). Compared with FFT-based transforms, the piecewise approach works in continuous space, on arbitrary finite intervals, and treats singularities exactly rather than through periodic extension, padding, or windowing (Berthod, 23 Sep 2025).

The approximation error is attributed solely to the initial fit produced by piecewisefit (Berthod, 23 Sep 2025). Once the piecewise representation is fixed, the Hilbert transform of that approximant is exact within floating-point arithmetic because it is evaluated from analytic formulas (Berthod, 23 Sep 2025). In the density-of-states example discussed below, the fitted piecewise approximation attains relative accuracy better than PiP_i7 over the full support PiP_i8 despite discontinuities and a logarithmic singularity (Berthod, 23 Sep 2025).

This design addresses a class of numerical pathologies that also appear in other Hilbert-transform settings. A simple delta–delta discretization of the finite Hilbert transform on an interval has convergence that is non-uniform, with order PiP_i9 in the interior but a boundary layer where the consistency error does not tend to zero (Costabel, 2023). Multi-domain spectral methods on the real line improve behavior for piecewise analytic functions by decomposing the domain into subintervals and applying Chebyshev-based quadrature locally, but they remain numerical spectral schemes rather than analytic piecewise transforms (Klein et al., 2021). PiecewiseHilbert belongs to a different design point: rather than resolve singular structure numerically, it attempts to encode that structure directly in the basis formulas.

The stability argument in PiecewiseHilbert is therefore structural. Principal-value handling is built into the analytic expressions, critical points are represented with dedicated formulas such as LOG, and symmetry can be built into the representation through parity flags (Berthod, 23 Sep 2025). This suggests that numerical robustness is achieved less by adaptive integration and more by choosing an approximation space that mirrors the singular geometry of the target function.

5. Canonical example: two-dimensional lattice density of states

The explicit example in the paper concerns a two-dimensional lattice density of states with dispersion

ddxPi(x,X)=Fi(x)K(x,X).\frac{d}{dx} P_i(x,\mathbf{X}) = F_i(x)\,K(x,\mathbf{X}).0

and density of states

ddxPi(x,X)=Fi(x)K(x,X).\frac{d}{dx} P_i(x,\mathbf{X}) = F_i(x)\,K(x,\mathbf{X}).1

where ddxPi(x,X)=Fi(x)K(x,X).\frac{d}{dx} P_i(x,\mathbf{X}) = F_i(x)\,K(x,\mathbf{X}).2 is the complete elliptic integral (Berthod, 23 Sep 2025). The critical points are discontinuities at ddxPi(x,X)=Fi(x)K(x,X).\frac{d}{dx} P_i(x,\mathbf{X}) = F_i(x)\,K(x,\mathbf{X}).3 and a logarithmic singularity at ddxPi(x,X)=Fi(x)K(x,X).\frac{d}{dx} P_i(x,\mathbf{X}) = F_i(x)\,K(x,\mathbf{X}).4 (Berthod, 23 Sep 2025).

The known singular part is represented directly as a PiecewiseFunction: K(x,y)=1yx+i0+,K(x,y) = \frac{1}{y - x + i0^+},5 and the regular residual is then fitted polynomially: K(x,y)=1yx+i0+,K(x,y) = \frac{1}{y - x + i0^+},6 The resulting PiecewiseFunction has one piece on (0,4) combining POLY and LOG formulas (Berthod, 23 Sep 2025). The paper reports the verification K(x,y)=1yx+i0+,K(x,y) = \frac{1}{y - x + i0^+},7 which establishes relative error below ddxPi(x,X)=Fi(x)K(x,X).\frac{d}{dx} P_i(x,\mathbf{X}) = F_i(x)\,K(x,\mathbf{X}).5 across the full support (Berthod, 23 Sep 2025).

Although the short article stops at the fit, the linked Tutorial 2 shows how PiecewiseHilbert is used to solve an implicit equation involving Hilbert transforms (Berthod, 23 Sep 2025). The motivating physical pattern is a Kramers–Kronig-type relation such as

ddxPi(x,X)=Fi(x)K(x,X).\frac{d}{dx} P_i(x,\mathbf{X}) = F_i(x)\,K(x,\mathbf{X}).6

where the imaginary part is represented as a piecewise function with singular features captured analytically and the real part is recovered efficiently through the Hilbert transform (Berthod, 23 Sep 2025).

This example also clarifies what “fast” means in context. The gain does not come from asymptotically faster transforms in the FFT sense; it comes from eliminating repeated numerical quadrature in iterative workflows once the piecewise approximation has been constructed.

The code was written to support applications including MagnetoTransport.jl, linear magneto-transport with local self-energy, and the paper associates the broader framework with problems such as superconductivity in metallic hydrogen and Hall response of correlated electrons (Berthod, 23 Sep 2025). In these contexts, Hilbert transforms occur inside coupled integral equations and self-consistent spectral calculations, where repeated evaluation of Cauchy-type transforms is a bottleneck (Berthod, 23 Sep 2025).

The relation to PiecewiseLorentz is close. The Lorentz transform uses kernels of the form

ddxPi(x,X)=Fi(x)K(x,X).\frac{d}{dx} P_i(x,\mathbf{X}) = F_i(x)\,K(x,\mathbf{X}).7

so PiecewiseHilbert and PiecewiseLorentz are both built on Cauchy-type kernels and differ mainly in whether the evaluation point is real or complex (Berthod, 23 Sep 2025). The base Piecewise module’s seven moment formulas are likewise part of the same analytic-integration philosophy, with the kernel ddxPi(x,X)=Fi(x)K(x,X).\frac{d}{dx} P_i(x,\mathbf{X}) = F_i(x)\,K(x,\mathbf{X}).8 replacing the Hilbert kernel (Berthod, 23 Sep 2025).

Several limitations are explicit. Fast analytic Hilbert transforms are available only for the pre-defined formulas extended by PiecewiseHilbert (Berthod, 23 Sep 2025). The library targets one-dimensional transforms of functions of a single real variable, and multi-dimensional Hilbert transforms are not supported (Berthod, 23 Sep 2025). The representation is tied to a finite union of intervals on the real line, so infinite support requires truncation or another compactification strategy chosen by the user (Berthod, 23 Sep 2025). The methodology also presumes that the user can choose basis formulas matching the singularities of the problem (Berthod, 23 Sep 2025).

These limitations distinguish PiecewiseHilbert from other Hilbert-transform frameworks. One-sided Hilbert transforms on the half-line are naturally analyzed in Mellin space, where the transform acts by multiplication with ddxPi(x,X)=Fi(x)K(x,X).\frac{d}{dx} P_i(x,\mathbf{X}) = F_i(x)\,K(x,\mathbf{X}).9 and solutions can develop a universal K(x,y)=1yx+i0+,K(x,y) = \frac{1}{y - x + i0^+},0 singularity at the origin when the Mellin transform of the data does not vanish at K(x,y)=1yx+i0+,K(x,y) = \frac{1}{y - x + i0^+},1 (Blåsten et al., 2023). Finite Hilbert transforms on bounded intervals can require delicate handling of endpoint layers under discretization (Costabel, 2023). Curved Hilbert transforms along monomial curves require non-isotropic cube systems and curve-adapted BMO spaces (Bongers et al., 2019). PiecewiseHilbert does not attempt to subsume these geometrically different theories; it addresses the narrower but practically important case of analytic Cauchy-type transforms of fitted one-dimensional piecewise models.

A plausible implication is that the module’s future development would most naturally proceed by enlarging the basis family and adding new transform kernels rather than by generalizing immediately to higher-dimensional singular integral geometry. The paper explicitly suggests increasing the repertoire of basis formulas, extending the methodology to new kernels, and possibly exploring multi-dimensional generalizations or automated symbolic generation of transform formulas (Berthod, 23 Sep 2025).

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to PiecewiseHilbert.