omnibias-geometry
Status: Beta (v0.2.0).
Differential geometry on manifolds, built on the omnibias-fields substrate with
cross-backend (PyTorch + JAX) parity:
- metric tensor
g_ij, inverse metricg^{ij}, volume elementsqrt|g| - Christoffel symbols
Gamma^k_ij - covariant derivative
nabla(scalar / vector / one-form) - the Laplace-Beltrami operator
Delta_g f - Riemann / Ricci / scalar curvature
- the geodesic equation RHS
- exterior calculus:
d, wedge, Hodge star, codifferential (see Phase 4) - the pullback metric
g = JᵀhJof a learned chartphi: R^d -> R^n(analytic or neural), turning curvature / Laplace-Beltrami into tools for learned manifolds - gated chart scan (
omnibias.geometry.scan; discreteC_L, not SO(2)/SO(3)) and shipped Wilson-line holonomy band (omnibias.geometry.gauge.band; closed form only abelian + transverse-constant; no Yang-Mills / mass-gap claim)
Install
pip install "omnibias-geometry[torch]" # or [jax], or [all]
Define a manifold
A metric is given by a per-point callable g_point(x): (d,) -> (d, d) written
with backend ops (so it is vmap/autodiff compatible):
import torch
from omnibias.geometry import ManifoldSpec, MetricSpec
from omnibias.geometry.torch import ops as geo
R = 1.0
def sphere_g(x): # x = (theta, phi)
theta = x[0]
z = 0.0 * theta
return torch.stack([
torch.stack([R**2 + z, z]),
torch.stack([z, R**2 * torch.sin(theta) ** 2]),
])
sphere = ManifoldSpec("S2", 2, MetricSpec(sphere_g, dim=2))
coords = torch.tensor([[1.0, 0.5], [2.0, 3.0]], dtype=torch.float64)
geo.scalar_curvature(coords, sphere) # ~ 2 / R^2
geo.christoffel(coords, sphere) # (B, k, i, j)
laplace_beltrami and covariant_derivative additionally take a
FieldState (any omnibias-fields field):
from omnibias.fields._core.components import ComponentSpec
from omnibias.fields._core.coords import CoordinateSpec
from omnibias.pinn.torch.fields.one_layer import OneLayerVectorField
field = OneLayerVectorField(
coordinate_spec=CoordinateSpec(("theta", "phi")),
components=ComponentSpec(("f", "vx", "vy")), hidden=16, base="tanh",
)
state = field(coords)
geo.laplace_beltrami(state, "f", sphere) # (B,)
geo.covariant_derivative(state, ("vx", "vy"), sphere, kind="vector")
Learned manifolds (pullback metric)
Hand a chart phi: R^d -> R^n to a ChartSpec; the induced metric g = JᵀhJ
(with J by autodiff) plugs straight into every operator above:
from omnibias.geometry import ChartSpec
from omnibias.geometry.torch import ops as geo
def phi(x): # the standard S^2 embedding, x = (theta, phi)
th, ph = x[0], x[1]
return torch.stack([torch.sin(th)*torch.cos(ph),
torch.sin(th)*torch.sin(ph), torch.cos(th)])
chart = ChartSpec(phi=phi, domain_dim=2, ambient_dim=3, name="S2")
manifold = ManifoldSpec("S2", 2, geo.metric_spec_from_chart(chart))
geo.scalar_curvature(coords, manifold) # ~ 2 (recovers the round sphere)
geo.pullback_metric(coords, chart) # (B, 2, 2) = diag(1, sin^2 theta)
phi can equally be a neural network: omnibias then supplies exact curvature and
Laplace-Beltrami on the learned manifold.
Two exact mechanisms, one consistent stack
omnibias-geometry is exact end-to-end. It uses two equally-exact
mechanisms, depending on what is being differentiated:
| Quantity | Mechanism | Why |
|---|---|---|
Field-function derivatives (grad f, hess f, Δ_g f applied to the field) |
Closed-form sigma-tower — one forward pass at every order, bit-identical across torch / JAX, scales as O(1) in input dim. |
The field is a Riccati-activation neural field; omnibias-fields exposes the closed-form recurrence. |
| Metric derivatives inside Christoffel symbols, Riemann / Ricci / scalar curvature | Forward-mode autodiff of the analytic per-point metric g(x) — exact to machine precision (not a finite-difference approximation). |
A user-supplied metric g_point(x) is an arbitrary analytic Python function; the right tool is exact forward-mode AD, not a sigma-tower recurrence. |
Both paths produce identical results to a sympy symbolic reference (within
float64 ULPs) on the analytic round sphere — scalar curvature = 2/R²,
Ricci = g/R², Δ_{S²} cos(θ) = -2 cos(θ) — and to torch ↔ jax parity at
rtol = 1e-9. See GEOMETRY_DERIVATIONS.md for
the index conventions and the per-op derivation, and
docs/scope-and-guarantees.md for the
project-wide definition of "closed-form" vs "autodiff-exact".
Validation
Every operator is checked against (1) the analytic round sphere
(scalar curvature = 2/R^2, Ricci = g/R^2, eigenfunction
Delta_{S^2} cos(theta) = -2 cos(theta)), (2) a sympy symbolic computation, and
(3) torch/jax cross-backend parity, all in float64.
License
Apache-2.0. See LICENSE and ../../LICENSING.md.
You never need a commercial licence for this package.
Release files for omnibias-geometry 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| omnibias_geometry-0.2.0.tar.gz | 583.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| omnibias_geometry-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 1.1 MB
Release files / omnibias_geometry-0.2.0.tar.gz
| Download URL | omnibias_geometry-0.2.0.tar.gz |
|---|---|
| Size | 583.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fabe45cad2d25350515cd7ff62bbaa6de8d0cd4f2fc5d7e4216c9d09fe0f9cda
|
|
BLAKE2b-256 checksum How to use checksums |
992d44725d4b8dbeacbb6035e7c96bac1a6d8be45b02c766a8f3ede8fa6665df
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 13, 2026.
Transparency logRelease files / omnibias_geometry-0.2.0-py3-none-any.whl
| Download URL | omnibias_geometry-0.2.0-py3-none-any.whl |
|---|---|
| Size | 536.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2fd4f135b6ce90c7292bd76887dc7690f8cb2d342923e64dfeb6949f7b64d9c3
|
|
BLAKE2b-256 checksum How to use checksums |
58ae8ea75082dd36ed48af4f76c8b62ef494bddb621d75eae9ee5bd3fb6d7d5e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 13, 2026.
Transparency log