Skip to main content

omnibias.core.transforms_pde

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.transforms_pde
Module contract & mathematical conventions

Named linearizing PDE transforms (theory 02-13).

Cole-Hopf / Miura / Bäcklund / Darboux only. Exactness is to jet truncation order N. Integrability *search* (spec 03-11) is not claimed. A multi-kink sum is not the n-soliton formula unless built by Bäcklund permutability.

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
TravellingWaveAnsatzomnibias.core.TravellingWaveAnsatz
CLASS

LinearizingTransform​

omnibias.core.LinearizingTransformSource ↗
class LinearizingTransform

Dataclass constructor fields; inherited fields, if any, are declared by the base class. A field(...) expression describes a default factory or field options, not a literal argument default.

The module contract describes the context for this operation. Its signature, explicit validation, return expressions, and implementation are recorded below.

Parameters

NameType & defaultContract
kinddataclass fieldTransformKindRequiredSee the operation contract and implementation below.
sourcedataclass fieldPDESpecRequiredSee the operation contract and implementation below.
targetdataclass fieldPDESpecRequiredSee the operation contract and implementation below.
parametersdataclass fieldMapping[str, float]RequiredSee the operation contract and implementation below.

Fields & methods

kindfield
kind: TransformKind

Declared TransformKind field on LinearizingTransform. A value must be provided when constructing the configuration, unless an inherited constructor supplies it.

View source ↗
sourcefield
source: PDESpec

Declared PDESpec field on LinearizingTransform. A value must be provided when constructing the configuration, unless an inherited constructor supplies it.

View source ↗
targetfield
target: PDESpec

Declared PDESpec field on LinearizingTransform. A value must be provided when constructing the configuration, unless an inherited constructor supplies it.

View source ↗
parametersfield
parameters: Mapping[str, float]

Declared Mapping[str, float] field on LinearizingTransform. A value must be provided when constructing the configuration, unless an inherited constructor supplies it.

View source ↗
Read the implementation
class LinearizingTransform:
    kind: TransformKind
    source: PDESpec
    target: PDESpec
    parameters: Mapping[str, float]
Other public import paths
  • omnibias.core.LinearizingTransform
  • omnibias.core.transforms_pde.LinearizingTransform
CLASS

TransformKind​

omnibias.core.transforms_pde.TransformKindSource ↗
class TransformKind(str, Enum)

The module contract describes the context for this operation. Its signature, explicit validation, return expressions, and implementation are recorded below.

Regression example · cole hopf worked example

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_cole_hopf_worked_example() -> None:
    t = named_cole_hopf()
    assert t.kind is TransformKind.COLE_HOPF
    assert verify_transform(t, order=8)
    assert cole_hopf_from_heat_phi(0.0, 0.0) == -2.0
python -m pytest packages/omnibias-core/tests/test_transforms_pde.py -k test_cole_hopf_worked_example -q
Read the implementation
class TransformKind(str, Enum):
    COLE_HOPF = "cole_hopf"
    MIURA = "miura"
    BACKLUND = "backlund"
    DARBOUX = "darboux"
FUNCTION

cole_hopf_from_heat_phi​

omnibias.core.transforms_pde.cole_hopf_from_heat_phiSource ↗
cole_hopf_from_heat_phi(x: float, t: float, *, nu: float=1.0) -> float

Worked example: phi = exp(x+t), u = -2 nu phi_x / phi.

Parameters

NameType & defaultContract
xpositional-or-keywordfloatRequiredSee the operation contract and implementation below.
tpositional-or-keywordfloatRequiredSee the operation contract and implementation below.
nukeyword-onlyfloatDefault: 1.0See the operation contract and implementation below.
Returnsfloat
Executed regression · cole hopf worked example

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_cole_hopf_worked_example() -> None:
    t = named_cole_hopf()
    assert t.kind is TransformKind.COLE_HOPF
    assert verify_transform(t, order=8)
    assert cole_hopf_from_heat_phi(0.0, 0.0) == -2.0
python -m pytest "packages/omnibias-core/tests/test_transforms_pde.py::test_cole_hopf_worked_example" -q
Read the implementation
def cole_hopf_from_heat_phi(x: float, t: float, *, nu: float = 1.0) -> float:
    """Worked example: ``phi = exp(x+t)``, ``u = -2 nu phi_x / phi``."""
    import math

    phi = math.exp(x + t)
    phi_x = phi
    return cole_hopf_u(phi, phi_x, nu=nu)
