Skip to content
This repository has been archived by the owner on Dec 7, 2021. It is now read-only.

A tool for visualizing tensor network contractions.

License

Notifications You must be signed in to change notification settings

ITensor/ITensorsVisualization.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

⚠️ INFO: This repository is deprecated

The functionality of ITensorsVisualization has been moved into the monorepo at ITensors.jl. For the latest ITensor visualization functionality, use particular backend packages such as ITensorUnicodePlots or ITensorGLMakie.

ITensorsVisualization

This is a package for visualizing tensor networks. The main purpose is to use it with the ITensors.jl package to view and debug tensor network contractions, for example:

using ITensors
using ITensorsVisualization

i = Index(2, "index_i")
j = Index(10, "index_j")
k = Index(40, "index_k")
l = Index(40, "index_l")
m = Index(40, "index_m")
A = randomITensor(i, j, k)
B = randomITensor(i, j, l, m)
C = randomITensor(k, l)
# Contract the tensors over the common indices
# and visualize the results
ABC = @visualize A * B * C

A window like the following should appear:

alt text

The visualization makes an initial guess for the locations of the tensors (using NetworkLayout.jl), and then allows users to interactively move the tensors to better locations. You can move the tensors and external indices (the square and circle nodes of the network) by left clicking on a node and dragging it to a new location. You can also right click and drag to translate the entire diagram, and scroll to zoom in and out.

In addition, you can pause the execution between contractions to analyze intermediate results:

julia> AB = @visualize A * B pause = true; ABC = @visualize AB * C;
Press C/c and then Enter to continue:
c

This will first visualize the contraction A * B, wait for the user to respond, and then perform the contraction and continue to visualize and perform contraction AB * C. This is helpful for viewing and debugging multistep contractions.

alt text alt text

About

A tool for visualizing tensor network contractions.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages