omnibias.core.verified.hardy_line
Coefficient recurrences, activation contracts, jet algebra, and verified arithmetic shared by the numerical backends.
import omnibias.core.verified.hardy_lineModule 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.
hardy_angle
omnibias.core.verified.hardy_angleSource ↗hardy_angle(y: float, a: float) -> IntervalVerified phi = atan(y / a).
Parameters
| Name | Type & default | Contract |
|---|---|---|
ypositional-or-keyword | floatRequired | See the operation contract and implementation below. |
apositional-or-keyword | floatRequired | See the operation contract and implementation below. |
IntervalExecuted 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" -qRead 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_angleomnibias.core.verified.hardy_line.hardy_angle
hardy_angle_iv
omnibias.core.verified.hardy_line.hardy_angle_ivSource ↗hardy_angle_iv(y: Interval, a: float) -> IntervalVerified phi = atan(y / a) for interval y.
Parameters
| Name | Type & default | Contract |
|---|---|---|
ypositional-or-keyword | IntervalRequired | See the operation contract and implementation below. |
apositional-or-keyword | floatRequired | See the operation contract and implementation below. |
IntervalRead 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())hardy_even
omnibias.core.verified.hardy_evenSource ↗hardy_even(y: float, a: float, alpha: float) -> IntervalVerified P_{a,alpha}(y) = r^{-alpha} cos(alpha phi) (even).
Parameters
| Name | Type & default | Contract |
|---|---|---|
ypositional-or-keyword | floatRequired | See the operation contract and implementation below. |
apositional-or-keyword | floatRequired | See the operation contract and implementation below. |
alphapositional-or-keyword | floatRequired | See the operation contract and implementation below. |
IntervalExecuted 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" -qRegression 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 -qRead 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_evenomnibias.core.verified.hardy_line.hardy_even
hardy_even_dalpha
omnibias.core.verified.hardy_even_dalphaSource ↗hardy_even_dalpha(y: float, a: float, alpha: float) -> IntervalVerified dP/dalpha = -ln(r) P - phi Q.
Parameters
| Name | Type & default | Contract |
|---|---|---|
ypositional-or-keyword | floatRequired | See the operation contract and implementation below. |
apositional-or-keyword | floatRequired | See the operation contract and implementation below. |
alphapositional-or-keyword | floatRequired | See the operation contract and implementation below. |
IntervalRead 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) * qOther public import paths
omnibias.core.verified.hardy_even_dalphaomnibias.core.verified.hardy_line.hardy_even_dalpha
hardy_even_deriv
omnibias.core.verified.hardy_even_derivSource ↗hardy_even_deriv(y: float, a: float, alpha: float) -> IntervalVerified P' = -alpha Q_{a, alpha+1}.
Parameters
| Name | Type & default | Contract |
|---|---|---|
ypositional-or-keyword | floatRequired | See the operation contract and implementation below. |
apositional-or-keyword | floatRequired | See the operation contract and implementation below. |
alphapositional-or-keyword | floatRequired | See the operation contract and implementation below. |
IntervalExecuted 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]" -qRegression 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 -qRead 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_derivomnibias.core.verified.hardy_line.hardy_even_deriv
hardy_even_deriv_iv
omnibias.core.verified.hardy_line.hardy_even_deriv_ivSource ↗hardy_even_deriv_iv(y: Interval, a: float, alpha: float) -> IntervalInterval-y enclosure of P'.
Parameters
| Name | Type & default | Contract |
|---|---|---|
ypositional-or-keyword | IntervalRequired | See the operation contract and implementation below. |
apositional-or-keyword | floatRequired | See the operation contract and implementation below. |
alphapositional-or-keyword | floatRequired | See the operation contract and implementation below. |
IntervalRead 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)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
| Name | Type & default | Contract |
|---|---|---|
y_nodespositional-or-keyword | Sequence[float]Required | See the operation contract and implementation below. |
a_valuespositional-or-keyword | Sequence[float]Required | See the operation contract and implementation below. |
alphapositional-or-keyword | floatRequired | See the operation contract and implementation below. |
list[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_matrixomnibias.core.verified.hardy_line.hardy_even_deriv_matrix
hardy_even_deriv_n
omnibias.core.verified.hardy_even_deriv_nSource ↗hardy_even_deriv_n(y: float, a: float, alpha: float, n: int) -> IntervalClosed-form P^(n) via the Hardy table. n = 1 matches hardy_even_deriv.
Parameters
| Name | Type & default | Contract |
|---|---|---|
ypositional-or-keyword | floatRequired | See the operation contract and implementation below. |
apositional-or-keyword | floatRequired | See the operation contract and implementation below. |
alphapositional-or-keyword | floatRequired | See the operation contract and implementation below. |
npositional-or-keyword | intRequired | See the operation contract and implementation below. |
IntervalExplicit validation & failure cases
- When
n < 0, raisesValueError(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_nomnibias.core.verified.hardy_line.hardy_even_deriv_n
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) -> IntervalInterval-y enclosure of P^(n).
Parameters
| Name | Type & default | Contract |
|---|---|---|
ypositional-or-keyword | IntervalRequired | See the operation contract and implementation below. |
apositional-or-keyword | floatRequired | See the operation contract and implementation below. |
alphapositional-or-keyword | floatRequired | See the operation contract and implementation below. |
npositional-or-keyword | intRequired | See the operation contract and implementation below. |
IntervalExplicit validation & failure cases
- When
n < 0, raisesValueError(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_ivomnibias.core.verified.hardy_line.hardy_even_deriv_n_iv
hardy_even_iv
omnibias.core.verified.hardy_line.hardy_even_ivSource ↗hardy_even_iv(y: Interval, a: float, alpha: float) -> IntervalInterval-y enclosure of P_{a,alpha} (sound over a cell).
Parameters
| Name | Type & default | Contract |
|---|---|---|
ypositional-or-keyword | IntervalRequired | See the operation contract and implementation below. |
apositional-or-keyword | floatRequired | See the operation contract and implementation below. |
alphapositional-or-keyword | floatRequired | See the operation contract and implementation below. |
IntervalRead 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))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
| Name | Type & default | Contract |
|---|---|---|
y_nodespositional-or-keyword | Sequence[float]Required | See the operation contract and implementation below. |
a_valuespositional-or-keyword | Sequence[float]Required | See the operation contract and implementation below. |
alphapositional-or-keyword | floatRequired | See the operation contract and implementation below. |
list[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_matrixomnibias.core.verified.hardy_line.hardy_even_matrix
hardy_even_profile
omnibias.core.verified.hardy_even_profileSource ↗hardy_even_profile(y: float, coeffs: Sequence[float], scales: Sequence[float], alpha: float) -> IntervalVerified even profile Theta = sum_i c_i P_{a_i, alpha}.
Parameters
| Name | Type & default | Contract |
|---|---|---|
ypositional-or-keyword | floatRequired | See the operation contract and implementation below. |
coeffspositional-or-keyword | Sequence[float]Required | See the operation contract and implementation below. |
scalespositional-or-keyword | Sequence[float]Required | See the operation contract and implementation below. |
alphapositional-or-keyword | floatRequired | See the operation contract and implementation below. |
IntervalExecuted 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-15python -m pytest "packages/omnibias-core/tests/verified/test_hardy_line.py::test_hardy_profile_and_tail" -qRead 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_profileomnibias.core.verified.hardy_line.hardy_even_profile
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) -> IntervalVerified Theta' = sum_i c_i P'_{a_i, alpha}.
Parameters
| Name | Type & default | Contract |
|---|---|---|
ypositional-or-keyword | floatRequired | See the operation contract and implementation below. |
coeffspositional-or-keyword | Sequence[float]Required | See the operation contract and implementation below. |
scalespositional-or-keyword | Sequence[float]Required | See the operation contract and implementation below. |
alphapositional-or-keyword | floatRequired | See the operation contract and implementation below. |
IntervalRead 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_derivomnibias.core.verified.hardy_line.hardy_even_profile_deriv
hardy_odd
omnibias.core.verified.hardy_oddSource ↗hardy_odd(y: float, a: float, alpha: float) -> IntervalVerified Q_{a,alpha}(y) = r^{-alpha} sin(alpha phi) (odd).
Parameters
| Name | Type & default | Contract |
|---|---|---|
ypositional-or-keyword | floatRequired | See the operation contract and implementation below. |
apositional-or-keyword | floatRequired | See the operation contract and implementation below. |
alphapositional-or-keyword | floatRequired | See the operation contract and implementation below. |
IntervalExecuted 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" -qRegression 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 -qRead 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_oddomnibias.core.verified.hardy_line.hardy_odd
hardy_odd_dalpha
omnibias.core.verified.hardy_odd_dalphaSource ↗hardy_odd_dalpha(y: float, a: float, alpha: float) -> IntervalVerified dQ/dalpha = -ln(r) Q + phi P.
Parameters
| Name | Type & default | Contract |
|---|---|---|
ypositional-or-keyword | floatRequired | See the operation contract and implementation below. |
apositional-or-keyword | floatRequired | See the operation contract and implementation below. |
alphapositional-or-keyword | floatRequired | See the operation contract and implementation below. |
IntervalRead 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) * pOther public import paths
omnibias.core.verified.hardy_odd_dalphaomnibias.core.verified.hardy_line.hardy_odd_dalpha
hardy_odd_deriv
omnibias.core.verified.hardy_odd_derivSource ↗hardy_odd_deriv(y: float, a: float, alpha: float) -> IntervalVerified Q' = alpha P_{a, alpha+1}.
Parameters
| Name | Type & default | Contract |
|---|---|---|
ypositional-or-keyword | floatRequired | See the operation contract and implementation below. |
apositional-or-keyword | floatRequired | See the operation contract and implementation below. |
alphapositional-or-keyword | floatRequired | See the operation contract and implementation below. |
IntervalExecuted 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]" -qRegression 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 -qRead 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_derivomnibias.core.verified.hardy_line.hardy_odd_deriv
hardy_odd_deriv_iv
omnibias.core.verified.hardy_line.hardy_odd_deriv_ivSource ↗hardy_odd_deriv_iv(y: Interval, a: float, alpha: float) -> IntervalInterval-y enclosure of Q'.
Parameters
| Name | Type & default | Contract |
|---|---|---|
ypositional-or-keyword | IntervalRequired | See the operation contract and implementation below. |
apositional-or-keyword | floatRequired | See the operation contract and implementation below. |
alphapositional-or-keyword | floatRequired | See the operation contract and implementation below. |
IntervalRead 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)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
| Name | Type & default | Contract |
|---|---|---|
y_nodespositional-or-keyword | Sequence[float]Required | See the operation contract and implementation below. |
a_valuespositional-or-keyword | Sequence[float]Required | See the operation contract and implementation below. |
alphapositional-or-keyword | floatRequired | See the operation contract and implementation below. |
list[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_matrixomnibias.core.verified.hardy_line.hardy_odd_deriv_matrix
hardy_odd_deriv_n
omnibias.core.verified.hardy_odd_deriv_nSource ↗hardy_odd_deriv_n(y: float, a: float, alpha: float, n: int) -> IntervalClosed-form Q^(n) via the Hardy table. n = 1 matches hardy_odd_deriv.
Parameters
| Name | Type & default | Contract |
|---|---|---|
ypositional-or-keyword | floatRequired | See the operation contract and implementation below. |
apositional-or-keyword | floatRequired | See the operation contract and implementation below. |
alphapositional-or-keyword | floatRequired | See the operation contract and implementation below. |
npositional-or-keyword | intRequired | See the operation contract and implementation below. |
IntervalExplicit validation & failure cases
- When
n < 0, raisesValueError(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_nomnibias.core.verified.hardy_line.hardy_odd_deriv_n
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) -> IntervalInterval-y enclosure of Q^(n).
Parameters
| Name | Type & default | Contract |
|---|---|---|
ypositional-or-keyword | IntervalRequired | See the operation contract and implementation below. |
apositional-or-keyword | floatRequired | See the operation contract and implementation below. |
alphapositional-or-keyword | floatRequired | See the operation contract and implementation below. |
npositional-or-keyword | intRequired | See the operation contract and implementation below. |
IntervalExplicit validation & failure cases
- When
n < 0, raisesValueError(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_ivomnibias.core.verified.hardy_line.hardy_odd_deriv_n_iv
hardy_odd_iv
omnibias.core.verified.hardy_line.hardy_odd_ivSource ↗hardy_odd_iv(y: Interval, a: float, alpha: float) -> IntervalInterval-y enclosure of Q_{a,alpha} (sound over a cell).
Parameters
| Name | Type & default | Contract |
|---|---|---|
ypositional-or-keyword | IntervalRequired | See the operation contract and implementation below. |
apositional-or-keyword | floatRequired | See the operation contract and implementation below. |
alphapositional-or-keyword | floatRequired | See the operation contract and implementation below. |
IntervalRead 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))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
| Name | Type & default | Contract |
|---|---|---|
y_nodespositional-or-keyword | Sequence[float]Required | See the operation contract and implementation below. |
a_valuespositional-or-keyword | Sequence[float]Required | See the operation contract and implementation below. |
alphapositional-or-keyword | floatRequired | See the operation contract and implementation below. |
list[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_matrixomnibias.core.verified.hardy_line.hardy_odd_matrix
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') -> IntervalInterval U for one Hardy-Ω atom with U'=HΩ and U(0)=0.
Parameters
| Name | Type & default | Contract |
|---|---|---|
ypositional-or-keyword | floatRequired | See the operation contract and implementation below. |
apositional-or-keyword | floatRequired | See the operation contract and implementation below. |
alphapositional-or-keyword | floatRequired | See the operation contract and implementation below. |
npositional-or-keyword | intRequired | See the operation contract and implementation below. |
paritykeyword-only | strDefault: 'odd' | See the operation contract and implementation below. |
IntervalExplicit validation & failure cases
- When
n < 0, raisesValueError(f'derivative order n must be >= 0, got {n}'). - When
not alpha > 0.0, raisesValueError(f'Hilbert-derivative commutation needs decay (alpha > 0); got alpha={alpha!r}'). - When
parity not in ('even', 'odd'), raisesValueError(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 * integOther public import paths
omnibias.core.verified.hardy_omega_velocity_atomomnibias.core.verified.hardy_line.hardy_omega_velocity_atom
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') -> IntervalInterval-y enclosure of the Hardy-Ω velocity atom.
Parameters
| Name | Type & default | Contract |
|---|---|---|
ypositional-or-keyword | IntervalRequired | See the operation contract and implementation below. |
apositional-or-keyword | floatRequired | See the operation contract and implementation below. |
alphapositional-or-keyword | floatRequired | See the operation contract and implementation below. |
npositional-or-keyword | intRequired | See the operation contract and implementation below. |
paritykeyword-only | strDefault: 'odd' | See the operation contract and implementation below. |
IntervalExplicit validation & failure cases
- When
n < 0, raisesValueError(f'derivative order n must be >= 0, got {n}'). - When
not alpha > 0.0, raisesValueError(f'Hilbert-derivative commutation needs decay (alpha > 0); got alpha={alpha!r}'). - When
parity not in ('even', 'odd'), raisesValueError(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 * integOther public import paths
omnibias.core.verified.hardy_omega_velocity_atom_ivomnibias.core.verified.hardy_line.hardy_omega_velocity_atom_iv
hardy_pair
omnibias.core.verified.hardy_pairSource ↗hardy_pair(y: float, a: float, alpha: float) -> tuple[Interval, Interval]Return (P, Q) at y.
Parameters
| Name | Type & default | Contract |
|---|---|---|
ypositional-or-keyword | floatRequired | See the operation contract and implementation below. |
apositional-or-keyword | floatRequired | See the operation contract and implementation below. |
alphapositional-or-keyword | floatRequired | See the operation contract and implementation below. |
tuple[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" -qRegression 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 -qRead 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_pairomnibias.core.verified.hardy_line.hardy_pair
hardy_radius
omnibias.core.verified.hardy_radiusSource ↗hardy_radius(y: float, a: float) -> IntervalVerified r = sqrt(a^2 + y^2).
Parameters
| Name | Type & default | Contract |
|---|---|---|
ypositional-or-keyword | floatRequired | See the operation contract and implementation below. |
apositional-or-keyword | floatRequired | See the operation contract and implementation below. |
IntervalExecuted 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" -qRead 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_radiusomnibias.core.verified.hardy_line.hardy_radius
hardy_radius_iv
omnibias.core.verified.hardy_line.hardy_radius_ivSource ↗hardy_radius_iv(y: Interval, a: float) -> IntervalVerified r = sqrt(a^2 + y^2) for an interval y (cell covering).
Parameters
| Name | Type & default | Contract |
|---|---|---|
ypositional-or-keyword | IntervalRequired | See the operation contract and implementation below. |
apositional-or-keyword | floatRequired | See the operation contract and implementation below. |
IntervalRead 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()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
| Name | Type & default | Contract |
|---|---|---|
coeffspositional-or-keyword | Sequence[float]Required | See the operation contract and implementation below. |
scalespositional-or-keyword | Sequence[float]Required | See the operation contract and implementation below. |
alphapositional-or-keyword | floatRequired | See the operation contract and implementation below. |
tuple[float, float]Explicit validation & failure cases
- When
len(coeffs) != len(scales), raisesValueError('coeffs and scales must have the same length'). - When
alpha <= 0.0, raisesValueError('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-15python -m pytest "packages/omnibias-core/tests/verified/test_hardy_line.py::test_hardy_profile_and_tail" -qRead 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_constantomnibias.core.verified.hardy_line.hardy_tail_constant
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) -> IntervalVerified exact H[Theta] = sum_i c_i Q_{a_i, alpha}.
Parameters
| Name | Type & default | Contract |
|---|---|---|
ypositional-or-keyword | floatRequired | See the operation contract and implementation below. |
coeffspositional-or-keyword | Sequence[float]Required | See the operation contract and implementation below. |
scalespositional-or-keyword | Sequence[float]Required | See the operation contract and implementation below. |
alphapositional-or-keyword | floatRequired | See the operation contract and implementation below. |
IntervalExecuted 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-15python -m pytest "packages/omnibias-core/tests/verified/test_hardy_line.py::test_hardy_profile_and_tail" -qRead 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_profileomnibias.core.verified.hardy_line.hilbert_hardy_even_profile
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) -> IntervalVerified exact (H Theta)' = sum_i c_i Q'_{a_i, alpha}.
Parameters
| Name | Type & default | Contract |
|---|---|---|
ypositional-or-keyword | floatRequired | See the operation contract and implementation below. |
coeffspositional-or-keyword | Sequence[float]Required | See the operation contract and implementation below. |
scalespositional-or-keyword | Sequence[float]Required | See the operation contract and implementation below. |
alphapositional-or-keyword | floatRequired | See the operation contract and implementation below. |
IntervalRead 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_derivomnibias.core.verified.hardy_line.hilbert_hardy_even_profile_deriv
hilbert_of_hardy_even
omnibias.core.verified.hilbert_of_hardy_evenSource ↗hilbert_of_hardy_even(y: float, a: float, alpha: float) -> IntervalExact line Hilbert: H[P] = Q.
Parameters
| Name | Type & default | Contract |
|---|---|---|
ypositional-or-keyword | floatRequired | See the operation contract and implementation below. |
apositional-or-keyword | floatRequired | See the operation contract and implementation below. |
alphapositional-or-keyword | floatRequired | See the operation contract and implementation below. |
IntervalExecuted 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-9python -m pytest "packages/omnibias-core/tests/verified/test_hardy_line.py::test_hilbert_rotation_matches_pv[-2.0-0.8-0.623]" -qRead 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_evenomnibias.core.verified.hardy_line.hilbert_of_hardy_even
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) -> IntervalExact line Hilbert: H[P^(n)] = Q^(n). Commutation needs alpha > 0.
Parameters
| Name | Type & default | Contract |
|---|---|---|
ypositional-or-keyword | floatRequired | See the operation contract and implementation below. |
apositional-or-keyword | floatRequired | See the operation contract and implementation below. |
alphapositional-or-keyword | floatRequired | See the operation contract and implementation below. |
npositional-or-keyword | intRequired | See the operation contract and implementation below. |
IntervalExplicit validation & failure cases
- When
not alpha > 0.0, raisesValueError(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_nomnibias.core.verified.hardy_line.hilbert_of_hardy_even_deriv_n
hilbert_of_hardy_odd
omnibias.core.verified.hilbert_of_hardy_oddSource ↗hilbert_of_hardy_odd(y: float, a: float, alpha: float) -> IntervalExact line Hilbert: H[Q] = -P.
Parameters
| Name | Type & default | Contract |
|---|---|---|
ypositional-or-keyword | floatRequired | See the operation contract and implementation below. |
apositional-or-keyword | floatRequired | See the operation contract and implementation below. |
alphapositional-or-keyword | floatRequired | See the operation contract and implementation below. |
IntervalExecuted 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-9python -m pytest "packages/omnibias-core/tests/verified/test_hardy_line.py::test_hilbert_rotation_matches_pv[-2.0-0.8-0.623]" -qRead 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_oddomnibias.core.verified.hardy_line.hilbert_of_hardy_odd
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) -> IntervalExact line Hilbert: H[Q^(n)] = -P^(n). Commutation needs alpha > 0.
Parameters
| Name | Type & default | Contract |
|---|---|---|
ypositional-or-keyword | floatRequired | See the operation contract and implementation below. |
apositional-or-keyword | floatRequired | See the operation contract and implementation below. |
alphapositional-or-keyword | floatRequired | See the operation contract and implementation below. |
npositional-or-keyword | intRequired | See the operation contract and implementation below. |
IntervalExplicit validation & failure cases
- When
not alpha > 0.0, raisesValueError(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_nomnibias.core.verified.hardy_line.hilbert_of_hardy_odd_deriv_n
pochhammer
omnibias.core.verified.pochhammerSource ↗pochhammer(alpha: float, n: int) -> floatRising factorial (alpha)_n. Exact for integer alpha; float otherwise.
Parameters
| Name | Type & default | Contract |
|---|---|---|
alphapositional-or-keyword | floatRequired | See the operation contract and implementation below. |
npositional-or-keyword | intRequired | See the operation contract and implementation below. |
floatExplicit validation & failure cases
- When
n < 0, raisesValueError(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 accOther public import paths
omnibias.core.verified.pochhammeromnibias.core.verified.hardy_line.pochhammer
pochhammer_iv
omnibias.core.verified.pochhammer_ivSource ↗pochhammer_iv(alpha: float, n: int) -> IntervalOutward-rounded enclosure of (alpha)_n.
Parameters
| Name | Type & default | Contract |
|---|---|---|
alphapositional-or-keyword | floatRequired | See the operation contract and implementation below. |
npositional-or-keyword | intRequired | See the operation contract and implementation below. |
IntervalExplicit validation & failure cases
- When
n < 0, raisesValueError(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 accOther public import paths
omnibias.core.verified.pochhammer_ivomnibias.core.verified.hardy_line.pochhammer_iv