Commit 837fabb
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 837fabb
2 files changed
Lines changed: 32 additions & 3 deletions
| 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 | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
| 12 | + | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
250 | 250 | | |
251 | 251 | | |
252 | 252 | | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
253 | 282 | | |
0 commit comments