{
 "library": "brainference",
 "version": "1.0.0",
 "root": "8d7193fc97804cdc3aa9080728d8094732206c114f34d36b8ca2b89b943b3990",
 "license": null,
 "slug": "SpectralEntropy",
 "ref": "SpectralEntropy#d557",
 "hash": "sema:SpectralEntropy#mh:SHA-256:d557f8c3d693a0ee6c24c656efb113cf0fab9dabae8c60f5ba1ae076dbc6b79a",
 "stub": "d557",
 "layer": "Infrastructure",
 "type": "Primitives",
 "summary": "Entropy of a graph Laplacian's eigenvalues: the diversity of global flow and relaxation modes",
 "mechanism": "Build the graph Laplacian L. For an undirected graph L = D - A, with D the diagonal degree matrix and A the adjacency matrix. For a directed graph use the incidence matrix B (B_ie = +1 if edge e leaves node i, -1 if it enters, 0 otherwise) and L = B B^T. Take its eigenvalues lambda_i, normalise them to p_i = lambda_i / sum_j lambda_j, and compute H_s = -sum_i p_i log2 p_i, the ShannonEntropy#a177 of the spectrum. Because the Laplacian governs diffusion, synchronisation and relaxation on the graph, H_s describes global structure: a spread-out spectrum (high H_s) means many distinct flow modes, a concentrated spectrum (low H_s) means regular, modular or tightly structured topology. It complements local measures such as DegreeEntropy#a793.",
 "invariants": [
  "Uses the whole eigenvalue spectrum, so it reflects global rather than local structure",
  "Laplacian eigenvalues are non-negative, so the normalised spectrum is a valid distribution",
  "The zero eigenvalues (one per connected component) contribute nothing"
 ],
 "parameters": {},
 "signature": [],
 "preconditions": [],
 "postconditions": [],
 "failure_modes": [
  "Density domination: when the spectrum mostly tracks node or edge count, H_s scales almost perfectly with density and carries little else, so an excellent data collapse can be a trivial one",
  "Comparing spectra of graphs with different Laplacian definitions (combinatorial, normalised, incidence-based)",
  "Eigendecomposition cost on very large graphs"
 ],
 "domain": "",
 "caution": "",
 "sources": [
  {
   "kind": "thesis",
   "id": "do_2026_ant_collective_behavior",
   "note": "Ch. 1.2.1 Eq. 1.2; Ch. 1.3.3 Eqs. 1.8-1.9; Ch. 3.2.1 Eqs. 3.22-3.25; Ch. 4.2.3"
  }
 ],
 "name": "SpectralEntropy",
 "builds_on": [
  {
   "alias": "shannon_entropy",
   "relation": "references",
   "library": "brainference",
   "slug": "ShannonEntropy",
   "ref": "ShannonEntropy#a177",
   "url": "https://semahash.org/vocabularies/brainference/patterns/ShannonEntropy"
  },
  {
   "alias": "degree_entropy",
   "relation": "composes_with",
   "library": "brainference",
   "slug": "DegreeEntropy",
   "ref": "DegreeEntropy#a793",
   "url": "https://semahash.org/vocabularies/brainference/patterns/DegreeEntropy"
  }
 ],
 "related": [],
 "used_by": [
  {
   "slug": "InteractionSequenceEntropySignature",
   "relation": "references",
   "url": "https://semahash.org/vocabularies/brainference/patterns/InteractionSequenceEntropySignature"
  },
  {
   "slug": "SecondOrderInteractionNetwork",
   "relation": "composes_with",
   "url": "https://semahash.org/vocabularies/brainference/patterns/SecondOrderInteractionNetwork"
  }
 ],
 "url": "https://semahash.org/vocabularies/brainference/patterns/SpectralEntropy",
 "md_url": "https://semahash.org/vocabularies/brainference/patterns/SpectralEntropy.md",
 "library_url": "https://semahash.org/vocabularies/brainference"
}
