Wolfram Language
Paclet Repository
Community-contributed installable additions to the Wolfram Language
Primary Navigation
Categories
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
Create a Paclet
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
TreePath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
t
h
e
o
u
t
p
u
t
i
n
d
i
c
e
s
,
a
n
d
a
s
i
z
e
-
p
e
r
-
i
n
d
e
x
A
s
s
o
c
i
a
t
i
o
n
.
D
e
t
a
i
l
s
a
n
d
O
p
t
i
o
n
s
▪
G
r
e
e
d
y
C
o
n
t
r
a
c
t
i
o
n
P
a
t
h
returns the same canonical path format as
O
p
t
i
m
a
l
C
o
n
t
r
a
c
t
i
o
n
P
a
t
h
: a
L
i
s
t
of integer pairs
{
i
,
j
}
in opt_einsum convention. At each step the two tensors at positions
i
and
j
are removed and the contraction result is appended at the end of the list.
▪
The greedy search is
(
n
)
per step in the network size, so it scales to hundreds of tensors where
O
p
t
i
m
a
l
C
o
n
t
r
a
c
t
i
o
n
P
a
t
h
is intractable. Paths are not provably optimal but in practice are within a small constant factor.
▪
The search is backed by the Rust library function
"
o
p
t
i
m
i
z
e
_
g
r
e
e
d
y
"
from
W
o
l
f
r
a
m
/
P
a
c
l
e
t
E
x
t
e
n
s
i
o
n
s
, loaded on first use through
E
x
t
e
n
s
i
o
n
C
a
r
g
o
.
▪
Setting
"
T
e
m
p
e
r
a
t
u
r
e
"
to a numeric value enables stochastic local search; combined with
"
R
a
n
d
o
m
S
e
e
d
"
this produces deterministic-but-randomized paths, useful for benchmarking ensembles.
▪
The following options can be given:
"
M
e
m
o
r
y
W
e
i
g
h
t
"
N
o
n
e
w
e
i
g
h
t
g
i
v
e
n
t
o
i
n
t
e
r
m
e
d
i
a
t
e
-
t
e
n
s
o
r
m
e
m
o
r
y
c
o
s
t
v
s
.
F
L
O
P
s
"
T
e
m
p
e
r
a
t
u
r
e
"
N
o
n
e
s
t
o
c
h
a
s
t
i
c
-
s
e
a
r
c
h
t
e
m
p
e
r
a
t
u
r
e
;
h
i
g
h
e
r
v
a
l
u
e
s
e
x
p
l
o
r
e
m
o
r
e
c
a
n
d
i
d
a
t
e
s
"
M
a
x
N
e
i
g
h
b
o
r
s
"
N
o
n
e
b
e
a
m
w
i
d
t
h
:
n
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