mercurial.hierarchy.complexity module

Complexity measure Λ(x) for LADDER level classification (Definition 3.2).

class mercurial.hierarchy.complexity.ComplexityMeasure(alpha: float = 1.0, beta: float = 1.0, gamma: float = 0.1)[source]

Bases: object

Computes Λ(x) = α log₂ N_dof + β I_int + γ Σ

where: - N_dof: effective degrees of freedom (rank of covariance matrix) - I_int: integrated information (Φ, simplified from IIT) - Σ: organizational entropy (based on mutual information between components)

Methods

compute(pattern_state)

Compute Λ = α log₂ N_dof + β I_int + γ Σ

effective_dof(pattern_state)

Compute N_dof ≈ rank of covariance matrix (numerical rank).

integrated_information(pattern_state[, ...])

Approximate Φ (I_int) using a simplified IIT measure.

organizational_entropy(pattern_state)

Compute Σ (organizational entropy) based on the distribution of pairwise distances.

compute(pattern_state: ndarray) float[source]

Compute Λ = α log₂ N_dof + β I_int + γ Σ

effective_dof(pattern_state: ndarray) float[source]

Compute N_dof ≈ rank of covariance matrix (numerical rank). Uses singular value decomposition and count singular values above noise floor.

integrated_information(pattern_state: ndarray, partition_minsize: int = 2) float[source]

Approximate Φ (I_int) using a simplified IIT measure. Φ = min_{partition} (I(whole) - Σ I(parts)) We approximate by splitting the dimensions into two random partitions.

organizational_entropy(pattern_state: ndarray) float[source]

Compute Σ (organizational entropy) based on the distribution of pairwise distances. Lower Σ means more ordered organization.

class mercurial.hierarchy.complexity.LevelClassifier[source]

Bases: object

Assigns a LADDER level to a pattern based on its complexity measure. Uses predefined thresholds (calibratable).

Methods

classify(complexity)

Return (level_index, level_name) for given complexity.

get_level_range(pattern_state, measure)

Compute complexity and return level index.

neural_complexity(E, I)

Compute Λ from neural activity (spectral and temporal features).

LEVEL_NAMES = ['Neutral Substrate', 'Quantum-Gravitational', 'Elementary Particles', 'Composite Particles', 'Atomic Species', 'Molecular Aggregates', 'Mesoscale Structures', 'Macroscopic Materials', 'Functional Assemblies', 'Integrated Biological', 'Networked Systems', 'Planetary Systems', 'Interplanetary', 'Interstellar', 'Galactic', 'Intergalactic', 'Cosmic Web', 'Observable Universe', 'Entire Branch']
LEVEL_THRESHOLDS = [0.0, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0]
classmethod classify(complexity: float) Tuple[int, str][source]

Return (level_index, level_name) for given complexity.

classmethod get_level_range(pattern_state: ndarray, measure: ComplexityMeasure) Tuple[int, int][source]

Compute complexity and return level index. Also returns a confidence interval (simplified).

neural_complexity(E: ndarray, I: ndarray) float[source]

Compute Λ from neural activity (spectral and temporal features).