Wolfram Language Paclet Repository

Community-contributed installable additions to the Wolfram Language

Primary Navigation

    • Cloud & Deployment
    • Core Language & Structure
    • Data Manipulation & Analysis
    • Engineering Data & Computation
    • External Interfaces & Connections
    • Financial Data & Computation
    • Geographic Data & Computation
    • Geometry
    • Graphs & Networks
    • Higher Mathematical Computation
    • Images
    • Knowledge Representation & Natural Language
    • Machine Learning
    • Notebook Documents & Presentation
    • Scientific and Medical Data & Computation
    • Social, Cultural & Linguistic Data
    • Strings & Text
    • Symbolic & Numeric Computation
    • System Operation & Setup
    • Time-Related Computation
    • User Interface Construction
    • Visualization & Graphics
    • Random Paclet
    • Alphabetical List
  • Using Paclets
    • Get Started
    • Download Definition Notebook
  • Learn More about Wolfram Language

TensorNetworks

Guides

  • TensorNetworks

Tech Notes

  • Building Tensor Networks
  • Contraction Paths and Execution
  • Matrix Product States
  • A Working Tour of the Symmetry Functions
  • Tensor Networks Overview
  • Young Tableaux and Tensor Symmetries

Symbols

  • ActivateTensors
  • BinaryTensorNetwork
  • BinaryTensorNetworkQ
  • CanonicalPath
  • CanonicalPathQ
  • ContractIndices
  • ContractionTree
  • EinsteinSummation
  • GreedyContractionPath
  • HookFactor
  • HookLength
  • HookLengths
  • IndexedMultiply
  • InitializeTensorNetwork
  • MetricTensor
  • MetricTensorQ
  • MPSCanonicalForm
  • MPSCanonicalQ
  • MPSEntanglementEntropy
  • MPSNormalize
  • MPSNorm
  • MPSOverlap
  • MPSSchmidtValues
  • MPSTruncate
  • OptimalContractionPath
  • PartitionQ
  • PathIndexContractions
  • PathQ
  • PathToTreePath
  • RandomTensorNetwork
  • SchurDimension
  • SparseTensorNetwork
  • TableauColumns
  • TableauDimension
  • TableauRows
  • TableauShape
  • TableauSize
  • TableauWeylDimension
  • TensorNetworkAdd
  • TensorNetworkContraction
  • TensorNetworkContractions
  • TensorNetworkContract
  • TensorNetworkData
  • TensorNetworkDelete
  • TensorNetworkFreeIndices
  • TensorNetworkGraphData
  • TensorNetworkGraphQ
  • TensorNetworkIndexDimensions
  • TensorNetworkIndexGraph
  • TensorNetworkIndices
  • TensorNetwork
  • TensorNetworkQ
  • TensorNetworkRemoveCycles
  • TensorNetworkReplaceIndices
  • TensorNetworkSize
  • TensorNetworkTensors
  • TensorNetworkToNetGraph
  • ToTensorNetworkGraph
  • TransposePartition
  • TreePathQ
  • TreePathToPath
  • YoungProject
  • YoungSymmetrize
  • YoungTableau
  • YoungTableauQ
Wolfram`TensorNetworks`
TensorNetworkIndexGraph
​
TensorNetworkIndexGraph
[graph]
returns a
Graph
whose vertices are the individual indices of the tensor-network graph
graph
and whose edges encode both contractions between tensors and co-occurrence of indices within each tensor.
​
Details and Options
▪
The input
graph
must be an annotated tensor-network graph satisfying
TensorNetworkGraphQ
. Build one with
ToTensorNetworkGraph
or read it from a
TensorNetwork
object via the
"Graph"
property. The diagnostic check
TensorNetworkGraphQ
[True]
(verbose mode) is used, so invalid inputs leave the expression unevaluated and print messages.
▪
Vertices of the returned graph are individual indices (each a
Superscript
or
Subscript
labeled by its parent tensor's vertex id), so the vertex set is
Catenate
[
TensorNetworkIndices
[graph]]
.
▪
Edges come in two kinds:
▪
• Contraction edges: one directed edge per inter-tensor index contraction, obtained from
EdgeTags
[graph]
. Each tag is a pair
{srcIndex,tgtIndex}
and becomes the directed edge
srcIndextgtIndex
.
▪
• Co-occurrence edges: for each tensor vertex of
graph
, every pair of indices on that tensor is connected by an undirected edge. Equivalently, each tensor contributes a complete subgraph over its own index list.
▪
Additional
Graph
options are forwarded to the returned graph, and
VertexLabels

Automatic
is supplied by default so each vertex is labeled with its index.
▪
The index graph is complementary to
ToTensorNetworkGraph
: in the tensor-network graph, vertices are tensors and edges are contracted indices; in the index graph, vertices are indices and edges record both contractions between tensors and co-occurrence within a tensor.
​
Examples  
(6)
Basic Examples  
(1)
Build an annotated tensor-network graph from a small TensorNetwork:
In[1]:=
tn=
TensorNetwork
[{RandomReal[{-1,1},{2,3}],RandomReal[{-1,1},{3,4}]},{{i,j},{j,k}}];
In[2]:=
graph=
ToTensorNetworkGraph
[tn]
Get the index-connectivity graph; vertices are individual indices and edges connect indices that share a tensor or a contraction:
In[3]:=
TensorNetworkIndexGraph
[graph]
Build the index graph for a 4-site MPS:
In[4]:=
TensorNetworkIndexGraph

ToTensorNetworkGraph

RandomTensorNetwork
["MPS"[4,2,2]]
Forward Graph options to control layout and styling:
In[5]:=
TensorNetworkIndexGraph
[graph,VertexSizeLarge,GraphLayout"RadialEmbedding"]
Scope  
(3)

Applications  
(1)

Properties & Relations  
(1)

SeeAlso
TensorNetwork
 
▪
ToTensorNetworkGraph
 
▪
TensorNetworkGraphQ
 
▪
TensorNetworkIndices
 
▪
TensorNetworkContractions
 
▪
Graph
 
▪
GraphUnion
 
▪
EdgeTags
 
▪
VertexLabels
 
▪
GraphLayout
TechNotes
▪
Building Tensor Networks
RelatedGuides
▪
TensorNetworks
""

© 2026 Wolfram. All rights reserved.

  • Legal & Privacy Policy
  • Contact Us
  • WolframAlpha.com
  • WolframCloud.com