topobench.transforms.liftings.graph2cell package#
Graph2Cell liftings with automated exports.
- class CellCycleLifting(max_cell_length=None, **kwargs)#
Bases:
Graph2CellLiftingLift graphs to cell complexes.
The algorithm creates 2-cells by identifying the cycles and considering them as 2-cells.
- Parameters:
- max_cell_lengthint, optional
The maximum length of the cycles to be lifted. Default is None.
- **kwargsoptional
Additional arguments for the class.
- __init__(max_cell_length=None, **kwargs)#
- lift_topology(data)#
Find the cycles of a graph and lifts them to 2-cells.
- Parameters:
- datatorch_geometric.data.Data
The input data to be lifted.
- Returns:
- dict
The lifted topology.
- class DiscreteConfigurationComplexLifting(k, preserve_edge_attr=True, feature_aggregation='concat', **kwargs)#
Bases:
Graph2CellLiftingLift graphs to cell complexes.
Lift graphs to cell complexes by generating the k-th discrete configuration complex D_k(G) of the graph. This is a cube complex, which is similar to a simplicial complex except each n-dimensional cell is homeomorphic to a n-dimensional cube rather than an n-dimensional simplex.
The discrete configuration complex of order k consists of all sets of k unique edges or vertices of G, with the additional constraint that if an edge e is in a cell, then neither of the endpoints of e are in the cell. For examples of different graphs and their configuration complexes, see the tutorial.
Note that since TopoNetx only supports cell complexes of dimension 2, if you generate a configuration complex of order k > 2 this will only produce the 2-skeleton.
- Parameters:
- kint
The order of the configuration complex, i.e. the number of ‘agents’ in a single configuration.
- preserve_edge_attrbool, optional
Whether to preserve edge attributes. Default is True.
- feature_aggregationstr, optional
For a k-agent configuration, the method by which the features are aggregated. Can be “mean”, “sum”, or “concat”. Default is “concat”.
- **kwargsdict, optional
Additional arguments for the class.
Notes
The discrete configuration complex provides a way to model higher-order interactions in graphs, particularly useful for scenarios involving multiple agents or particles moving on a graph structure.
- __init__(k, preserve_edge_attr=True, feature_aggregation='concat', **kwargs)#
- forward(data)#
Apply the full lifting (topology + features) to the input data.
- Parameters:
- datatorch_geometric.data.Data
The input data to be lifted.
- Returns:
- torch_geometric.data.Data
The lifted data.
- lift_topology(data)#
Generate the cubical complex of discrete graph configurations.
- Parameters:
- datatorch_geometric.data.Data
The input data to be lifted.
- Returns:
- dict
The lifted topology.
- class Graph2CellLifting(complex_dim=2, **kwargs)#
Bases:
GraphLiftingAbstract class for lifting graphs to cell complexes.
- Parameters:
- complex_dimint, optional
The dimension of the cell complex to be generated. Default is 2.
- **kwargsoptional
Additional arguments for the class.
- __init__(complex_dim=2, **kwargs)#
Submodules#
- topobench.transforms.liftings.graph2cell.base module
CellComplexCellComplex.__init__()CellComplex.add_cell()CellComplex.add_cells_from()CellComplex.add_edge()CellComplex.add_edges_from()CellComplex.add_node()CellComplex.adjacency_matrix()CellComplex.all_cell_to_node_coadjacency_matrix()CellComplex.cell_neighbors()CellComplex.clear()CellComplex.clone()CellComplex.coadjacency_matrix()CellComplex.degree()CellComplex.dirac_operator_matrix()CellComplex.down_laplacian_matrix()CellComplex.euler_characterisitics()CellComplex.from_networkx_graph()CellComplex.from_trimesh()CellComplex.get_cell_attributes()CellComplex.get_cell_data()CellComplex.get_edge_attributes()CellComplex.get_filtration()CellComplex.get_linegraph()CellComplex.get_node_attributes()CellComplex.hodge_laplacian_matrix()CellComplex.incidence_matrix()CellComplex.is_connected()CellComplex.is_insertable_cycle()CellComplex.load_mesh()CellComplex.neighbors()CellComplex.node_to_all_cell_adjacnecy_matrix()CellComplex.node_to_all_cell_incidence_matrix()CellComplex.number_of_cells()CellComplex.number_of_edges()CellComplex.number_of_nodes()CellComplex.order()CellComplex.remove_cell()CellComplex.remove_cells()CellComplex.remove_equivalent_cells()CellComplex.remove_node()CellComplex.remove_nodes()CellComplex.remove_singletons()CellComplex.restrict_to_cells()CellComplex.restrict_to_nodes()CellComplex.set_cell_attributes()CellComplex.set_cell_data()CellComplex.set_edge_attributes()CellComplex.set_filtration()CellComplex.set_node_attributes()CellComplex.singletons()CellComplex.size()CellComplex.skeleton()CellComplex.to_colored_hypergraph()CellComplex.to_combinatorial_complex()CellComplex.to_hasse_graph()CellComplex.to_hypergraph()CellComplex.up_laplacian_matrix()CellComplex.cellsCellComplex.dimCellComplex.edgesCellComplex.is_regularCellComplex.maxdimCellComplex.nodesCellComplex.shape
Graph2CellLiftingGraphLiftingget_complex_connectivity()
- topobench.transforms.liftings.graph2cell.cycle_lifting module
CellComplexCellComplex.__init__()CellComplex.add_cell()CellComplex.add_cells_from()CellComplex.add_edge()CellComplex.add_edges_from()CellComplex.add_node()CellComplex.adjacency_matrix()CellComplex.all_cell_to_node_coadjacency_matrix()CellComplex.cell_neighbors()CellComplex.clear()CellComplex.clone()CellComplex.coadjacency_matrix()CellComplex.degree()CellComplex.dirac_operator_matrix()CellComplex.down_laplacian_matrix()CellComplex.euler_characterisitics()CellComplex.from_networkx_graph()CellComplex.from_trimesh()CellComplex.get_cell_attributes()CellComplex.get_cell_data()CellComplex.get_edge_attributes()CellComplex.get_filtration()CellComplex.get_linegraph()CellComplex.get_node_attributes()CellComplex.hodge_laplacian_matrix()CellComplex.incidence_matrix()CellComplex.is_connected()CellComplex.is_insertable_cycle()CellComplex.load_mesh()CellComplex.neighbors()CellComplex.node_to_all_cell_adjacnecy_matrix()CellComplex.node_to_all_cell_incidence_matrix()CellComplex.number_of_cells()CellComplex.number_of_edges()CellComplex.number_of_nodes()CellComplex.order()CellComplex.remove_cell()CellComplex.remove_cells()CellComplex.remove_equivalent_cells()CellComplex.remove_node()CellComplex.remove_nodes()CellComplex.remove_singletons()CellComplex.restrict_to_cells()CellComplex.restrict_to_nodes()CellComplex.set_cell_attributes()CellComplex.set_cell_data()CellComplex.set_edge_attributes()CellComplex.set_filtration()CellComplex.set_node_attributes()CellComplex.singletons()CellComplex.size()CellComplex.skeleton()CellComplex.to_colored_hypergraph()CellComplex.to_combinatorial_complex()CellComplex.to_hasse_graph()CellComplex.to_hypergraph()CellComplex.up_laplacian_matrix()CellComplex.cellsCellComplex.dimCellComplex.edgesCellComplex.is_regularCellComplex.maxdimCellComplex.nodesCellComplex.shape
CellCycleLiftingGraph2CellLifting
- topobench.transforms.liftings.graph2cell.discrete_configuration_complex_lifting module
CellComplexCellComplex.__init__()CellComplex.add_cell()CellComplex.add_cells_from()CellComplex.add_edge()CellComplex.add_edges_from()CellComplex.add_node()CellComplex.adjacency_matrix()CellComplex.all_cell_to_node_coadjacency_matrix()CellComplex.cell_neighbors()CellComplex.clear()CellComplex.clone()CellComplex.coadjacency_matrix()CellComplex.degree()CellComplex.dirac_operator_matrix()CellComplex.down_laplacian_matrix()CellComplex.euler_characterisitics()CellComplex.from_networkx_graph()CellComplex.from_trimesh()CellComplex.get_cell_attributes()CellComplex.get_cell_data()CellComplex.get_edge_attributes()CellComplex.get_filtration()CellComplex.get_linegraph()CellComplex.get_node_attributes()CellComplex.hodge_laplacian_matrix()CellComplex.incidence_matrix()CellComplex.is_connected()CellComplex.is_insertable_cycle()CellComplex.load_mesh()CellComplex.neighbors()CellComplex.node_to_all_cell_adjacnecy_matrix()CellComplex.node_to_all_cell_incidence_matrix()CellComplex.number_of_cells()CellComplex.number_of_edges()CellComplex.number_of_nodes()CellComplex.order()CellComplex.remove_cell()CellComplex.remove_cells()CellComplex.remove_equivalent_cells()CellComplex.remove_node()CellComplex.remove_nodes()CellComplex.remove_singletons()CellComplex.restrict_to_cells()CellComplex.restrict_to_nodes()CellComplex.set_cell_attributes()CellComplex.set_cell_data()CellComplex.set_edge_attributes()CellComplex.set_filtration()CellComplex.set_node_attributes()CellComplex.singletons()CellComplex.size()CellComplex.skeleton()CellComplex.to_colored_hypergraph()CellComplex.to_combinatorial_complex()CellComplex.to_hasse_graph()CellComplex.to_hypergraph()CellComplex.up_laplacian_matrix()CellComplex.cellsCellComplex.dimCellComplex.edgesCellComplex.is_regularCellComplex.maxdimCellComplex.nodesCellComplex.shape
DiscreteConfigurationComplexLiftingGraph2CellLiftingVertexpermutationsedge_cycle_to_vertex_cycle()generate_configuration_class()