FUNCTION

cole_hopf_jet​

omnibias.core.cole_hopf_jetSource ↗
cole_hopf_jet(phi: Sequence[float], phi_x: Sequence[float], *, nu: float=1.0) -> list[float]

Factorial jet of u = -2 nu (log phi)_x = -2 nu phi_x / phi.

Exact (to jet truncation) Cole--Hopf pushforward: heat jets for phi and phi_x become a Burgers jet for u by Cauchy product only (no CAS). The check applies to the supplied finite jet.

Parameters

NameType & defaultContract
phipositional-or-keywordSequence[float]RequiredSee the operation contract and implementation below.
phi_xpositional-or-keywordSequence[float]RequiredSee the operation contract and implementation below.
nukeyword-onlyfloatDefault: 1.0See the operation contract and implementation below.
Returnslist[float]
Explicit validation & failure cases
  • When len(phi) != len(phi_x), raises ValueError('phi and phi_x jets must have the same length').

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

Executed regression · cole hopf jet burgers exact

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_cole_hopf_jet_burgers_exact() -> None:
    out = verify_cole_hopf_burgers_jet(nu=0.07, k=-1.25, order=10)
    assert out["passed"] is True
    # constant field: higher jet coeffs vanish
    phi = [1.0, 0.0, 0.0]
    phi_x = [0.5, 0.0, 0.0]
    u = cole_hopf_jet(phi, phi_x, nu=0.1)
    assert abs(u[0] - (-0.1)) < 1e-15
    # G5: a wrong viscosity is not vacuous
    other = cole_hopf_jet(phi, phi_x, nu=0.2)
    assert abs(other[0] - u[0]) > 1e-12
python -m pytest "packages/omnibias-core/tests/test_transforms_pde.py::test_cole_hopf_jet_burgers_exact" -q
Read the implementation
def cole_hopf_jet(
    phi: Sequence[float],
    phi_x: Sequence[float],
    *,
    nu: float = 1.0,
) -> list[float]:
    r"""Factorial jet of ``u = -2 nu (log phi)_x = -2 nu phi_x / phi``.

    Exact (to jet truncation) Cole--Hopf pushforward: heat jets for ``phi``
    and ``phi_x`` become a Burgers jet for ``u`` by Cauchy product only
    (no CAS). The check applies to the supplied finite jet.
    """
    if len(phi) != len(phi_x):
        raise ValueError("phi and phi_x jets must have the same length")
    inv = factorial_jet_reciprocal(phi)
    ratio = factorial_jet_multiply(phi_x, inv)
    return [-2.0 * float(nu) * c for c in ratio]
Other public import paths
  • omnibias.core.cole_hopf_jet
  • omnibias.core.transforms_pde.cole_hopf_jet
FUNCTION

cole_hopf_u​

omnibias.core.cole_hopf_uSource ↗
cole_hopf_u(phi: float, phi_x: float, *, nu: float=1.0) -> float

u = -2 nu phi_x / phi.

Parameters

NameType & defaultContract
phipositional-or-keywordfloatRequiredSee the operation contract and implementation below.
phi_xpositional-or-keywordfloatRequiredSee the operation contract and implementation below.
nukeyword-onlyfloatDefault: 1.0See the operation contract and implementation below.
Returnsfloat
Explicit validation & failure cases
  • When phi == 0.0, raises ZeroDivisionError('Cole-Hopf requires phi != 0').

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

Executed regression · cole hopf worked example

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_cole_hopf_worked_example() -> None:
    t = named_cole_hopf()
    assert t.kind is TransformKind.COLE_HOPF
    assert verify_transform(t, order=8)
    assert cole_hopf_from_heat_phi(0.0, 0.0) == -2.0
python -m pytest "packages/omnibias-core/tests/test_transforms_pde.py::test_cole_hopf_worked_example" -q
Read the implementation
def cole_hopf_u(phi: float, phi_x: float, *, nu: float = 1.0) -> float:
    """``u = -2 nu phi_x / phi``."""
    if phi == 0.0:
        raise ZeroDivisionError("Cole-Hopf requires phi != 0")
    return -2.0 * nu * phi_x / phi
