Add some AbstractNamedGraph functionalities #8
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Some convenience
AbstractNamedGraph
functionalities that I ended up using quite often, so I though it could make sense to add them here. A summary of the (potential) additions:rename_vertices
which allows renaming the vertices of anAbstractNamedGraph
orAbstractNamedEdge
given aFunction
orDictionary
name map. It is basically the same as the one in https://github.com/mtfishman/ITensorNetworks.jl/blob/main/examples/peps/utils.jl, with some minor adjustments to make it work for all currently existingAbstractNamedGraph
subtypes. In particular, it seemed to make sense to allow renaming to change the vertex type for the case ofNamedGraph
.AbstractNamedGraph
subtypes which just take a list of vertices, similar to howGraphs.Graph(::Integer)
returns a graph with a given number of vertices and no edges.AbstractNamedGraph
s, useful for checking if the underlying graph of two instances of a given data structure is the same.