Overload of NamedGraphs Functions for DataGraph #20
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.
This is Quick PR to allow a few functions from NamedGraphs.jl to work on a DataGraph.
Specifically these changes allow the functions
parent_graph(dg::DataGraph)
andparent_vertices_to_vertices(dg::DataGraph, args...)
to work by passing to theunderlying_graph
. This is necessary for upcoming changes toITensorNetworks.jl
and I would prefer to do it more generally here than on just theAbstractITensorNetwork
type.There is an implicit assumption here that
underlying_graph(dg)
is anAbstractNamedGraph
as opposed to say aSimpleGraph
(for which it will error). @mtfishman I could add an explicit error check for this if you wish? But this is also our assumption going forward in a lot ofITensorNetworks.jl
code: i.e. that we always work withAbstractNamedGraphs
and that certain functionality will not work if theunderlying_graph
is aSimpleGraph
instead.