Hypercausal Node#

Hypercausal Node#

Triadic forward propagation linking past, present, and projected future states.

Each node binds a QuantumBackend (which handles state evolution) and an optional ProjectionPolicy (which determines how multiple candidate futures are aggregated into a single representative future).

Implements the HypercausalNode protocol.

class qmlhc.hc.node.HCNode(backend, policy=None, config=None)[source]#

Bases: HypercausalNode

Concrete implementation of a hypercausal node.

This node combines a QuantumBackend, which generates both the current and future states, together with an optional ProjectionPolicy that aggregates multiple candidate futures into a single representative vector.

Notes

The forward method implements the triadic relation: (past present projected futures).

__init__(backend, policy=None, config=None)[source]#

Initialize a hypercausal node.

Parameters:
  • backend (QuantumBackend) – Quantum backend responsible for computing state transitions.

  • policy (ProjectionPolicy or None, optional) – Strategy for selecting a representative future. If None, the mean across branches is used.

  • config (NodeConfig or None, optional) – Static configuration object, by default NodeConfig().

forward(x_t, s_tm1, branches=2)[source]#

Perform one forward pass through the node.

Steps#

  1. Encode the current input x_t into the backend.

  2. Execute the backend to compute the current compact state S_t.

  3. Generate K candidate futures F = {S_{t+1}^k}.

  4. Select a representative future Ŝ_{t+1} using the policy.

type x_t:

Union[ndarray, Sequence[float]]

param x_t:

Current input at time t.

type x_t:

TensorLike

type s_tm1:

Union[ndarray, Sequence[float], None]

param s_tm1:

Previous state at time t-1 (may be None for the first step).

type s_tm1:

TensorLike or None

type branches:

int

param branches:

Number of candidate futures to generate, by default 2.

type branches:

int, optional

returns:

(S_t, Ŝ_{t+1}, info) where: - S_t : Array Current state vector. - Ŝ_{t+1} : Array Aggregated representative future. - info : dict Additional metadata including: -s_tm1 : previous state (if provided) - branches : matrix of candidate futures - policy : policy name - diagnostics : policy diagnostics or aggregation info

rtype:

tuple

class qmlhc.hc.node.NodeConfig(branches=2)[source]#

Bases: object

Static configuration for a hypercausal node.

Parameters:

branches (int, optional) – Number of candidate futures (K) to generate from the backend, by default 2.

branches: int = 2#