Skip to main content

omnibias.core.verified.hardy_line

0.5.0rc1Release candidatePython >=3.10Apache-2.0

Coefficient recurrences, activation contracts, jet algebra, and verified arithmetic shared by the numerical backends.

import omnibias.core.verified.hardy_line
Module contract & mathematical conventions

Verified whole-line Hilbert transform on the generalized Cauchy-Hardy pair.

For a > 0 and real alpha, the branch

F_{a,alpha}(y) = (a - i y)^{-alpha}

is analytic and single-valued in the upper half-plane. Writing r = sqrt(a^2 + y^2) and phi = atan(y / a),

P_{a,alpha}(y) = r^{-alpha} cos(alpha phi) (even), Q_{a,alpha}(y) = r^{-alpha} sin(alpha phi) (odd).

Under the repo convention H[f](x) = (1/pi) p.v. int f(t)/(x-t) dt,

H[P] = Q, H[Q] = -P.

Derivatives close in the family:

P' = -alpha Q_{a, alpha+1}, Q' = alpha P_{a, alpha+1}.

The classical Poisson / conjugate-Poisson pair of omnibias.core.verified.line is the special case alpha = 1:

P_{a,1} = a / (a^2 + y^2), Q_{a,1} = y / (a^2 + y^2).

For self-similar profiles the physical far-field exponent is alpha = 1/(1+lambda), so a finite Hardy sum matches the algebraic decay that a finite Poisson sum (|y|^{-2}) structurally cannot.

Shared formulas do not imply universal floating-point identity. Verify dtype, shape, derivative-order support, and the stated numerical assumptions for the path you use.

FUNCTION

hardy_angle​

omnibias.core.verified.hardy_angleSource ↗
hardy_angle(y: float, a: float) -> Interval

Verified phi = atan(y / a).

Parameters

NameType & defaultContract
ypositional-or-keywordfloatRequiredSee the operation contract and implementation below.
apositional-or-keywordfloatRequiredSee the operation contract and implementation below.
ReturnsInterval
Executed regression · hardy pair encloses random sample

Recorded coverage confirms this test executed the API body. This example belongs to the pinned upstream test suite. It may use fixtures and imports from its full file. Run it from that checkout with its test dependencies installed.

def test_hardy_pair_encloses_random_sample() -> None:
    rng = random.Random(17)
    for _ in range(40):
        y = rng.uniform(-8.0, 8.0)
        a = rng.uniform(0.2, 3.0)
        alpha = rng.uniform(0.51, 1.2)
        p, q = hardy_pair(y, a, alpha)
        assert p.contains(_true_p(y, a, alpha))
        assert q.contains(_true_q(y, a, alpha))
python -m pytest "packages/omnibias-core/tests/verified/test_hardy_line.py::test_hardy_pair_encloses_random_sample" -q
Read the implementation
def hardy_angle(y: float, a: float) -> Interval:
    """Verified ``phi = atan(y / a)``."""
    _validate_scale_alpha(a, 1.0)
    return atan_iv(Interval.point(y) * Interval.point(a).reciprocal())
Other public import paths
  • omnibias.core.verified.hardy_angle
  • omnibias.core.verified.hardy_line.hardy_angle
FUNCTION

hardy_angle_iv​

omnibias.core.verified.hardy_line.hardy_angle_ivSource ↗
hardy_angle_iv(y: Interval, a: float) -> Interval

Verified phi = atan(y / a) for interval y.

Parameters

NameType & defaultContract
ypositional-or-keywordIntervalRequiredSee the operation contract and implementation below.
apositional-or-keywordfloatRequiredSee the operation contract and implementation below.
ReturnsInterval
Read the implementation
def hardy_angle_iv(y: Interval, a: float) -> Interval:
    """Verified ``phi = atan(y / a)`` for interval ``y``."""
    _validate_scale_alpha(a, 1.0)
    return atan_iv(y * Interval.point(a).reciprocal())
FUNCTION

hardy_even​

omnibias.core.verified.hardy_evenSource ↗
hardy_even(y: float, a: float, alpha: float) -> Interval

Verified P_{a,alpha}(y) = r^{-alpha} cos(alpha phi) (even).

Parameters

NameType & defaultContract
ypositional-or-keywordfloatRequiredSee the operation contract and implementation below.
apositional-or-keywordfloatRequiredSee the operation contract and implementation below.
alphapositional-or-keywordfloatRequiredSee the operation contract and implementation below.
ReturnsInterval
Executed regression · rejects nonpositive scale

Recorded coverage confirms this test executed the API body. This example belongs to the pinned upstream test suite. It may use fixtures and imports from its full file. Run it from that checkout with its test dependencies installed.

def test_rejects_nonpositive_scale() -> None:
    with pytest.raises(ValueError):
        hardy_even(0.0, 0.0, 0.6)
    with pytest.raises(ValueError):
        hardy_even(0.0, -1.0, 0.6)
python -m pytest "packages/omnibias-core/tests/verified/test_hardy_line.py::test_rejects_nonpositive_scale" -q
Regression example · alpha one recovers poisson

This example belongs to the pinned upstream test suite. It may use fixtures and imports from its full file. Run it from that checkout with its test dependencies installed.

def test_alpha_one_recovers_poisson() -> None:
    for a in (0.5, 1.3, 2.0):
        for y in (-2.0, 0.0, 0.7, 5.0):
            assert hardy_even(y, a, 1.0).contains(float(poisson_kernel(y, a).mid))
            assert hardy_odd(y, a, 1.0).contains(float(conjugate_poisson(y, a).mid))
            # Derivatives match Poisson closed forms at alpha=1.
            assert hardy_even_deriv(y, a, 1.0).contains(
                float(poisson_kernel_deriv(y, a).mid)
            )
            assert hardy_odd_deriv(y, a, 1.0).contains(
                float(conjugate_poisson_deriv(y, a).mid)
            )
python -m pytest packages/omnibias-core/tests/verified/test_hardy_line.py -k test_alpha_one_recovers_poisson -q
Read the implementation
def hardy_even(y: float, a: float, alpha: float) -> Interval:
    r"""Verified ``P_{a,alpha}(y) = r^{-alpha} cos(alpha phi)`` (even)."""
    _validate_scale_alpha(a, alpha)
    r = hardy_radius(y, a)
    # r^{-alpha} = exp(-alpha * ln(r)); r > 0 for a > 0.
    r_pow = exp_iv(Interval.point(-alpha) * ln_iv(r))
    return r_pow * cos_iv(Interval.point(alpha) * hardy_angle(y, a))
Other public import paths
  • omnibias.core.verified.hardy_even
  • omnibias.core.verified.hardy_line.hardy_even
FUNCTION

hardy_even_dalpha​

omnibias.core.verified.hardy_even_dalphaSource ↗
hardy_even_dalpha(y: float, a: float, alpha: float) -> Interval

Verified dP/dalpha = -ln(r) P - phi Q.

Parameters

NameType & defaultContract
ypositional-or-keywordfloatRequiredSee the operation contract and implementation below.
apositional-or-keywordfloatRequiredSee the operation contract and implementation below.
alphapositional-or-keywordfloatRequiredSee the operation contract and implementation below.
ReturnsInterval
Read the implementation
def hardy_even_dalpha(y: float, a: float, alpha: float) -> Interval:
    r"""Verified ``dP/dalpha = -ln(r) P - phi Q``."""
    _validate_scale_alpha(a, alpha)
    p, q = hardy_pair(y, a, alpha)
    return -ln_iv(hardy_radius(y, a)) * p - hardy_angle(y, a) * q
Other public import paths
  • omnibias.core.verified.hardy_even_dalpha
  • omnibias.core.verified.hardy_line.hardy_even_dalpha
FUNCTION

hardy_even_deriv​

omnibias.core.verified.hardy_even_derivSource ↗
hardy_even_deriv(y: float, a: float, alpha: float) -> Interval

Verified P' = -alpha Q_{a, alpha+1}.

Parameters

