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`
TensorNetworkReplaceIndices
​
TensorNetworkReplaceIndices
[graph,rules]
returns a tensor-network
Graph
whose
"Index"
annotations have been rewritten by applying
rules
to every per-vertex index list.
​
Details and Options
Examples  
(6)
Scope  
(4)
Single rule  
(1)
A single rule can be passed directly, without wrapping it in a list:
In[1]:=
tn=TensorNetwork[{RandomReal[{-1,1},{2,3}],RandomReal[{-1,1},{3,4}]},{{i,j},{j,k}}];
In[2]:=
g=ToTensorNetworkGraph[tn];
In[3]:=
TensorNetworkIndices[TensorNetworkReplaceIndices[g,Superscript[1,1]Superscript[1,"out"]]]
Multiple rules  
(1)

Working with variance  
(1)

Round-trip through TensorNetwork  
(1)

Applications  
(1)

Properties & Relations  
(1)

SeeAlso
TensorNetwork
 
▪
ToTensorNetworkGraph
 
▪
TensorNetworkData
 
▪
TensorNetworkIndices
 
▪
Replace
 
▪
Superscript
 
▪
Subscript
TechNotes
▪
Building Tensor Networks
RelatedGuides
▪
TensorNetworks
Build a small tensor network and convert it to a graph:
In[1]:=
tn=TensorNetwork[{RandomReal[{-1,1},{2,3}],RandomReal[{-1,1},{3,4}]},{{i,j},{j,k}}];
In[2]:=
g=ToTensorNetworkGraph[tn]
The graph's per-vertex index annotations use Superscript/Subscript labels:
In[3]:=
TensorNetworkIndices[g]
Rename a single free index:
In[4]:=
TensorNetworkIndices[TensorNetworkReplaceIndices[g,Superscript[1,1]Superscript[1,"i"]]]
Rename the two free indices in one call by passing a list of rules:
In[5]:=
TensorNetworkIndices[TensorNetworkReplaceIndices[g,{Superscript[1,1]Superscript[1,"a"],Subscript[2,2]Subscript[2,"c"]}]]
""

© 2026 Wolfram. All rights reserved.

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