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`
TensorNetworkIndexDimensions
​
TensorNetworkIndexDimensions
[tn]
returns the list of
indexdimension
rules for every index occurrence in the tensor network
tn
.
​
​
TensorNetworkIndexDimensions
[indices,tensors]
computes the rules from an explicit list of per-tensor index lists and an explicit list of tensors.
​
​
TensorNetworkIndexDimensions
[net]
returns the index-dimension rules of the graph form
net
.
​
Details and Options
Examples  
(5)
Scope  
(3)
Duplicates for shared indices  
(1)
Each index appears once per occurrence;
TensorNetworkIndexDimensions
does not deduplicate, so a shared label appears as many times as the number of tensors containing it.
In[1]:=
SeedRandom[1];​​tn=
TensorNetwork
[{RandomReal[{-1,1},{2,3}],RandomReal[{-1,1},{3,4}]},{{i,j},{j,k}}];
In[2]:=
TensorNetworkIndexDimensions
[tn]
Out[2]=
{i2,j3,j3,k4}
Wrap with
…
to collapse duplicates into a unique-key lookup table; later rules overwrite earlier ones with the same key, which is safe here because the dimensions agree:
In[3]:=

TensorNetworkIndexDimensions
[tn]
Out[3]=
i2,j3,k4
Or use
GroupBy
[
First
]
to keep every occurrence under its index key, exposing the per-tensor multiplicity:
In[4]:=
GroupBy
TensorNetworkIndexDimensions
[tn],First
Out[4]=
i{i2},j{j3,j3},k{k4}
Graph form  
(1)

Property form  
(1)

Applications  
(1)

Properties & Relations  
(1)

SeeAlso
TensorNetwork
 
▪
TensorNetworkData
 
▪
TensorNetworkIndices
 
▪
TensorNetworkFreeIndices
 
▪
Counts
 
▪
Thread
 
▪
Association
TechNotes
▪
Building Tensor Networks
RelatedGuides
▪
TensorNetworks
Get the dimension of each index occurrence in a tensor network:
In[1]:=
tn=
TensorNetwork
[{RandomReal[{-1,1},{2,3}],RandomReal[{-1,1},{3,4}]},{{1,2},{2,3}}];
In[2]:=
TensorNetworkIndexDimensions
[tn]
Out[2]=
{12,23,23,34}
The shared index
2
appears in both tensors, so it contributes two rules with the same right-hand side. The free indices
1
and
3
contribute one rule each.
The same dimensions show up for a structured network such as a 4-site matrix product state:
In[3]:=
SeedRandom[42];​​
TensorNetworkIndexDimensions

RandomTensorNetwork
["MPS"[4,2,2]]
Out[3]=
{12,52,12,22,62,22,32,72,32,82}
Every bond index (
1
,
2
,
3
) appears twice; every physical index (
5
,
6
,
7
,
8
) appears once. The right-hand sides agree across occurrences of the same index.
The low-level form takes explicit per-tensor indices and dimensions directly, with no TensorNetwork object involved:
In[4]:=
TensorNetworkIndexDimensions
["Indices"{{1,2}},"Dimensions"{{3,4}}]
Out[4]=
{13,24}
The two-argument form is equivalent and takes the dimensions from the tensor list directly:
In[5]:=
TensorNetworkIndexDimensions
[{{1,2},{2,3}},{RandomReal[{-1,1},{2,3}],RandomReal[{-1,1},{3,4}]}]
Out[5]=
{12,23,23,34}
""

© 2026 Wolfram. All rights reserved.

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