NameType & defaultContract
ypositional-or-keywordfloatRequiredSee the operation contract and implementation below.
apositional-or-keywordfloatRequiredSee the operation contract and implementation below.
alphapositional-or-keywordfloatRequiredSee the operation contract and implementation below.
ReturnsInterval
Executed regression · hardy pair encloses truth dense grid

Recorded coverage confirms this test executed the API body. This example belongs to the pinned upstream test suite. It may use fixtures and imports from its full file. Run it from that checkout with its test dependencies installed.

def test_hardy_pair_encloses_truth_dense_grid(y: float, a: float, alpha: float) -> None:
    p, q = hardy_pair(y, a, alpha)
    assert p.contains(_true_p(y, a, alpha))
    assert q.contains(_true_q(y, a, alpha))
    assert hardy_even_deriv(y, a, alpha).contains(
        -alpha * _true_q(y, a, alpha + 1.0)
    )
    assert hardy_odd_deriv(y, a, alpha).contains(
        alpha * _true_p(y, a, alpha + 1.0)
    )
python -m pytest "packages/omnibias-core/tests/verified/test_hardy_line.py::test_hardy_pair_encloses_truth_dense_grid[-0.1-0.4-0.55]" -q
Regression example · alpha one recovers poisson

This example belongs to the pinned upstream test suite. It may use fixtures and imports from its full file. Run it from that checkout with its test dependencies installed.

def test_alpha_one_recovers_poisson() -> None:
    for a in (0.5, 1.3, 2.0):
        for y in (-2.0, 0.0, 0.7, 5.0):
            assert hardy_even(y, a, 1.0).contains(float(poisson_kernel(y, a).mid))
            assert hardy_odd(y, a, 1.0).contains(float(conjugate_poisson(y, a).mid))
            # Derivatives match Poisson closed forms at alpha=1.
            assert hardy_even_deriv(y, a, 1.0).contains(
                float(poisson_kernel_deriv(y, a).mid)
            )
            assert hardy_odd_deriv(y, a, 1.0).contains(
                float(conjugate_poisson_deriv(y, a).mid)
            )
python -m pytest packages/omnibias-core/tests/verified/test_hardy_line.py -k test_alpha_one_recovers_poisson -q
Read the implementation
def hardy_even_deriv(y: float, a: float, alpha: float) -> Interval:
    r"""Verified ``P' = -alpha Q_{a, alpha+1}``."""
    _validate_scale_alpha(a, alpha)
    return Interval.point(-alpha) * hardy_odd(y, a, alpha + 1.0)
Other public import paths
  • omnibias.core.verified.hardy_even_deriv
  • omnibias.core.verified.hardy_line.hardy_even_deriv
FUNCTION

hardy_even_deriv_iv​

omnibias.core.verified.hardy_line.hardy_even_deriv_ivSource ↗
hardy_even_deriv_iv(y: Interval, a: float, alpha: float) -> Interval

Interval-y enclosure of P'.

Parameters

NameType & defaultContract
ypositional-or-keywordIntervalRequiredSee the operation contract and implementation below.
apositional-or-keywordfloatRequiredSee the operation contract and implementation below.
alphapositional-or-keywordfloatRequiredSee the operation contract and implementation below.
ReturnsInterval
Read the implementation
def hardy_even_deriv_iv(y: Interval, a: float, alpha: float) -> Interval:
    """Interval-``y`` enclosure of ``P'``."""
    _validate_scale_alpha(a, alpha)
    return Interval.point(-alpha) * hardy_odd_iv(y, a, alpha + 1.0)
FUNCTION

hardy_even_deriv_matrix​

omnibias.core.verified.hardy_even_deriv_matrixSource ↗
hardy_even_deriv_matrix(y_nodes: Sequence[float], a_values: Sequence[float], alpha: float) -> list[list[Interval]]

