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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a
i
n
i
n
g
l
a
y
e
r
s
.
D
e
t
a
i
l
s
a
n
d
O
p
t
i
o
n
s
▪
The result of
R
a
n
d
o
m
T
e
n
s
o
r
N
e
t
w
o
r
k
is a
T
e
n
s
o
r
N
e
t
w
o
r
k
object; all its property accessors apply (
"
T
e
n
s
o
r
s
"
,
"
H
y
p
e
r
e
d
g
e
s
"
,
"
F
r
e
e
I
n
d
i
c
e
s
"
,
"
B
o
n
d
s
"
,
…
).
▪
For the general graph form, the rank of each vertex is sampled uniformly from
{
V
e
r
t
e
x
D
e
g
r
e
e
[
v
]
,
V
e
r
t
e
x
D
e
g
r
e
e
[
v
]
+
r
}
; the extra legs are free indices of the resulting network.
▪
Free leg dimensions match bond dimensions: with the
{
d
i
m
}
form every index has dimension
d
i
m
; with the
m
a
x
D
i
m
form every index dimension is an independent random integer in
{
2
,
m
a
x
D
i
m
}
.
▪
For named topologies the indices are integer labels assigned in a fixed, predictable layout. For an MPS of length
n
, bond indices use
1
,
…
,
n
-
1
and physical indices use
n
+
1
,
…
,
2
n
.
▪
For an MPO of length
n
, physical input indices start at
n
+
1
and physical output indices at
2
n
+
1
; this leaves the bulk bond labels
1
,
…
,
n
-
1
untouched.
▪
The scalar-arguments form
"
P
E
P
S
"
[
r
o
w
s
,
c
o
l
s
,
χ
,
d
]
is equivalent to the list-arguments form
"
P
E
P
S
"
[
{
r
o
w
s
,
c
o
l
s
}
,
χ
,
d
]
.
▪
Tensor entries are independent draws from a uniform distribution on
{
-
1
,
1
}
(real) or on a complex square of side
2
centered at the origin (
"
C
o
m
p
l
e
x
"
). The state is not normalized.
▪
The following options can be given:
M
e
t
h
o
d
A
u
t
o
m
a
t
i
c
u
s
e
r
e
a
l
(
d
e
f
a
u
l
t
)
o
r
c
o
m
p
l
e
x
r
a
n
d
o
m
t
e
n
s
o
r
s
"
B
o
u
n
d
a
r
y
"
"
O
p
e
n
"
f
o
r
c
h
a
i
n
t
o
p
o
l
o
g
i
e
s
(
M
P
S
,
T
T
,
M
P
O
)
,
c
h
o
o
s
e
"
O
p
e
n
"
o
r
"
P
e
r
i
o
d
i
c
"
Examples
(
2
1
)
Basic Examples
(
4
)
Create a random tensor network from a small random graph:
I
n
[
1
]
:
=
R
a
n
d
o
m
T
e
n
s
o
r
N
e
t
w
o
r
k
[
{
5
,
8
}
,
3
]
O
u
t
[
1
]
=
T
e
n
s
o
r
N
e
t
w
o
r
k
T
e
n
s
o
r
s
:
5
B
i
n
a
r
y
:
Y
e
s
F
r
e
e
i
n
d
i
c
e
s
:
4
S
p
a
r
s
e
:
N
o
O
u
t
p
u
t
d
i
m
e
n
s
i
o
n
:
1
6
Create a random Matrix Product State of length 4 with bond dimension 2:
I
n
[
1
]
:
=
R
a
n
d
o
m
T
e
n
s
o
r
N
e
t
w
o
r
k
[
"
M
P
S
"
[
4
,
2
,
2
]
]
O
u
t
[
1
]
=
T
e
n
s
o
r
N
e
t
w
o
r
k
T
e
n
s
o
r
s
:
4
B
i
n
a
r
y
:
Y
e
s
F
r
e
e
i
n
d
i
c
e
s
:
4
S
p
a
r
s
e
:
N
o
O
u
t
p
u
t
d
i
m
e
n
s
i
o
n
:
1
6
Use periodic boundary conditions to get a uniform ring of rank-3 tensors:
I
n
[
1
]
:
=
R
a
n
d
o
m
T
e
n
s
o
r
N
e
t
w
o
r
k
[
"
M
P
S
"
[
4
,
2
,
2
]
,
"
B
o
u
n
d
a
r
y
"
"
P
e
r
i
o
d
i
c
"
]
O
u
t
[
1
]
=
T
e
n
s
o
r
N
e
t
w
o
r
k
T
e
n
s
o
r
s
:
4
B
i
n
a
r
y
:
Y
e
s
F
r
e
e
i
n
d
i
c
e
s
:
4
S
p
a
r
s
e
:
N
o
O
u
t
p
u
t
d
i
m
e
n
s
i
o
n
:
1
6
Properties of the generated network can be queried directly:
I
n
[
1
]
:
=
R
a
n
d
o
m
T
e
n
s
o
r
N
e
t
w
o
r
k
[
"
M
P
S
"
[
4
,
2
,
2
]
]
[
"
H
y
p
e
r
e
d
g
e
s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