Analysis Toolkit¶
Purpose and scope¶
The toolkit is structured for operational readability: each monitor returns a different failure or regime signal before the scalar order parameter alone would show anything unusual. In practice, teams use this page as a first-pass selection guide, then tune thresholds against their domain trajectories.
How operators should use this layer¶
Treat the toolkit as a multi-signal diagnostic funnel rather than a single alarm source:
- start with fast, broad monitors (
order_parameter,lyapunov); - add structural monitors (
plv,chimera,winding) when patterns localise; - then confirm causal or thermodynamic interpretations (
coupling_est,entropy_prod,itpc,pid).
This sequencing reduces false positives and gives policy teams a reproducible rationale for each escalation before any actuation change is promoted.
The sections below are ordered from global coherence to higher-order coupling relationships because that mirrors a typical diagnostic flow: global stability -> phase alignment structure -> causality and stability risk -> topological and thermodynamic drift.
SPO provides 12 dynamical monitors — most oscillator simulators have 1-2. Each monitor detects a different aspect of the dynamics that scalar R misses.
Selecting a minimal monitor set¶
For a first production run, teams usually start with:
order_parameterfor synchronization trend and collapse detection,lyapunovfor local stability margin,plvfor pairwise synchrony topology,- one supervisory metric (
evsorpid) for domain-facing interpretability.
Expanding to all monitors is recommended only after a baseline is stable; this keeps false alarm fatigue manageable while keeping observability depth.
Order Parameter & PLV¶
Standard Kuramoto order parameter R = |⟨exp(iθ)⟩| and Phase-Locking Value matrix PLV_ij = |⟨exp(i(θ_i - θ_j))⟩_t|.
order_params ¶
Kuramoto order parameter family with 5-backend fallback chain.
Follows the AttnRes-level module standard
(feedback_module_standard_attnres.md):
compute_order_parameter— R and mean phase ψ.compute_plv— phase-locking value between two equal-length phase series.compute_layer_coherence— R restricted to a layer.
Each kernel is available in five languages — Rust, Mojo, Julia, Go,
Python. AVAILABLE_BACKENDS reports detected backends in canonical
fallback order, while ACTIVE_BACKEND is selected by a small import-time
hot-path probe so slow external wrappers do not displace the faster local
path.
Functions:¶
compute_order_parameter ¶
Kuramoto global order parameter (R, ψ).
R = |mean(exp(i · θ))|;
ψ = arg(mean(exp(i · θ))) mod 2π.
Parameters¶
phases : FloatArray
Oscillator phases in radians, shape (N,).
Returns¶
tuple[float, float]
The (R, ψ) Kuramoto order parameter and mean phase.
Notes¶
R carries a positive small-sample bias: N uniformly random phases give
E[R²] = 1/N, so R reads about 1/√N (≈ 0.35 at N = 8) even with
no coherence. A monitor comparing coherence across small populations should use
:func:debiased_squared_order_parameter, whose expectation is 0 under
uniformity, rather than reading the raw R as if it were unbiased.
Source code in src/scpn_phase_orchestrator/upde/order_params.py
debiased_squared_order_parameter ¶
Return the small-N-bias-corrected squared Kuramoto order parameter.
The raw magnitude R = |mean(exp(iθ))| has a positive small-sample bias:
N uniformly random phases give E[R²] = 1/N, so R reads about
1/√N (≈ 0.35 at N = 8) even with no coherence. This estimator removes
that floor. It is the pairwise phase consistency of Vinck et al. (2010),
(N · R² − 1) / (N − 1),
whose expectation is 0 under uniform phases and 1 at perfect synchrony. It can
be slightly negative on a finite anti-aligned sample — that is honest, not an
error. Reuses the accelerated :func:compute_order_parameter for R; the
debiasing itself is a scalar correction.
Parameters¶
phases : FloatArray
Oscillator phases in radians, shape (N,) with N ≥ 2.
Returns¶
float
The debiased squared order parameter, in [-1 / (N − 1), 1].
Raises¶
ValueError
If fewer than two phases are supplied — the correction is undefined for a
single oscillator (N − 1 = 0).
References¶
Vinck, M., van Wingerden, M., Womelsdorf, T., Fries, P., & Pennartz, C. M. A. (2010). The pairwise phase consistency: a bias-free measure of rhythmic neuronal synchronization. NeuroImage, 51(1), 112–122.
Source code in src/scpn_phase_orchestrator/upde/order_params.py
compute_plv ¶
Phase-locking value between two equal-length phase series.
PLV = |mean(exp(i · (φ_a − φ_b)))| over samples.
Parameters¶
phases_a : FloatArray
First phase series in radians, shape (T,).
phases_b : FloatArray
Second phase series in radians, shape (T,).
Returns¶
float The phase-locking value between the two series.
Raises¶
ValueError If the two phase series have different lengths.
Source code in src/scpn_phase_orchestrator/upde/order_params.py
compute_layer_coherence ¶
Return the order parameter R for the oscillators in layer_mask.
Parameters¶
phases : FloatArray
Oscillator phases in radians, shape (N,).
layer_mask : BoolArray | IntArray
Boolean mask or integer index array selecting the layer's oscillators.
Returns¶
float
The Kuramoto order parameter R for the selected oscillators.
Source code in src/scpn_phase_orchestrator/upde/order_params.py
Phase-Amplitude Coupling (PAC)¶
Modulation index (MI) via Tort et al. 2010. Bins low-frequency phase, computes mean amplitude per bin, KL divergence from uniform. N×N PAC matrix: entry [i,j] = MI(phase_i, amplitude_j).
Central to neuroscience — cross-frequency coupling between brain oscillation bands (theta-gamma, alpha-beta).
pac ¶
Tort 2010 phase-amplitude coupling with 5-backend fallback chain.
Follows feedback_module_standard_attnres.md:
modulation_index— scalar Tort 2010 MI on a single (θ_low, a_high) pair of time series.pac_matrix—(N, N)pairwise MI matrix overNoscillator phase / amplitude channels.pac_gate— pure-Python boolean gate on an MI value (no backend dispatch needed — trivial comparison).
All compute kernels are available in Rust, Mojo, Julia, Go, Python.
AVAILABLE_BACKENDS reports detected backends in canonical fallback order,
while ACTIVE_BACKEND is selected by a small import-time hot-path probe so
slow external wrappers do not displace the faster local path.
Functions:¶
modulation_index ¶
Phase-amplitude coupling via Tort et al. 2010, J. Neurophysiol.
Bins amplitude by phase, computes KL divergence from uniform,
returns the modulation index normalised to [0, 1] by
log(n_bins).
Parameters¶
theta_low : FloatArray
Low-frequency driver phase in radians, shape (T,).
amp_high : FloatArray
High-frequency amplitude envelope, shape (T,).
n_bins : int
Number of phase bins used for the modulation-index histogram.
Returns¶
float The Tort modulation index of phase-amplitude coupling.
Raises¶
ValueError
If n_bins is not a positive integer or inputs mismatch.
Source code in src/scpn_phase_orchestrator/upde/pac.py
pac_matrix ¶
pac_matrix(
phases_history: FloatArray,
amplitudes_history: FloatArray,
n_bins: int = 18,
) -> FloatArray
Return the (N, N) PAC matrix [i, j] = MI(phase_i, amplitude_j).
Parameters¶
phases_history : FloatArray
(T, N) phase time series.
amplitudes_history : FloatArray
(T, N) amplitude time series.
n_bins : int
number of phase bins.
Returns¶
FloatArray
FloatArray The (N, N) phase-amplitude coupling matrix.
Raises¶
ValueError
If n_bins is not positive or the histories have mismatched shapes.
Source code in src/scpn_phase_orchestrator/upde/pac.py
pac_gate ¶
Binary gate: True when PAC exceeds threshold.
Pure-Python helper; no dispatcher — the comparison is trivial.
Parameters¶
pac_value : float A phase-amplitude coupling value. threshold : float Decision threshold.
Returns¶
bool
True when the PAC value exceeds the threshold.
Source code in src/scpn_phase_orchestrator/upde/pac.py
Chimera State Detection¶
Detects chimera states: coexisting coherent and incoherent clusters within the same network. Uses local order parameter R_i based on neighborhood coupling.
- Coherent: R_i > 0.7
- Incoherent: R_i < 0.3
- Boundary: in-between
- Chimera index = boundary_count / N
Detects phase transitions that global R misses.
chimera ¶
Chimera state detection with a 5-backend fallback chain.
Kuramoto & Battogtokh 2002, Nonlinear Phenomena in Complex Systems
5:380–385. An oscillator i is coherent when its local order
parameter R_i = |⟨exp(i(θ_j − θ_i))⟩_{j ∈ N(i)}| exceeds the
coherence threshold, incoherent when it falls below the incoherence
threshold. The chimera index is the fraction of oscillators that sit
in the boundary band in between.
Compute surface:
- :func:
local_order_parameter—(N,)per-oscillatorR_ivector; the coupling diagonal must be zero so self-coupling is never counted as a neighbour. - :func:
detect_chimera— classification wrapper returning :class:ChimeraState.
Entrainment Verification Score (EVS)¶
Three-criterion battery for rigorous entrainment validation:
- ITPC (inter-trial phase coherence) persistence
- Survival during stimulus pause
- Frequency specificity (ratio at target vs control frequency)
Distinguishes true entrainment from broadband phase-locking artifacts.
EVS and phase-locking metrics for finite two-dimensional phase recordings.
The module implements ITPC, persistence across pauses, and
frequency-specificity checks for Entrainment Verification Signals. A Rust
extension is used when available while the Python fallback remains the
reference-compatible path. Inputs are normalized to finite trials x time
phase arrays, pause indices are bounds-checked, and candidate frequency vectors
must match the trial axis before evidence is reported.
Partial Information Decomposition (PID)¶
Decomposes mutual information into:
- Redundancy: shared information from both oscillator groups
- Synergy: information present only in the joint group
Detects when groups carry synergistic (non-redundant) information about global phase (Williams & Beer 2010).
pid ¶
Partial information decomposition (PID) about global synchronisation.
Decomposes two oscillator groups with a 5-backend fallback chain.
Model¶
Williams & Beer 2010 (Nonnegative Decomposition of Multivariate Information,
arXiv:1004.2515) decompose the information two sources carry about a target into
redundant, unique, and synergistic parts. Estimating it needs a distribution,
so the input is a phase history (T, N) (T timesteps, N
oscillators). Each timestep is reduced to three circular observables:
- target
Y_t— the global order-parameter phase∠⟨e^{iθ}⟩over all oscillators, - source
A_t— the group-A order-parameter phase, - source
B_t— the group-B order-parameter phase.
The three series are binned into n_bins equal-width phase bins and the joint
distribution is estimated over the T samples.
Decomposition¶
With the specific information I_spec(Y=y; S) = Σ_s p(s|y)·log[p(y|s)/p(y)]:
redundancy I_red = Σ_y p(y)·min( I_spec(Y=y; A), I_spec(Y=y; B) )
synergy I_syn = MI(A,B; Y) − MI(A; Y) − MI(B; Y) + I_red
I_red is the Williams & Beer I_min redundancy; the unique information of
each source is MI(S; Y) − I_red and MI(A; Y) = I_red + U_A holds by
construction. All terms are non-negative.
A single snapshot (T = 1) carries no distributional information, so every
component is 0; meaningful decomposition needs T ≥ 2.
Functions:¶
redundancy ¶
redundancy(
phases: FloatArray,
group_a: list[int] | IntArray,
group_b: list[int] | IntArray,
n_bins: int = _DEFAULT_BINS,
) -> float
Redundant information both groups share about the global phase.
I_red = Σ_y p(y)·min(I_spec(Y=y; A), I_spec(Y=y; B)) (Williams & Beer
2010 I_min). phases is a (T, N) phase history.
Parameters¶
phases : FloatArray
Oscillator phases in radians, shape (N,).
group_a : list[int] | IntArray
Indices of the first oscillator group.
group_b : list[int] | IntArray
Indices of the second oscillator group.
n_bins : int
Number of histogram bins.
Returns¶
float The redundant information the groups share about the global phase.
Source code in src/scpn_phase_orchestrator/monitor/pid.py
synergy ¶
synergy(
phases: FloatArray,
group_a: list[int] | IntArray,
group_b: list[int] | IntArray,
n_bins: int = _DEFAULT_BINS,
) -> float
Synergistic information present only in the joint (A, B).
I_syn = MI(A,B; Y) − MI(A; Y) − MI(B; Y) + I_red. Positive synergy means
the combined group carries information about the global state that neither
subgroup carries alone. phases is a (T, N) phase history.
Parameters¶
phases : FloatArray
Oscillator phases in radians, shape (N,).
group_a : list[int] | IntArray
Indices of the first oscillator group.
group_b : list[int] | IntArray
Indices of the second oscillator group.
n_bins : int
Number of histogram bins.
Returns¶
float
The synergistic information present only in the joint (A, B).
Source code in src/scpn_phase_orchestrator/monitor/pid.py
Lyapunov Exponent¶
Real-time estimation of the maximal Lyapunov exponent. Positive = chaos, zero = edge of chaos (critical), negative = stable attractor.
lyapunov ¶
Lyapunov stability monitor with a 5-backend fallback chain.
Two public surfaces:
- :class:
LyapunovGuard— stateful observer that tracks the Lyapunov functionV(θ) = -(K/2N) Σ_ij A_ij cos(θ_i − θ_j), its numerical time derivative, and basin-of-attraction membership (van Hemmen & Wreszinski 1993). Single-backend NumPy; inexpensive per call. - :func:
lyapunov_spectrum— full Lyapunov spectrum via periodic QR reorthogonalisation (Benettin 1980 / Shimada-Nagashima 1979). Multi- backend; the heavy kernel is dispatched to Rust → Mojo → Julia → Go → Python in order of availability.
Classes¶
LyapunovState
dataclass
¶
Lyapunov function V, dV/dt, basin membership, and max phase diff.
Methods:¶
__post_init__ ¶
Normalize scalar aliases and reject invalid state fields.
Source code in src/scpn_phase_orchestrator/monitor/lyapunov.py
LyapunovGuard ¶
Lyapunov stability monitor for Kuramoto networks.
V(θ) = -(K/2N) Σ_{i,j} A_ij cos(θ_i - θ_j)
dV/dt ≤ 0 for gradient flow (Kuramoto is gradient on V). Basin of attraction: max|θ_i - θ_j| < π/2 for connected pairs.
van Hemmen & Wreszinski 1993, J. Stat. Phys. 72:145-166.
Create a guard with a validated geodesic basin threshold.
Source code in src/scpn_phase_orchestrator/monitor/lyapunov.py
Methods:¶
evaluate ¶
Compute Lyapunov function, its time derivative, and basin check.
Parameters¶
phases : object
Oscillator phases in radians, shape (N,).
knm : object
Coupling matrix K_nm, shape (N, N).
Returns¶
LyapunovState The Lyapunov value, its derivative, and the basin-check result.
Source code in src/scpn_phase_orchestrator/monitor/lyapunov.py
Functions:¶
lyapunov_spectrum ¶
lyapunov_spectrum(
phases_init: object,
omegas: object,
knm: object,
alpha: object,
dt: object = 0.01,
n_steps: object = 1000,
qr_interval: object = 10,
zeta: object = 0.0,
psi: object = 0.0,
) -> FloatArray
Full Lyapunov spectrum (all N exponents) via QR decomposition.
Evolves N perturbation vectors alongside the Kuramoto ODE. Every
qr_interval steps, QR-reorthogonalises and accumulates growth
rates from the diagonal of R.
Benettin et al. 1980, Meccanica 15:9-20. Shimada & Nagashima 1979, Prog. Theor. Phys. 61:1605-1616.
Dispatches to the first available backend per the SPO fallback chain (Rust → Mojo → Julia → Go → Python). All five produce the same exponents up to floating-point rounding; the dispatcher's choice only affects wall-clock cost.
Parameters¶
phases_init : object (N,) initial phases. omegas : object (N,) natural frequencies. knm : object (N, N) coupling matrix. alpha : object (N, N) phase-lag matrix. dt : object integration timestep. n_steps : object total integration steps. qr_interval : object steps between QR reorthogonalisations. zeta : object driver strength. psi : object target driver phase.
Returns¶
FloatArray (N,) array of Lyapunov exponents, sorted descending.
Raises¶
ValueError If the integration parameters are invalid.
Source code in src/scpn_phase_orchestrator/monitor/lyapunov.py
567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 | |
Entropy Production¶
Measures thermodynamic irreversibility of the phase dynamics. Higher entropy production = system further from equilibrium.
entropy_prod ¶
Overdamped-Kuramoto thermodynamic dissipation rate with a 5-backend chain.
Σ = Σ_i (dθ_i/dt)² · dt
dθ_i/dt = ω_i + (α / N) · Σ_j K_ij · sin(θ_j − θ_i)
Zero at frequency-locked fixed points; positive otherwise. Reference: Acebrón et al. 2005, Rev. Mod. Phys. 77:137–185.
Functions:¶
entropy_production_rate ¶
entropy_production_rate(
phases: object,
omegas: object,
knm: object,
alpha: object,
dt: object,
) -> float
Thermodynamic dissipation rate Σ (dθ/dt)² · dt.
dθ_i/dt = ω_i + (α / N) Σ_j K_ij sin(θ_j − θ_i). Zero at
frequency-locked fixed points; positive otherwise.
Acebrón et al. 2005, Rev. Mod. Phys. 77:137–185.
Parameters¶
phases : object
(N,) instantaneous phases in radians.
omegas : object
(N,) natural frequencies.
knm : object
(N, N) coupling matrix.
alpha : object
global coupling strength.
dt : object
integration timestep for the · dt factor.
Returns¶
float Non-negative dissipation scalar.
Raises¶
ValueError If the inputs are non-finite or mismatched.
Source code in src/scpn_phase_orchestrator/monitor/entropy_prod.py
Winding Number¶
Topological charge of phase trajectories. Counts how many times the phase wraps around the circle. Integer-valued topological invariant.
winding ¶
Cumulative winding-number tracker with a 5-backend fallback chain.
w_i = floor(Σ_t wrap(Δθ_{i,t}) / 2π) where wrap(x) ∈ (−π, π].
Counts how many full 2π rotations each oscillator completes
across a phase history; positive = counterclockwise, negative =
clockwise.
Functions:¶
winding_numbers ¶
Cumulative winding number of each oscillator over a trajectory.
w_i = floor(Σ_t wrap(Δθ_{i,t}) / 2π) with
wrap(x) ∈ (−π, π].
Parameters¶
phases_history : FloatArray
(T, N) phases in radians.
Returns¶
IntArray
(N,) int64 array of winding numbers.
Source code in src/scpn_phase_orchestrator/monitor/winding.py
winding_vector ¶
N-dimensional integer classification vector from winding numbers.
Alias for :func:winding_numbers; topologically distinct
trajectories map to distinct integer-lattice points.
Parameters¶
phases_history : FloatArray
Phase history, shape (T, N).
Returns¶
IntArray The integer winding classification vector.
Source code in src/scpn_phase_orchestrator/monitor/winding.py
Inter-Trial Phase Coherence (ITPC)¶
Phase consistency across repeated trials or time windows. Standard neuroscience measure for event-related phase locking.
itpc ¶
Lachaux 1999 inter-trial phase coherence with a 5-backend fallback chain.
Two kernels:
- :func:
compute_itpc— ITPC across trials at each time point. - :func:
itpc_persistence— mean ITPC at stimulus-pause indices.
Functions:¶
compute_itpc ¶
Inter-Trial Phase Coherence at each time point.
ITPC = |mean(exp(i·θ))| across trials (Lachaux et al. 1999).
Parameters¶
phases_trials : object
shape (n_trials, n_timepoints) — phases in radians. A 1-D input is treated
as a single trial.
Returns¶
FloatArray
(n_timepoints,) array of ITPC values in [0, 1].
Source code in src/scpn_phase_orchestrator/monitor/itpc.py
itpc_persistence ¶
Mean ITPC at stimulus-pause indices.
Distinguishes true neural entrainment from evoked response: if ITPC remains high after the driving stimulus stops, oscillators have genuinely phase-locked. If it drops immediately, the response was merely evoked.
Parameters¶
phases_trials : object
(n_trials, n_timepoints) phases in radians.
pause_indices : object
time-point indices falling within / after a pause.
Returns¶
float
Mean ITPC across pause_indices. 0.0 if empty.
Source code in src/scpn_phase_orchestrator/monitor/itpc.py
Coupling Estimation from Data¶
Two methods for inferring coupling from observed time series:
- Basic: least-squares fit of dθ/dt - ω = Σ K_ij sin(θ_j - θ_i)
- Harmonics: higher Fourier harmonics for non-sinusoidal coupling
The harmonics method captures real biological coupling shapes (Stankovski 2017).
coupling_est ¶
Least-squares coupling estimators for observed phase trajectories.
The primary estimator fits pairwise sinusoidal Kuramoto coupling from phase-history derivatives and natural frequencies, returning a dense matrix with zero diagonal. The harmonics variant expands the regression library with higher Fourier sine and cosine terms. Both routines are offline inference helpers: they estimate parameters from caller-provided arrays and perform no runtime actuation or binding updates.
Functions:¶
estimate_coupling ¶
Estimate K_ij coupling matrix from observed phase trajectories.
Least-squares fit of dθ_i/dt - ω_i = Σ_j K_ij sin(θ_j - θ_i). Constructs the regression matrix from pairwise sin(Δθ) and solves for K_ij via pseudoinverse.
Parameters¶
phases : FloatArray (n_oscillators, n_timesteps) phase trajectories. omegas : FloatArray (n_oscillators,) natural frequencies. dt : float timestep between samples.
Returns¶
FloatArray (n_oscillators, n_oscillators) estimated coupling matrix K_ij.
Raises¶
ValueError If the inputs are invalid or inconsistent.
Source code in src/scpn_phase_orchestrator/autotune/coupling_est.py
estimate_coupling_harmonics ¶
estimate_coupling_harmonics(
phases: FloatArray,
omegas: FloatArray,
dt: float,
n_harmonics: int = 2,
) -> dict[str, FloatArray]
Estimate coupling with higher Fourier harmonics.
Fits: dθ_i/dt - ω_i = Σ_j Σ_k [a_jk sin(k·Δθ) + b_jk cos(k·Δθ)] for k = 1..n_harmonics.
Real biological oscillators have non-sinusoidal coupling (Stankovski 2017, Rev. Mod. Phys.).
Returns dict with keys 'sin_1', 'cos_1', 'sin_2', 'cos_2', ... each an (n, n) matrix of coefficients.
Parameters¶
phases : FloatArray
Oscillator phases in radians, shape (N,).
omegas : FloatArray
Natural frequencies in rad/s, shape (N,).
dt : float
Integration step size.
n_harmonics : int
Number of harmonics to fit.
Returns¶
dict[str, FloatArray] Coupling with higher Fourier harmonics.
Raises¶
ValueError If the inputs are invalid or inconsistent.
Source code in src/scpn_phase_orchestrator/autotune/coupling_est.py
169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 | |
Read with operational intent¶
Most monitors are most useful when compared over time and context, not as single point alarms. A practical dashboard should show short-term and rolling-window views side by side, then correlate alarms with known interventions.
The intended use is:
- detect onset conditions with one or two fast indicators,
- confirm with a slower structural monitor,
- only then trigger policy or supervisory changes.
Synthetic HCP Connectome Generation¶
Generates neuroscience-realistic coupling matrices inspired by the Human Connectome Project:
- Intra-hemispheric exponential distance decay
- Inter-hemispheric corpus callosum pattern
- Default Mode Network hub structure
connectome ¶
Synthetic and optional neurolib HCP coupling loaders.
load_hcp_connectome generates a deterministic HCP-inspired synthetic matrix
with explicit non-real-data provenance. load_neurolib_hcp is the optional real
HCP path and fails with an import error when neurolib is unavailable. Both
paths return non-negative zero-diagonal structural coupling matrices suitable
for examples, validation, and explicit downstream review.
Functions:¶
load_neurolib_hcp ¶
Load real HCP structural connectivity from neurolib.
Parameters¶
n_regions : int number of regions to return (max 80). If < 80, returns the top-left (n_regions, n_regions) submatrix.
Returns¶
FloatArray Symmetric non-negative coupling matrix, shape (n_regions, n_regions).
Raises¶
ImportError If neurolib is not installed. ValueError If n_regions < 2 or > 80.
Source code in src/scpn_phase_orchestrator/coupling/connectome.py
load_hcp_connectome ¶
Generate a synthetic HCP-inspired coupling matrix.
Parameters¶
n_regions : int number of cortical regions (must be >= 2, even recommended).
Returns¶
FloatArray Symmetric coupling matrix, shape (n_regions, n_regions), zero diagonal.
Source code in src/scpn_phase_orchestrator/coupling/connectome.py
Monitoring stack as a decision chain¶
Treat this page as a decision chain for escalation, not a list of separate tools. The intended order is:
- start with one global stability indicator,
- confirm structural coherence with pairwise and topology-aware indicators,
- apply causal or energetic checks before any bounded actuation proposal.
The sequence is designed to reduce false positives and preserve audit quality.
Minimal observability profile¶
A practical minimum profile for a first production pilot is:
order_parameterfor baseline synchrony,lyapunovfor local stability trend,- one causal or directional metric (
coupling_estoritpc), - one action governance metric (
evsorpid).
This gives enough signal to decide whether a policy should stay static, reduce its scope, or escalate to broader review.