Skip to content

Commit 31498fe

Browse files
mtfishmanclaude
andcommitted
Inline tensor collection in TreeTensorNetwork docstring example
The intermediate `ITensorNetwork` wrap was redundant — `TreeTensorNetwork` accepts a tensor collection directly. Use a literal vertex label (`[1]`) in `ortho_region` instead of looking it up via `vertices(itn)`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent f29d8cd commit 31498fe

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

src/treetensornetworks/treetensornetwork.jl

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,9 @@ gauge is assumed. To enforce an actual orthogonal gauge, call
5353
```jldoctest
5454
julia> using ITensors: Index, ITensor
5555
56-
julia> using Graphs: vertices
57-
5856
julia> i, j, k = Index(2, "i"), Index(2, "j"), Index(2, "k");
5957
60-
julia> itn = ITensorNetwork([ITensor(i, j), ITensor(j, k)]);
61-
62-
julia> ttn = TreeTensorNetwork(itn; ortho_region = [first(vertices(itn))]);
58+
julia> ttn = TreeTensorNetwork([ITensor(i, j), ITensor(j, k)]; ortho_region = [1]);
6359
6460
```
6561

0 commit comments

Comments
 (0)