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`
PathToTreePath
​
PathToTreePath
[path]
converts a linear pairwise contraction
path
to a nested tree-form path with auto-derived integer leaves.
​
​
PathToTreePath
[path,indices]
uses the explicit list
indices
as the leaf labels.
​
Details and Options
​
Examples  
(10)
Basic Examples  
(4)
The simplest pairwise path produces a two-leaf tree:
In[1]:=
PathToTreePath[{{1,2}}]
Out[1]=
{{1},{2}}
​
A two-step path builds a deeper tree; the last leaf appears at the top of the tree:
In[1]:=
PathToTreePath[{{1,2},{1,2}}]
Out[1]=
{{3},{{1},{2}}}
​
Pass an explicit list of leaf labels:
In[1]:=
PathToTreePath[{{1,2}},{x,y}]
Out[1]=
{{x},{y}}
​
Derive the leaf labels from a tensor network and pass them as the second argument; the result is the tree path induced by a
GreedyContractionPath
:
In[1]:=
tn=RandomTensorNetwork["MPS"[4,3,2]]
In[2]:=
path=GreedyContractionPath[tn]
Out[2]=
{{2,3},{1,3},{1,2}}
In[3]:=
PathToTreePath[path,tn["Vertices"]]
Out[3]=
{{4},{{1},{{2},{3}}}}
Scope  
(4)

Applications  
(1)

Properties & Relations  
(1)

SeeAlso
TreePathToPath
 
▪
CanonicalPath
 
▪
PathQ
 
▪
CanonicalPathQ
 
▪
TreePathQ
 
▪
PathIndexContractions
TechNotes
▪
Contraction Paths and Execution
RelatedGuides
▪
TensorNetworks
""

© 2026 Wolfram. All rights reserved.

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