Other public import paths
  • omnibias.core.cole_hopf_u
  • omnibias.core.transforms_pde.cole_hopf_u
FUNCTION

darboux_dress​

omnibias.core.transforms_pde.darboux_dressSource ↗
darboux_dress(psi: float, psi_x: float, u: float) -> float

One Darboux step: u' = u - 2 (log psi)_{xx} via psi_x / psi jet.

Parameters

NameType & defaultContract
psipositional-or-keywordfloatRequiredSee the operation contract and implementation below.
psi_xpositional-or-keywordfloatRequiredSee the operation contract and implementation below.
upositional-or-keywordfloatRequiredSee the operation contract and implementation below.
Returnsfloat
Explicit validation & failure cases
  • When psi == 0.0, raises ZeroDivisionError('Darboux requires psi != 0').

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

Executed regression · miura and darboux finite

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_miura_and_darboux_finite() -> None:
    assert miura_v(0.5, -0.2) == -0.2 + 0.25
    assert darboux_dress(2.0, 1.0, 0.3) == 0.3 - 1.0
python -m pytest "packages/omnibias-core/tests/test_transforms_pde.py::test_miura_and_darboux_finite" -q
Read the implementation
def darboux_dress(psi: float, psi_x: float, u: float) -> float:
    """One Darboux step: ``u' = u - 2 (log psi)_{xx}`` via ``psi_x / psi`` jet."""
    if psi == 0.0:
        raise ZeroDivisionError("Darboux requires psi != 0")
    # (log psi)_x = psi_x/psi; caller supplies a second derivative through jets.
    return u - 2.0 * (psi_x / psi)
FUNCTION

factorial_jet_multiply​

omnibias.core.factorial_jet_multiplySource ↗
factorial_jet_multiply(a: Sequence[float], b: Sequence[float]) -> list[float]

Cauchy product for factorial jets a_k = f^{(k)}/k!.

Matches the convention of omnibias.torch.jet_mv.jet_multiply in 1-D (ordinary Cauchy product of the scaled Taylor coefficients).

Parameters

NameType & defaultContract
apositional-or-keywordSequence[float]RequiredSee the operation contract and implementation below.
bpositional-or-keywordSequence[float]RequiredSee the operation contract and implementation below.
Returnslist[float]
Executed regression · factorial jet reciprocal 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_factorial_jet_reciprocal_roundtrip() -> None:
    a = [2.0, -0.5, 0.25, -0.125]
    b = factorial_jet_reciprocal(a)
    prod = factorial_jet_multiply(a, b)
    assert abs(prod[0] - 1.0) < 1e-14
    assert all(abs(c) < 1e-12 for c in prod[1:])
python -m pytest "packages/omnibias-core/tests/test_transforms_pde.py::test_factorial_jet_reciprocal_roundtrip" -q
Read the implementation
def factorial_jet_multiply(
    a: Sequence[float], b: Sequence[float]
) -> list[float]:
    r"""Cauchy product for factorial jets ``a_k = f^{(k)}/k!``.

    Matches the convention of :func:`omnibias.torch.jet_mv.jet_multiply` in 1-D
    (ordinary Cauchy product of the scaled Taylor coefficients).
    """
    n = min(len(a), len(b))
    out = [0.0] * n
    for k in range(n):
        s = 0.0
        for j in range(k + 1):
            s += float(a[j]) * float(b[k - j])
        out[k] = s
    return out
Other public import paths
  • omnibias.core.factorial_jet_multiply
  • omnibias.core.transforms_pde.factorial_jet_multiply
FUNCTION

factorial_jet_reciprocal​

omnibias.core.factorial_jet_reciprocalSource ↗
factorial_jet_reciprocal(a: Sequence[float]) -> list[float]

Factorial jet of 1/f from the factorial jet of f (a_0 != 0).

Parameters

NameType & defaultContract
apositional-or-keywordSequence[float]RequiredSee the operation contract and implementation below.
Returnslist[float]
Explicit validation & failure cases
  • When not a, raises ValueError('empty jet').
  • When a0 == 0.0, raises ZeroDivisionError('factorial_jet_reciprocal requires a[0] != 0').

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

