Make named_binary_tree vertex labels type-stable#173
Merged
Conversation
`named_binary_tree` now labels each vertex with a `Vector{Int}` path from the root (`[1]`, `[1, 1]`, `[1, 2]`, ...) instead of a growing `Tuple`, so the resulting graph has a concrete `vertextype` of `Vector{Int}` rather than the abstract `Tuple`.
The labels previously lived in a `Vector{Tuple}`, and tuples of different lengths can't share a concrete element type, so `vertextype` came out abstract and downstream code parameterized on it lost specialization. The new labels carry the same path contents, now as vectors, so code that referred to binary-tree vertices by their tuple names needs the corresponding `(...)` to `[...]` update.
The `source_name` and `child_name` keyword hooks are unchanged.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The vertex-label change to `named_binary_tree` is breaking, so bump the minor version and the matching `NamedGraphs` compat in the `test`, `docs`, and `examples` subprojects. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jun 25, 2026
mtfishman
added a commit
to ITensor/DataGraphs.jl
that referenced
this pull request
Jun 25, 2026
## Summary Widen the `NamedGraphs` compat to allow v0.12 (ITensor/NamedGraphs.jl#173). That release changes the `named_binary_tree` vertex labels, which DataGraphs does not use, so it stays compatible with both v0.11 and v0.12. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
mtfishman
added a commit
to ITensor/ITensorNetworks.jl
that referenced
this pull request
Jun 25, 2026
## Summary Widen the `NamedGraphs` compat to allow v0.12 (ITensor/NamedGraphs.jl#173). That release changes the `named_binary_tree` vertex labels, which ITensorNetworks does not use, so it stays compatible with both v0.11 and v0.12. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
mtfishman
added a commit
to ITensor/ITensorNetworksNext.jl
that referenced
this pull request
Jun 25, 2026
## Summary Widen the `NamedGraphs` compat to allow v0.12 (ITensor/NamedGraphs.jl#173). That release changes the `named_binary_tree` vertex labels, which ITensorNetworksNext does not use, so it stays compatible with both v0.11 and v0.12. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
named_binary_treenow labels each vertex with aVector{Int}path from the root ([1],[1, 1],[1, 2], ...) instead of a growingTuple, so the resulting graph has a concretevertextypeofVector{Int}rather than the abstractTuple.The labels previously lived in a
Vector{Tuple}, and tuples of different lengths can't share a concrete element type, sovertextypecame out abstract and downstream code parameterized on it lost specialization. The new labels carry the same path contents, now as vectors, so code that referred to binary-tree vertices by their tuple names needs the corresponding(...)to[...]update.This is a breaking release (
0.12.0) since the default vertex names change. Thesource_nameandchild_namekeyword hooks are unchanged.