Matrix Product States (MPS)
Matrix Product States (MPS
) (also known as Tensor Trains) are Ansatz
Tensor Networks whose tensors are laid out in a 1D chain. Depending on the boundary conditions, these chains can be open or closed (i.e. periodic boundary conditions).
Warning
Currently only Open
boundary conditions are supported in Tenet.
In Tenet, a Matrix Product State can be easily created by passing a list of arrays to the MPS
constructor:
julia> ψ = MPS([rand(2, 2), rand(2, 2, 4), rand(2, 4, 2), rand(2, 2)])
MPS (inputs=0, outputs=4)
The default ordering of the indices on the MPS
constructor is (physical, left, right), but you can specify the ordering by passing the order
keyword argument:
julia> ϕ = MPS([rand(2, 2), rand(2, 2, 4), rand(4, 2, 2), rand(2, 2)]; order=[:l, :o, :r])
MPS (inputs=0, outputs=4)
where :l
, :r
, and :o
represent the left, right, and outer physical indices, respectively.
Additionally, Tenet has the rand
function to generate random MPS
with a given number of sites and maximum bond dimension:
julia> Φ = rand(MPS, n=8, maxdim=10)
MPS (inputs=0, outputs=8)
Canonical Forms
An MPS
representation is not unique: a single MPS
can be represented in different canonical forms. The choice of canonical form can affect the efficiency and stability of algorithms used to manipulate the MPS
. The current form of the MPS
is stored as the trait Form
and can be accessed via the form
function:
julia> form(ψ)
NonCanonical()
Warning
Depending on the form, Tenet will dispatch under the hood the appropriate algorithm which assumes full use of the canonical form, so be careful when making modifications that might alter the canonical form without changing the trait.
Tenet has the internal function Tenet.check_form
to check if the MPS
is in the correct canonical form. This function can be used to ensure that the MPS
is in the correct form before performing any operation that requires it. Currently, Tenet supports the NonCanonical
, CanonicalForm
and MixedCanonical
forms.
NonCanonical
Form
In the NonCanonical
form, the tensors in the MPS
do not satisfy any particular orthogonality conditions. This is the default form
when an MPS
is initialized without specifying a canonical form. It is useful for general purposes but may not be optimal for certain computations that benefit from orthogonality.
Canonical
Form
Also known as Vidal's form, the Canonical
form represents the MPS
using a sequence of tensors MPS
is expressed as:
You can convert an MPS
to the Canonical
form by calling canonize!
:
julia> canonize!(ψ)
MPS (inputs=0, outputs=4)
julia> form(ψ)
Canonical()
MixedCanonical
Form
In the MixedCanonical
form, the Schmidt coefficients are contained in one tensor, called the orthogonality center, and the rest of the tensors locating to the left and right side are left- and right-canonical; i.e. isometries pointing to the right and left directions respectively.
Tip
If the Schmidt coefficients are spread out along multiple tensors but localized, then MixedCanonical
accepts using a Vector{<:Site}
for representing the orthogonality center.
You can convert an MPS
to the MixedCanonical
form and specify the orthogonality center using mixed_canonize!
. Additionally, one can check that the MPS
is effectively in mixed canonical form using the function isisometry
, which returns true
if the Tensor
at that particular site is an isometry pointing at direction dir
:
julia> mixed_canonize!(ψ, Site(2))
ERROR: ArgumentError: `orthog_center` must be a `Site` or a `Vector{Site}`
julia> isisometry(ψ, 1; dir=:right) # Check if the first tensor is left canonical
ERROR: KeyError: key 1 not found
julia> isisometry(ψ, 3; dir=:left) # Check if the third tensor is right canonical
ERROR: KeyError: key 3 not found
julia> form(ψ)
Canonical()
Matrix Product Operators (MPO)
Matrix Product Operators (MPO
) are the operator version of Matrix Product States (MPS). The major difference between them is that MPOs have 2 indices per site (1 input and 1 output) while MPSs only have 1 index per site (i.e. an output).
open_mpo = rand(MPO, n=10, maxdim=4)
To apply an MPO
to an MPS
, you can use the evolve!
function:
julia> mps = rand(MPS; n=10)
MPS (inputs=0, outputs=10)
julia> evolve!(mps, open_mpo; normalize=false)
MPS (inputs=0, outputs=10)
Additional Resources
For more in-depth information on Matrix Product States and their canonical forms, you may refer to:
- Schollwöck, U. (2011). The density-matrix renormalization group in the age of matrix product states. Annals of physics, 326(1), 96-192.
DocumenterMermaid.MermaidScriptBlock([...])