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
  • 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
  • SparseTensorNetwork
  • TableauColumns
  • TableauDimension
  • TableauRows
  • TableauShape
  • TableauSize
  • 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`
TensorNetworkContractions
​
TensorNetworkContractions
[tn]
returns the list of index contractions in the tensor network
tn
, with each shared index replaced by the canonical list of its per-tensor labeled occurrences.
​
Details and Options
Examples  
(4)
Scope  
(2)
A 3-tensor chain  
(1)
Build a chain of three tensors sharing pairwise indices 2 and 3:
In[1]:=
tn=TensorNetwork[{RandomReal[{-1,1},{2,2}],RandomReal[{-1,1},{2,2}],RandomReal[{-1,1},{2,2}]},{{1,2},{2,3},{3,4}}]
In[2]:=
TensorNetworkContractions[tn]
Out[2]=
{{
1
1
,{
2
1
,
2
2
}},{{
2
1
,
2
2
},{
3
2
,
3
3
}},{{
3
2
,
3
3
},
4
3
}}
A matrix product state  
(1)

Applications  
(1)

Properties & Relations  
(1)

SeeAlso
TensorNetwork
 
▪
TensorNetworkData
 
▪
TensorNetworkFreeIndices
 
▪
TensorNetworkIndices
 
▪
BinaryTensorNetwork
 
▪
BinaryTensorNetworkQ
TechNotes
▪
Building Tensor Networks
RelatedGuides
▪
TensorNetworks
Get the list of index contractions in a tensor network:
In[1]:=
tn=TensorNetwork[{RandomReal[{-1,1},{2,3}],RandomReal[{-1,1},{3,4}]},{{i,j},{j,k}}]
In[2]:=
TensorNetworkContractions[tn]
Out[2]=

i
1
,
j
1
,
j
2
,
j
1
,
j
2
,
k
2

The shared index
j
has been replaced everywhere it appears by the list
{
j
1
,
j
2
}
of its two per-tensor labels, while the free indices
i
and
k
keep a single labeled occurrence
i
1
and
k
2
.
The same contraction structure is exposed under property syntax:
In[3]:=
tn["Contractions"]
Out[3]=

i
1
,
j
1
,
j
2
,
j
1
,
j
2
,
k
2

""

© 2026 Wolfram. All rights reserved.

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