Skip to main content

The Master Equation

The framework's master equation is a nonlinear field, evolved as a dynamical system. When you call solve() or multibody(), this is what runs:

ϕ¨  =  2ϕ    μ2(r)ϕ    λϕ3  +  ϕc2kwkCk(ϕ)\ddot{\phi} \;=\; \nabla^2\phi \;-\; \mu^2(r)\,\phi \;-\; \lambda\phi^3 \;+\; \phi_c^2 \sum_k w_k\, C_k(\phi)

Its core — □ϕ = ∇²ϕ − μ²ϕ − λϕ³ — is a well-posed ϕ⁴ Klein–Gordon field. That is not a placeholder: it is exactly the field the nano-zeqond engine integrates with a velocity-Verlet symplectic integrator at sub-Zeqond resolution, with energy conserved to ≤0.1% and reported live as driftPct. It is what makes solve() a real dynamical solve rather than a lookup.

Term by term

∇²ϕ — the spatial Laplacian (the wave/gradient term): how the field couples to its neighbours and propagates.

−μ²(r)·ϕ — the mass term. μ² sets the local "stiffness": higher mass → higher-frequency oscillation, shorter correlation length, more confinement. Position-dependent when your problem calls for it.

−λϕ³ — nonlinear self-interaction. Without it the field is linear (a superposition engine); with it you get real nonlinear behaviour — interference, saturation, phase-locking.

+ φc²·Σ_k w_k·C_k(ϕ) — the coupling term. The operators you pass in koSettings become the weights w_k; C_k(ϕ) is each operator's contribution to the field's evolution, and φc is the coupling scale. This is where your chosen operators enter the dynamics. The value of this whole term is returned as masterEquationTerms.operatorCoupling — it moves as you add or reweight operators.

A bounded decay/source term can be added for damped or forced problems; it is off by default so the shipped contract integrates the clean, energy-conserving ϕ⁴ core.

Two compute paths — pick the right one

The master equation is the dynamical path. It is not the only way to compute, and for exact answers it is not the one you want:

  • compute() — exact closed-form physics. One operator, textbook formula, CODATA constants (e.g. NM21F = G·m₁·m₂/r²). Use this for a single, exact, independently re-derivable result.
  • solve() / multibody() — the master equation. A nonlinear field (or N coupled fields) evolved over time with your operators weighting the coupling term. Use this for evolving, multi-force, or many-body problems where the trajectory matters.

Both return a signed CKO. compute() gives you the exact value; solve() gives you the trajectory, the register dump, and the coupling term.

What comes back

const r = await sdk.solve({
prompt: "free body: gravity + drag + restoring",
mass: 5, location: "earth", medium: "air",
koSettings: { NM19: 1.0, NM21: 1.0, NM30: 0.5 },
tMax: 5, dt: 0.01,
});

r.ckoId; // signed CKO id
r.masterEquationTerms.operatorCoupling; // value of φc²·Σ w_k C_k(ϕ)
r.energy; // conserved field energy
r.errorPct; // integrator tolerance (≤0.1%)
r.solution; // the evolved trajectory

These are the fields the API actually returns. The run is also reduced to a single characterizing scalar, functionalEnergy — the functional equation E = P_φ·Z — returned alongside, as a diagnostic that never alters the physics.

Why this field

  • It has a compatibility limit. At λ = 0 and no coupling it reduces to the linear Klein–Gordon equation, whose exact spectral solution is known — so the engine can be checked against ground truth (it is, to machine precision on the linear modes).
  • It's bounded and symplectic. Velocity-Verlet gives O(dt²) energy error that stays bounded over long runs, so driftPct reflects only integrator error and the ≤0.1% tolerance is real.
  • The clock is in the math, not beside it. The integration step rides the Zeqond time base (see KO42 · the gauge mode), so the evolution advances in the framework's proper computational time.

The spectral form (for integral problems)

For problems posed as an integral over state space and time — reconstruction, fields, N-body kernels — the same field admits a propagator form:

Ψ(x,t)=K(x,x,t,t)ϕ(x,t)dxdt,K=KspectralKtemporalKchaos\Psi(x,t) = \iint K(x,x',t,t')\,\phi(x',t')\,dx'\,dt', \qquad K = K_{\text{spectral}}\cdot K_{\text{temporal}}\cdot K_{\text{chaos}}

For the linear core this is exact: K_spectral is the lattice Fourier basis, K_temporal the per-mode phase propagator, and the nonlinear part is handled by the integrator. It is the same mathematics the engine's verification oracle uses to check the field to machine precision.

Background and derivation: the framework paper (DOI 10.5281/zenodo.15825138).