MPSDynamics Documentation
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(nummodes, α, s, beta="inf"; wc=1, soft=false)
Generate chain coefficients for an Harmonic bath coupled to a spin-1/2 with spectral density given by:
soft cutoff: $J(ω) = 2παω_c (\frac{ω}{ω_c})^s \exp(-ω/ω_c)$
hard cutoff: $J(ω) = 2παω_c (\frac{ω}{ω_c})^s θ(ω-ω_c)$
The Hamiltonian is given by:
$H = \frac{ω_0}{2}σ_z + Δσ_x + σ_x\sum_kg_k(b_k^\dagger+b_k) + \sum_kω_kb_k^\dagger b_k$
And the spectral density is defined by:
$J(ω) ≡ π\sum_k|g_k|^2δ(ω-ω_k)$
MPSDynamics.chainmps
— Methodchainmps(N::Int, sites::Vector{Int}, numex::Int)
Generate an MPS with numex
excitations of an equal super-position over sites
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.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);
+MPSDynamics Documentation · MPSDynamics.jl MPSDynamics Documentation
MPSDynamics.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(nummodes, α, s, beta="inf"; wc=1, soft=false)
Generate chain coefficients for an Harmonic bath coupled to a spin-1/2 with spectral density given by:
soft cutoff: $J(ω) = 2παω_c (\frac{ω}{ω_c})^s \exp(-ω/ω_c)$
hard cutoff: $J(ω) = 2παω_c (\frac{ω}{ω_c})^s θ(ω-ω_c)$
The Hamiltonian is given by:
$H = \frac{ω_0}{2}σ_z + Δσ_x + σ_x\sum_kg_k(b_k^\dagger+b_k) + \sum_kω_kb_k^\dagger b_k$
And the spectral density is defined by:
$J(ω) ≡ π\sum_k|g_k|^2δ(ω-ω_k)$
sourceMPSDynamics.chainmps
— Methodchainmps(N::Int, sites::Vector{Int}, numex::Int)
Generate an MPS with numex
excitations of an equal super-position over sites
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.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,4 +11,4 @@
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.measure
— Methodmeasure(A, O; kwargs...)
measure observable O
on mps state A
sourceMPSDynamics.measure1siteoperator
— Methodmeasure1siteoperator(A, 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 or just one if i is specified.
For calculating operators on single sites this will be more efficient if the site is on the left of the mps.
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::Vector, OC::Int)
Put MPS A
into mixed canonical form with orthogonality centre on site OC
.
sourceMPSDynamics.mpsmixednorm!
— Methodmpsmixednorm!(A::TreeNetwork, id::Int)
Normalise tree-MPS A
such that orthogonality centre is on site id
.
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(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.normmps
— Methodnormmps(net::TreeNetwork; mpsorthog=:None)
When applied to a tree-MPS mpsorthog=:Left
is not defined.
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(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.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 provdided 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.
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.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
sourceSettings
This document was generated with Documenter.jl on Monday 11 January 2021. Using Julia version 1.4.2.
+0.0
MPSDynamics.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.
MPSDynamics.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.
MPSDynamics.findchild
— Methodfindchild(node::TreeNode, id::Int)
Return integer corresponding to the which number child site id
is of node
.
MPSDynamics.measure
— Methodmeasure(A, O; kwargs...)
measure observable O
on mps state A
MPSDynamics.measure1siteoperator
— Methodmeasure1siteoperator(A, 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 or just one if i is specified.
For calculating operators on single sites this will be more efficient if the site is on the left of the mps.
MPSDynamics.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.
MPSDynamics.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.
MPSDynamics.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
MPSDynamics.mpsembed!
— Methodmpsembed(A::Vector, Dmax::Int)
Embed MPS A
in manifold of max bond-dimension Dmax
MPSDynamics.mpsleftnorm!
— Functionmpsleftnorm!(A::Vector, jq::Int=length(A))
Left orthoganalise MPS A
up to site jq
.
MPSDynamics.mpsmixednorm!
— Methodmpsmixednorm!(A::Vector, OC::Int)
Put MPS A
into mixed canonical form with orthogonality centre on site OC
.
MPSDynamics.mpsmixednorm!
— Methodmpsmixednorm!(A::TreeNetwork, id::Int)
Normalise tree-MPS A
such that orthogonality centre is on site id
.
MPSDynamics.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.
MPSDynamics.mpsrightnorm!
— Functionmpsrightnorm!(A::Vector, jq::Int=1)
Right orthoganalise MPS A
up to site jq
.
MPSDynamics.mpsrightnorm!
— Methodmpsrightnorm!(A::TreeNetwork)
When applied to a tree-MPS, right normalise towards head-node.
MPSDynamics.mpsshiftoc!
— Methodmpsshiftoc!(A::TreeNetwork, newhd::Int)
Shift the orthogonality centre by one site, setting new head-node newhd
.
MPSDynamics.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.
MPSDynamics.normmps
— Methodnormmps(net::TreeNetwork; mpsorthog=:None)
When applied to a tree-MPS mpsorthog=:Left
is not defined.
MPSDynamics.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.
MPSDynamics.physdims
— Methodphysdims(M)
Return the physical dimensions of an MPS or MPO M
.
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.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 provdided 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.
MPSDynamics.randisometry
— Methodrandisometry([T=Float64], dims...)
Construct a random isometry
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
— 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
— 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.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