AbstractGraph
experimental.network_dynamics.graph.AbstractGraph()Abstract base class for network topology representations.
Defines the interface for network topology that can be used with dynamics. All graph types (dense, sparse, multilayer, etc.) should inherit from this class.
Note: Subclasses should store immutable properties (n_nodes, density, symmetric) as private fields computed during initialization to avoid issues during pytree transformations where weights might not be available.
Attributes
| Name | Description |
|---|---|
| density | Fraction of non-zero connections (excluding diagonal). |
| n_nodes | Number of nodes in the network. |
| region_labels | Labels for each node/region in the network. |
| symmetric | Check if the graph is symmetric (undirected). |
| weights | Weight matrix [n_nodes, n_nodes]. |
Methods
| Name | Description |
|---|---|
| gather_edges | Gather a graph-shaped value in this graph’s public edge order. |
| verify | Verify graph structure and properties. |
gather_edges
experimental.network_dynamics.graph.AbstractGraph.gather_edges(graph_shaped)Gather a graph-shaped value in this graph’s public edge order.
verify
experimental.network_dynamics.graph.AbstractGraph.verify(verbose=True)Verify graph structure and properties.
Args: verbose: Whether to print verification details
Returns: True if verification passes, False otherwise