-
Notifications
You must be signed in to change notification settings - Fork 4
[PartitionedGraphs] Rename various types and functions to improve clarity. #110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Considering this is technically a breaking change I've opted to increment the minor version number. |
|
Thanks @jack-dunham, I think these names are clearer. @JoeyT1994 let us know what you think of these changes, I think we've discussed these name changes. @jack-dunham when you make breaking changes you need to bump the subdirectory Project.toml compat entries accordingly (i.e. |
|
Yeah I like these name changes -> they are more intuitive and quotient graph is in-line with the definition from the graph-theory community. |
|
@jack-dunham @JoeyT1994 I'll merge this so we can start using it in ITensorNetworksNext.jl. ITensorNetworks.jl and TensorNetworkQuantumSimulator.jl will need to be upgraded but that should be pretty easy since it is just a name change. |
|
Your PR no longer requires formatting changes. Thank you for your contribution! |
This is to make checking of `quotient_edges` etc easier.
|
To summarize: # If you want a non-trivial partitioning, then overload the following function:
partitioned_vertices(g::MyGraphType)
# For fast quotient graph construction and fast `has_edge` at the quotient_graph level:
quotient_graph(g::MyGraphType)
# You should also define the `quotient_graph_type` via:
quotient_graph_type(g::MyGraphType)
# if this is differs from the default give by:
quotient_graph_type(g::AbstractGraph{V}) where {V} = NamedGraph{V}
# For a fast vertex to quotient-vertex map then:
find_quotient_vertex(g::MyGraphType, vertex)
# ...which automatically gives a fast edge to quotient-edge map via:
find_quotient_edge(g, edge) # no need to overload this.
# For fast finding of edge partitions:
partitioned_edges(g::MyGraphType)If any of the above properties are desirable for find_quotient_vertex(g::MyGraphType, vertex) = g.inverse_vertex_map[vertex]where we have chosen to store the map in the field |
|
Thanks for the summary, looks like a good interface. What about the names |
…ove type annotation
- `add_vertex!` not takes the `SuperVertex` argument before the regular vertex argument. - Updated tests to reflect the interface change.
…and `SuperEdge` args.
…interface function Also removed some dead code.
Co-authored-by: Matt Fishman <mtfishman@users.noreply.github.com>
|
@jack-dunham looks like the PR needs formatting. |
|
This looks good to me, thanks for sticking with all the comments. Is this ready on your end? If so I'll merge and register. |
I think I want to spend another hour to do one final pass over the code and write some more tests to check the extra stuff added. Ill let you know when I'm done on my end. |
…ided partitioning is most trival Most trivial as in a vector of vertex groups
… is the quotient vertex type.
…on of `departition`
…type parameter of its underlying graph Co-authored-by: Matt Fishman <mtfishman@users.noreply.github.com>
|
@jack-dunham looks good from my end, ready to merge? |
This PR renames some types and functions in the
PartitionedGraphslibrary for clarity. Specifically:PartitionsGraphView->QuotientGraph.PartitionVertex->SuperVertex.PartitionEdge->SuperEdge.The associated functions pertaining to these types have also been renamed accordingly. I have also attempted to rename local variables to reflect this change.
Tests have been updated, and by some miracle, all passed first time.