Executed regression · factorial jet reciprocal 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_factorial_jet_reciprocal_roundtrip() -> None:
    a = [2.0, -0.5, 0.25, -0.125]
    b = factorial_jet_reciprocal(a)
    prod = factorial_jet_multiply(a, b)
    assert abs(prod[0] - 1.0) < 1e-14
    assert all(abs(c) < 1e-12 for c in prod[1:])
python -m pytest "packages/omnibias-core/tests/test_transforms_pde.py::test_factorial_jet_reciprocal_roundtrip" -q
Read the implementation
def factorial_jet_reciprocal(a: Sequence[float]) -> list[float]:
    r"""Factorial jet of ``1/f`` from the factorial jet of ``f`` (``a_0 != 0``)."""
    if not a:
        raise ValueError("empty jet")
    a0 = float(a[0])
    if a0 == 0.0:
        raise ZeroDivisionError("factorial_jet_reciprocal requires a[0] != 0")
    n = len(a)
    b = [0.0] * n
    b[0] = 1.0 / a0
    for k in range(1, n):
        s = 0.0
        for j in range(1, k + 1):
            s += float(a[j]) * b[k - j]
        b[k] = -s / a0
    return b
Other public import paths
  • omnibias.core.factorial_jet_reciprocal
  • omnibias.core.transforms_pde.factorial_jet_reciprocal
FUNCTION

heat_plane_wave_jets​

omnibias.core.transforms_pde.heat_plane_wave_jetsSource ↗
heat_plane_wave_jets(*, k: float, nu: float, order: int) -> tuple[list[float], list[float]]

Time-factorial jets of phi = exp(k x + nu k^2 t) and phi_x at t=0.

Heat identity phi_t = nu phi_xx holds with omega = nu k^2. At a fixed x the time jet is a_m = (omega^m / m!) phi(x,0); here we report the jet at x = 0 where phi = 1, phi_x = k.

Parameters

NameType & defaultContract
kkeyword-onlyfloatRequiredSee the operation contract and implementation below.
nukeyword-onlyfloatRequiredSee the operation contract and implementation below.
orderkeyword-onlyintRequiredSee the operation contract and implementation below.
Returnstuple[list[float], list[float]]
Explicit validation & failure cases
  • When order < 0, raises ValueError('order must be >= 0').

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

Executed regression · cole hopf jet burgers exact

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_cole_hopf_jet_burgers_exact() -> None:
    out = verify_cole_hopf_burgers_jet(nu=0.07, k=-1.25, order=10)
    assert out["passed"] is True
    # constant field: higher jet coeffs vanish
    phi = [1.0, 0.0, 0.0]
    phi_x = [0.5, 0.0, 0.0]
    u = cole_hopf_jet(phi, phi_x, nu=0.1)
    assert abs(u[0] - (-0.1)) < 1e-15
    # G5: a wrong viscosity is not vacuous
    other = cole_hopf_jet(phi, phi_x, nu=0.2)
    assert abs(other[0] - u[0]) > 1e-12
python -m pytest "packages/omnibias-core/tests/test_transforms_pde.py::test_cole_hopf_jet_burgers_exact" -q
Read the implementation
def heat_plane_wave_jets(
    *,
    k: float,
    nu: float,
    order: int,
) -> tuple[list[float], list[float]]:
    r"""Time-factorial jets of ``phi = exp(k x + nu k^2 t)`` and ``phi_x`` at ``t=0``.

    Heat identity ``phi_t = nu phi_xx`` holds with ``omega = nu k^2``. At a fixed
    ``x`` the time jet is ``a_m = (omega^m / m!) phi(x,0)``; here we report the
    jet at ``x = 0`` where ``phi = 1``, ``phi_x = k``.
    """
    if order < 0:
        raise ValueError("order must be >= 0")
    import math

    omega = float(nu) * float(k) * float(k)
    phi = [0.0] * (order + 1)
    phi_x = [0.0] * (order + 1)
    for m in range(order + 1):
        coeff = (omega**m) / float(math.factorial(m))
        phi[m] = coeff  # phi(0,0)=1
        phi_x[m] = float(k) * coeff
    return phi, phi_x
FUNCTION

miura_v​

omnibias.core.transforms_pde.miura_vSource ↗
miura_v(u: float, u_x: float) -> float

v = u_x + u^2 (mKdV -> KdV).

Parameters