Design matrix [[P'_{a_i, alpha}(y_j)]].

Parameters

NameType & defaultContract
y_nodespositional-or-keywordSequence[float]RequiredSee the operation contract and implementation below.
a_valuespositional-or-keywordSequence[float]RequiredSee the operation contract and implementation below.
alphapositional-or-keywordfloatRequiredSee the operation contract and implementation below.
Returnslist[list[Interval]]
Read the implementation
def hardy_even_deriv_matrix(
    y_nodes: Sequence[float], a_values: Sequence[float], alpha: float
) -> list[list[Interval]]:
    """Design matrix ``[[P'_{a_i, alpha}(y_j)]]``."""
    return _matrix(hardy_even_deriv, y_nodes, a_values, alpha)
Other public import paths
  • omnibias.core.verified.hardy_even_deriv_matrix
  • omnibias.core.verified.hardy_line.hardy_even_deriv_matrix
FUNCTION

hardy_even_deriv_n​

omnibias.core.verified.hardy_even_deriv_nSource ↗
hardy_even_deriv_n(y: float, a: float, alpha: float, n: int) -> Interval

Closed-form P^(n) via the Hardy table. n = 1 matches hardy_even_deriv.

Parameters

NameType & defaultContract
ypositional-or-keywordfloatRequiredSee the operation contract and implementation below.
apositional-or-keywordfloatRequiredSee the operation contract and implementation below.
alphapositional-or-keywordfloatRequiredSee the operation contract and implementation below.
npositional-or-keywordintRequiredSee the operation contract and implementation below.
ReturnsInterval
Explicit validation & failure cases
  • When n < 0, raises ValueError(f'derivative order n must be >= 0, got {n}').

These are explicit source guards. Backend operations may also raise for invalid shapes, dtypes, or unsupported devices.

Read the implementation
def hardy_even_deriv_n(y: float, a: float, alpha: float, n: int) -> Interval:
    """Closed-form ``P^(n)`` via the Hardy table. ``n = 1`` matches ``hardy_even_deriv``."""
    if n < 0:
        raise ValueError(f"derivative order n must be >= 0, got {n}")
    if n == 1:
        return hardy_even_deriv(y, a, alpha)
    if n == 0:
        return hardy_even(y, a, alpha)
    _validate_scale_alpha(a, alpha)
    p_sign, p_kind, _, _ = _table_kind(n)
    factor = pochhammer_iv(alpha, n)
    atom = _eval_pq(p_kind, y, a, alpha + float(n))
    return (Interval.point(-1.0) * factor * atom) if p_sign < 0 else (factor * atom)
Other public import paths
  • omnibias.core.verified.hardy_even_deriv_n
  • omnibias.core.verified.hardy_line.hardy_even_deriv_n
FUNCTION

hardy_even_deriv_n_iv​

omnibias.core.verified.hardy_even_deriv_n_ivSource ↗
hardy_even_deriv_n_iv(y: Interval, a: float, alpha: float, n: int) -> Interval

Interval-y enclosure of P^(n).

Parameters

NameType & defaultContract
ypositional-or-keywordIntervalRequiredSee the operation contract and implementation below.
apositional-or-keywordfloatRequiredSee the operation contract and implementation below.
alphapositional-or-keywordfloatRequiredSee the operation contract and implementation below.
npositional-or-keywordintRequiredSee the operation contract and implementation below.
ReturnsInterval
Explicit validation & failure cases
  • When n < 0, raises ValueError(f'derivative order n must be >= 0, got {n}').

These are explicit source guards. Backend operations may also raise for invalid shapes, dtypes, or unsupported devices.

Read the implementation
def hardy_even_deriv_n_iv(y: Interval, a: float, alpha: float, n: int) -> Interval:
    """Interval-``y`` enclosure of ``P^(n)``."""
    if n < 0:
        raise ValueError(f"derivative order n must be >= 0, got {n}")
    if n == 1:
        return hardy_even_deriv_iv(y, a, alpha)
    if n == 0:
        return hardy_even_iv(y, a, alpha)
    _validate_scale_alpha(a, alpha)
    p_sign, p_kind, _, _ = _table_kind(n)
    factor = pochhammer_iv(alpha, n)
    atom = _eval_pq_iv(p_kind, y, a, alpha + float(n))
    return (Interval.point(-1.0) * factor * atom) if p_sign < 0 else (factor * atom)
Other public import paths
  • omnibias.core.verified.hardy_even_deriv_n_iv
  • omnibias.core.verified.hardy_line.hardy_even_deriv_n_iv
FUNCTION

hardy_even_iv​

omnibias.core.verified.hardy_line.hardy_even_ivSource ↗
hardy_even_iv(y: Interval, a: float, alpha: float) -> Interval

Interval-y enclosure of P_{a,alpha} (sound over a cell).

Parameters

NameType & defaultContract
ypositional-or-keywordIntervalRequiredSee the operation contract and implementation below.
apositional-or-keywordfloatRequiredSee the operation contract and implementation below.
alphapositional-or-keywordfloatRequiredSee the operation contract and implementation below.
ReturnsInterval
Read the implementation
def hardy_even_iv(y: Interval, a: float, alpha: float) -> Interval:
    r"""Interval-``y`` enclosure of ``P_{a,alpha}`` (sound over a cell)."""
    _validate_scale_alpha(a, alpha)
    r = hardy_radius_iv(y, a)
    r_pow = exp_iv(Interval.point(-alpha) * ln_iv(r))
    return r_pow * cos_iv(Interval.point(alpha) * hardy_angle_iv(y, a))
FUNCTION

hardy_even_matrix​

omnibias.core.verified.hardy_even_matrixSource ↗
hardy_even_matrix(y_nodes: Sequence[float], a_values: Sequence[float], alpha: float) -> list[list[Interval]]

Design matrix [[P_{a_i, alpha}(y_j)]].

Parameters

NameType & defaultContract
y_nodespositional-or-keywordSequence[float]RequiredSee the operation contract and implementation below.
a_valuespositional-or-keywordSequence[float]RequiredSee the operation contract and implementation below.
alphapositional-or-keywordfloatRequiredSee the operation contract and implementation below.
Returnslist[list[Interval]]
Read the implementation
def hardy_even_matrix(
    y_nodes: Sequence[float], a_values: Sequence[float], alpha: float
) -> list[list[Interval]]:
    """Design matrix ``[[P_{a_i, alpha}(y_j)]]``."""
    return _matrix(hardy_even, y_nodes, a_values, alpha)
Other public import paths
  • omnibias.core.verified.hardy_even_matrix
  • omnibias.core.verified.hardy_line.hardy_even_matrix
FUNCTION

hardy_even_profile​

omnibias.core.verified.hardy_even_profileSource ↗
hardy_even_profile(y: float, coeffs: Sequence[float], scales: Sequence[float], alpha: float) -> Interval

Verified even profile Theta = sum_i c_i P_{a_i, alpha}.

Parameters

NameType & defaultContract
ypositional-or-keywordfloatRequiredSee the operation contract and implementation below.
coeffspositional-or-keywordSequence[float]RequiredSee the operation contract and implementation below.
scalespositional-or-keywordSequence[float]RequiredSee the operation contract and implementation below.
alphapositional-or-keywordfloatRequiredSee the operation contract and implementation below.
ReturnsInterval
Executed regression · hardy profile and tail

Recorded coverage confirms this test executed the API body. This example belongs to the pinned upstream test suite. It may use fixtures and imports from its full file. Run it from that checkout with its test dependencies installed.

def test_hardy_profile_and_tail() -> None:
    coeffs = [1.0, -0.3, 0.1]
    scales = [0.6, 1.2, 2.0]
    alpha = 0.623
    y = 0.5
    th = hardy_even_profile(y, coeffs, scales, alpha)
    truth = sum(c * _true_p(y, a, alpha) for c, a in zip(coeffs, scales, strict=True))
    assert th.contains(truth)
    hth = hilbert_hardy_even_profile(y, coeffs, scales, alpha)
    h_truth = sum(c * _true_q(y, a, alpha) for c, a in zip(coeffs, scales, strict=True))
    assert hth.contains(h_truth)
    c, p = hardy_tail_constant(coeffs, scales, alpha)
    assert p == alpha
    assert c >= sum(abs(x) for x in coeffs) - 1e-15
python -m pytest "packages/omnibias-core/tests/verified/test_hardy_line.py::test_hardy_profile_and_tail" -q
Read the implementation
def hardy_even_profile(
    y: float, coeffs: Sequence[float], scales: Sequence[float], alpha: float
) -> Interval:
    r"""Verified even profile ``Theta = sum_i c_i P_{a_i, alpha}``."""
    return _profile_sum(hardy_even, y, coeffs, scales, alpha)
Other public import paths
  • omnibias.core.verified.hardy_even_profile
  • omnibias.core.verified.hardy_line.hardy_even_profile
FUNCTION

hardy_even_profile_deriv​

omnibias.core.verified.hardy_even_profile_derivSource ↗
hardy_even_profile_deriv(y: float, coeffs: Sequence[float], scales: Sequence[float], alpha: float) -> Interval

Verified Theta' = sum_i c_i P'_{a_i, alpha}.

Parameters

NameType & defaultContract
ypositional-or-keywordfloatRequiredSee the operation contract and implementation below.
coeffspositional-or-keywordSequence[float]RequiredSee the operation contract and implementation below.
scalespositional-or-keywordSequence[float]RequiredSee the operation contract and implementation below.
alphapositional-or-keywordfloatRequiredSee the operation contract and implementation below.
ReturnsInterval
Read the implementation
def hardy_even_profile_deriv(
    y: float, coeffs: Sequence[float], scales: Sequence[float], alpha: float
) -> Interval:
    r"""Verified ``Theta' = sum_i c_i P'_{a_i, alpha}``."""
    return _profile_sum(hardy_even_deriv, y, coeffs, scales, alpha)
Other public import paths
  • omnibias.core.verified.hardy_even_profile_deriv
  • omnibias.core.verified.hardy_line.hardy_even_profile_deriv
FUNCTION

hardy_odd​

omnibias.core.verified.hardy_oddSource ↗
hardy_odd(y: float, a: float, alpha: float) -> Interval

Verified Q_{a,alpha}(y) = r^{-alpha} sin(alpha phi) (odd).

Parameters

NameType & defaultContract
ypositional-or-keywordfloatRequiredSee the operation contract and implementation below.
apositional-or-keywordfloatRequiredSee the operation contract and implementation below.
alphapositional-or-keywordfloatRequiredSee the operation contract and implementation below.
ReturnsInterval
Executed regression · hardy pair encloses random sample

Recorded coverage confirms this test executed the API body. This example belongs to the pinned upstream test suite. It may use fixtures and imports from its full file. Run it from that checkout with its test dependencies installed.

def test_hardy_pair_encloses_random_sample() -> None:
    rng = random.Random(17)
    for _ in range(40):
        y = rng.uniform(-8.0, 8.0)
        a = rng.uniform(0.2, 3.0)
        alpha = rng.uniform(0.51, 1.2)
        p, q = hardy_pair(y, a, alpha)
        assert p.contains(_true_p(y, a, alpha))
        assert q.contains(_true_q(y, a, alpha))
python -m pytest "packages/omnibias-core/tests/verified/test_hardy_line.py::test_hardy_pair_encloses_random_sample" -q
Regression example · alpha one recovers poisson

This example belongs to the pinned upstream test suite. It may use fixtures and imports from its full file. Run it from that checkout with its test dependencies installed.

def test_alpha_one_recovers_poisson() -> None:
    for a in (0.5, 1.3, 2.0):
        for y in (-2.0, 0.0, 0.7, 5.0):
            assert hardy_even(y, a, 1.0).contains(float(poisson_kernel(y, a).mid))
            assert hardy_odd(y, a, 1.0).contains(float(conjugate_poisson(y, a).mid))
            # Derivatives match Poisson closed forms at alpha=1.
            assert hardy_even_deriv(y, a, 1.0).contains(
                float(poisson_kernel_deriv(y, a).mid)
            )
            assert hardy_odd_deriv(y, a, 1.0).contains(
                float(conjugate_poisson_deriv(y, a).mid)
            )
python -m pytest packages/omnibias-core/tests/verified/test_hardy_line.py -k test_alpha_one_recovers_poisson -q
Read the implementation
def hardy_odd(y: float, a: float, alpha: float) -> Interval:
    r"""Verified ``Q_{a,alpha}(y) = r^{-alpha} sin(alpha phi)`` (odd)."""
    _validate_scale_alpha(a, alpha)
    r = hardy_radius(y, a)
    r_pow = exp_iv(Interval.point(-alpha) * ln_iv(r))
    return r_pow * sin_iv(Interval.point(alpha) * hardy_angle(y, a))
Other public import paths
  • omnibias.core.verified.hardy_odd
  • omnibias.core.verified.hardy_line.hardy_odd
FUNCTION

hardy_odd_dalpha​

omnibias.core.verified.hardy_odd_dalphaSource ↗
hardy_odd_dalpha(y: float, a: float, alpha: float) -> Interval

Verified dQ/dalpha = -ln(r) Q + phi P.

Parameters

NameType & defaultContract
ypositional-or-keywordfloatRequiredSee the operation contract and implementation below.
apositional-or-keywordfloatRequiredSee the operation contract and implementation below.
alphapositional-or-keywordfloatRequiredSee the operation contract and implementation below.
ReturnsInterval
Read the implementation
def hardy_odd_dalpha(y: float, a: float, alpha: float) -> Interval:
    r"""Verified ``dQ/dalpha = -ln(r) Q + phi P``."""
    _validate_scale_alpha(a, alpha)
    p, q = hardy_pair(y, a, alpha)
    return -ln_iv(hardy_radius(y, a)) * q + hardy_angle(y, a) * p
Other public import paths
  • omnibias.core.verified.hardy_odd_dalpha
  • omnibias.core.verified.hardy_line.hardy_odd_dalpha
FUNCTION

hardy_odd_deriv​

omnibias.core.verified.hardy_odd_derivSource ↗
hardy_odd_deriv(y: float, a: float, alpha: float) -> Interval

Verified Q' = alpha P_{a, alpha+1}.

Parameters

NameType & defaultContract
ypositional-or-keywordfloatRequiredSee the operation contract and implementation below.
apositional-or-keywordfloatRequiredSee the operation contract and implementation below.
alphapositional-or-keywordfloatRequiredSee the operation contract and implementation below.
ReturnsInterval
Executed regression · hardy pair encloses truth dense grid

Recorded coverage confirms this test executed the API body. This example belongs to the pinned upstream test suite. It may use fixtures and imports from its full file. Run it from that checkout with its test dependencies installed.

def test_hardy_pair_encloses_truth_dense_grid(y: float, a: float, alpha: float) -> None:
    p, q = hardy_pair(y, a, alpha)
    assert p.contains(_true_p(y, a, alpha))
    assert q.contains(_true_q(y, a, alpha))
    assert hardy_even_deriv(y, a, alpha).contains(
        -alpha * _true_q(y, a, alpha + 1.0)
    )
    assert hardy_odd_deriv(y, a, alpha).contains(
        alpha * _true_p(y, a, alpha + 1.0)
    )
python -m pytest "packages/omnibias-core/tests/verified/test_hardy_line.py::test_hardy_pair_encloses_truth_dense_grid[-0.1-0.4-0.55]" -q
Regression example · alpha one recovers poisson

This example belongs to the pinned upstream test suite. It may use fixtures and imports from its full file. Run it from that checkout with its test dependencies installed.

def test_alpha_one_recovers_poisson() -> None:
    for a in (0.5, 1.3, 2.0):
        for y in (-2.0, 0.0, 0.7, 5.0):
            assert hardy_even(y, a, 1.0).contains(float(poisson_kernel(y, a).mid))
            assert hardy_odd(y, a, 1.0).contains(float(conjugate_poisson(y, a).mid))
            # Derivatives match Poisson closed forms at alpha=1.
            assert hardy_even_deriv(y, a, 1.0).contains(
                float(poisson_kernel_deriv(y, a).mid)
            )
            assert hardy_odd_deriv(y, a, 1.0).contains(
                float(conjugate_poisson_deriv(y, a).mid)
            )
python -m pytest packages/omnibias-core/tests/verified/test_hardy_line.py -k test_alpha_one_recovers_poisson -q
Read the implementation
def hardy_odd_deriv(y: float, a: float, alpha: float) -> Interval:
    r"""Verified ``Q' = alpha P_{a, alpha+1}``."""
    _validate_scale_alpha(a, alpha)
    return Interval.point(alpha) * hardy_even(y, a, alpha + 1.0)
Other public import paths
  • omnibias.core.verified.hardy_odd_deriv
  • omnibias.core.verified.hardy_line.hardy_odd_deriv
FUNCTION

hardy_odd_deriv_iv​

omnibias.core.verified.hardy_line.hardy_odd_deriv_ivSource ↗
hardy_odd_deriv_iv(y: Interval, a: float, alpha: float) -> Interval

Interval-y enclosure of Q'.

Parameters

NameType & defaultContract
ypositional-or-keywordIntervalRequiredSee the operation contract and implementation below.
apositional-or-keywordfloatRequiredSee the operation contract and implementation below.
alphapositional-or-keywordfloatRequiredSee the operation contract and implementation below.
ReturnsInterval
Read the implementation
def hardy_odd_deriv_iv(y: Interval, a: float, alpha: float) -> Interval:
    """Interval-``y`` enclosure of ``Q'``."""
    _validate_scale_alpha(a, alpha)
    return Interval.point(alpha) * hardy_even_iv(y, a, alpha + 1.0)
FUNCTION

hardy_odd_deriv_matrix​

omnibias.core.verified.hardy_odd_deriv_matrixSource ↗
hardy_odd_deriv_matrix(y_nodes: Sequence[float], a_values: Sequence[float], alpha: float) -> list[list[Interval]]

Design matrix [[Q'_{a_i, alpha}(y_j)]].

Parameters

NameType & defaultContract
y_nodespositional-or-keywordSequence[float]RequiredSee the operation contract and implementation below.
a_valuespositional-or-keywordSequence[float]RequiredSee the operation contract and implementation below.
alphapositional-or-keywordfloatRequiredSee the operation contract and implementation below.
Returnslist[list[Interval]]
Read the implementation
def hardy_odd_deriv_matrix(
    y_nodes: Sequence[float], a_values: Sequence[float], alpha: float
) -> list[list[Interval]]:
    """Design matrix ``[[Q'_{a_i, alpha}(y_j)]]``."""
    return _matrix(hardy_odd_deriv, y_nodes, a_values, alpha)
Other public import paths
  • omnibias.core.verified.hardy_odd_deriv_matrix
  • omnibias.core.verified.hardy_line.hardy_odd_deriv_matrix
FUNCTION

hardy_odd_deriv_n​

omnibias.core.verified.hardy_odd_deriv_nSource ↗
hardy_odd_deriv_n(y: float, a: float, alpha: float, n: int) -> Interval

Closed-form Q^(n) via the Hardy table. n = 1 matches hardy_odd_deriv.

Parameters

NameType & defaultContract
ypositional-or-keywordfloatRequiredSee the operation contract and implementation below.
apositional-or-keywordfloatRequiredSee the operation contract and implementation below.
alphapositional-or-keywordfloatRequiredSee the operation contract and implementation below.
npositional-or-keywordintRequiredSee the operation contract and implementation below.
ReturnsInterval
Explicit validation & failure cases
  • When n < 0, raises ValueError(f'derivative order n must be >= 0, got {n}').

These are explicit source guards. Backend operations may also raise for invalid shapes, dtypes, or unsupported devices.

Read the implementation
def hardy_odd_deriv_n(y: float, a: float, alpha: float, n: int) -> Interval:
    """Closed-form ``Q^(n)`` via the Hardy table. ``n = 1`` matches ``hardy_odd_deriv``."""
    if n < 0:
        raise ValueError(f"derivative order n must be >= 0, got {n}")
    if n == 1:
        return hardy_odd_deriv(y, a, alpha)
    if n == 0:
        return hardy_odd(y, a, alpha)
    _validate_scale_alpha(a, alpha)
    _, _, q_sign, q_kind = _table_kind(n)
    factor = pochhammer_iv(alpha, n)
    atom = _eval_pq(q_kind, y, a, alpha + float(n))
    return (Interval.point(-1.0) * factor * atom) if q_sign < 0 else (factor * atom)
Other public import paths
  • omnibias.core.verified.hardy_odd_deriv_n
  • omnibias.core.verified.hardy_line.hardy_odd_deriv_n
FUNCTION

hardy_odd_deriv_n_iv​

omnibias.core.verified.hardy_odd_deriv_n_ivSource ↗
hardy_odd_deriv_n_iv(y: Interval, a: float, alpha: float, n: int) -> Interval

Interval-y enclosure of Q^(n).

Parameters

NameType & defaultContract
ypositional-or-keywordIntervalRequiredSee the operation contract and implementation below.
apositional-or-keywordfloatRequiredSee the operation contract and implementation below.
alphapositional-or-keywordfloatRequiredSee the operation contract and implementation below.
npositional-or-keywordintRequiredSee the operation contract and implementation below.
ReturnsInterval
Explicit validation & failure cases
  • When n < 0, raises ValueError(f'derivative order n must be >= 0, got {n}').

These are explicit source guards. Backend operations may also raise for invalid shapes, dtypes, or unsupported devices.

Read the implementation
def hardy_odd_deriv_n_iv(y: Interval, a: float, alpha: float, n: int) -> Interval:
    """Interval-``y`` enclosure of ``Q^(n)``."""
    if n < 0:
        raise ValueError(f"derivative order n must be >= 0, got {n}")
    if n == 1:
        return hardy_odd_deriv_iv(y, a, alpha)
    if n == 0:
        return hardy_odd_iv(y, a, alpha)
    _validate_scale_alpha(a, alpha)
    _, _, q_sign, q_kind = _table_kind(n)
    factor = pochhammer_iv(alpha, n)
    atom = _eval_pq_iv(q_kind, y, a, alpha + float(n))
    return (Interval.point(-1.0) * factor * atom) if q_sign < 0 else (factor * atom)
Other public import paths
  • omnibias.core.verified.hardy_odd_deriv_n_iv
  • omnibias.core.verified.hardy_line.hardy_odd_deriv_n_iv
FUNCTION

hardy_odd_iv​

omnibias.core.verified.hardy_line.hardy_odd_ivSource ↗
hardy_odd_iv(y: Interval, a: float, alpha: float) -> Interval

Interval-y enclosure of Q_{a,alpha} (sound over a cell).

Parameters

NameType & defaultContract
ypositional-or-keywordIntervalRequiredSee the operation contract and implementation below.
apositional-or-keywordfloatRequiredSee the operation contract and implementation below.
alphapositional-or-keywordfloatRequiredSee the operation contract and implementation below.
ReturnsInterval
Read the implementation
def hardy_odd_iv(y: Interval, a: float, alpha: float) -> Interval:
    r"""Interval-``y`` enclosure of ``Q_{a,alpha}`` (sound over a cell)."""
    _validate_scale_alpha(a, alpha)
    r = hardy_radius_iv(y, a)
    r_pow = exp_iv(Interval.point(-alpha) * ln_iv(r))
    return r_pow * sin_iv(Interval.point(alpha) * hardy_angle_iv(y, a))
FUNCTION

hardy_odd_matrix​

omnibias.core.verified.hardy_odd_matrixSource ↗
hardy_odd_matrix(y_nodes: Sequence[float], a_values: Sequence[float], alpha: float) -> list[list[Interval]]

Design matrix [[Q_{a_i, alpha}(y_j)]].

Parameters

NameType & defaultContract
y_nodespositional-or-keywordSequence[float]RequiredSee the operation contract and implementation below.
a_valuespositional-or-keywordSequence[float]RequiredSee the operation contract and implementation below.
alphapositional-or-keywordfloatRequiredSee the operation contract and implementation below.
Returnslist[list[Interval]]
Read the implementation
def hardy_odd_matrix(
    y_nodes: Sequence[float], a_values: Sequence[float], alpha: float
) -> list[list[Interval]]:
    """Design matrix ``[[Q_{a_i, alpha}(y_j)]]``."""
    return _matrix(hardy_odd, y_nodes, a_values, alpha)
Other public import paths
  • omnibias.core.verified.hardy_odd_matrix
  • omnibias.core.verified.hardy_line.hardy_odd_matrix
FUNCTION

hardy_omega_velocity_atom​

omnibias.core.verified.hardy_omega_velocity_atomSource ↗
hardy_omega_velocity_atom(y: float, a: float, alpha: float, n: int, *, parity: str='odd') -> Interval

Interval U for one Hardy-Ω atom with U'=HΩ and U(0)=0.

Parameters

NameType & defaultContract
ypositional-or-keywordfloatRequiredSee the operation contract and implementation below.
apositional-or-keywordfloatRequiredSee the operation contract and implementation below.
alphapositional-or-keywordfloatRequiredSee the operation contract and implementation below.
npositional-or-keywordintRequiredSee the operation contract and implementation below.
paritykeyword-onlystrDefault: 'odd'See the operation contract and implementation below.
ReturnsInterval
Explicit validation & failure cases
  • When n < 0, raises ValueError(f'derivative order n must be >= 0, got {n}').
  • When not alpha > 0.0, raises ValueError(f'Hilbert-derivative commutation needs decay (alpha > 0); got alpha={alpha!r}').
  • When parity not in ('even', 'odd'), raises ValueError(f"parity must be 'even' or 'odd', got {parity!r}").

These are explicit source guards. Backend operations may also raise for invalid shapes, dtypes, or unsupported devices.

Read the implementation
def hardy_omega_velocity_atom(
    y: float, a: float, alpha: float, n: int, *, parity: str = "odd"
) -> Interval:
    """Interval ``U`` for one Hardy-Ω atom with ``U'=HΩ`` and ``U(0)=0``."""
    if n < 0:
        raise ValueError(f"derivative order n must be >= 0, got {n}")
    _validate_scale_alpha(a, alpha)
    if not (alpha > 0.0):
        raise ValueError(
            "Hilbert-derivative commutation needs decay (alpha > 0); "
            f"got alpha={alpha!r}"
        )
    if parity not in ("even", "odd"):
        raise ValueError(f"parity must be 'even' or 'odd', got {parity!r}")
    factor = pochhammer_iv(alpha, n)
    beta = alpha + float(n)
    if parity == "odd":
        p_sign, p_kind, _, _ = _table_kind(n)
        integ = (
            _integrate_p_point(y, a, beta)
            if p_kind == "even"
            else _integrate_q_point(y, a, beta)
        )
        signed = -factor * integ if p_sign > 0 else factor * integ
        return signed
    _, _, q_sign, q_kind = _table_kind(n)
    integ = (
        _integrate_p_point(y, a, beta)
        if q_kind == "even"
        else _integrate_q_point(y, a, beta)
    )
    return factor * integ if q_sign > 0 else -factor * integ
Other public import paths
  • omnibias.core.verified.hardy_omega_velocity_atom
  • omnibias.core.verified.hardy_line.hardy_omega_velocity_atom
FUNCTION

hardy_omega_velocity_atom_iv​

omnibias.core.verified.hardy_omega_velocity_atom_ivSource ↗
hardy_omega_velocity_atom_iv(y: Interval, a: float, alpha: float, n: int, *, parity: str='odd') -> Interval

Interval-y enclosure of the Hardy-Ω velocity atom.

Parameters

NameType & defaultContract
ypositional-or-keywordIntervalRequiredSee the operation contract and implementation below.
apositional-or-keywordfloatRequiredSee the operation contract and implementation below.
alphapositional-or-keywordfloatRequiredSee the operation contract and implementation below.
npositional-or-keywordintRequiredSee the operation contract and implementation below.
paritykeyword-onlystrDefault: 'odd'See the operation contract and implementation below.
ReturnsInterval
Explicit validation & failure cases
  • When n < 0, raises ValueError(f'derivative order n must be >= 0, got {n}').
  • When not alpha > 0.0, raises ValueError(f'Hilbert-derivative commutation needs decay (alpha > 0); got alpha={alpha!r}').
  • When parity not in ('even', 'odd'), raises ValueError(f"parity must be 'even' or 'odd', got {parity!r}").

These are explicit source guards. Backend operations may also raise for invalid shapes, dtypes, or unsupported devices.

Read the implementation
def hardy_omega_velocity_atom_iv(
    y: Interval, a: float, alpha: float, n: int, *, parity: str = "odd"
) -> Interval:
    """Interval-``y`` enclosure of the Hardy-Ω velocity atom."""
    if n < 0:
        raise ValueError(f"derivative order n must be >= 0, got {n}")
    _validate_scale_alpha(a, alpha)
    if not (alpha > 0.0):
        raise ValueError(
            "Hilbert-derivative commutation needs decay (alpha > 0); "
            f"got alpha={alpha!r}"
        )
    if parity not in ("even", "odd"):
        raise ValueError(f"parity must be 'even' or 'odd', got {parity!r}")
    factor = pochhammer_iv(alpha, n)
    beta = alpha + float(n)
    if parity == "odd":
        p_sign, p_kind, _, _ = _table_kind(n)
        integ = (
            _integrate_p_iv(y, a, beta) if p_kind == "even" else _integrate_q_iv(y, a, beta)
        )
        return -factor * integ if p_sign > 0 else factor * integ
    _, _, q_sign, q_kind = _table_kind(n)
    integ = (
        _integrate_p_iv(y, a, beta) if q_kind == "even" else _integrate_q_iv(y, a, beta)
    )
    return factor * integ if q_sign > 0 else -factor * integ
Other public import paths
  • omnibias.core.verified.hardy_omega_velocity_atom_iv
  • omnibias.core.verified.hardy_line.hardy_omega_velocity_atom_iv
FUNCTION

hardy_pair​

omnibias.core.verified.hardy_pairSource ↗
hardy_pair(y: float, a: float, alpha: float) -> tuple[Interval, Interval]

Return (P, Q) at y.

Parameters

NameType & defaultContract
ypositional-or-keywordfloatRequiredSee the operation contract and implementation below.
apositional-or-keywordfloatRequiredSee the operation contract and implementation below.
alphapositional-or-keywordfloatRequiredSee the operation contract and implementation below.
Returnstuple[Interval, Interval]
Executed regression · hardy pair encloses random sample

Recorded coverage confirms this test executed the API body. This example belongs to the pinned upstream test suite. It may use fixtures and imports from its full file. Run it from that checkout with its test dependencies installed.

def test_hardy_pair_encloses_random_sample() -> None:
    rng = random.Random(17)
    for _ in range(40):
        y = rng.uniform(-8.0, 8.0)
        a = rng.uniform(0.2, 3.0)
        alpha = rng.uniform(0.51, 1.2)
        p, q = hardy_pair(y, a, alpha)
        assert p.contains(_true_p(y, a, alpha))
        assert q.contains(_true_q(y, a, alpha))
python -m pytest "packages/omnibias-core/tests/verified/test_hardy_line.py::test_hardy_pair_encloses_random_sample" -q
Regression example · hardy pair encloses truth dense grid

This example belongs to the pinned upstream test suite. It may use fixtures and imports from its full file. Run it from that checkout with its test dependencies installed.

def test_hardy_pair_encloses_truth_dense_grid(y: float, a: float, alpha: float) -> None:
    p, q = hardy_pair(y, a, alpha)
    assert p.contains(_true_p(y, a, alpha))
    assert q.contains(_true_q(y, a, alpha))
    assert hardy_even_deriv(y, a, alpha).contains(
        -alpha * _true_q(y, a, alpha + 1.0)
    )
    assert hardy_odd_deriv(y, a, alpha).contains(
        alpha * _true_p(y, a, alpha + 1.0)
    )
python -m pytest packages/omnibias-core/tests/verified/test_hardy_line.py -k test_hardy_pair_encloses_truth_dense_grid -q
Read the implementation
def hardy_pair(y: float, a: float, alpha: float) -> tuple[Interval, Interval]:
    """Return ``(P, Q)`` at ``y``."""
    return hardy_even(y, a, alpha), hardy_odd(y, a, alpha)
Other public import paths
  • omnibias.core.verified.hardy_pair
  • omnibias.core.verified.hardy_line.hardy_pair
FUNCTION

hardy_radius​

omnibias.core.verified.hardy_radiusSource ↗
hardy_radius(y: float, a: float) -> Interval

Verified r = sqrt(a^2 + y^2).

Parameters

NameType & defaultContract
ypositional-or-keywordfloatRequiredSee the operation contract and implementation below.
apositional-or-keywordfloatRequiredSee the operation contract and implementation below.
ReturnsInterval
Executed regression · hardy pair encloses random sample

Recorded coverage confirms this test executed the API body. This example belongs to the pinned upstream test suite. It may use fixtures and imports from its full file. Run it from that checkout with its test dependencies installed.

def test_hardy_pair_encloses_random_sample() -> None:
    rng = random.Random(17)
    for _ in range(40):
        y = rng.uniform(-8.0, 8.0)
        a = rng.uniform(0.2, 3.0)
        alpha = rng.uniform(0.51, 1.2)
        p, q = hardy_pair(y, a, alpha)
        assert p.contains(_true_p(y, a, alpha))
        assert q.contains(_true_q(y, a, alpha))
python -m pytest "packages/omnibias-core/tests/verified/test_hardy_line.py::test_hardy_pair_encloses_random_sample" -q
Read the implementation
def hardy_radius(y: float, a: float) -> Interval:
    """Verified ``r = sqrt(a^2 + y^2)``."""
    _validate_scale_alpha(a, 1.0)
    return (Interval.point(a).pow_int(2) + Interval.point(y).pow_int(2)).sqrt()
Other public import paths
  • omnibias.core.verified.hardy_radius
  • omnibias.core.verified.hardy_line.hardy_radius
FUNCTION

hardy_radius_iv​

omnibias.core.verified.hardy_line.hardy_radius_ivSource ↗
hardy_radius_iv(y: Interval, a: float) -> Interval

Verified r = sqrt(a^2 + y^2) for an interval y (cell covering).

Parameters

NameType & defaultContract
ypositional-or-keywordIntervalRequiredSee the operation contract and implementation below.
apositional-or-keywordfloatRequiredSee the operation contract and implementation below.
ReturnsInterval
Read the implementation
def hardy_radius_iv(y: Interval, a: float) -> Interval:
    """Verified ``r = sqrt(a^2 + y^2)`` for an interval ``y`` (cell covering)."""
    _validate_scale_alpha(a, 1.0)
    return (Interval.point(a).pow_int(2) + y.pow_int(2)).sqrt()
FUNCTION

hardy_tail_constant​

omnibias.core.verified.hardy_tail_constantSource ↗
hardy_tail_constant(coeffs: Sequence[float], scales: Sequence[float], alpha: float) -> tuple[float, float]

Far-field decay (C, p) with |Theta(y)| <= C |y|^{-p}.

Asymptotically P_{a,alpha}(y) ~ cos(pi alpha / 2) |y|^{-alpha} (leading), and |P| <= r^{-alpha} <= |a|^{-0} |y|^{-alpha} is too loose near zero; for the Hilbert tail we use the uniform bound |P_{a,alpha}(y)| <= |y|^{-alpha} for |y| >= a is not always true. A safe envelope is |P| <= r^{-alpha} <= a^{-alpha} near the origin and |P| <= |y|^{-alpha} at infinity; feeding ~omnibias.core.verified.line.hilbert_tail_bound we take C = sum_i |c_i| and p = alpha (outward-rounded), which is sound for |y| >= max_i a_i after absorbing the angular factor into a slightly larger C via max |cos| <= 1.

Parameters

NameType & defaultContract
coeffspositional-or-keywordSequence[float]RequiredSee the operation contract and implementation below.
scalespositional-or-keywordSequence[float]RequiredSee the operation contract and implementation below.
alphapositional-or-keywordfloatRequiredSee the operation contract and implementation below.
Returnstuple[float, float]
Explicit validation & failure cases
  • When len(coeffs) != len(scales), raises ValueError('coeffs and scales must have the same length').
  • When alpha <= 0.0, raises ValueError('alpha must be > 0 for an algebraic tail').

These are explicit source guards. Backend operations may also raise for invalid shapes, dtypes, or unsupported devices.

Executed regression · hardy profile and tail

Recorded coverage confirms this test executed the API body. This example belongs to the pinned upstream test suite. It may use fixtures and imports from its full file. Run it from that checkout with its test dependencies installed.

def test_hardy_profile_and_tail() -> None:
    coeffs = [1.0, -0.3, 0.1]
    scales = [0.6, 1.2, 2.0]
    alpha = 0.623
    y = 0.5
    th = hardy_even_profile(y, coeffs, scales, alpha)
    truth = sum(c * _true_p(y, a, alpha) for c, a in zip(coeffs, scales, strict=True))
    assert th.contains(truth)
    hth = hilbert_hardy_even_profile(y, coeffs, scales, alpha)
    h_truth = sum(c * _true_q(y, a, alpha) for c, a in zip(coeffs, scales, strict=True))
    assert hth.contains(h_truth)
    c, p = hardy_tail_constant(coeffs, scales, alpha)
    assert p == alpha
    assert c >= sum(abs(x) for x in coeffs) - 1e-15
python -m pytest "packages/omnibias-core/tests/verified/test_hardy_line.py::test_hardy_profile_and_tail" -q
Read the implementation
def hardy_tail_constant(
    coeffs: Sequence[float], scales: Sequence[float], alpha: float
) -> tuple[float, float]:
    r"""Far-field decay ``(C, p)`` with ``|Theta(y)| <= C |y|^{-p}``.

    Asymptotically ``P_{a,alpha}(y) ~ cos(pi alpha / 2) |y|^{-alpha}`` (leading),
    and ``|P| <= r^{-alpha} <= |a|^{-0} |y|^{-alpha}`` is too loose near zero;
    for the Hilbert tail we use the uniform bound
    ``|P_{a,alpha}(y)| <= |y|^{-alpha}`` for ``|y| >= a`` is not always true.
    A safe envelope is ``|P| <= r^{-alpha} <= a^{-alpha}`` near the origin and
    ``|P| <= |y|^{-alpha}`` at infinity; feeding
    :func:`~omnibias.core.verified.line.hilbert_tail_bound` we take
    ``C = sum_i |c_i|`` and ``p = alpha`` (outward-rounded), which is sound for
    ``|y| >= max_i a_i`` after absorbing the angular factor into a slightly
    larger ``C`` via ``max |cos| <= 1``.
    """
    if len(coeffs) != len(scales):
        raise ValueError("coeffs and scales must have the same length")
    if alpha <= 0.0:
        raise ValueError("alpha must be > 0 for an algebraic tail")
    acc = Interval.point(0.0)
    for c in coeffs:
        acc = acc + Interval.point(float(c)).abs()
    return acc.hi, float(alpha)
Other public import paths
  • omnibias.core.verified.hardy_tail_constant
  • omnibias.core.verified.hardy_line.hardy_tail_constant
FUNCTION

hilbert_hardy_even_profile​

omnibias.core.verified.hilbert_hardy_even_profileSource ↗
hilbert_hardy_even_profile(y: float, coeffs: Sequence[float], scales: Sequence[float], alpha: float) -> Interval

Verified exact H[Theta] = sum_i c_i Q_{a_i, alpha}.

Parameters

NameType & defaultContract
ypositional-or-keywordfloatRequiredSee the operation contract and implementation below.
coeffspositional-or-keywordSequence[float]RequiredSee the operation contract and implementation below.
scalespositional-or-keywordSequence[float]RequiredSee the operation contract and implementation below.
alphapositional-or-keywordfloatRequiredSee the operation contract and implementation below.
ReturnsInterval
Executed regression · hardy profile and tail

Recorded coverage confirms this test executed the API body. This example belongs to the pinned upstream test suite. It may use fixtures and imports from its full file. Run it from that checkout with its test dependencies installed.

def test_hardy_profile_and_tail() -> None:
    coeffs = [1.0, -0.3, 0.1]
    scales = [0.6, 1.2, 2.0]
    alpha = 0.623
    y = 0.5
    th = hardy_even_profile(y, coeffs, scales, alpha)
    truth = sum(c * _true_p(y, a, alpha) for c, a in zip(coeffs, scales, strict=True))
    assert th.contains(truth)
    hth = hilbert_hardy_even_profile(y, coeffs, scales, alpha)
    h_truth = sum(c * _true_q(y, a, alpha) for c, a in zip(coeffs, scales, strict=True))
    assert hth.contains(h_truth)
    c, p = hardy_tail_constant(coeffs, scales, alpha)
    assert p == alpha
    assert c >= sum(abs(x) for x in coeffs) - 1e-15
python -m pytest "packages/omnibias-core/tests/verified/test_hardy_line.py::test_hardy_profile_and_tail" -q
Read the implementation
def hilbert_hardy_even_profile(
    y: float, coeffs: Sequence[float], scales: Sequence[float], alpha: float
) -> Interval:
    r"""Verified exact ``H[Theta] = sum_i c_i Q_{a_i, alpha}``."""
    return _profile_sum(hardy_odd, y, coeffs, scales, alpha)
Other public import paths
  • omnibias.core.verified.hilbert_hardy_even_profile
  • omnibias.core.verified.hardy_line.hilbert_hardy_even_profile
FUNCTION

hilbert_hardy_even_profile_deriv​

omnibias.core.verified.hilbert_hardy_even_profile_derivSource ↗
hilbert_hardy_even_profile_deriv(y: float, coeffs: Sequence[float], scales: Sequence[float], alpha: float) -> Interval

Verified exact (H Theta)' = sum_i c_i Q'_{a_i, alpha}.

Parameters

NameType & defaultContract
ypositional-or-keywordfloatRequiredSee the operation contract and implementation below.
coeffspositional-or-keywordSequence[float]RequiredSee the operation contract and implementation below.
scalespositional-or-keywordSequence[float]RequiredSee the operation contract and implementation below.
alphapositional-or-keywordfloatRequiredSee the operation contract and implementation below.
ReturnsInterval
Read the implementation
def hilbert_hardy_even_profile_deriv(
    y: float, coeffs: Sequence[float], scales: Sequence[float], alpha: float
) -> Interval:
    r"""Verified exact ``(H Theta)' = sum_i c_i Q'_{a_i, alpha}``."""
    return _profile_sum(hardy_odd_deriv, y, coeffs, scales, alpha)
Other public import paths
  • omnibias.core.verified.hilbert_hardy_even_profile_deriv
  • omnibias.core.verified.hardy_line.hilbert_hardy_even_profile_deriv
FUNCTION

hilbert_of_hardy_even​

omnibias.core.verified.hilbert_of_hardy_evenSource ↗
hilbert_of_hardy_even(y: float, a: float, alpha: float) -> Interval

Exact line Hilbert: H[P] = Q.

Parameters

NameType & defaultContract
ypositional-or-keywordfloatRequiredSee the operation contract and implementation below.
apositional-or-keywordfloatRequiredSee the operation contract and implementation below.
alphapositional-or-keywordfloatRequiredSee the operation contract and implementation below.
ReturnsInterval
Executed regression · hilbert rotation matches pv

Recorded coverage confirms this test executed the API body. This example belongs to the pinned upstream test suite. It may use fixtures and imports from its full file. Run it from that checkout with its test dependencies installed.

def test_hilbert_rotation_matches_pv(x0: float, a: float, alpha: float) -> None:
    h_p = _pv_hilbert_hardy(_mp_p, x0, a, alpha)
    assert hilbert_of_hardy_even(x0, a, alpha).contains(h_p)
    assert abs(h_p - _true_q(x0, a, alpha)) < 1e-9
    h_q = _pv_hilbert_hardy(_mp_q, x0, a, alpha)
    assert hilbert_of_hardy_odd(x0, a, alpha).contains(h_q)
    assert abs(h_q + _true_p(x0, a, alpha)) < 1e-9
python -m pytest "packages/omnibias-core/tests/verified/test_hardy_line.py::test_hilbert_rotation_matches_pv[-2.0-0.8-0.623]" -q
Read the implementation
def hilbert_of_hardy_even(y: float, a: float, alpha: float) -> Interval:
    """Exact line Hilbert: ``H[P] = Q``."""
    return hardy_odd(y, a, alpha)
Other public import paths
  • omnibias.core.verified.hilbert_of_hardy_even
  • omnibias.core.verified.hardy_line.hilbert_of_hardy_even
FUNCTION

hilbert_of_hardy_even_deriv_n​

omnibias.core.verified.hilbert_of_hardy_even_deriv_nSource ↗
hilbert_of_hardy_even_deriv_n(y: float, a: float, alpha: float, n: int) -> Interval

Exact line Hilbert: H[P^(n)] = Q^(n). Commutation needs alpha > 0.

Parameters

NameType & defaultContract
ypositional-or-keywordfloatRequiredSee the operation contract and implementation below.
apositional-or-keywordfloatRequiredSee the operation contract and implementation below.
alphapositional-or-keywordfloatRequiredSee the operation contract and implementation below.
npositional-or-keywordintRequiredSee the operation contract and implementation below.
ReturnsInterval
Explicit validation & failure cases
  • When not alpha > 0.0, raises ValueError(f'Hilbert-derivative commutation needs decay (alpha > 0); got alpha={alpha!r}').

These are explicit source guards. Backend operations may also raise for invalid shapes, dtypes, or unsupported devices.

Read the implementation
def hilbert_of_hardy_even_deriv_n(y: float, a: float, alpha: float, n: int) -> Interval:
    """Exact line Hilbert: ``H[P^(n)] = Q^(n)``. Commutation needs ``alpha > 0``."""
    if not (alpha > 0.0):
        raise ValueError(
            "Hilbert-derivative commutation needs decay (alpha > 0); "
            f"got alpha={alpha!r}"
        )
    return hardy_odd_deriv_n(y, a, alpha, n)
Other public import paths
  • omnibias.core.verified.hilbert_of_hardy_even_deriv_n
  • omnibias.core.verified.hardy_line.hilbert_of_hardy_even_deriv_n
FUNCTION

hilbert_of_hardy_odd​

omnibias.core.verified.hilbert_of_hardy_oddSource ↗
hilbert_of_hardy_odd(y: float, a: float, alpha: float) -> Interval

Exact line Hilbert: H[Q] = -P.

Parameters

NameType & defaultContract
ypositional-or-keywordfloatRequiredSee the operation contract and implementation below.
apositional-or-keywordfloatRequiredSee the operation contract and implementation below.
alphapositional-or-keywordfloatRequiredSee the operation contract and implementation below.
ReturnsInterval
Executed regression · hilbert rotation matches pv

Recorded coverage confirms this test executed the API body. This example belongs to the pinned upstream test suite. It may use fixtures and imports from its full file. Run it from that checkout with its test dependencies installed.

def test_hilbert_rotation_matches_pv(x0: float, a: float, alpha: float) -> None:
    h_p = _pv_hilbert_hardy(_mp_p, x0, a, alpha)
    assert hilbert_of_hardy_even(x0, a, alpha).contains(h_p)
    assert abs(h_p - _true_q(x0, a, alpha)) < 1e-9
    h_q = _pv_hilbert_hardy(_mp_q, x0, a, alpha)
    assert hilbert_of_hardy_odd(x0, a, alpha).contains(h_q)
    assert abs(h_q + _true_p(x0, a, alpha)) < 1e-9
python -m pytest "packages/omnibias-core/tests/verified/test_hardy_line.py::test_hilbert_rotation_matches_pv[-2.0-0.8-0.623]" -q
Read the implementation
def hilbert_of_hardy_odd(y: float, a: float, alpha: float) -> Interval:
    """Exact line Hilbert: ``H[Q] = -P``."""
    return -hardy_even(y, a, alpha)
Other public import paths
  • omnibias.core.verified.hilbert_of_hardy_odd
  • omnibias.core.verified.hardy_line.hilbert_of_hardy_odd
FUNCTION

hilbert_of_hardy_odd_deriv_n​

omnibias.core.verified.hilbert_of_hardy_odd_deriv_nSource ↗
hilbert_of_hardy_odd_deriv_n(y: float, a: float, alpha: float, n: int) -> Interval

Exact line Hilbert: H[Q^(n)] = -P^(n). Commutation needs alpha > 0.

Parameters

NameType & defaultContract
ypositional-or-keywordfloatRequiredSee the operation contract and implementation below.
apositional-or-keywordfloatRequiredSee the operation contract and implementation below.
alphapositional-or-keywordfloatRequiredSee the operation contract and implementation below.
npositional-or-keywordintRequiredSee the operation contract and implementation below.
ReturnsInterval
Explicit validation & failure cases
  • When not alpha > 0.0, raises ValueError(f'Hilbert-derivative commutation needs decay (alpha > 0); got alpha={alpha!r}').

These are explicit source guards. Backend operations may also raise for invalid shapes, dtypes, or unsupported devices.

Read the implementation
def hilbert_of_hardy_odd_deriv_n(y: float, a: float, alpha: float, n: int) -> Interval:
    """Exact line Hilbert: ``H[Q^(n)] = -P^(n)``. Commutation needs ``alpha > 0``."""
    if not (alpha > 0.0):
        raise ValueError(
            "Hilbert-derivative commutation needs decay (alpha > 0); "
            f"got alpha={alpha!r}"
        )
    return -hardy_even_deriv_n(y, a, alpha, n)
Other public import paths
  • omnibias.core.verified.hilbert_of_hardy_odd_deriv_n
  • omnibias.core.verified.hardy_line.hilbert_of_hardy_odd_deriv_n
FUNCTION

pochhammer​

omnibias.core.verified.pochhammerSource ↗
pochhammer(alpha: float, n: int) -> float

Rising factorial (alpha)_n. Exact for integer alpha; float otherwise.

Parameters

NameType & defaultContract
alphapositional-or-keywordfloatRequiredSee the operation contract and implementation below.
npositional-or-keywordintRequiredSee the operation contract and implementation below.
Returnsfloat
Explicit validation & failure cases
  • When n < 0, raises ValueError(f'Pochhammer order n must be >= 0, got {n}').

These are explicit source guards. Backend operations may also raise for invalid shapes, dtypes, or unsupported devices.

Read the implementation
def pochhammer(alpha: float, n: int) -> float:
    """Rising factorial ``(alpha)_n``. Exact for integer ``alpha``; float otherwise."""
    if n < 0:
        raise ValueError(f"Pochhammer order n must be >= 0, got {n}")
    acc = 1.0
    for k in range(n):
        acc *= alpha + k
    return acc
Other public import paths
  • omnibias.core.verified.pochhammer
  • omnibias.core.verified.hardy_line.pochhammer
FUNCTION

pochhammer_iv​

omnibias.core.verified.pochhammer_ivSource ↗
pochhammer_iv(alpha: float, n: int) -> Interval

Outward-rounded enclosure of (alpha)_n.

Parameters

NameType & defaultContract
alphapositional-or-keywordfloatRequiredSee the operation contract and implementation below.
npositional-or-keywordintRequiredSee the operation contract and implementation below.
ReturnsInterval
Explicit validation & failure cases
  • When n < 0, raises ValueError(f'Pochhammer order n must be >= 0, got {n}').

These are explicit source guards. Backend operations may also raise for invalid shapes, dtypes, or unsupported devices.

Read the implementation
def pochhammer_iv(alpha: float, n: int) -> Interval:
    """Outward-rounded enclosure of ``(alpha)_n``."""
    if n < 0:
        raise ValueError(f"Pochhammer order n must be >= 0, got {n}")
    acc = Interval.point(1.0)
    for k in range(n):
        acc = acc * Interval.point(alpha + float(k))
    return acc
Other public import paths
  • omnibias.core.verified.pochhammer_iv
  • omnibias.core.verified.hardy_line.pochhammer_iv