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
  • 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
  • TreePathToPath
  • YoungProject
  • YoungSymmetrize
  • YoungTableau
  • YoungTableauQ
Wolfram`TensorNetworks`
MPSTruncate
​
MPSTruncate
[mps,maxBond]
compresses an MPS by truncating every bond to at most
maxBond
singular values. •
​
​
MPSTruncate
[mps,maxBond,"Normalize"False]
returns the compressed MPS without rescaling to unit norm.
​
Details and Options
Examples  
(4)
Scope  
(1)
The compressed MPS has smaller bonds. Compare the bond dictionaries before and after:
In[1]:=
mps=BlockRandomSeedRandom[42];
RandomTensorNetwork
["MPS"[8,4,2]];​​mps["Bonds"]
Out[1]=
{{
1
1
,
1
2
}4,{
2
2
,
2
3
}4,{
3
3
,
3
4
}4,{
4
4
,
4
5
}4,{
5
5
,
5
6
}4,{
6
6
,
6
7
}4,{
7
7
,
7
8
}4}
​
In[1]:=
mps=BlockRandomSeedRandom[42];
RandomTensorNetwork
["MPS"[8,4,2]];​​compressed=
MPSTruncate
[mps,2];​​compressed["Bonds"]
Out[1]=
{{
1
1
,
1
2
}2,{
2
2
,
2
3
}2,{
3
3
,
3
4
}2,{
4
4
,
4
5
}2,{
5
5
,
5
6
}2,{
6
6
,
6
7
}2,{
7
7
,
7
8
}2}
Truncation throws information away. The fidelity
〈original|compressed〉
original·compressed
measures how much was kept:
In[2]:=
compressed=
MPSTruncate
[mps,2];​​mps=BlockRandomSeedRandom[42];
RandomTensorNetwork
["MPS"[8,4,2]];​​fidelity=Abs
MPSOverlap
[mps,compressed]
MPSNorm
[mps]*
MPSNorm
[compressed]
Out[2]=
0.85481
​
A larger maxBond drops fewer singular values and yields higher fidelity:
In[1]:=
mps=BlockRandomSeedRandom[42];
RandomTensorNetwork
["MPS"[8,4,2]];​​compressed3=
MPSTruncate
[mps,3];Abs
MPSOverlap
[mps,compressed3]
MPSNorm
[mps]*
MPSNorm
[compressed3]
Out[1]=
0.940158
If maxBond is at least as large as every existing bond, no singular values are discarded:
In[2]:=
smallMPS=BlockRandomSeedRandom[42];
RandomTensorNetwork
["MPS"[5,2,2]];smallMPS["Bonds"]
Out[2]=
{{
1
1
,
1
2
}2,{
2
2
,
2
3
}2,{
3
3
,
3
4
}2,{
4
4
,
4
5
}2}
​
In[1]:=
smallMPS=BlockRandomSeedRandom[42];
RandomTensorNetwork
["MPS"[5,2,2]];​​
MPSTruncate
[smallMPS,4]["Bonds"]
Out[1]=
{{
1
1
,
1
2
}2,{
2
2
,
2
3
}2,{
3
3
,
3
4
}2,{
4
4
,
4
5
}2}
Options  
(1)

Applications  
(1)

Properties & Relations  
(1)

SeeAlso
MPSCanonicalForm
 
▪
MPSNormalize
 
▪
MPSSchmidtValues
 
▪
MPSEntanglementEntropy
 
▪
MPSOverlap
 
▪
MPSNorm
 
▪
RandomTensorNetwork
 
▪
SingularValueDecomposition
TechNotes
▪
MPS Algorithms
RelatedGuides
▪
TensorNetworks
Build an 8-site MPS with bond dimension 4 and physical dimension 2:
In[1]:=
mps=BlockRandomSeedRandom[42];
RandomTensorNetwork
["MPS"[8,4,2]]
Out[1]=
TensorNetwork
Tensors: 8
Binary: Yes
Free indices: 8
Sparse: No
Output dimension: 256
​

Compress the MPS to bond dimension 2. The result is a new TensorNetwork object:
In[2]:=
compressed=
MPSTruncate
[mps,2]
Out[2]=
TensorNetwork
Tensors: 8
Binary: Yes
Free indices: 8
Sparse: No
Output dimension: 256
​

Skip the post-truncation rescale with "Normalize" -> False:
In[3]:=
rawCompressed=
MPSTruncate
[mps,2,"Normalize"False]
Out[3]=
TensorNetwork
Tensors: 8
Binary: Yes
Free indices: 8
Sparse: No
Output dimension: 256
​

By default the result has unit norm:
In[4]:=
MPSNorm
[compressed]
Out[4]=
1.
Without rescaling, the norm reflects the discarded singular values:
In[5]:=
MPSNorm
[rawCompressed]
Out[5]=
19.1745
""

© 2026 Wolfram. All rights reserved.

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