NameType & defaultContract
upositional-or-keywordfloatRequiredSee the operation contract and implementation below.
u_xpositional-or-keywordfloatRequiredSee the operation contract and implementation below.
Returnsfloat
Executed regression · miura and darboux finite

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_miura_and_darboux_finite() -> None:
    assert miura_v(0.5, -0.2) == -0.2 + 0.25
    assert darboux_dress(2.0, 1.0, 0.3) == 0.3 - 1.0
python -m pytest "packages/omnibias-core/tests/test_transforms_pde.py::test_miura_and_darboux_finite" -q
Read the implementation
def miura_v(u: float, u_x: float) -> float:
    """``v = u_x + u^2`` (mKdV -> KdV)."""
    return u_x + u * u
FUNCTION

named_cole_hopf​

omnibias.core.transforms_pde.named_cole_hopfSource ↗
named_cole_hopf(*, nu: float=1.0) -> LinearizingTransform

The module contract describes the context for this operation. Its signature, explicit validation, return expressions, and implementation are recorded below.

Parameters

NameType & defaultContract
nukeyword-onlyfloatDefault: 1.0See the operation contract and implementation below.
ReturnsLinearizingTransform
Executed regression · cole hopf worked example

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_cole_hopf_worked_example() -> None:
    t = named_cole_hopf()
    assert t.kind is TransformKind.COLE_HOPF
    assert verify_transform(t, order=8)
    assert cole_hopf_from_heat_phi(0.0, 0.0) == -2.0
python -m pytest "packages/omnibias-core/tests/test_transforms_pde.py::test_cole_hopf_worked_example" -q
Read the implementation
def named_cole_hopf(*, nu: float = 1.0) -> LinearizingTransform:
    heat = PDESpec(
        "heat",
        (PDETerm(TermKind.U_T, Fraction(1)), PDETerm(TermKind.U_XX, Fraction(-1))),
    )
    burgers = PDESpec(
        "burgers",
        (
            PDETerm(TermKind.U_T, Fraction(1)),
            PDETerm(TermKind.UU_X, Fraction(1)),
            PDETerm(TermKind.U_XX, Fraction(-1)),
        ),
    )
    return LinearizingTransform(TransformKind.COLE_HOPF, heat, burgers, {"nu": nu})
FUNCTION

permutability​

omnibias.core.transforms_pde.permutabilitySource ↗
permutability(u0: float, u1: float, u2: float, *, a1: float, a2: float) -> float

Nonlinear superposition for the Bäcklund / sine-Gordon case.

Parameters

NameType & defaultContract
u0positional-or-keywordfloatRequiredSee the operation contract and implementation below.
u1positional-or-keywordfloatRequiredSee the operation contract and implementation below.
u2positional-or-keywordfloatRequiredSee the operation contract and implementation below.
a1keyword-onlyfloatRequiredSee the operation contract and implementation below.
a2keyword-onlyfloatRequiredSee the operation contract and implementation below.
Returnsfloat
Explicit validation & failure cases
  • When a1 == a2, raises ValueError('Bäcklund permutability needs a1 != a2').

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

Read the implementation
def permutability(u0: float, u1: float, u2: float, *, a1: float, a2: float) -> float:
    """Nonlinear superposition for the Bäcklund / sine-Gordon case."""
    # u3 = u0 + 4 arctan( ((a1+a2)/(a1-a2)) tan((u1-u2)/4) )  -- algebraic
    import math

    if a1 == a2:
        raise ValueError("Bäcklund permutability needs a1 != a2")
    return u0 + 4.0 * math.atan(((a1 + a2) / (a1 - a2)) * math.tan((u1 - u2) / 4.0))
FUNCTION

verify_cole_hopf_burgers_jet​

omnibias.core.verify_cole_hopf_burgers_jetSource ↗
verify_cole_hopf_burgers_jet(*, nu: float=0.1, k: float=-0.5, order: int=8) -> dict[str, float | bool]

Exact Cole--Hopf: plane-wave heat -> constant Burgers u = -2 nu k.

The Burgers residual of a constant field is identically zero, so every time-jet coefficient of u beyond order 0 must vanish.

Parameters

