Minimal Core Demo#
Example 01 – Minimal Core Demo#
Minimal flow of a hyper-causal model:
x_t → Backend (encode/run) → HCNode (project + policy) → Ŝ_{t+1} → ConsistencyLoss
Modules exercised#
qmlhc.core: contracts, BackendConfig, QuantumBackend (base), HCModel
qmlhc.hc: HCNode, MeanPolicy
qmlhc.loss: ConsistencyLoss
- class qmlhc.examples.ex_minimal_core_demo.ToyBackend(config)[source]
Bases:
QuantumBackendDemonstrative backend, deterministic and numerically stable.
This backend defines the minimal deterministic behavior for demonstration purposes. It applies a smooth nonlinear transformation to the encoded input and generates future projections through uniform perturbations.
- run(params=None)[source]
Applies a tanh-based transformation to the encoded input.
- project_future(s_t, branches=2)[source]
Generates K possible future states.
- qmlhc.examples.ex_minimal_core_demo.minimal_core_demo()[source]
Run a minimal demonstration of the hyper-causal model.
This function performs a full pass through a minimal hyper-causal pipeline: it initializes a backend, defines a node with mean policy, executes the forward step, and computes the triadic consistency loss. The results are printed to the console for inspection.
- Returns:
Prints the results directly to the console.
- Return type:
None