Ana içerik geç

Composing operators

The framework composes operators through the master equation's Sum_{k=1..42} C_k(phi) term. You compose them in practice by passing an operators array to a protocol call.

The rule of 4

Step 2 of the 7-step wizard protocol: max 4 operators per call, and one of them must be KO42. So: 1 to 3 operators of your choice, plus KO42.

// valid: KO42 + QM9 + NM23
const cko = await zeq.run("zeq-formulation", {
operators: ["QM9", "NM23"], // KO42 is implicit
params: { m_kg: 1, v_mps: 100 },
});

// INVALID: 4 user operators
await zeq.run("zeq-formulation", {
operators: ["QM9", "NM23", "GR31", "CS47"],
params: { /* ... */ },
});
// → KO42OverflowError: max 3 user operators per call

Why the limit? KO42 can only prove the ≤0.1% error band for compositions of bounded depth. Beyond 3 user operators, the error band starts to drift and the framework refuses to issue a signed CKO. If you need a deeper composition, chain CKOs: run two protocols, feed the first's output into the second's parameters.

A worked example: time-dilated kinetic energy

A ship passing near a gravitating body; compute kinetic energy in its proper frame.

const cko = await zeq.run("zeq-formulation", {
operators: [
"GR35", // time dilation
"NM23", // kinetic energy
],
params: {
m_kg: 1000,
v_mps: 1e6,
G: 6.674e-11,
M_kg: 5.972e24, // Earth mass
r_m: 6.371e6, // Earth radius
},
});

console.log(cko.E);
// {
// dilation_factor: 0.99999931,
// ke_rest_frame: 5e11,
// ke_proper: 4.9999655e11,
// }

console.log(cko.operators);
// ["KO42", "GR35", "NM23"] (KO42 is always first)

console.log(cko.ko42.error_band);
// 0.00052 — 0.052%, within bound

Chaining CKOs

When you need more than 3 operators, chain. Each link is independently KO42-verified:

const step1 = await zeq.run("zeq-propagation", {
operators: ["QM9"],
params: { /* ... */ },
});

const step2 = await zeq.run("zeq-formulation", {
operators: ["GR35", "NM23"],
params: {
...otherParams,
incoming_lambda_m: step1.E.lambda_m, // thread the output
},
});

// Both CKOs are verifiable. The chain has a cumulative error band:
const chainError = 1 - (1 - step1.ko42.error_band) * (1 - step2.ko42.error_band);
// ≈ sum of individual bands for small bands

Picking the right operators

Step 3 of the wizard protocol: match operators to the domain. Some rules of thumb:

  • Quantum-scale problems (atomic, photonic, sub-µm): start with a QM operator (QM1, QM5, QM9, QM17).
  • Mesoscale / everyday physics (balls, cars, pendula): start with NM (NM19, NM23, NM26, NM30).
  • High-energy or astrophysics (near black holes, cosmological scales): start with GR (GR32, GR35, GR37).
  • Algorithm / information problems: CS (CS43 for performance, CS47 for entropy, CS87 for minimum descriptor length).
  • Self-referential / observation problems: Awareness (ON0 for self-measurement, PSI96 for phase-resonant observers).

When in doubt, call zeq.operators.suggest({domain, params}) — the SDK ships with a recommender trained on the protocol registry.

Next

Use a pre-built protocol → Calling a protocol.