Commit 1fde7ef
Loosen
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>linkdim(::AbstractITensorNetwork, ::AbstractEdge) signature1 parent c0cb74d commit 1fde7ef
2 files changed
Lines changed: 19 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
556 | 556 | | |
557 | 557 | | |
558 | 558 | | |
559 | | - | |
| 559 | + | |
560 | 560 | | |
561 | 561 | | |
562 | 562 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
250 | 250 | | |
251 | 251 | | |
252 | 252 | | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
253 | 271 | | |
0 commit comments