ITensor / ITensor/ITensorNetworks.jl

Swap the vertex naming convention of `inner_network`

Open
#108 0 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

Currently in inner_network, bra vertices are given the name (v, 1) and ket vertices are given the name (v, 2), for example:

julia> x = random_ttn(siteinds("S=1/2", path_graph(3)))
TreeTensorNetwork{Int64} with 3 vertices:
3-element Vector{Int64}:
 1
 2
 3

and 2 edge(s):
1 => 2
2 => 3

with vertex data:
3-element Dictionaries.Dictionary{Int64, Any}
 1 │ ((dim=2|id=808|"S=1/2,Site,n=1"),)
 2 │ ((dim=2|id=193|"S=1/2,Site,n=2"),)
 3 │ ((dim=2|id=123|"S=1/2,Site,n=3"),)

julia> inner_network(x, x)
ITensorNetwork{Tuple{Int64, Int64}} with 6 vertices:
6-element Vector{Tuple{Int64, Int64}}:
 (1, 1)
 (2, 1)
 (3, 1)
 (1, 2)
 (2, 2)
 (3, 2)

and 7 edge(s):
(1, 1) => (2, 1)
(1, 1) => (1, 2)
(2, 1) => (3, 1)
(2, 1) => (2, 2)
(3, 1) => (3, 2)
(1, 2) => (2, 2)
(2, 2) => (3, 2)

with vertex data:
6-element Dictionaries.Dictionary{Tuple{Int64, Int64}, Any}
 (1, 1) │ ((dim=2|id=808|"S=1/2,Site,n=1"),)
 (2, 1) │ ((dim=2|id=193|"S=1/2,Site,n=2"),)
 (3, 1) │ ((dim=2|id=123|"S=1/2,Site,n=3"),)
 (1, 2) │ ((dim=2|id=808|"S=1/2,Site,n=1"),)
 (2, 2) │ ((dim=2|id=193|"S=1/2,Site,n=2"),)
 (3, 2) │ ((dim=2|id=123|"S=1/2,Site,n=3"),)

I think it would be nicer if this convention was reversed.

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 locating the inner_network entry point and inspect how it assigns tuple names to bra and ket vertices. Reverse the convention so bra vertices use (v, 2) and ket vertices use (v, 1), then verify that the resulting network has the expected vertex names and edges.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
backend
Issue type
Refactor
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.