Phase Contract¶
Every oscillator produces a PhaseState with the following fields:
| Field | Type | Contract |
|---|---|---|
theta |
float | Phase in [0, 2*pi). Wrapping enforced by extractor. |
omega |
float | Instantaneous angular frequency, rad/s. May be negative. |
amplitude |
float | Signal amplitude. Channel-specific meaning. |
quality |
float | Confidence in [0, 1]. 0 = unreliable. 1 = perfect. |
channel |
str | "P", "I", or "S". Set by extractor. |
node_id |
str | Unique identifier for this oscillator instance. |
Extraction Requirements¶
thetaMUST be in[0, 2*pi)after extraction. Extractors apply% TWO_PI.omegais computed from the signal, not assumed constant. Physical: phase gradient. Informational: median inter-event frequency. Symbolic: phase difference / dt.qualityreflects measurement reliability, not system health. Low quality means the phase estimate is uncertain.node_idmust match an entry in the binding specoscillator_ids.
Quality Gating¶
PhaseQualityScorer.downweight_mask(min_quality=0.3)returns weight 0 for states below threshold.detect_collapse(threshold=0.1)returns True when majority of states are below 0.1.- Down-weighted oscillators still participate in UPDE integration but with reduced coupling effect (multiply Knm row by quality weight).
Phase Wrapping¶
The UPDE engine wraps output phases via % TWO_PI after every integration step. Phase differences use the standard sin(theta_j - theta_i) form, which handles wrapping implicitly.