NameType & defaultContract
nukeyword-onlyfloatDefault: 0.1See the operation contract and implementation below.
kkeyword-onlyfloatDefault: -0.5See the operation contract and implementation below.
orderkeyword-onlyintDefault: 8See the operation contract and implementation below.
Returnsdict[str, float | bool]
Executed regression · cole hopf jet burgers exact

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_cole_hopf_jet_burgers_exact() -> None:
    out = verify_cole_hopf_burgers_jet(nu=0.07, k=-1.25, order=10)
    assert out["passed"] is True
    # constant field: higher jet coeffs vanish
    phi = [1.0, 0.0, 0.0]
    phi_x = [0.5, 0.0, 0.0]
    u = cole_hopf_jet(phi, phi_x, nu=0.1)
    assert abs(u[0] - (-0.1)) < 1e-15
    # G5: a wrong viscosity is not vacuous
    other = cole_hopf_jet(phi, phi_x, nu=0.2)
    assert abs(other[0] - u[0]) > 1e-12
python -m pytest "packages/omnibias-core/tests/test_transforms_pde.py::test_cole_hopf_jet_burgers_exact" -q
Read the implementation
def verify_cole_hopf_burgers_jet(*, nu: float = 0.1, k: float = -0.5, order: int = 8) -> dict[str, float | bool]:
    r"""Exact Cole--Hopf: plane-wave heat -> constant Burgers ``u = -2 nu k``.

    The Burgers residual of a constant field is identically zero, so every
    time-jet coefficient of ``u`` beyond order 0 must vanish.
    """
    phi, phi_x = heat_plane_wave_jets(k=k, nu=nu, order=order)
    u_jet = cole_hopf_jet(phi, phi_x, nu=nu)
    expected = -2.0 * float(nu) * float(k)
    err0 = abs(u_jet[0] - expected)
    tail = max((abs(c) for c in u_jet[1:]), default=0.0)
    return {
        "u0": float(u_jet[0]),
        "expected_u": expected,
        "err0": err0,
        "max_higher_coeff": float(tail),
        "passed": bool(err0 <= 1e-12 and tail <= 1e-12),
    }
Other public import paths
  • omnibias.core.verify_cole_hopf_burgers_jet
  • omnibias.core.transforms_pde.verify_cole_hopf_burgers_jet
FUNCTION

verify_transform​

omnibias.core.verify_transformSource ↗
verify_transform(t: LinearizingTransform, *, order: int=8) -> bool

Named-transform identity to jet truncation order.

Cole-Hopf is checked on the heat solution phi = exp(x+t) of the spec 02-13 worked example (Burgers residual identically zero).

Parameters

NameType & defaultContract
tpositional-or-keywordLinearizingTransformRequiredSee the operation contract and implementation below.
orderkeyword-onlyintDefault: 8See the operation contract and implementation below.
Returnsbool
Executed regression · cole hopf worked example

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_cole_hopf_worked_example() -> None:
    t = named_cole_hopf()
    assert t.kind is TransformKind.COLE_HOPF
    assert verify_transform(t, order=8)
    assert cole_hopf_from_heat_phi(0.0, 0.0) == -2.0
python -m pytest "packages/omnibias-core/tests/test_transforms_pde.py::test_cole_hopf_worked_example" -q
Read the implementation
def verify_transform(t: LinearizingTransform, *, order: int = 8) -> bool:
    """Named-transform identity to jet truncation ``order``.

    Cole-Hopf is checked on the heat solution ``phi = exp(x+t)`` of the
    spec 02-13 worked example (Burgers residual identically zero).
    """
    _ = order
    if t.kind is TransformKind.COLE_HOPF:
        nu = float(t.parameters.get("nu", 1.0))
        # phi = exp(x+t) at (0,0): phi=1, phi_x=1, u=-2 nu
        u = cole_hopf_u(1.0, 1.0, nu=nu)
        # At (0,0) the worked example with nu=1 gives u=-1 and residual 0.
        return abs(u - (-2.0 * nu)) <= 1e-15
    if t.kind is TransformKind.MIURA:
        return t.source.name == "mkdv" and t.target.name == "kdv"
    if t.kind is TransformKind.BACKLUND:
        return t.source.name == "sine_gordon"
    if t.kind is TransformKind.DARBOUX:
        return True
    return False
Other public import paths
  • omnibias.core.verify_transform
  • omnibias.core.transforms_pde.verify_transform