SpectralEntropyLib is an R library providing functions to compute spectral entropies and related information-theoretic quantities for complex networks.
It implements the theoretical framework introduced in:
M. De Domenico, J. Biamonte
Spectral entropies as information-theoretic tools for complex network comparison
Physical Review X, 6(4), 041062 (2016).
https://doi.org/10.1103/PhysRevX.6.041062
Any physical system can be viewed as information implicitly represented in its state.
This library provides computational tools to quantify that information when the system is represented as a network, using techniques inspired by quantum statistical mechanics.
Main tools include:
- Spectral entropies (von Neumann entropy, Rényi q-entropy)
- Generalized divergences (Kullback–Leibler, Jensen–Shannon)
- Information-theoretic distance measures between networks
- Spectral gap profiles and thermodynamic quantities derived from spectra
- Support for edge-colored and multilayer networks
- Visualization utilities for entropy profiles and density matrices
Clone this repository and install locally with devtools:
devtools::install("path/to/SpectralEntropyLib")Dependencies include:
igraphMatrixexpmRSpectraggplot2RColorBrewer
library(SpectralEntropyLib)
library(igraph)
# Example: simple ring graph with 10 nodes
g <- igraph::make_ring(10)
# von Neumann entropy at resolution beta = 0.5
S_vn <- getVNEntropy(g, beta = 0.5)
# Rényi entropy with q = 2
S_renyi <- getRenyiEntropy(g, beta = 0.5, q = 2)
# Jensen–Shannon distance between two networks
g1 <- igraph::make_ring(8)
g2 <- igraph::make_full_graph(8)
dist <- getNetworkDistance(g1, g2, beta = 0.5)
print(S_vn)
print(S_renyi)
print(dist)If you use SpectralEntropyLib in your work, please cite:
- M. De Domenico, J. Biamonte, Spectral entropies as information-theoretic tools for complex network comparison, Physical Review X 6, 041062 (2016).
https://doi.org/10.1103/PhysRevX.6.041062
@article{dedomenico2016spectral,
title={Spectral entropies as information-theoretic tools for complex network comparison},
author={De Domenico, Manlio and Biamonte, Jacob},
journal={Physical Review X},
volume={6},
number={4},
pages={041062},
year={2016},
publisher={American Physical Society}
}This package is released under the MIT License.
See the LICENSE file for details.