Introduction
The MPSDynamics.jl
package provides an easy to use interface for performing tensor network simulations on matrix product states (MPS) and tree tensor network (TTN) states. Written in the Julia programming language, MPSDynamics.jl
is a versatile open-source package providing a choice of several variants of the Time-Dependent Variational Principle (TDVP) method for time evolution. The package also provides strong support for the measurement of observables, as well as the storing and logging of data, which makes it a useful tool for the study of many-body physics. The package has been developed with the aim of studying non-Markovian open system dynamics at finite temperature using the state-of-the-art numerically exact Thermalized-Time Evolving Density operator with Orthonormal Polynomials Algorithm (T-TEDOPA) based on environment chain mapping. However the methods implemented can equally be applied to other areas of physics.
Table of Contents
Installation
The package may be installed by typing the following into a Julia REPL
] add https://github.com/shareloqs/MPSDynamics.git
Functions
MPSDynamics.OneSiteObservable
— MethodOneSiteObservable(name,op,sites)
Computes the local expectation value of the one-site operator op
on the specified sites. Used to define one-site observables that are obs and convobs parameters for the runsim
function.
MPSDynamics.MPOtoVector
— MethodMPOtoVector(mpo::MPO)
Convert an ITensors chain MPO into a form compatible with MPSDynamics
MPSDynamics.addchild!
— Methodaddchild!(tree::Tree, id::Int)
Add child to node id
of tree
.
MPSDynamics.addchildren!
— Methodaddchildren!(tree::Tree, id::Int, n::Int)
Add n
children to node id
of tree
.
MPSDynamics.chaincoeffs_ohmic
— Methodchaincoeffs_ohmic(N, α, s; ωc=1, soft=false)
Generate chain coefficients $[[ϵ_0,ϵ_1,...],[t_0,t_1,...],c_0]$ for an Harmonic bath at zero temperature with a power law spectral density given by:
soft cutoff: $J(ω) = 2παω_c (\frac{ω}{ω_c})^s \exp(-ω/ω_c)$
hard cutoff: $J(ω) = 2παω_c (\frac{ω}{ω_c})^s θ(ω-ω_c)$
The coefficients parameterise the chain Hamiltonian
$H = H_S + c_0 A_S⊗B_0+\sum_{i=0}^{N-1}t_i (b_{i+1}^\dagger b_i +h.c.) + \sum_{i=0}^{N} ϵ_ib_i^\dagger b_i$
which is unitarily equivalent (before the truncation to N
sites) to
$H = H_S + A_S⊗\int_0^∞dω\sqrt{\frac{J(ω)}{π}}B_ω + \int_0^∞dωωb_ω^\dagger b_ω$
MPSDynamics.chainmps
— Methodchainmps(N::Int, site::Int, numex::Int)
Generate an MPS with numex
excitations on site
The returned MPS will have bond-dimensions and physical dimensions numex+1
MPSDynamics.chainmps
— Methodchainmps(N::Int, sites::Vector{Int}, numex::Int)
Generate an MPS with numex
excitations of an equal super-position over sites
The returned MPS will have bond-dimensions and physical dimensions numex+1
MPSDynamics.chainprop
— Methodchainprop(t, cparams...)
Propagate an excitation placed initially on the first site of a tight-binding chain with parameters given by cparams for a time t and return occupation expectation for each site.
MPSDynamics.dynamap
— Methoddynamap(ps1,ps2,ps3,ps4)
Calulate complete dynamical map to time step at which ps1, ps2, ps3 and ps4 are specified.
MPSDynamics.electron2kmps
— Functionelectronkmps(N::Int, k::Vector{Int}, spin=:Up, chainparams=[fill(1.0,N), fill(1.0,N-1)])
Generate an MPS with 2 electrons in k-states k1
and k2
.
MPSDynamics.electronkmps
— Functionelectronkmps(N::Int, k::Int, spin=:Up, chainparams=[fill(1.0,N), fill(1.0,N-1)])
Generate an MPS for an electron with momentum k
.
MPSDynamics.elementmpo
— Methodelementmpo(M, el...)
Return the element of the MPO M
for the set of physical states el...
MPSDynamics.elementmps
— Methodelementmps(A, el...)
Return the element of the MPS A
for the set of physical states el...
Examples
julia> A = chainmps(6, [2,4], 1);
+Introduction · MPSDynamics.jl Introduction
The MPSDynamics.jl
package provides an easy to use interface for performing tensor network simulations on matrix product states (MPS) and tree tensor network (TTN) states. Written in the Julia programming language, MPSDynamics.jl
is a versatile open-source package providing a choice of several variants of the Time-Dependent Variational Principle (TDVP) method for time evolution. The package also provides strong support for the measurement of observables, as well as the storing and logging of data, which makes it a useful tool for the study of many-body physics. The package has been developed with the aim of studying non-Markovian open system dynamics at finite temperature using the state-of-the-art numerically exact Thermalized-Time Evolving Density operator with Orthonormal Polynomials Algorithm (T-TEDOPA) based on environment chain mapping. However the methods implemented can equally be applied to other areas of physics.
Table of Contents
Installation
The package may be installed by typing the following into a Julia REPL
] add https://github.com/shareloqs/MPSDynamics.git
Functions
MPSDynamics.OneSiteObservable
— MethodOneSiteObservable(name,op,sites)
Computes the local expectation value of the one-site operator op
on the specified sites. Used to define one-site observables that are obs and convobs parameters for the runsim
function.
sourceMPSDynamics.MPOtoVector
— MethodMPOtoVector(mpo::MPO)
Convert an ITensors chain MPO into a form compatible with MPSDynamics
sourceMPSDynamics.addchild!
— Methodaddchild!(tree::Tree, id::Int)
Add child to node id
of tree
.
sourceMPSDynamics.addchildren!
— Methodaddchildren!(tree::Tree, id::Int, n::Int)
Add n
children to node id
of tree
.
sourceMPSDynamics.chaincoeffs_ohmic
— Methodchaincoeffs_ohmic(N, α, s; ωc=1, soft=false)
Generate chain coefficients $[[ϵ_0,ϵ_1,...],[t_0,t_1,...],c_0]$ for an Harmonic bath at zero temperature with a power law spectral density given by:
soft cutoff: $J(ω) = 2παω_c (\frac{ω}{ω_c})^s \exp(-ω/ω_c)$
hard cutoff: $J(ω) = 2παω_c (\frac{ω}{ω_c})^s θ(ω-ω_c)$
The coefficients parameterise the chain Hamiltonian
$H = H_S + c_0 A_S⊗B_0+\sum_{i=0}^{N-1}t_i (b_{i+1}^\dagger b_i +h.c.) + \sum_{i=0}^{N} ϵ_ib_i^\dagger b_i$
which is unitarily equivalent (before the truncation to N
sites) to
$H = H_S + A_S⊗\int_0^∞dω\sqrt{\frac{J(ω)}{π}}B_ω + \int_0^∞dωωb_ω^\dagger b_ω$
sourceMPSDynamics.chainmps
— Methodchainmps(N::Int, site::Int, numex::Int)
Generate an MPS with numex
excitations on site
The returned MPS will have bond-dimensions and physical dimensions numex+1
sourceMPSDynamics.chainmps
— Methodchainmps(N::Int, sites::Vector{Int}, numex::Int)
Generate an MPS with numex
excitations of an equal super-position over sites
The returned MPS will have bond-dimensions and physical dimensions numex+1
sourceMPSDynamics.chainprop
— Methodchainprop(t, cparams...)
Propagate an excitation placed initially on the first site of a tight-binding chain with parameters given by cparams for a time t and return occupation expectation for each site.
sourceMPSDynamics.dynamap
— Methoddynamap(ps1,ps2,ps3,ps4)
Calulate complete dynamical map to time step at which ps1, ps2, ps3 and ps4 are specified.
sourceMPSDynamics.electron2kmps
— Functionelectronkmps(N::Int, k::Vector{Int}, spin=:Up, chainparams=[fill(1.0,N), fill(1.0,N-1)])
Generate an MPS with 2 electrons in k-states k1
and k2
.
sourceMPSDynamics.electronkmps
— Functionelectronkmps(N::Int, k::Int, spin=:Up, chainparams=[fill(1.0,N), fill(1.0,N-1)])
Generate an MPS for an electron with momentum k
.
sourceMPSDynamics.elementmpo
— Methodelementmpo(M, el...)
Return the element of the MPO M
for the set of physical states el...
sourceMPSDynamics.elementmps
— Methodelementmps(A, el...)
Return the element of the MPS A
for the set of physical states el...
Examples
julia> A = chainmps(6, [2,4], 1);
julia> elementmps(A, 1, 2, 1, 1, 1, 1)
0.7071067811865475
@@ -11,14 +11,14 @@
0.0
julia> elementmps(A, 1, 1, 1, 1, 1, 1)
-0.0
sourceMPSDynamics.entanglemententropy
— Methodentanglemententropy(A)
For a list of tensors A
representing a right orthonormalized MPS, compute the entanglement entropy for a bipartite cut for every bond.
sourceMPSDynamics.findchainlength
— Methodfindchainlength(T, cparams...; eps=10^-6)
Estimate length of chain required for a particular set of chain parameters by calulating how long an excitation on the first site takes to reach the end. The chain length is given as the length required for the excitation to have just reached the last site after time T.
sourceMPSDynamics.findchild
— Methodfindchild(node::TreeNode, id::Int)
Return integer corresponding to the which number child site id
is of node
.
sourceMPSDynamics.hbathchain
— Methodhbathchain(N::Int, d::Int, chainparams, longrangecc...; tree=false, reverse=false, coupletox=false)
Create an MPO representing a tight-binding chain of N
oscillators with d
Fock states each. Chain parameters are supplied in the standard form: chainparams
$=[[ϵ_0,ϵ_1,...],[t_0,t_1,...],c_0]$. The output does not itself represent a complete MPO but will possess an end which is open and should be attached to another tensor site, usually representing the system.
Arguments
reverse
: If reverse=true
create a chain were the last (i.e. Nth) site is the site which couples to the systemcoupletox
: Used to choose the form of the system coupling. coupletox=true
gives a non-number conserving coupling of the form $H_{\text{I}}= A_{\text{S}}(b_{0}^\dagger + b_0)$ where $A_{\text{S}}$ is a system operator, while coupletox=false
gives the number-converving coupling $H_{\text{I}}=(A_{\text{S}} b_{0}^\dagger + A_{\text{S}}^\dagger b_0)$tree
: If true
the resulting chain will be of type TreeNetwork
; useful for construcing tree-MPOs
Example
One can constuct a system site tensor to couple to a chain by using the function up
to populate the tensor. For example, to construct a system site with Hamiltonian Hs
and coupling operator As
, the system tensor M
is constructed as follows for a non-number conserving interaction:
u = one(Hs) # system identity
+0.0
sourceMPSDynamics.entanglemententropy
— Methodentanglemententropy(A)
For a list of tensors A
representing a right orthonormalized MPS, compute the entanglement entropy for a bipartite cut for every bond.
sourceMPSDynamics.findchainlength
— Methodfindchainlength(T, cparams...; eps=10^-6)
Estimate length of chain required for a particular set of chain parameters by calulating how long an excitation on the first site takes to reach the end. The chain length is given as the length required for the excitation to have just reached the last site after time T.
sourceMPSDynamics.findchild
— Methodfindchild(node::TreeNode, id::Int)
Return integer corresponding to the which number child site id
is of node
.
sourceMPSDynamics.hbathchain
— Methodhbathchain(N::Int, d::Int, chainparams, longrangecc...; tree=false, reverse=false, coupletox=false)
Create an MPO representing a tight-binding chain of N
oscillators with d
Fock states each. Chain parameters are supplied in the standard form: chainparams
$=[[ϵ_0,ϵ_1,...],[t_0,t_1,...],c_0]$. The output does not itself represent a complete MPO but will possess an end which is open and should be attached to another tensor site, usually representing the system.
Arguments
reverse
: If reverse=true
create a chain were the last (i.e. Nth) site is the site which couples to the systemcoupletox
: Used to choose the form of the system coupling. coupletox=true
gives a non-number conserving coupling of the form $H_{\text{I}}= A_{\text{S}}(b_{0}^\dagger + b_0)$ where $A_{\text{S}}$ is a system operator, while coupletox=false
gives the number-converving coupling $H_{\text{I}}=(A_{\text{S}} b_{0}^\dagger + A_{\text{S}}^\dagger b_0)$tree
: If true
the resulting chain will be of type TreeNetwork
; useful for construcing tree-MPOs
Example
One can constuct a system site tensor to couple to a chain by using the function up
to populate the tensor. For example, to construct a system site with Hamiltonian Hs
and coupling operator As
, the system tensor M
is constructed as follows for a non-number conserving interaction:
u = one(Hs) # system identity
M = zeros(1,3,2,2)
M[1, :, :, :] = up(Hs, As, u)
The full MPO can then be constructed with:
Hmpo = [M, hbathchain(N, d, chainparams, coupletox=true)...]
Similarly for a number conserving interaction the site tensor would look like:
u = one(Hs) # system identity
M = zeros(1,4,2,2)
-M[1, :, :, :] = up(Hs, As, As', u)
And the full MPO would be
Hmpo = [M, hbathchain(N, d, chainparams; coupletox=false)...]
sourceMPSDynamics.isingmpo
— Methodisingmpo(N; J=1.0, h=1.0)
Return the MPO representation of a N
-spin 1D Ising model with external field $\vec{h} = (0,0,h)$.
sourceMPSDynamics.measure
— Methodmeasure(A, O; kwargs...)
Measure observable O
on mps state A
sourceMPSDynamics.measure1siteoperator
— Methodmeasure1siteoperator(A::Vector, O, sites::Vector{Int})
For a list of tensors A
representing a right orthonormalized MPS, compute the local expectation value of a one-site operator O for every site or just one if it is specified.
For calculating operators on single sites this will be more efficient if the site is on the left of the mps.
sourceMPSDynamics.measure1siteoperator
— Methodmeasure1siteoperator(A::Vector, O)
For a list of tensors A
representing a right orthonormalized MPS, compute the local expectation value of a one-site operator O for every site.
sourceMPSDynamics.measure2siteoperator
— Method measure2siteoperator(A::Vector, M1, M2, j1, j2)
Caculate expectation of M1*M2 where M1 acts on site j1 and M2 acts on site j2, assumes A is right normalised.
sourceMPSDynamics.modemps
— Functionmodemps(N::Int, k::Vector{Int}, numex::Int, chainparams=[fill(1.0,N), fill(1.0,N-1)])
Generate an MPS with numex
excitations of an equal superposition of modes k
of a bosonic tight-binding chain.
sourceMPSDynamics.modemps
— Functionmodemps(N::Int, k::Int, numex::Int, chainparams=[fill(1.0,N), fill(1.0,N-1)])
Generate an MPS with numex
excitations of mode k
of a bosonic tight-binding chain.
chainparams
takes the form [e::Vector, t::Vector]
where e
are the on-site energies and t
are the hoppping parameters.
The returned MPS will have bond-dimensions and physical dimensions numex+1
sourceMPSDynamics.mpsembed!
— Methodmpsembed(A::Vector, Dmax::Int)
Embed MPS A
in manifold of max bond-dimension Dmax
sourceMPSDynamics.mpsleftnorm!
— Functionmpsleftnorm!(A::Vector, jq::Int=length(A))
Left orthoganalise MPS A
up to site jq
.
sourceMPSDynamics.mpsmixednorm!
— Methodmpsmixednorm!(A::TreeNetwork, id::Int)
Normalise tree-MPS A
such that orthogonality centre is on site id
.
sourceMPSDynamics.mpsmixednorm!
— Methodmpsmixednorm!(A::Vector, OC::Int)
Put MPS A
into mixed canonical form with orthogonality centre on site OC
.
sourceMPSDynamics.mpsmoveoc!
— Methodmpsmoveoc!(A::TreeNetwork, id::Int)
Move the orthogonality centre of right normalised tree-MPS A
to site id
.
This function will be more efficient than using mpsmixednorm!
if the tree-MPS is already right-normalised.
sourceMPSDynamics.mpsrightnorm!
— Functionmpsrightnorm!(A::Vector, jq::Int=1)
Right orthoganalise MPS A
up to site jq
.
sourceMPSDynamics.mpsrightnorm!
— Methodmpsrightnorm!(A::TreeNetwork)
When applied to a tree-MPS, right normalise towards head-node.
sourceMPSDynamics.mpsshiftoc!
— Methodmpsshiftoc!(A::TreeNetwork, newhd::Int)
Shift the orthogonality centre by one site, setting new head-node newhd
.
sourceMPSDynamics.normmps
— Methodnormmps(net::TreeNetwork; mpsorthog=:None)
When applied to a tree-MPS mpsorthog=:Left
is not defined.
sourceMPSDynamics.normmps
— Methodnormmps(A::Vector; mpsorthog=:None)
Calculate norm of MPS A
.
Setting mpsorthog
=:Right
/:Left
will calculate the norm assuming right/left canonical form. Setting mpsorthog=OC::Int
will cause the norm to be calculated assuming the orthoganility center is on site OC
. If mpsorthog is :None
the norm will be calculated as an MPS-MPS product.
sourceMPSDynamics.orthcentersmps
— Methodorthcentersmps(A)
Compute the orthoganality centres of MPS A
.
Return value is a list in which each element is the corresponding site tensor of A
with the orthoganility centre on that site. Assumes A
is right normalised.
sourceMPSDynamics.physdims
— Methodphysdims(M)
Return the physical dimensions of an MPS or MPO M
.
sourceMPSDynamics.productstatemps
— Functionproductstatemps(physdims::Dims, Dmax=1; state=:Vacuum, mpsorthog=:Right)
Return an MPS representing a product state with local Hilbert space dimensions given by physdims
.
By default all bond-dimensions will be 1 since the state is a product state. However, to embed the product state in a manifold of greater bond-dimension, Dmax
can be set accordingly.
The indvidual states of the MPS sites can be provided by setting state
to a list of column vectors. Setting state=:Vacuum
will produce an MPS in the vacuum state (where the state of each site is represented by a column vector with a 1 in the first row and zeros elsewhere). Setting state=:FullOccupy
will produce an MPS in which each site is fully occupied (ie. a column vector with a 1 in the last row and zeros elsewhere).
The argument mpsorthog
can be used to set the gauge of the resulting MPS.
Example
julia> ψ = unitcol(1,2); d = 6; N = 30; α = 0.1; Δ = 0.0; ω0 = 0.2; s = 1
+M[1, :, :, :] = up(Hs, As, As', u)
And the full MPO would be
Hmpo = [M, hbathchain(N, d, chainparams; coupletox=false)...]
sourceMPSDynamics.isingmpo
— Methodisingmpo(N; J=1.0, h=1.0)
Return the MPO representation of a N
-spin 1D Ising model with external field $\vec{h} = (0,0,h)$.
sourceMPSDynamics.measure
— Methodmeasure(A, O; kwargs...)
Measure observable O
on mps state A
sourceMPSDynamics.measure1siteoperator
— Methodmeasure1siteoperator(A::Vector, O, sites::Vector{Int})
For a list of tensors A
representing a right orthonormalized MPS, compute the local expectation value of a one-site operator O for every site or just one if it is specified.
For calculating operators on single sites this will be more efficient if the site is on the left of the mps.
sourceMPSDynamics.measure1siteoperator
— Methodmeasure1siteoperator(A::Vector, O)
For a list of tensors A
representing a right orthonormalized MPS, compute the local expectation value of a one-site operator O for every site.
sourceMPSDynamics.measure2siteoperator
— Method measure2siteoperator(A::Vector, M1, M2, j1, j2)
Caculate expectation of M1*M2 where M1 acts on site j1 and M2 acts on site j2, assumes A is right normalised.
sourceMPSDynamics.modemps
— Functionmodemps(N::Int, k::Vector{Int}, numex::Int, chainparams=[fill(1.0,N), fill(1.0,N-1)])
Generate an MPS with numex
excitations of an equal superposition of modes k
of a bosonic tight-binding chain.
sourceMPSDynamics.modemps
— Functionmodemps(N::Int, k::Int, numex::Int, chainparams=[fill(1.0,N), fill(1.0,N-1)])
Generate an MPS with numex
excitations of mode k
of a bosonic tight-binding chain.
chainparams
takes the form [e::Vector, t::Vector]
where e
are the on-site energies and t
are the hoppping parameters.
The returned MPS will have bond-dimensions and physical dimensions numex+1
sourceMPSDynamics.mpsembed!
— Methodmpsembed(A::Vector, Dmax::Int)
Embed MPS A
in manifold of max bond-dimension Dmax
sourceMPSDynamics.mpsleftnorm!
— Functionmpsleftnorm!(A::Vector, jq::Int=length(A))
Left orthoganalise MPS A
up to site jq
.
sourceMPSDynamics.mpsmixednorm!
— Methodmpsmixednorm!(A::TreeNetwork, id::Int)
Normalise tree-MPS A
such that orthogonality centre is on site id
.
sourceMPSDynamics.mpsmixednorm!
— Methodmpsmixednorm!(A::Vector, OC::Int)
Put MPS A
into mixed canonical form with orthogonality centre on site OC
.
sourceMPSDynamics.mpsmoveoc!
— Methodmpsmoveoc!(A::TreeNetwork, id::Int)
Move the orthogonality centre of right normalised tree-MPS A
to site id
.
This function will be more efficient than using mpsmixednorm!
if the tree-MPS is already right-normalised.
sourceMPSDynamics.mpsrightnorm!
— Functionmpsrightnorm!(A::Vector, jq::Int=1)
Right orthoganalise MPS A
up to site jq
.
sourceMPSDynamics.mpsrightnorm!
— Methodmpsrightnorm!(A::TreeNetwork)
When applied to a tree-MPS, right normalise towards head-node.
sourceMPSDynamics.mpsshiftoc!
— Methodmpsshiftoc!(A::TreeNetwork, newhd::Int)
Shift the orthogonality centre by one site, setting new head-node newhd
.
sourceMPSDynamics.normmps
— Methodnormmps(net::TreeNetwork; mpsorthog=:None)
When applied to a tree-MPS mpsorthog=:Left
is not defined.
sourceMPSDynamics.normmps
— Methodnormmps(A::Vector; mpsorthog=:None)
Calculate norm of MPS A
.
Setting mpsorthog
=:Right
/:Left
will calculate the norm assuming right/left canonical form. Setting mpsorthog=OC::Int
will cause the norm to be calculated assuming the orthoganility center is on site OC
. If mpsorthog is :None
the norm will be calculated as an MPS-MPS product.
sourceMPSDynamics.orthcentersmps
— Methodorthcentersmps(A)
Compute the orthoganality centres of MPS A
.
Return value is a list in which each element is the corresponding site tensor of A
with the orthoganility centre on that site. Assumes A
is right normalised.
sourceMPSDynamics.physdims
— Methodphysdims(M)
Return the physical dimensions of an MPS or MPO M
.
sourceMPSDynamics.productstatemps
— Functionproductstatemps(physdims::Dims, Dmax=1; state=:Vacuum, mpsorthog=:Right)
Return an MPS representing a product state with local Hilbert space dimensions given by physdims
.
By default all bond-dimensions will be 1 since the state is a product state. However, to embed the product state in a manifold of greater bond-dimension, Dmax
can be set accordingly.
The indvidual states of the MPS sites can be provided by setting state
to a list of column vectors. Setting state=:Vacuum
will produce an MPS in the vacuum state (where the state of each site is represented by a column vector with a 1 in the first row and zeros elsewhere). Setting state=:FullOccupy
will produce an MPS in which each site is fully occupied (ie. a column vector with a 1 in the last row and zeros elsewhere).
The argument mpsorthog
can be used to set the gauge of the resulting MPS.
Example
julia> ψ = unitcol(1,2); d = 6; N = 30; α = 0.1; Δ = 0.0; ω0 = 0.2; s = 1
julia> cpars = chaincoeffs_ohmic(N, α, s)
julia> H = spinbosonmpo(ω0, Δ, d, N, cpars)
-julia> A = productstatemps(physdims(H), state=[ψ, fill(unitcol(1,d), N)...]) # MPS representation of |ψ>|Vacuum>
sourceMPSDynamics.productstatemps
— Functionproductstatemps(N::Int, d::Int, Dmax=1; state=:Vacuum, mpsorthog=:Right)
Return an N
-site MPS with all local Hilbert space dimensions given by d
.
sourceMPSDynamics.randisometry
— Methodrandisometry([T=Float64], dims...)
Construct a random isometry
sourceMPSDynamics.randmps
— Functionrandmps(N::Int, d::Int, Dmax::Int, T=Float64)
Construct a random, N
-site, right-normalised MPS with all local Hilbert space dimensions given by d
.
sourceMPSDynamics.randmps
— Functionrandmps(tree::Tree, physdims, Dmax::Int, T::Type{<:Number} = Float64)
Construct a random, right-normalised, tree-MPS, with structure given by tree and max bond-dimension given by Dmax
.
The local Hilbert space dimensions are specified by physdims which can either be of type Dims{length(tree)}
, specifying the dimension of each site, or of type Int
, in which case the same local dimension is used for every site.
sourceMPSDynamics.randmps
— Methodrandmps(physdims::Dims{N}, Dmax::Int, T::Type{<:Number} = Float64) where {N}
Construct a random, right-normalised MPS with local Hilbert space dimensions given by physdims
and max bond-dimension given by Dmax
.
T
specifies the element type, eg. use T=ComplexF64
for a complex valued MPS.
sourceMPSDynamics.randtree
— Methodrandtree(numnodes::Int, maxdegree::Int)
Construct a random tree with nummodes
modes and max degree maxdegree
.
sourceMPSDynamics.rmsd
— Methodrmsd(dat1::Vector{Float64}, dat2::Vector{Float64})
Calculate the root mean squared difference between two measurements of an observable over the same time period.
sourceMPSDynamics.spinbosonmpo
— Methodspinbosonmpo(ω0, Δ, d, N, chainparams; rwa=false, tree=false)
Generate MPO for a spin-1/2 coupled to a chain of harmonic oscillators, defined by the Hamiltonian
$H = \frac{ω_0}{2}σ_z + Δσ_x + c_0σ_x(b_0^\dagger+b_0) + \sum_{i=0}^{N-1} t_i (b_{i+1}^\dagger b_i +h.c.) + \sum_{i=0}^{N} ϵ_ib_i^\dagger b_i$.
The spin is on site 1 of the MPS and the bath modes are to the right.
This Hamiltonain is unitarily equivalent (before the truncation to N
sites) to the spin-boson Hamiltonian defined by
$H = \frac{ω_0}{2}σ_z + Δσ_x + σ_x\int_0^∞ dω\sqrt{\frac{J(ω)}{π}}(b_ω^\dagger+b_ω) + \int_0^∞ dω ωb_ω^\dagger b_ω$.
The chain parameters, supplied by chainparams
=$[[ϵ_0,ϵ_1,...],[t_0,t_1,...],c_0]$, can be chosen to represent any arbitrary spectral density $J(ω)$ at any temperature.
The rotating wave approximation can be made by setting rwa=true
.
sourceMPSDynamics.svdmps
— Methodsvdmps(A)
For a right normalised mps A
compute the full svd spectrum for a bipartition at every bond.
sourceMPSDynamics.svdtrunc
— MethodU, S, Vd = svdtrunc(A; truncdim = max(size(A)...), truncerr = 0.)
Perform a truncated SVD, with maximum number of singular values to keep equal to truncdim
or truncating any singular values smaller than truncerr
. If both options are provided, the smallest number of singular values will be kept. Unlike the SVD in Julia, this returns matrix U, a diagonal matrix (not a vector) S, and Vt such that A ≈ U * S * Vt
sourceMPSDynamics.xyzmpo
— Methodxyzmpo(N::Int; Jx=1.0, Jy=Jx, Jz=Jx, hx=0., hz=0.)
Return the MPO representation of the N
-spin XYZ Hamiltonian with external field $\vec{h}=(h_x, 0, h_z)$.
$H = \sum_{n=1}^{N-1} -J_x σ_x^{n} σ_x^{n+1} - J_y σ_y^{n} σ_y^{n+1} - J_z σ_z^{n} σ_z^{n+1} + \sum_{n=1}^{N}(- h_x σ_x^{n} - h_z σ_z^{n})$.
sourceSettings
This document was generated with Documenter.jl on Saturday 17 February 2024. Using Julia version 1.7.3.
+julia> A = productstatemps(physdims(H), state=[ψ, fill(unitcol(1,d), N)...]) # MPS representation of |ψ>|Vacuum>
MPSDynamics.productstatemps
— Functionproductstatemps(N::Int, d::Int, Dmax=1; state=:Vacuum, mpsorthog=:Right)
Return an N
-site MPS with all local Hilbert space dimensions given by d
.
MPSDynamics.randisometry
— Methodrandisometry([T=Float64], dims...)
Construct a random isometry
MPSDynamics.randmps
— Functionrandmps(N::Int, d::Int, Dmax::Int, T=Float64)
Construct a random, N
-site, right-normalised MPS with all local Hilbert space dimensions given by d
.
MPSDynamics.randmps
— Functionrandmps(tree::Tree, physdims, Dmax::Int, T::Type{<:Number} = Float64)
Construct a random, right-normalised, tree-MPS, with structure given by tree and max bond-dimension given by Dmax
.
The local Hilbert space dimensions are specified by physdims which can either be of type Dims{length(tree)}
, specifying the dimension of each site, or of type Int
, in which case the same local dimension is used for every site.
MPSDynamics.randmps
— Methodrandmps(physdims::Dims{N}, Dmax::Int, T::Type{<:Number} = Float64) where {N}
Construct a random, right-normalised MPS with local Hilbert space dimensions given by physdims
and max bond-dimension given by Dmax
.
T
specifies the element type, eg. use T=ComplexF64
for a complex valued MPS.
MPSDynamics.randtree
— Methodrandtree(numnodes::Int, maxdegree::Int)
Construct a random tree with nummodes
modes and max degree maxdegree
.
MPSDynamics.rmsd
— Methodrmsd(dat1::Vector{Float64}, dat2::Vector{Float64})
Calculate the root mean squared difference between two measurements of an observable over the same time period.
MPSDynamics.spinbosonmpo
— Methodspinbosonmpo(ω0, Δ, d, N, chainparams; rwa=false, tree=false)
Generate MPO for a spin-1/2 coupled to a chain of harmonic oscillators, defined by the Hamiltonian
$H = \frac{ω_0}{2}σ_z + Δσ_x + c_0σ_x(b_0^\dagger+b_0) + \sum_{i=0}^{N-1} t_i (b_{i+1}^\dagger b_i +h.c.) + \sum_{i=0}^{N} ϵ_ib_i^\dagger b_i$.
The spin is on site 1 of the MPS and the bath modes are to the right.
This Hamiltonain is unitarily equivalent (before the truncation to N
sites) to the spin-boson Hamiltonian defined by
$H = \frac{ω_0}{2}σ_z + Δσ_x + σ_x\int_0^∞ dω\sqrt{\frac{J(ω)}{π}}(b_ω^\dagger+b_ω) + \int_0^∞ dω ωb_ω^\dagger b_ω$.
The chain parameters, supplied by chainparams
=$[[ϵ_0,ϵ_1,...],[t_0,t_1,...],c_0]$, can be chosen to represent any arbitrary spectral density $J(ω)$ at any temperature.
The rotating wave approximation can be made by setting rwa=true
.
MPSDynamics.svdmps
— Methodsvdmps(A)
For a right normalised mps A
compute the full svd spectrum for a bipartition at every bond.
MPSDynamics.svdtrunc
— MethodU, S, Vd = svdtrunc(A; truncdim = max(size(A)...), truncerr = 0.)
Perform a truncated SVD, with maximum number of singular values to keep equal to truncdim
or truncating any singular values smaller than truncerr
. If both options are provided, the smallest number of singular values will be kept. Unlike the SVD in Julia, this returns matrix U, a diagonal matrix (not a vector) S, and Vt such that A ≈ U * S * Vt
MPSDynamics.xyzmpo
— Methodxyzmpo(N::Int; Jx=1.0, Jy=Jx, Jz=Jx, hx=0., hz=0.)
Return the MPO representation of the N
-spin XYZ Hamiltonian with external field $\vec{h}=(h_x, 0, h_z)$.
$H = \sum_{n=1}^{N-1} -J_x σ_x^{n} σ_x^{n+1} - J_y σ_y^{n} σ_y^{n+1} - J_z σ_z^{n} σ_z^{n+1} + \sum_{n=1}^{N}(- h_x σ_x^{n} - h_z σ_z^{n})$.