Loosen linkdim(::AbstractITensorNetwork, ::AbstractEdge) signature#373
Merged
Conversation
837fabb to
1fde7ef
Compare
The previous signature
`linkdim(tn::AbstractITensorNetwork{V}, edge::AbstractEdge{V}) where V`
required the network's vertex-type parameter and the edge's vertex-type
parameter to match exactly. For graphs with abstract V (e.g. the
`NamedGraph{Tuple}` produced by `named_binary_tree`, where vertices are
tuples of varying arity), downstream operations can produce edges whose
V parameter is a strict subtype — for example, `subgraph(g, vs)` where
`vs` came from a Dict's keys and concretized to
`Tuple{Int64, Vararg{Int64}}`. In that situation dispatch failed with
`MethodError` even though `linkinds` itself accepts the edge fine.
Drop the `{V}` constraint so `linkdim` accepts any `AbstractEdge`
alongside any `AbstractITensorNetwork`. Behavior is unchanged for cases
that previously dispatched; previously-failing cases now go through.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1fde7ef to
9f112b3
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #373 +/- ##
==========================================
+ Coverage 76.87% 76.91% +0.03%
==========================================
Files 58 58
Lines 2638 2638
==========================================
+ Hits 2028 2029 +1
+ Misses 610 609 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
mtfishman
added a commit
to ITensor/ITensorActions
that referenced
this pull request
May 28, 2026
…@v3) (#119) ## Summary `julia-actions/cache@v3` (introduced via #118) saves caches **on job failure** by default, where v2 only saved on success. The escape hatch documented in the v3 release notes is `save-always: false`. This PR sets that on every `julia-actions/cache@v3` invocation in the reusable workflows here. The new v3 default is reasonable for the common case (test-failure retries reuse the expensive depot install). But when the failure is in the *setup* itself — a half-installed depot, an aborted `Pkg` precompile — the broken state is cached, the restore-key prefix matches subsequent runs, and every retry restores the broken state and fails identically. Reruns alone can't recover; the cache has to be manually evicted or expire. This was hit on [`ITensor/ITensorNetworks.jl#373`](ITensor/ITensorNetworks.jl#373): a fresh Windows run failed in `Pkg.test` precompilation (`ChainRulesCore is required but does not seem to be installed`), the broken state was cached, and two reruns reproduced the failure verbatim by restoring from that cache. Co-authored-by: Claude Opus 4.7 (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
Drop the
where Vconstraint onlinkdim(::AbstractITensorNetwork{V}, ::AbstractEdge{V}). The previous form required the network's vertex-type parameter and the edge's vertex-type parameter to bind to the sameV, which fails when the network'sVis abstract and the edge'sVis a concrete subtype (e.g. anITensorNetwork{Any}paired with aNamedEdge{Int}).linkindsitself accepts the edge in that case, so the constraint was just blocking dispatch unnecessarily.