Skip to main content

omnibias.fields.jax.ops

0.2.0rc1Release candidatePython >=3.10Apache-2.0

Structured scalar, vector, and tensor fields with derivative caches, calculus operators, and coordinate conventions.

import omnibias.fields.jax.ops
Module contract & mathematical conventions

Functional operator surface for the JAX backend.

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.

Imports & aliases​

These names share a definition with another public module. Follow a name for its full contract, parameters, and examples.

Import from this moduleCanonical reference
advectionomnibias.fields.jax.ops.advection
advection_diffusion_residualomnibias.fields.jax.ops.advection_diffusion_residual
biharmonicomnibias.fields.jax.ops.biharmonic
conservation_residualomnibias.fields.jax.ops.conservation_residual
curlomnibias.fields.jax.ops.curl
curl_of_curlomnibias.fields.jax.ops.curl_of_curl
dalembertianomnibias.fields.jax.ops.dalembertian
deformation_gradientomnibias.fields.jax.ops.deformation_gradient
derivativeomnibias.fields.jax.ops.derivative
diffusive_fluxomnibias.fields.jax.ops.diffusive_flux
directional_derivativeomnibias.fields.jax.ops.directional_derivative
divergenceomnibias.fields.jax.ops.divergence
dzomnibias.fields.jax.ops.dz
dzbaromnibias.fields.jax.ops.dzbar
flux_divergenceomnibias.fields.jax.ops.flux_divergence
grad_squared_normomnibias.fields.jax.ops.grad_squared_norm
gradientomnibias.fields.jax.ops.gradient
gradient_of_compositionomnibias.fields.jax.ops.gradient_of_composition
gradient_of_derivativeomnibias.fields.jax.ops.gradient_of_derivative
gradient_of_divergenceomnibias.fields.jax.ops.gradient_of_divergence
hessianomnibias.fields.jax.ops.hessian
inner_productomnibias.fields.jax.ops.inner_product
integrateomnibias.fields.jax.ops.integrate
jacobianomnibias.fields.jax.ops.jacobian
l2_normomnibias.fields.jax.ops.l2_norm
laplacianomnibias.fields.jax.ops.laplacian
laplacian_of_compositionomnibias.fields.jax.ops.laplacian_of_composition
line_integralomnibias.fields.jax.ops.line_integral
material_derivativeomnibias.fields.jax.ops.material_derivative
mixed_partialomnibias.fields.jax.ops.mixed_partial
p_laplacianomnibias.fields.jax.ops.p_laplacian
polylaplacianomnibias.fields.jax.ops.polylaplacian
quadrature_nodesomnibias.fields.jax.ops.quadrature_nodes
rate_of_rotation_tensoromnibias.fields.jax.ops.rate_of_rotation_tensor
skew_symmetric_advectionomnibias.fields.jax.ops.skew_symmetric_advection
sobolev_normomnibias.fields.jax.ops.sobolev_norm
spatial_hessianomnibias.fields.jax.ops.spatial_hessian
spatial_jacobianomnibias.fields.jax.ops.spatial_jacobian
stack_componentsomnibias.fields.jax.ops.stack_components
strain_rateomnibias.fields.jax.ops.strain_rate
tensor_cofactoromnibias.fields.jax.ops.tensor_cofactor
tensor_determinantomnibias.fields.jax.ops.tensor_determinant
tensor_divergenceomnibias.fields.jax.ops.tensor_divergence
tensor_double_dotomnibias.fields.jax.ops.tensor_double_dot
tensor_inverseomnibias.fields.jax.ops.tensor_inverse
tensor_matmulomnibias.fields.jax.ops.tensor_matmul
tensor_traceomnibias.fields.jax.ops.tensor_trace
tensor_transposeomnibias.fields.jax.ops.tensor_transpose
valueomnibias.fields.jax.ops.value
variable_coefficient_diffusionomnibias.fields.jax.ops.variable_coefficient_diffusion
vector_biharmonicomnibias.fields.jax.ops.vector_biharmonic
vector_derivativeomnibias.fields.jax.ops.vector_derivative
vector_hessianomnibias.fields.jax.ops.vector_hessian
vector_laplacianomnibias.fields.jax.ops.vector_laplacian
vector_polylaplacianomnibias.fields.jax.ops.vector_polylaplacian
vorticityomnibias.fields.jax.ops.vorticity
wave_operatoromnibias.fields.jax.ops.wave_operator
FUNCTION

register​

omnibias.fields.jax.ops.registerSource ↗
register(name: str) -> Callable[[Callable[..., Any]], Callable[..., Any]]

Decorator: register a new op under name.

Examples

>>> @register("symmetric_laplacian")
... def sym_lap(state, name):
...     return state.ops.laplacian(state, name)

Parameters

NameType & defaultContract
namepositional-or-keywordstrRequiredSee the operation contract and implementation below.
ReturnsCallable[[Callable[..., Any]], Callable[..., Any]]
Explicit validation & failure cases
  • When not isinstance(name, str) or not name, raises ValueError('op name must be a non-empty string').
  • When ' ' in name or name != name.lower(), raises ValueError(f'op names must be lowercase with no whitespace; got {name!r}').

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

Executed regression · ops registry roundtrip

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_ops_registry_roundtrip() -> None:
    @ops_registry.register("phase1_probe_op")
    def _probe(state: object, name: str) -> str:
        return f"probe::{name}"

    assert ops_registry.lookup("phase1_probe_op") is _probe
    assert ops_registry.lookup("definitely_not_registered") is None
python -m pytest "packages/omnibias-fields/tests/_core/test_substrate.py::test_ops_registry_roundtrip" -q
Read the implementation
def register(name: str) -> Callable[[Callable[..., Any]], Callable[..., Any]]:
    """Decorator: register a new op under ``name``.

    Examples
    --------
    >>> @register("symmetric_laplacian")
    ... def sym_lap(state, name):
    ...     return state.ops.laplacian(state, name)
    """
    if not isinstance(name, str) or not name:
        raise ValueError("op name must be a non-empty string")
    if " " in name or name != name.lower():
        raise ValueError(
            f"op names must be lowercase with no whitespace; got {name!r}"
        )

    def deco(fn: Callable[..., Any]) -> Callable[..., Any]:
        if name in _REGISTRY:
            raise ValueError(f"op {name!r} is already registered")
        _REGISTRY[name] = fn
        return fn
    return deco
Other public import paths
  • omnibias.fields.jax.ops.register
  • omnibias.fields.torch.ops.register
  • omnibias.fields.jax.ops.registry.register
  • omnibias.fields.torch.ops.registry.register