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
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`
B
i
n
a
r
y
T
e
n
s
o
r
N
e
t
w
o
r
k
B
i
n
a
r
y
T
e
n
s
o
r
N
e
t
w
o
r
k
[
t
n
]
r
e
t
u
r
n
s
a
b
i
n
a
r
y
(
p
a
i
r
w
i
s
e
)
t
e
n
s
o
r
n
e
t
w
o
r
k
e
q
u
i
v
a
l
e
n
t
t
o
t
n
,
i
n
s
e
r
t
i
n
g
a
S
y
m
b
o
l
i
c
D
e
l
t
a
P
r
o
d
u
c
t
A
r
r
a
y
s
p
i
d
e
r
f
o
r
e
v
e
r
y
i
n
d
e
x
t
h
a
t
a
p
p
e
a
r
s
i
n
t
h
r
e
e
o
r
m
o
r
e
t
e
n
s
o
r
s
.
D
e
t
a
i
l
s
a
n
d
O
p
t
i
o
n
s
Examples
(
9
)
Basic Examples
(
2
)
Build a three-tensor network in which the index i2 is shared by all three tensors, so the network is not binary:
I
n
[
1
]
:
=
t
e
n
s
o
r
s
=
R
a
n
d
o
m
R
e
a
l
[
{
-
1
,
1
}
,
{
3
,
2
,
2
,
2
}
]
;
I
n
[
2
]
:
=
t
n
=
T
e
n
s
o
r
N
e
t
w
o
r
k
[
t
e
n
s
o
r
s
,
{
{
i
1
,
i
2
,
i
3
}
,
{
i
2
,
i
4
,
i
5
}
,
{
i
2
,
i
3
,
i
6
}
}
]
O
u
t
[
2
]
=
T
e
n
s
o
r
N
e
t
w
o
r
k
T
e
n
s
o
r
s
:
3
B
i
n
a
r
y
:
N
o
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
Test if it is a binary (pairwise) tensor network:
I
n
[
3
]
:
=
t
n
[
"
B
i
n
a
r
y
Q
"
]
O
u
t
[
3
]
=
F
a
l
s
e
It is clear from the hypergraph that the index i2 is shared by 3 tensors:
I
n
[
4
]
:
=
Q
u
i
e
t
[
t
n
[
"
H
y
p
e
r
g
r
a
p
h
"
]
,
R
e
s
o
u
r
c
e
O
b
j
e
c
t
:
:
u
p
d
a
v
b
]
O
u
t
[
4
]
=
Convert to a binary tensor network. The returned object is itself a
T
e
n
s
o
r
N
e
t
w
o
r
k
object whose summary box reports Binary: Yes:
I
n
[
5
]
:
=
b
i
n
=
B
i
n
a
r
y
T
e
n
s
o
r
N
e
t
w
o
r
k
[
t
n
]
O
u
t
[
5
]
=
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
After binarization the new network reports the binary property as True and has size larger than the original (one extra spider per hyperedge):
I
n
[
6
]
:
=
b
i
n
[
"
B
i
n
a
r
y
Q
"
]
O
u
t
[
6
]
=
T
r
u
e
I
n
[
7
]
:
=
T
e
n
s
o
r
N
e
t
w
o
r
k
S
i
z
e
[
t
n
]
O
u
t
[
7
]
=
3
I
n
[
8
]
:
=
T
e
n
s
o
r
N
e
t
w
o
r
k
S
i
z
e
[
b
i
n
]
O
u
t
[
8
]
=
4
Every standard tensor-network topology (MPS, PEPS, TTN, MERA, MPO) produced by RandomTensorNetwork is already binary. Start from an MPS of length 4:
I
n
[
1
]
:
=
m
p
s
=
B
l
o
c
k
R
a
n
d
o
m
[
S
e
e
d
R
a
n
d
o
m
[
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
I
n
[
2
]
:
=
B
i
n
a
r
y
T
e
n
s
o
r
N
e
t
w
o
r
k
Q
[
m
p
s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