omnibias.qcalculus.torch.hybrid
q-numbers, Jackson derivatives and integrals, q-series, and the ordinary-calculus limit as q approaches one.
import omnibias.qcalculus.torch.hybridModule contract & mathematical conventions
q-OMBU hybrid (torch; theory 09-15).
Named q -> 1 is not founding bias collapse (delta -> 0) and
not temperature collapse (beta -> inf, feasibility). Ordinary
sigma cells still use founding bias collapse. do not conflate
the two.
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 module | Canonical reference |
|---|---|
DISCLAIMER | omnibias.qcalculus.jax.hybrid.DISCLAIMER |
QOMBUConfig | omnibias.qcalculus.QOMBUConfig |
honesty_payload | omnibias.qcalculus.jax.hybrid.honesty_payload |
q_ombu_forward
omnibias.qcalculus.torch.q_ombu_forwardSource ↗q_ombu_forward(x: Tensor, params: Sequence[float] | None=None, *, config: QOMBUConfig | None=None) -> tuple[Tensor, Tensor]Returns (y, limit_residual).
Parameters
| Name | Type & default | Contract |
|---|---|---|
xpositional-or-keyword | TensorRequired | See the operation contract and implementation below. |
paramspositional-or-keyword | Sequence[float] | NoneDefault: None | See the operation contract and implementation below. |
configkeyword-only | QOMBUConfig | NoneDefault: None | See the operation contract and implementation below. |
tuple[Tensor, Tensor]Regression example · g4 bit identical
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_g4_bit_identical() -> None:
torch.set_default_dtype(torch.float64)
assert torch_ex()["y"] == jax_ex()["y"]
t_y, t_r = torch_fwd(torch.tensor(2.0))
j_y, j_r = jax_fwd(jnp.asarray(2.0))
assert float(t_y) == float(j_y)
assert float(t_r) == float(j_r)python -m pytest tests/test_q_ombu_parity.py -k test_g4_bit_identical -qRead the implementation
def q_ombu_forward(
x: Tensor,
params: Sequence[float] | None = None,
*,
config: QOMBUConfig | None = None,
) -> tuple[Tensor, Tensor]:
"""Returns ``(y, limit_residual)``."""
y, residual = core.q_ombu_forward(float(x.reshape(-1)[0].detach()), params, config=config)
return x.new_tensor(y), x.new_tensor(residual)Other public import paths
omnibias.qcalculus.torch.q_ombu_forwardomnibias.qcalculus.torch.hybrid.q_ombu_forward
worked_example
omnibias.qcalculus.torch.hybrid.worked_exampleSource ↗worked_example() -> dict[str, float]The module contract describes the context for this operation. Its signature, explicit validation, return expressions, and implementation are recorded below.
dict[str, float]Regression example · g4 bit identical
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_g4_bit_identical() -> None:
torch.set_default_dtype(torch.float64)
assert torch_ex()["y"] == jax_ex()["y"]
t_y, t_r = torch_fwd(torch.tensor(2.0))
j_y, j_r = jax_fwd(jnp.asarray(2.0))
assert float(t_y) == float(j_y)
assert float(t_r) == float(j_r)python -m pytest tests/test_q_ombu_parity.py -k test_g4_bit_identical -qRead the implementation
def worked_example() -> dict[str, float]:
return core.worked_example()