Skip to content

Make named_binary_tree vertex labels type-stable#173

Merged
mtfishman merged 2 commits into
mainfrom
mf/typestable-binary-tree-vertices
Jun 25, 2026
Merged

Make named_binary_tree vertex labels type-stable#173
mtfishman merged 2 commits into
mainfrom
mf/typestable-binary-tree-vertices

Conversation

@mtfishman

@mtfishman mtfishman commented Jun 24, 2026

Copy link
Copy Markdown
Member

Summary

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.

This is a breaking release (0.12.0) since the default vertex names change. The source_name and child_name keyword hooks are unchanged.

mtfishman and others added 2 commits June 24, 2026 19:06
`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>
@mtfishman mtfishman enabled auto-merge (squash) June 25, 2026 13:56
@mtfishman mtfishman merged commit b81fe49 into main Jun 25, 2026
19 checks passed
@mtfishman mtfishman deleted the mf/typestable-binary-tree-vertices branch June 25, 2026 13:59
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant