ITensor / ITensor/ITensorNetworks.jl

Confusing `ITensor(::ITensorNetwork)` behavior

Open
#98 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Julia
Stars
128
Forks
23
Avg merge
4d 7h
Merged PRs (30d)
7

Description

The behavior of ITensor(::ITensorNetwork) is confusing, since it outputs a Vector{ITensor}:

julia> tn = randomITensorNetwork(named_grid((2, 2)); link_space=2)
ITensorNetwork{Tuple{Int64, Int64}} with 4 vertices:
4-element Vector{Tuple{Int64, Int64}}:
 (1, 1)
 (2, 1)
 (1, 2)
 (2, 2)

and 4 edge(s):
(1, 1) => (2, 1)
(1, 1) => (1, 2)
(2, 1) => (2, 2)
(1, 2) => (2, 2)

with vertex data:
4-element Dictionaries.Dictionary{Tuple{Int64, Int64}, Any}
 (1, 1) │ ((dim=2|id=727|"1×1↔2×1"), (dim=2|id=273|"1×1↔1×2"))
 (2, 1) │ ((dim=2|id=727|"1×1↔2×1"), (dim=2|id=845|"2×1↔2×2"))
 (1, 2) │ ((dim=2|id=273|"1×1↔1×2"), (dim=2|id=145|"1×2↔2×2"))
 (2, 2) │ ((dim=2|id=845|"2×1↔2×2"), (dim=2|id=145|"1×2↔2×2"))

julia> ITensor(tn)
4-element Vector{ITensor}:
 ITensor ord=2
Dim 1: (dim=2|id=727|"1×1↔2×1")
Dim 2: (dim=2|id=273|"1×1↔1×2")
NDTensors.Dense{Float64, Vector{Float64}}
 2×2
  1.291668655610816    0.5147066921592675
 -0.9207966219752203  -0.687320048765168
 ITensor ord=2
Dim 1: (dim=2|id=727|"1×1↔2×1")
Dim 2: (dim=2|id=845|"2×1↔2×2")
NDTensors.Dense{Float64, Vector{Float64}}
 2×2
 -1.482610874323555   0.2997297254174642
  1.2362723189696732  1.8881470232421553
 ITensor ord=2
Dim 1: (dim=2|id=273|"1×1↔1×2")
Dim 2: (dim=2|id=145|"1×2↔2×2")
NDTensors.Dense{Float64, Vector{Float64}}
 2×2
 -0.3620519644906389  -0.8149107592460717
 -0.6007286129069581  -1.794450655933629
 ITensor ord=2
Dim 1: (dim=2|id=845|"2×1↔2×2")
Dim 2: (dim=2|id=145|"1×2↔2×2")
NDTensors.Dense{Float64, Vector{Float64}}
 2×2
  0.7163493122261674   0.880775856816735
 -0.7909478596586718  -0.5341080305805886

I would have expected it would output an ITensor.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the shown ITensor(::ITensorNetwork) call in the Julia REPL and locate the constructor entry point. Determine whether the documented or intended result is one ITensor or a collection for a network with four vertices, then confirm the chosen behavior with an appropriate regression test or API clarification.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.