DMRJtensor.DMRJtensorModule

DMRjulia (version 0.12.0)

(made for julia v1.10.4+ (July 6, 2024), see included license)

Code: https://github.com/bakerte/DMRJtensor.jl

Documentation: T.E. Baker, S. Desrosiers, M. Tremblay, M.P. Thompson "Méthodes de calcul avec réseaux de tenseurs en physique" Canadian Journal of Physics 99, 4 (2021)

             [ibid. "Basic tensor network computations in physics" https://arxiv.org/abs/1911.11566 p. 19]

      and  T.E. Baker and M.P. Thompson "Build your own tensor network library: DMRjulia I. Basic library for the density matrix renormalization group" arxiv: 2109.03120

Funding for this program is graciously provided by:

  • Institut quantique (Université de Sherbrooke)
  • Département de physique, Université de Sherbrooke
  • Canada First Research Excellence Fund (CFREF)
  • Institut Transdisciplinaire d'Information Quantique (INTRIQ)
  • US-UK Fulbright Commission (Bureau of Education and Cultural Affairs from the United States Department of State)
  • Department of Physics, University of York
  • Canada Research Chair in Quantum Computing for Modelling of Molecules and Materials
  • Department of Physics & Astronomy, University of Victoria
  • Department of Chemistry, University of Victoria
  • Faculty of Science, University of Victoria
  • National Science and Engineering Research Council (NSERC)
DMRJtensor.EnvType
Env

A global super-type for the environment defined either with envType or AbstractArray

DMRJtensor.MPOMethod
mpo = MPO(T,H[,regtens=false])

constructor for MPO with an MPO H; can change the element type T for the tensors; regtens outputs with the julia Array type

DMRJtensor.MPOMethod
cmpo,cpsi = MPS(T,mpo,psi[,oc=1])

Converts psi (MPS) and mpo (MPO) to type given by T

DMRJtensor.MPOMethod
mpo = MPO(T,H[,regtens=false])

constructor for MPO with a network H; can change the element type T for the tensors; regtens outputs with the julia Array type

DMRJtensor.MPOMethod
mpo = MPO(H[,regtens=false])

constructor for MPO with an MPO H; regtens outputs with the julia Array type

DMRJtensor.MPOMethod
mpo = MPO(H[,regtens=false])

constructor for MPO with a network H; regtens outputs with the julia Array type

DMRJtensor.MPOMethod
qmpo,qmps = MPO(Qlabels,mpo,mps[,newnorm=true,setflux=false,flux=...,randomize=true,override=true,lastfluxzero=false])

Creates a quantum number MPO qmpo from input mpo and an array of quantum number labels Qlabels, a vector of Qnum; also returns a quantum number MPS qmps from input dense mps

Optional arguments

  • mps::MPS: dense MPS
  • Qlabels::Array{Array{Qnum,1},1}: quantum number labels on each physical index (assigns physical index labels mod size of this vector)
  • newnorm::Bool: set new norm of the MPS tensor
  • setflux::Bool: toggle to force this to be the total flux of the MPS tensor
  • flux::Qnum: quantum number to force total MPS flux to be if setflux=true
  • randomize::Bool: randomize last tensor if flux forces a zero tensor
  • lastfluxzero::Bool: determines whether the rightmost flux should be zero or not

See also: Qnum

DMRJtensor.MPOMethod
qmpo = MPO(Qlabels,mpo[,regtens=false])

Creates a quantum number MPO qmpo from input mpo and Qlabels, a vector of Qnum

See also: Qnum

DMRJtensor.MPOMethod
qmpo,qmps = MPO(Qlabels,mpo,mps[,newnorm=true,setflux=false,flux=...,randomize=true,override=true,lastfluxzero=false])

Creates a quantum number MPO qmpo from input mpo and Qlabels, a vector of Qnum; also returns a quantum number MPS qmps from input dense mps

Optional arguments

  • mps::MPS: dense MPS
  • Qlabels::Array{Array{Qnum,1},1}: quantum number labels on each physical index (assigns physical index labels mod size of this vector)
  • newnorm::Bool: set new norm of the MPS tensor
  • setflux::Bool: toggle to force this to be the total flux of the MPS tensor
  • flux::Qnum: quantum number to force total MPS flux to be if setflux=true
  • randomize::Bool: randomize last tensor if flux forces a zero tensor
  • lastfluxzero::Bool: determines whether the rightmost flux should be zero or not

See also: Qnum

DMRJtensor.MPOMethod
qmpo = MPO(Qlabels,mpo)

Creates a quantum number MPO qmpo from input mpo and Qlabels

See also: Qnum

DMRJtensor.MPOMethod
mpo = MPO(H[,regtens=false])

constructor for MPO with an array of TensType H; regtens outputs with the julia Array type

DMRJtensor.MPOMethod
mpo = MPO(T,H[,regtens=false])

constructor for MPO with an array of TensType H; can change the element type T for the tensors; regtens outputs with the julia Array type

DMRJtensor.MPSMethod
psi = MPS(type,physindsize,Ns[,regtens=false,oc=1])

Constructs psi for MPS of tensor type Float64 by making empty tensors of size (1,physindsize,1) for w indexing 1:Ns (repeats on physindvec) with othrogonality center oc. regtens avoids conversion to denstens type (defaulted to perform the conversion for efficiency)

DMRJtensor.MPSMethod
cpsi,cmpo = MPS(T,psi,mpo[,oc=1])

Converts psi (MPS) and mpo (MPO) to type given by T

DMRJtensor.MPSMethod
psi = MPS(physindsize,Ns[,regtens=false,oc=1,type=Float64])

Constructs psi for MPS of tensor type Float64 by making empty tensors of size (1,physindsize,1) for w indexing 1:Ns (repeats on physindvec) with othrogonality center oc. regtens avoids conversion to denstens type (defaulted to perform the conversion for efficiency)

DMRJtensor.MPSMethod
psi = MPS(A[,regtens=false,oc=psi.oc,type=...])

Constructs psi for MPS with tensors A (MPS format) with orthogonality center oc. regtens avoids conversion to denstens type (defaulted to perform the conversion for efficiency); type defaults to the input type of the tensors in psi

DMRJtensor.MPSMethod
psi = MPS(A[,regtens=false,oc=psi.oc,type=...])

Constructs psi for MPS with tensors A (network) with orthogonality center oc. regtens avoids conversion to denstens type (defaulted to perform the conversion for efficiency); type defaults to the input type of the tensors in psi

DMRJtensor.MPSMethod
qmps = MPS(Qlabels[,oc=1,type=Float64])

Creates a quantum number MPS qmps with quantum numbers assigned from an array of qnum vectors Qlabels with orthogonality center oc and data type type

DMRJtensor.MPSMethod
qmps = MPS(Qlabels[,oc=1,type=Float64])

Creates a quantum number MPS qmps with quantum numbers assigned from an array of an array of qnum (non-uniform and can be shorter than Ns, which will cause the program to repeat a shorter number) Qlabels with orthogonality center oc and data type type; Ns is the number of sites in the system

DMRJtensor.MPSMethod
MPS(Qlabels,mps,mpo[,newnorm=true,setflux=false,flux=...,randomize=true,override=true,lastfluxzero=false])

Converts an MPS mps and MPO mpo into a an array of quantum number arrays with quantum numbers assigned from an array of qnum vectors Qlabels

Optional arguments

  • mps::MPS: dense MPS
  • Qlabels::Array{Array{Qnum,1},1}: quantum number labels on each physical index (assigns physical index labels mod size of this vector)
  • newnorm::Bool: set new norm of the MPS tensor
  • setflux::Bool: toggle to force this to be the total flux of the MPS tensor
  • flux::Qnum: quantum number to force total MPS flux to be if setflux=true
  • randomize::Bool: randomize last tensor if flux forces a zero tensor
  • lastfluxzero::Bool: determines whether the rightmost flux should be zero or not
DMRJtensor.MPSMethod
MPS(Qlabels,mps[,newnorm=true,setflux=false,flux=...,randomize=true,override=true,lastfluxzero=false])

Converts an MPS mps into a an array of quantum number arrays with quantum numbers assigned from an array of qnum vectors Qlabels

Optional arguments

  • mps::MPS: dense MPS
  • Qlabels::Array{Array{Qnum,1},1}: quantum number labels on each physical index (assigns physical index labels mod size of this vector)
  • newnorm::Bool: set new norm of the MPS tensor
  • setflux::Bool: toggle to force this to be the total flux of the MPS tensor
  • flux::Qnum: quantum number to force total MPS flux to be if setflux=true
  • randomize::Bool: randomize last tensor if flux forces a zero tensor
  • lastfluxzero::Bool: determines whether the rightmost flux should be zero or not
DMRJtensor.MPSMethod
qmps = MPS(Qlabels[,oc=1,type=Float64])

Creates a quantum number MPS qmps with quantum numbers assigned from an array of qnums in Qlabels with orthogonality center oc and data type type; Ns is the number of sites in the system

DMRJtensor.MPSMethod
MPS(Qlabels,mps,mpo[,newnorm=true,setflux=false,flux=...,randomize=true,override=true,lastfluxzero=false])

Converts an MPS mps and MPO mpo into a quantum number version with Qlabels assigned uniformly to every site

Optional arguments

  • mps::MPS: dense MPS
  • Qlabels::Array{Array{Qnum,1},1}: quantum number labels on each physical index (assigns physical index labels mod size of this vector)
  • newnorm::Bool: set new norm of the MPS tensor
  • setflux::Bool: toggle to force this to be the total flux of the MPS tensor
  • flux::Qnum: quantum number to force total MPS flux to be if setflux=true
  • randomize::Bool: randomize last tensor if flux forces a zero tensor
  • lastfluxzero::Bool: determines whether the rightmost flux should be zero or not
DMRJtensor.MPSMethod
MPS(Qlabels,mps[,newnorm=true,setflux=false,flux=...,randomize=true,override=true,lastfluxzero=false])

Converts an MPS mps into a quantum number version with Qlabels assigned uniformly to every site

Optional arguments

  • mps::MPS: dense MPS
  • Qlabels::Array{Array{Qnum,1},1}: quantum number labels on each physical index (assigns physical index labels mod size of this vector)
  • newnorm::Bool: set new norm of the MPS tensor
  • setflux::Bool: toggle to force this to be the total flux of the MPS tensor
  • flux::Qnum: quantum number to force total MPS flux to be if setflux=true
  • randomize::Bool: randomize last tensor if flux forces a zero tensor
  • lastfluxzero::Bool: determines whether the rightmost flux should be zero or not
DMRJtensor.MPSMethod
psi = MPS(physindvec[,regtens=false,oc=1,type=Float64])

Constructs psi for MPS of tensor type type by making empty tensors of size (1,physindvec[w],1) for w indexing physindvec with othrogonality center oc. regtens avoids conversion to denstens type (defaulted to perform the conversion for efficiency)

DMRJtensor.MPSMethod
psi = MPS(A[,regtens=false,oc=psi.oc,type=...])

Constructs psi for MPS with tensors A (Array of tensors or MPS) with orthogonality center oc. regtens avoids conversion to denstens type (defaulted to perform the conversion for efficiency); type defaults to the input type of the tensors in psi

DMRJtensor.MPSMethod
psi = MPS(T,A[,regtens=false,oc=1])

Constructs psi for MPS of tensor type T with tensors A (Array of tensors or MPS) with orthogonality center oc. regtens avoids conversion to denstens type (defaulted to perform the conversion for efficiency)

DMRJtensor.MPSMethod
psi = MPS(T,physindvec,Ns[,regtens=false,oc=1])

Constructs psi for MPS of tensor type T by making empty tensors of size (1,physindvec[w],1) for w indexing 1:Ns (repeats on physindvec) with othrogonality center oc. regtens avoids conversion to denstens type (defaulted to perform the conversion for efficiency)

DMRJtensor.MPSMethod
qmps = MPS(Qlabels,arr[,oc=1,newnorm=true,setflux=false,flux=...,randomize=true,override=true,lastfluxzero=false])

Converts an array arr into a quantum number MPS qmps with quantum numbers assigned from an array of qnum vectors Qlabels

Optional arguments

  • mps::MPS: dense MPS
  • Qlabels::Array{Array{Qnum,1},1}: quantum number labels on each physical index (assigns physical index labels mod size of this vector)
  • oc::Integer: Integer
  • newnorm::Bool: set new norm of the MPS tensor
  • setflux::Bool: toggle to force this to be the total flux of the MPS tensor
  • flux::Qnum: quantum number to force total MPS flux to be if setflux=true
  • randomize::Bool: randomize last tensor if flux forces a zero tensor
  • lastfluxzero::Bool: determines whether the rightmost flux should be zero or not
DMRJtensor.MPSMethod
psi = MPS(physindvec,Ns[,regtens=false,oc=1])

Constructs psi for MPS of tensor type T by making empty tensors of size (1,physindvec[w],1) for w indexing 1:Ns (repeats on physindvec) with othrogonality center oc. regtens avoids conversion to denstens type (defaulted to perform the conversion for efficiency)

DMRJtensor.algvarsType
algvars

Struct to hold variables for the MPS optimization function and others

DMRJtensor.environmentType
environment

Construct this object through Env. Array that holds environment tensors

Fields:

  • V::Array{TensType,1}: vector of environment tensors

See also: Env

DMRJtensor.environmentMethod
V = environment(W,Ns)

Creates a blank environment of type W with entries for Ns tensors

DMRJtensor.largeEnvType
largeEnv

Abstract types for largeEnv; saves tensors to disk on setting values and retrieves them on calling an element; slower than other regEnv form

See also: largeMPS largeMPO

DMRJtensor.largeEnvMethod
G,K = largeEnv(T,Ns[,Llabel="Lenv_",Lnames=[label*"i" for i = 1:Ns],Rlabel="Renv_",Rnames=[label*"i" for i = 1:Ns],ext=".dmrjulia"])

Creates large environments with Ns tensors of type T and retrieved through G and K respectively according to filenames specified in Lnames and Rnames (default file extension: .dmrjulia)

See also: largeMPS largeMPO largeLenv largeRenv

DMRJtensor.largeEnvMethod
G,K = largeEnv(Ns[,Llabel="Lenv_",Lnames=[label*"i" for i = 1:Ns],Rlabel="Renv_",Rnames=[label*"i" for i = 1:Ns],ext=".dmrjulia",type=Float64])

Creates large environments with Ns tensors and retrieved through G and K respectively according to filenames specified in Lnames and Rnames (default file extension: .dmrjulia)

See also: largeMPS largeMPO largeLenv largeRenv

DMRJtensor.largeEnvMethod
G,K = largeEnv(lenv,renv[,Llabel="Lenv_",Lnames=[label*"i" for i = 1:length(psi)],Rlabel="Renv_",Rnames=[label*"i" for i = 1:length(renv)],ext=".dmrjulia",type=Float64])

Writes tensors from environments lenv and renv to hard disk as retrieved through G and K respectively according to filenames specified in Lnames and Rnames (default file extension: .dmrjulia)

See also: largeMPS largeMPO largeLenv largeRenv

DMRJtensor.largeMPOType
largeMPO

Abstract types for largeMPO; saves tensors to disk on setting values and retrieves them on calling an element; slower than other regMPO form

See also: largeEnv largeMPO

DMRJtensor.largeMPOMethod
G = largeMPO(T,Ns[,label="mpo_",names=[label*"i" for i = 1:length(mpo)],ext=".dmrjulia"])

Creates a large MPO type (stored on disk) of element type T with Ns tensors but does not write anything to disk initially. Filenames specified in names (default file extension: .dmrjulia)

See also: largeMPS largeLenv largeRenv largeEnv

DMRJtensor.largeMPOMethod
G = largeMPO(Ns[,label="mpo_",names=[label*"i" for i = 1:length(mpo)],ext=".dmrjulia"])

Creates a large MPO type (stored on disk) with Ns tensors (element type: Float64) but does not write anything to disk initially. Filenames specified in names (default file extension: .dmrjulia)

See also: largeMPS largeLenv largeRenv largeEnv

DMRJtensor.largeMPOMethod
G = largeMPO(mpo[,label="mpo_",names=[label*"i" for i = 1:length(mpo)],ext=".dmrjulia"])

Writes tensors from MPO mpo to hard disk as retrieved through G according to filenames specified in names (default file extension: .dmrjulia)

See also: largeMPS largeLenv largeRenv largeEnv

DMRJtensor.largeMPSType
largeMPS

Abstract types for largeMPS; saves tensors to disk on setting values and retrieves them on calling an element; slower than other regMPS form

See also: largeMPO largeEnv

DMRJtensor.largeMPSMethod
G = largeMPS(T,Ns[,label="mps_",names=[label*"i" for i = 1:length(psi)],ext=".dmrjulia"])

Creates a large MPS type (stored on disk) of element type T with Ns tensors but does not write anything to disk initially. Filenames specified in names (default file extension: .dmrjulia)

See also: largeMPO largeLenv largeRenv largeEnv

DMRJtensor.largeMPSMethod
G = largeMPS(Ns[,label="mps_",names=[label*"i" for i = 1:length(psi)],ext=".dmrjulia"])

Creates a large MPS type (stored on disk) with Ns tensors (element type: Float64) but does not write anything to disk initially. Filenames specified in names (default file extension: .dmrjulia)

See also: largeMPO largeLenv largeRenv largeEnv

DMRJtensor.largeMPSMethod
G = largeMPS(psi[,label="mps_",names=[label*"i" for i = 1:length(psi)],ext=".dmrjulia"])

Writes tensors from MPS psi to hard disk as retrieved through G according to filenames specified in names (default file extension: .dmrjulia)

See also: largeMPO largeLenv largeRenv largeEnv

DMRJtensor.largeenvironmentType
largeenvironment

Construct this container with largeEnv. struct to hold largeEnv tensors

Fields:

  • V::Array{String,1}: filenames where the tensors are stored on disk
  • type::DataType: DataType of the stored tensors

See also: largeEnv

DMRJtensor.largematrixproductoperatorType
largematrixproductoperator

Construct this container with largeMPO. struct to hold largeMPO tensors

Fields:

  • H::Array{String,1}: filenames where the tensors are stored on disk
  • type::DataType: DataType of the stored tensors

See also: largeMPO

DMRJtensor.largematrixproductstateType
largematrixproductstate

Construct this container with largeMPS. struct to hold largeMPS tensors and orthogonality center

Fields:

  • A::Array{String,1}: filenames where the tensors are stored on disk
  • oc::Integer: orthogonality center
  • type::DataType: DataType of the stored tensors

See also: largeMPS

DMRJtensor.matrixproductoperatorType
matrixproductoperator

Contruct this through MPO. Struct to hold MPO tensors

Fields:

  • H::Array{TensType,1}: vector of MPO tensors

See also: MPO

DMRJtensor.matrixproductstateType
matrixproductstate

Contruct this through MPS. struct to hold regMPS tensors and orthogonality center

Fields:

  • A::Array{TensType,1}: vector of MPS tensors
  • oc::Integer: orthogonality center

See also: MPS

DMRJtensor.mpotermMethod

mpoterm(Qlabels,val,operator,ind,base,trail...)

Same as mpoterm but converts to quantum number MPO with Qlabels on the physical indices

See also: mpoterm

DMRJtensor.mpotermMethod
mpoterm(val,operator,ind,base,trail...)

Creates an MPO from operators (operator) with a prefactor val on sites ind. Must also provide a base function which are identity operators for each site. trail operators can be defined (example: fermion string operators)

Example:

Cup, Cdn, Nup, Ndn, Ndens, F, O, Id = fermionOps()
base = [Id for i = 1:Ns]; #identity operators of the appropriate physical index size for each site
CupCupdag = mpoterm(-1.,[Cup,Cup'],[1,2],base,F); #Cup_1 Cup^dag_2
newpsi = applyMPO(psi,CupCupdag); #applies <Cup_1 Cup^dag_2> to psi
expect(psi,newpsi);
TensorPACK.networkMethod
net = network(input[,groundlevel=1])

Produces net from a set of input types (any number) input; groundlevel gives the number of the bottom level for MPS-MPO systems

#Examples: julia> network(dualpsi,psi,mpo) #generates a network of nametens; works for any number of MPOs julia> network(dualpeps,peps,mpdo) #same functionality as for the MPO case julia> network(mpo,mera) #creates a MERA network on top of an MPO

Base.:*Method
C = A*B

Multiplies a matrix of Hterms with a matrix of strings together to get an output term for two operators multiplied together C

See also: bulkMPO Omat Hterm pauliterm

Base.:*Method
C = A*B

Multiplies two paulistrings together to get an output term for two operators multiplied together C

See also: bulkMPO Omat Hterm pauliterm

Base.:*Method
*(X,Y)

concatenates two MPSs X and Y (same as vcat in Base Julia)

Base.:*Method
*(psi,c)

makes copy of input MPS psi and multiplies orthogonality center by a number c. Some number types require conversaion of psi

See also: convertTensor MPS

Base.:*Method
C = A*B

Multiplies two matrices of Hterms together to get an output term for two operators multiplied together C

See also: bulkMPO Omat Hterm pauliterm

Base.:*Method
C = A*B

Multiplies a matrix of strings with a matrix of Hterms together to get an output term for two operators multiplied together C

See also: bulkMPO Omat Hterm pauliterm

Base.:*Method
C = A*B

Multiplies two matrices of strings together to get an output term for two operators multiplied together C

See also: bulkMPO Omat Hterm pauliterm

Base.:*Method
*(c,psi)

makes copy of input MPS psi and multiplies orthogonality center by a number c. Some number types require conversaion of psi

See also: convertTensor MPS

Base.:*Method

A + B

functionality for adding (similar to direct sum) of MPOs together; uses joinindex function to make a combined MPO

note: deparallelizes after every addition

See also: deparallelization add!

Base.:+Method

H + c

Adds a constant c to a Hamiltonian H (commutative)

Base.:+Method
A + B

functionality for adding (similar to direct sum) of MPOs together; uses joinindex function to make a combined MPO

Note: Calls add! so will run compressMPO! on the result

See also: deparallelization add! mult!

Base.:-Method

H - c

Adds a constant c to a Hamiltonian H

Base.:/Method
/(psi,c)

makes copy of input MPS psi and divides orthogonality center by a number c. Some number types require conversaion of psi

See also: convertTensor MPS

Base.Multimedia.displayMethod
display(A[,kron=false])

Generates printout for a given Hterms; kron (true) shows the long-form of the term while false is the truncated version (more common)

See also: bulkMPO Omat Hterm

Base.Multimedia.displayMethod
display(A[,kron=false])

Generates printout for a given input array of Hterms; kron (true) shows the long-form of the term while false is the truncated version (more common)

See also: bulkMPO Omat Hterm

Base.conj!Method
psi = conj!(psi)

Conjugates all elements in an MPS in-place; outputs psi which was input

See also conj

Base.conjMethod
newpsi = conj(psi)

Conjugates all elements in an MPS and makes a copy psi

See also conj!

Base.copyMethod
G = copy(names,X[,ext=".dmrjulia",copyext=ext])

Copies tensors from largeEnv input X to a new tensor with a single string names which is used to generate a vector of names representing the new filenames with input extension ext and the new extension copyext

Base.copyMethod
G = copy(names,X[,ext=".dmrjulia",copyext=ext])

Copies tensors from largeMPO input X to a new tensor with a vector of a single string names which is used to generate a vector of names representing the new filenames with input extension ext and the new extension copyext

Base.copyMethod
G = copy(names,X[,ext=".dmrjulia",copyext=ext])

Copies tensors from largeMPS input X to a new tensor with a vector of a single string names which is used to generate a vector of names representing the new filenames with input extension ext and the new extension copyext

Base.copyMethod
G = copy(names,X[,ext=".dmrjulia",copyext=ext])

Copies tensors from largeEnv input X to a new tensor with a vector of strings names representing the new filenames with input extension ext and the new extension copyext

Base.copyMethod
G = copy(names,X[,ext=".dmrjulia",copyext=ext])

Copies tensors from largeMPO input X to a new tensor with a vector of strings names representing the new filenames with input extension ext and the new extension copyext

Base.copyMethod
G = copy(names,X[,ext=".dmrjulia",copyext=ext])

Copies tensors from largeMPS input X to a new tensor with a vector of strings names representing the new filenames with input extension ext and the new extension copyext

Base.copyMethod
newG = copy(G)

Copies an Env to new output container of the same type; type stable (where deepcopy is type-unstable inherently)

Base.copyMethod
newmpo = copy(mpo)

Copies an MPO to new output container of the same type; type stable (where deepcopy is type-unstable inherently)

Base.copyMethod
newpsi = copy(psi)

Copies an MPS to new output container of the same type; type stable (where deepcopy is type-unstable inherently)

Base.eltypeMethod
G = eltype(Y)

eltype gets element type G of any largeType network

See also: largeType

Base.eltypeMethod
G = eltype(Y)

eltype gets element type G of the Env

Base.eltypeMethod
G = eltype(Y)

eltype gets element type G of the MPO

Base.eltypeMethod
G = eltype(Y)

eltype gets element type G of the MPS

Base.getindexMethod
G = getindex(A,i)

getindex allows to retrieve tensor G at position i from MERA

Base.getindexMethod
G = getindex(A,i)

getindex allows to retrieve tensor G at position i from largeEnv

Base.getindexMethod
G = getindex(A,i)

getindex allows to retrieve tensor G at position i from largeMPO

Base.getindexMethod
G = getindex(A,i)

getindex allows to retrieve tensor G at position i from largeMPS

Base.getindexMethod
G = getindex(A,i)

getindex allows to retrieve tensor G at position i from Env

Base.getindexMethod
G = getindex(A,i)

getindex allows to retrieve tensor G at position i from MPO

Base.getindexMethod
G = getindex(A,i)

getindex allows to retrieve tensor G at position i from MPS

Base.getindexMethod
G = getindex(A,r)

getindex allows to retrieve a range r (ex: r = 2:6) tensor G from Env

Base.getindexMethod
G = getindex(A,r)

getindex allows to retrieve a range r (ex: r = 2:6) tensor G from MPO

Base.getindexMethod
G = getindex(A,r)

getindex allows to retrieve a range r (ex: r = 2:6) tensor G from MPS

Base.lastindexMethod
B = psi[end]

lastindex! allows to get the end element of an Env

Base.lastindexMethod
B = psi[end]

lastindex! allows to get the end element of an MPO

Base.lastindexMethod
B = psi[end]

lastindex! allows to get the end element of an MPS

Base.lengthMethod
G = length(H)

length prints out the number of entries of the input H being a MERA; this is the number of tensors in the layer of isometries or unitaries

Base.lengthMethod
G = length(H)

length prints out the number of entries of the input H being a MPO; this is effecitvely the number of sites

Base.lengthMethod
G = length(H)

length prints out the number of entries of the input H being a MPS; this is effecitvely the number of sites

Base.lengthMethod
G = length(H)

length prints out the number of entries of the input H being a largeEnv; this is effecitvely the number of sites

Base.lengthMethod
G = length(H)

length prints out the number of entries of the input H being a largeMPO; this is effecitvely the number of sites

Base.lengthMethod
G = length(H)

length prints out the number of entries of the input H being a largeMPS; this is effecitvely the number of sites

Base.lengthMethod
G = length(H)

length prints out the number of entries of the input H being a Env; this is effecitvely the number of sites

Base.setindex!Method
Lenv[i] = G

setindex! allows to assign elements G to an largeEnv at element i

Base.setindex!Method
Lenv[i] = G

setindex! allows to assign elements G to an largeMPO at element i

Base.setindex!Method
Lenv[i] = G

setindex! allows to assign elements G to an largeMPS at element i

Base.setindex!Method
Lenv[i] = G

setindex! allows to assign elements G to an Env at element i

Base.setindex!Method
mpo[i] = G

setindex! allows to assign elements G to an MPO at element i

Base.setindex!Method
psi[i] = G

setindex! allows to assign elements G to an MPS at element i

Base.sizeMethod
G = size(H,i)

size prints out the size tuple G of the tensor field of a MPO; this is effectively the number of sites in a tuple

Base.sizeMethod
G = size(H)

size prints out the size tuple G of the tensor field of a MPO; this is effectively the number of sites in a tuple

Base.sizeMethod
G = size(H,i)

size prints out the size tuple G of the tensor field of a MPS; this is effectively the number of sites in a tuple

Base.sizeMethod
G = size(H)

size prints out the size tuple G of the tensor field of a MPS; this is effectively the number of sites in a tuple

Base.sizeMethod
G = size(H,i)

size prints out the size tuple G of the tensor field of a Env; this is effectively the number of sites in a tuple

Base.sizeMethod
G = size(H)

size prints out the size tuple G of the tensor field of a Env; this is effectively the number of sites in a tuple

DMRJtensor.Lupdate!Method
Lupdate!(i,Lenv,psi,dualpsi,mpo)

Updates left environment's (Lenv) i+1 site from info on the site i based on dual MPS (dualpsi), MPS (psi), and MPO (mpo`)

DMRJtensor.Lupdate!Method
Lupdate!(i,Lenv,psi,mpo)

Updates left environment's (Lenv) i+1 site from info on the site i based on MPS (psi) and MPO (mpo`)

DMRJtensor.LupdateMethod
Lupdate(Lenv,dualpsi,psi,mpo)

Updates left environment tensor Lenv with dual MPS dualpsi, MPS psi, and MPO mpo

DMRJtensor.OmatMethod

Omat(m)

Generates a bulk matrix product operator with reserved string "O" for zero with a matrix of size m x m. Can multiply this object to get bulk MPO for a given system.

Example:


H = bulkMPO(5) #["O" for i = 1:5,j = 1:5]

#XXZ model
H[1,1] = H[end,end] = "I"
H[2,1] = "S"*Char(0x207B)
H[3,1] = "S"*Char(0x207A)
H[4,1] = "Sz"
H[end,2] = half*"S"*Char(0x207A)
H[end,3] = half*"S"*Char(0x207B)
H[end,4] = "Sz"
H*H*H #multiply 3 sites together

See also: bulkMPO half

DMRJtensor.Rupdate!Method
Rupdate!(i,Renv,dualpsi,psi,mpo)

Updates right environment's (Renv) i-1 site from info on the site i based on dual MPS (dualpsi), MPS (psi), and MPO (mpo`)

DMRJtensor.Rupdate!Method
Rupdate!(i,Renv,psi,mpo)

Updates right environment's (Renv) i-1 site from info on the site i based on MPS (psi) and MPO (mpo`)

DMRJtensor.RupdateMethod
Rupdate(Renv,dualpsi,psi,mpo)

Updates right environment tensor Renv with dual MPS dualpsi, MPS psi, and MPO mpo

DMRJtensor.XXZFunction
XXZ(i[,spinmag=0.5,J=0.5])

Creates a bulk MPO of the Heisenberg model for uniform coupling J, and spin magnitude spinmag

See also: XXZ

DMRJtensor.applyMPOMethod
newpsi = applyMPO(psi,H[,m=1,cutoff=0.])

Applies MPO (H) to an MPS (psi) and truncates to maximum bond dimension m and cutoff cutoff

DMRJtensor.applyMPOMethod
newpsi = applyMPO(psi,H...[,m=1,cutoff=0.])

Applies MPOs (H) to an MPS (psi) and truncates to maximum bond dimension m and cutoff cutoff. Not recommended except for small problems since bond dimension is not truncated uniformly.

DMRJtensor.applyOps!Method
psi = applyOps!(psi,sites,Op[,trail=ones(1,1)])

Applies operator Op (any TensType) in-place to the MPS psi at sites sites, a vector of integers. A trailing operator trail can be applied if not the default.

DMRJtensor.applyOpsMethod
newpsi = applyOps(psi,sites,Op[,trail=ones(1,1)])

Applies operator Op (any TensType) to the MPS psi at sites sites, a vector of integers. A trailing operator trail can be applied if not the default.

DMRJtensor.applylocalF!Method
applylocalF!(tens, i)

(in-place) effectively apply a chain of F (fermion phase) operator by a single manipulation on the specified index.

See also: applylocalF

DMRJtensor.applylocalFMethod
applylocalF(tens, i)

effectively apply a chain of F (fermion phase) operator by a single manipulation on the specified index.

See also: applylocalF!

DMRJtensor.assignflux!Method
assignflux!(i,mps,QnumMat,storeVal)

Assigns flux to the right link index on an MPS tensor

Arguments

  • i::intType: current position
  • mps::MPS: MPS
  • QnumMat::Array{Array{Qnum,1},1}: quantum number matrix for the physical index
  • storeVal::Array{T,1}: maximum value found in MPS tensor, determine quantum number
DMRJtensor.boundaryMove!Method
boundaryMove!(psi,i,mpo,Lenv,Renv)

Move orthogonality center of psi to site i and updates left and right environments Lenv and Renv using MPO mpo

See also: move!

DMRJtensor.boundaryMove!Method
boundaryMove!(dualpsi,psi,i,mpo,Lenv,Renv)

Move orthogonality center of psi and dualpsi to site i and updates left and right environments Lenv and Renv using MPO mpo

See also: move!

DMRJtensor.boundaryMoveMethod
boundaryMove(psi,i,mpo,Lenv,Renv)

Copies psi and moves orthogonality center of psi to site i and updates left and right environments Lenv and Renv using MPO mpo

See also: move!

DMRJtensor.boundaryMoveMethod
boundaryMove(dualpsi,psi,i,mpo,Lenv,Renv)

Copies psi and moves orthogonality center of psi and dualpsi to site i and updates left and right environments Lenv and Renv using MPO mpo

See also: move!

DMRJtensor.bulkMPOMethod

bulkMPO(m)

Generates a bulk matrix product operator with reserved string "O" for zero with a matrix of size m x m. Can multiply this object to get bulk MPO for a given system.

Example:

Example:


H = bulkMPO(5) #["O" for i = 1:5,j = 1:5]

#XXZ model
H[1,1] = H[end,end] = "I"
H[2,1] = "S"*Char(0x207B)
H[3,1] = "S"*Char(0x207A)
H[4,1] = "Sz"
H[end,2] = half*"S"*Char(0x207A)
H[end,3] = half*"S"*Char(0x207B)
H[end,4] = "Sz"
H*H*H #multiply 3 sites together

See also: Omat half

DMRJtensor.compressMPO!Method

compressMPO!(W[,sweeps=,cutoff=,deltam=,minsweep=,nozeros=])

compresses MPO (W; or several M) with SVD compression for sweeps sweeps, cutoff applied to the SVD, deltam target for teh bond dimension compression, and nozeros defaulted to true to eliminate all zeros in the SVD

DMRJtensor.compressMPO!Method

compressMPO!(W[,sweeps=,cutoff=,deltam=,minsweep=,nozeros=])

compresses an array of MPOs (W) in parallel with SVD compression for sweeps sweeps, cutoff applied to the SVD, deltam target for teh bond dimension compression, and nozeros defaulted to true to eliminate all zeros in the SVD

DMRJtensor.compressMPOMethod

compressMPO(W,sweeps=,cutoff=,deltam=,minsweep=,nozeros=])

Same as compressMPO! but a copy is made of the original vector of MPOs

See also: compressMPO!

DMRJtensor.correlationMethod
T = correlation(dualpsi,psi,inputoperators...[,sites=ntuple(i->1,length(inputoperators)),trail=()])

Computes the general correlation on the input MPS psi with operators defined in the tuple inputoperators. The sites command specifies which sites to allow for the operators to be applied (i.e., some operators can skip some sites) and the trail option allows for a trailing operator like the Fermion sign operator; output is a tensor T of rank equal to the size of inputoperators

See also: expect correlationmatrix

DMRJtensor.correlationMethod
T = correlation(psi,inputoperators...[,sites=ntuple(i->1,length(inputoperators)),trail=()])

Computes the general correlation on the input MPS psi with operators defined in the tuple inputoperators. The sites command specifies which sites to allow for the operators to be applied (i.e., some operators can skip some sites) and the trail option allows for a trailing operator like the Fermion sign operator; output is a tensor T of rank equal to the size of inputoperators

See also: expect correlationmatrix

DMRJtensor.correlationmatrixMethod
rho = correlationmatrix(dualpsi,psi,Cc,Ca[,F,silent=])

Compute the correlation funciton (example, <dualpsi|Cci . Caj|psi>) on all sites; can also specify a trail F for Fermion strings; silent toggles output of every line; outputs matrix rho

Note:

  • More efficient than using mpoterms or correlation
  • Use mpoterm and applyMPO for higher order correlation functions or write a new function
DMRJtensor.correlationmatrixMethod
A = correlationmatrix(psi,Cc,Ca[,F,silent=])

Compute the correlation funciton (example, <psi|Cci . Caj|psi>) on all sites; can also specify a trail F for Fermion strings; silent toggles output of every line; outputs matrix rho

Note:

  • More efficient than using mpoterms or correlation
  • Use mpoterm and applyMPO for higher order correlation functions or write a new function

Example:

Cup, Cdn, Nup, Ndn, Ndens, F, O, Id = fermionOps()
rho = correlationmatrix(psi,Cup',Cup,F) #density matrix
DMRJtensor.defaultBoundaryMethod
tensor = defaultBoundary(A)

Creates a tensor tensor that has no elements for any input tensor A (both tensors of the same type)

DMRJtensor.deparallelize!Method

deparallelize!(M[,left=])

Deparallelizes a matrix-equivalent of a rank-4 tensor M; toggle the decomposition into the left or right

DMRJtensor.deparallelize!Method

deparallelize!(W[,sweeps=])

Deparallelize an array of MPOs (W) for sweeps passes; compressed MPO appears in first entry

DMRJtensor.elnumtypeMethod
G = elnumtype(op...)

Gives type G of input containers op, a tuple containing MPS, MPO, or Env types

DMRJtensor.emptyTensorMethod
B = emptyTensor(A)

Generates a tensor with no inputs from an input array of Qtens

DMRJtensor.emptyTensorMethod
B = emptyTensor(A)

Generates a tensor with no inputs from an input array of tens

DMRJtensor.emptyTensorMethod
B = emptyTensor(A)

Generates a tensor with no inputs from an input array of Array

DMRJtensor.emptyTensorMethod
B = emptyTensor(A)

Generates a tensor with no inputs from an input network of Qtens

DMRJtensor.emptyTensorMethod
B = emptyTensor(A)

Generates a tensor with no inputs from an input network of tens

DMRJtensor.emptyTensorMethod
B = emptyTensor(A)

Generates a tensor with no inputs from an input network of Array

DMRJtensor.expectMethod
expval = expect(dualpsi,psi,H[,Lbound=,Rbound=,order=])

evaluate <dualpsi|H|psi> for any number of MPOs H; can specifcy left and right boundaries (Lbound and Rbound); dualpsi is conjugated inside of the algorithm; output is an expectation value expval

See also: overlap

DMRJtensor.expectMethod
expval = expect(psi,H[,Lbound=,Rbound=,order=])

evaluate <psi|H|psi> for any number of MPOs H; can specifcy left and right boundaries (Lbound and Rbound); output is an expectation value expval

See also: overlap

DMRJtensor.fermionOpsMethod
Cup,Cdn,F,Nup,Ndn,Ndens,O,Id = fermionOps()

Make fermion operators Cup,Cdn,F,Nup,Ndn,Ndens,O,Id

#Outputs:

  • Cup: spin-up annihilation operator
  • Cdn: spin-down annihilation operator
  • F: Jordan-Wigner Fermion string
  • Nup: spin-up number operator
  • Ndn: spin-dn number operator
  • Ndens: total-spin number operator
  • O: zero matrix
  • Id: identity matrix
DMRJtensor.fullHMethod
H = fullH(mpo)

Generates the full Hamiltonian from an MPO (memory providing); assumes lower left triagular form

DMRJtensor.fullpsiMethod
vect = fullpsi(psi)

Generates the full wavefunction vect from an MPS psi (memory providing)

DMRJtensor.get_tensorsMethod
B = get_tensors(A)

Unified function for obtaining the vector of tensors from an MERA

DMRJtensor.get_tensorsMethod
B = get_tensors(A)

Unified function for obtaining the vector of tensors from an MPO

DMRJtensor.get_tensorsMethod
B = get_tensors(A)

Unified function for obtaining the vector of tensors from an MPS

DMRJtensor.heisenbergMPOMethod
heisenbergMPO(i[,spinmag=0.5,J=0.5,Ops=spinOps(spinmag)])

Creates a bulk MPO of the Heisenberg model for uniform coupling J, spin magnitude spinmag, and operator set Ops

#Example: julia> En = Vector{Float64}(undef,8) julia> for Ns = 3:10 mpo = makeMPO(XXZ,2,Ns) psi = randMPS(2,Ns) En[Ns-2] = dmrg(psi,mpo,sweeps=50,m=100,cutoff=1E-9) end

#Expected outputs: 3 -1.0 4 -0.9571067811865475 5 -1.9278862533179937 6 -2.0019953568985334 7 -2.836239680686649 8 -3.3749325986878933 9 -3.7363216980340077 10 -4.258035204636598

See also: XXZ

DMRJtensor.hubbardMPOMethod
hubbardMPO(i[,t=1.0,mu=-2.0,HubU=4.0,Ops=fermionOps()])

Creates a bulk MPO of the Hubbard model for uniform kinetic energy t, and spin magnitude spinmag

See also: XXZ

DMRJtensor.largeLenvMethod
G = largeLenv(T,Ns[,label="Lenv_",names=[label*"i" for i = 1:Ns],ext=".dmrjulia"])

Creates a large environment type (stored on disk) of element type T with Ns tensors but does not write anything to disk initially. Filenames specified in names (default file extension: .dmrjulia)

See also: largeMPS largeMPO largeRenv largeEnv

DMRJtensor.largeLenvMethod
G = largeLenv(Ns[,label="Lenv_",names=[label*"i" for i = 1:Ns],ext=".dmrjulia"])

Creates a large environment type (stored on disk) with Ns tensors (element type: Float64) but does not write anything to disk initially. Filenames specified in names (default file extension: .dmrjulia)

See also: largeMPS largeMPO largeRenv largeEnv

DMRJtensor.largeLenvMethod
G = largeLenv(lenv[,label="Lenv_",names=[label*"i" for i = 1:length(lenv)],ext=".dmrjulia"])

Writes tensors from environment lenv to hard disk as retrieved through G according to filenames specified in names (default file extension: .dmrjulia)

See also: largeMPS largeMPO largeRenv largeEnv

DMRJtensor.largeRenvMethod
G = largeRenv(T,Ns[,label="Renv_",names=[label*"i" for i = 1:Ns],ext=".dmrjulia"])

Creates a large environment type (stored on disk) of element type T with Ns tensors but does not write anything to disk initially. Filenames specified in names (default file extension: .dmrjulia)

See also: largeMPS largeMPO largeLenv largeEnv

DMRJtensor.largeRenvMethod
G = largeRenv(Ns[,label="Renv_",names=[label*"i" for i = 1:Ns],ext=".dmrjulia"])

Creates a large environment type (stored on disk) with Ns tensors (element type: Float64) but does not write anything to disk initially. Filenames specified in names (default file extension: .dmrjulia)

See also: largeMPS largeMPO largeLenv largeEnv

DMRJtensor.largeRenvMethod
G = largeRenv(renv[,label="Renv_",names=[label*"i" for i = 1:length(renv)],ext=".dmrjulia"])

Writes tensors from environment renv to hard disk as retrieved through G according to filenames specified in names (default file extension: .dmrjulia)

See also: largeMPS largeMPO largeLenv largeEnv

DMRJtensor.leftnormalize!Method
psi,D,V = leftnormalize!(psi)

Creates a left-normalized MPS in-place from psi and returns the external tensors D and V

DMRJtensor.leftnormalizeMethod
newpsi,D,V = leftnormalize(psi)

Creates a left-normalized MPS newpsi from psi and returns the external tensors D and V

DMRJtensor.libtestMethod

testlib([,tests=,path=libdir*"/test/"])

Tests all functions in the files enumerated in tests. Default is to check all test functionality in the library. Used in nightly builds. See format in /tests/ folder

See also: libdir

DMRJtensor.loadEnvMethod
G,K = loadEnv(Ns[,Llabel="Lenv_",Lnames=[label*"i" for i = 1:Ns],Rlabel="Renv_",Rnames=[label*"i" for i = 1:Ns],ext=".dmrjulia"])

If environment tensors are stored on hard disk, then they can be retrieved by using loadEnv

DMRJtensor.loadLenvMethod
G = loadLenv(Ns[,label="Lenv_",names=[label*"i" for i = 1:Ns],ext=".dmrjulia"])

If left environment tensors are stored on hard disk, then they can be retrieved by using loadLenv

DMRJtensor.loadMPOMethod
G = loadMPO(Ns[,label="mpo_",names=[label*"i" for i = 1:Ns],ext=".dmrjulia"])

If MPO tensors are stored on hard disk, then they can be retrieved by using loadMPO

DMRJtensor.loadMPSMethod
G = loadMPS(Ns[,label="mps_",names=[label*"i" for i = 1:Ns],ext=".dmrjulia"])

If MPS tensors are stored on hard disk, then they can be retrieved by using loadMPS

DMRJtensor.loadRenvMethod
G = loadRenv(Ns[,label="Renv_",names=[label*"i" for i = 1:Ns],ext=".dmrjulia"])

If right environment tensors are stored on hard disk, then they can be retrieved by using loadRenv

DMRJtensor.makeBoundaryMethod
Lbound = makeBoundary(qind,newArrows[,retType=])

makes a boundary tensor Lbound for an input from the quantum numbers qind and arrows newArrows; can also define type of resulting Qtensor retType (default Float64)

#Note:

  • dense tensors are just ones(1,1,1,...)

See also: makeEnds

DMRJtensor.makeEdgeEnvMethod
Lbound = makeEdgeEnv(dualpsi,psi[,mpovec,boundary=defaultBoundary,left=true])

Created leftmost boundary tensor for the MPS psi, dual MPS dualpsi, any number of MPOs mpovec; boundary creates a tensor of the appropriate type and left makes either a left (true) or right (false) tensor

DMRJtensor.makeEndsMethod
Lenv,Renv = makeEnds(dualpsi,psi[,mpovec,Lbound=,Rbound=])

Generates first and last environments for a given system of variable MPOs

Arguments:

  • dualpsi::MPS: dual MPS
  • psi::MPS: MPS
  • mpovec::MPO: MPOs
  • Lbound::TensType: left boundary
  • Rbound::TensType: right boundary
DMRJtensor.makeEndsMethod
Lenv,Renv = makeEnds(psi[,mpovec,Lbound=,Rbound=])

Generates first and last environment tensors for a given system of variable MPOs. Same as other implementation but dualpsi=psi

Arguments:

  • psi::MPS: MPS
  • mpovec::MPO: MPOs
  • Lbound::TensType: left boundary
  • Rbound::TensType: right boundary
DMRJtensor.makeEnvMethod
Lenv,Renv = makeEnv(psi,mpo[,Lbound=,Rbound=])

Generates environment tensors for a MPS (psi) with boundaries Lbound and Rbound

DMRJtensor.makeEnvMethod
Lenv,Renv = makeEnv(dualpsi,psi,mpo[,Lbound=defaultBoundary,Rbound=defaultBoundary,Llabel="Lenv_",Rlabel="Renv_"])

Generates environment tensors for a MPS (psi and its dual dualpsi) with boundaries Lbound and Rbound; labels Llabel and Rlabel are for large-types

DMRJtensor.makeMPOMethod
mpo = makeMPO(H,physSize,Ns[,lower=])

Converts a function producing a bulk MPO tensor H input i the site index into an MPO mpo; physSize can be a vector (one element for the physical index size on each site) or a number (uniform sites); lower signifies the input is the lower triangular form (default) and is represented by a tensor diagrammatically as

     s2
     |

a1 – W – a2 = W[a1,s1,s2,a2] | s1

Example:

spinmag = 0.5;Ns = 10
Sp,Sm,Sz,Sx,Sy,O,Id = spinOps(spinmag)
function H(i::Integer)
    return [Id O O;
            Sz O O;
            O Sz Id]
end
isingmpo = makeMPO(H,size(Id,1),Ns)
DMRJtensor.makeMPOMethod
mpo = makeMPO(H,physSize,Ns[,lower=])

Converts a function producing a bulk MPO tensor H input i the site index into an MPO mpo; physSize is a vector (one element for the physical index size on each site); lower signifies the input is the lower triangular form (default) and is represented by a tensor diagrammatically as

     s2
     |

a1 – W – a2 = W[a1,s1,s2,a2] | s1

Example:

spinmag = 0.5;Ns = 10
Sp,Sm,Sz,Sx,Sy,O,Id = spinOps(spinmag)
function H(i::Integer)
    return [Id O O;
            Sz O O;
            O Sz Id]
end
isingmpo = makeMPO(H,size(Id,1),Ns)
DMRJtensor.makeMPOMethod
mpo = makeMPO(H,physSize[,lower=])

Converts vector (H) of matrices into a full MPO mpo; physSize is a number (uniform sites); lower signifies the input is the lower triangular form (default) and is represented by a tensor diagrammatically as

     s2
     |

a1 – W – a2 = W[a1,s1,s2,a2] | s1

Example:

spinmag = 0.5;Ns = 10
Sp,Sm,Sz,Sx,Sy,O,Id = spinOps(spinmag)
function H(i::Integer)
    return [Id O O;
            Sz O O;
            O Sz Id]
end
isingmpo = makeMPO(H,size(Id,1),Ns)
DMRJtensor.makeMPOMethod
mpo = makeMPO(H,physSize[,lower=])

Converts vector (H) of matrices into a full MPO mpo; physSize is a vector (one element for the physical index size on each site); lower signifies the input is the lower triangular form (default) and is represented by a tensor diagrammatically as

     s2
     |

a1 – W – a2 = W[a1,s1,s2,a2] | s1

Example:

spinmag = 0.5;Ns = 10
Sp,Sm,Sz,Sx,Sy,O,Id = spinOps(spinmag)
function H(i::Integer)
    return [Id O O;
            Sz O O;
            O Sz Id]
end
isingmpo = makeMPO(H,size(Id,1),Ns)
DMRJtensor.makeMPOMethod
mpo = makeMPO(H,physSize,Ns[,lower=])

Converts a bulk MPO tensor H for Ns sites; physSize is a vector (one element for the physical index size on each site); lower signifies the input is the lower triangular form (default) and is represented by a tensor diagrammatically as

     s2
     |

a1 – W – a2 = W[a1,s1,s2,a2] | s1

Example:

spinmag = 0.5;Ns = 10
Sp,Sm,Sz,Sx,Sy,O,Id = spinOps(spinmag)
function H(i::Integer)
    return [Id O O;
            Sz O O;
            O Sz Id]
end
isingmpo = makeMPO(H,size(Id,1),Ns)
DMRJtensor.makeMPOMethod
mpo = makeMPO(H,physSize,Ns[,lower=])

Converts a bulk MPO tensor H into an MPO mpo of Ns sites; physSize is a number (uniform sites); lower signifies the input is the lower triangular form (default) and is represented by a tensor diagrammatically as

     s2
     |

a1 – W – a2 = W[a1,s1,s2,a2] | s1

Example:

spinmag = 0.5;Ns = 10
Sp,Sm,Sz,Sx,Sy,O,Id = spinOps(spinmag)
function H(i::Integer)
    return [Id O O;
            Sz O O;
            O Sz Id]
end
isingmpo = makeMPO(H,size(Id,1),Ns)
DMRJtensor.makeMPSMethod
makeMPS(vect,physInd[,Ns=,oc=])

generates an MPS from a single vector expressed as a denstens (i.e., from exact diagonalization) for Ns sites and physInd size physical index at orthogonality center oc

DMRJtensor.makeMPSMethod
makeMPS(vect,physInd[,Ns=,oc=])

generates an MPS from a single vector (i.e., from exact diagonalization) for Ns sites and physInd size physical index at orthogonality center oc

DMRJtensor.makeMPSMethod
makeMPS(vect,physInd[,Ns=,oc=])

generates an MPS from a single vector expressed as a denstens (i.e., from exact diagonalization) for Ns sites and physInd an integer that is equal on all sites for the size physical index at orthogonality center oc

DMRJtensor.makeqMPOMethod
mpo = makeqMPO(Qlabels,mpo)

Generates quantum number MPO from a dense Hamiltonian based on Qlabels

Arguments:

  • mpo::MPO: dense MPO
  • Qlabels::Array{Array{Qnum,1},1}: quantum numbers for physical indices (modulus size of vector)
DMRJtensor.makeqMPOMethod
mpo = makeqMPO(Qlabels,mpo)

Generates quantum number MPO from a dense Hamiltonian based on Qlabels

Arguments:

  • mpo::MPO: dense MPO
  • Qlabels::Array{Qnum,1}: quantum numbers for physical indices (uniform)
DMRJtensor.makeqMPSMethod
makeqMPS(mps,Qlabels[,newnorm=true,setflux=false,flux=...,randomize=true,override=true,lastfluxzero=false])

creates quantum number MPS from regular MPS according to Qlabels

Optional arguments

  • mps::MPS: dense MPS
  • Qlabels::Array{Array{Qnum,1},1}: quantum number labels on each physical index (assigns physical index labels mod size of this vector)
  • newnorm::Bool: set new norm of the MPS tensor
  • setflux::Bool: toggle to force this to be the total flux of the MPS tensor
  • flux::Qnum: quantum number to force total MPS flux to be if setflux=true
  • randomize::Bool: randomize last tensor if flux forces a zero tensor
  • lastfluxzero::Bool: determines whether the rightmost flux should be zero or not
DMRJtensor.makeqMPSMethod
makeqMPS(Qlabels,mps[,newnorm=true,setflux=false,flux=...,randomize=true,override=true,lastfluxzero=false])

creates quantum number MPS from regular MPS according to Qlabels

Optional arguments

  • mps::MPS: dense MPS
  • Qlabels::Array{Array{Qnum,1},1}: quantum number labels on each physical index (assigns physical index labels mod size of this vector)
  • newnorm::Bool: set new norm of the MPS tensor
  • setflux::Bool: toggle to force this to be the total flux of the MPS tensor
  • flux::Qnum: quantum number to force total MPS flux to be if setflux=true
  • randomize::Bool: randomize last tensor if flux forces a zero tensor
  • lastfluxzero::Bool: determines whether the rightmost flux should be zero or not
DMRJtensor.makeqMPSMethod
makeqMPS(Qlabels,arr[,newnorm=true,setflux=false,flux=...,randomize=true,override=true,lastfluxzero=false])

creates quantum number MPS from an input array or network (arr) according to Qlabels

Optional arguments:

  • mps::MPS: dense MPS
  • Qlabels::Array{Array{Qnum,1},1}: quantum number labels on each physical index (assigns physical index labels mod size of this vector)
  • newnorm::Bool: set new norm of the MPS tensor
  • setflux::Bool: toggle to force this to be the total flux of the MPS tensor
  • flux::Qnum: quantum number to force total MPS flux to be if setflux=true
  • randomize::Bool: randomize last tensor if flux forces a zero tensor
  • lastfluxzero::Bool: determines whether the rightmost flux should be zero or not
DMRJtensor.maketermMethod
Y = maketerm(X[,kron=false])

Generates the complete Pauli string Y from an input Hterm X; kron (true) shows the long-form of the term while false is the truncated version (more common)

See also: bulkMPO Omat

DMRJtensor.maketermMethod
Y = maketerm(X[,kron=false])

Generates the complete Pauli string Y from an input pauliterm X; kron (true) shows the long-form of the term while false is the truncated version (more common)

See also: bulkMPO Omat

DMRJtensor.move!Method
move!(psi,newoc[,m=,cutoff=,minm=])

in-place move orthgononality center of psi to a new site, newoc, with a maximum bond dimenion m, cutoff cutoff, and minimum bond dimension minm; toggle truncation of tensor during movement with condition

See also: move

DMRJtensor.moveMethod
move(psi,newoc[,m=,cutoff=,minm=])

same as move! but makes a copy of psi

See also: move!

DMRJtensor.moveL!Method
moveL!(psi[,cutoff=,m=,minm=,condition=])

acts in-place to move psi's orthogonality center left one space, with a maximum bond dimenion m, cutoff cutoff, and minimum bond dimension minm; toggle truncation of tensor during movement with condition

See also: moveL

DMRJtensor.moveL!Method
D,truncerr = moveL(Lpsi,Rpsi[,cutoff=,m=,minm=,condition=])

moves psi's orthogonality center left one space, with a maximum bond dimenion m, cutoff cutoff, minimum bond dimension minm; toggle truncation of tensor during movement with condition; returns psi[iL],psi[iR],D from the SVD, and the truncation error. Modifies Rpsi

See also: moveL!

DMRJtensor.moveLMethod
D,truncerr = moveL(Lpsi,Rpsi[,cutoff=,m=,minm=,condition=])

moves psi's orthogonality center left one space, with a maximum bond dimenion m, cutoff cutoff, minimum bond dimension minm; toggle truncation of tensor during movement with condition; returns psi[iL],psi[iR],D from the SVD, and the truncation error. Does not modify Lpsi and Rpsi

See also: moveL!

DMRJtensor.moveR!Method
D,truncerr = moveR!(psi[,cutoff=,m=,minm=,condition=])

acts in-place to move psi's orthogonality center right one space, with a maximum bond dimenion m, cutoff cutoff, and minimum bond dimension minm; toggle truncation of tensor during movement with condition

See also: moveR

DMRJtensor.moveR!Method
D,truncerr = moveR!(Lpsi,Rpsi[,cutoff=,m=,minm=,condition=])

moves psi's orthogonality center right one space, with a maximum bond dimenion m, cutoff cutoff, minimum bond dimension minm; toggle truncation of tensor during movement with condition; returns psi[iL],psi[iR],D from the SVD, and the truncation error Modifies Lpsi

See also: moveR!

DMRJtensor.moveRMethod
D,truncerr = moveR(Lpsi,Rpsi[,cutoff=,m=,minm=,condition=])

moves psi's orthogonality center right one space, with a maximum bond dimenion m, cutoff cutoff, minimum bond dimension minm; toggle truncation of tensor during movement with condition; returns psi[iL],psi[iR],D from the SVD, and the truncation error

See also: moveR!

DMRJtensor.movecenter!Method
movecenter!(psi,newoc[,m=,cutoff=,minm=,Lfct=,Rfct=])

movement function to move psi to a new site, newoc with Lfct and Rfct, with a maximum bond dimenion m, cutoff cutoff, and minimum bond dimension minm; toggle truncation of tensor during movement with condition

See also: move! move

DMRJtensor.multMethod
C = mult(A,B)

Multiplies a matrix of Hterms with a matrix of strings together to get an output term for two operators multiplied together C

See also: bulkMPO Omat Hterm pauliterm

DMRJtensor.multMethod
C = mult(A,B)

Multiplies a matrix of strings with a matrix of Hterms together to get an output term for two operators multiplied together C

See also: bulkMPO Omat Hterm pauliterm

DMRJtensor.nameMPSMethod
mps = nameMPS(A)

Assigns names to MPS A to create a network of named tensors mps

See also: nameMPO

DMRJtensor.operator_in_order!Method
operator_in_order!(pos,sizes)

Increments elements of input vector pos by one step (last element first) with sizes of a tensor sizes such that pos. For use in correlation function.

DMRJtensor.optimizeMethod

infovals: stores current energy (skips initialization for it), truncation error, entanglement entropy on requested bond (default center), largest m value, noise parameter <–-switch to second slot

DMRJtensor.penalty!Method
penalty!(mpo,lambda,psi[,compress=])

Adds penalty to Hamiltonian (mpo), H0, of the form H0 + lambda * |psi><psi|; toggle to compress resulting wavefunction

See also: penalty

DMRJtensor.permutationsMethod
G = permutations(nelem)

Heap algorithm for finding permutations of nelem elements. Output G is an Vector of all permutations stored as vectors. For example, a permutation of [1,2,3,4] is [2,1,3,4].

DMRJtensor.qubitOpsMethod
ox,oy,oz,op,om,Rx,Ry,Rz,H,O,Id = qubits([,d=2,angle=pi/4])

Creates a set of Pauli operators for a certain number of states d and angle for a rotation gate angle

#Outputs:

  • ox: Pauli-x operator
  • oy: Pauli-y operator
  • oz: Pauli-z operator
  • op: raising operator
  • om: lowering operator
  • Rx: rotation of x-axis operator
  • Ry: rotation of y-axis operator
  • Rz: rotation of z-axis operator
  • H: Hadamard gate
  • O: zero matrix
  • Id: identity matrix
DMRJtensor.qubitOpsMethod
ox,oy,oz,op,om,Rx,Ry,Rz,H,O,Id = qubits(d[,angle=pi/4])

Creates a set of Pauli operators for a certain number of states d and angle for a rotation gate angle

#Outputs:

  • ox: Pauli-x operator
  • oy: Pauli-y operator
  • oz: Pauli-z operator
  • op: raising operator
  • om: lowering operator
  • Rx: rotation of x-axis operator
  • Ry: rotation of y-axis operator
  • Rz: rotation of z-axis operator
  • H: Hadamard gate
  • O: zero matrix
  • Id: identity matrix
DMRJtensor.randMPSMethod
psi = randMPS(T,physindsize,Ns[,oc=1,m=1])

Generates random MPS with data type T, uniform physical index size physindsize (integer), with Ns sites, orthogonality center oc, and bond dimension m.

DMRJtensor.randMPSMethod
psi = randMPS(physindsize,Ns[,oc=1,m=1])

Generates random MPS with data type Float64, uniform physical index size physindsize, with Ns sites, orthogonality center oc, and bond dimension m.

DMRJtensor.randMPSMethod
psi = randMPS(mpo[,oc=...,m=...,datatype=...,physind=...])

Generates random MPS from an input MPO mpo; parameters chosen for a generic classical product state in terms of the orthogonality center, bond dimension, data type in each tensor, and physical indices

DMRJtensor.randMPSMethod
newpsi = randMPS(psi[,oc=...,m=...,datatype=...,physind=...])

Generates random MPS from an input MPS psi; parameters taken from psi for orthogonality center, bond dimension, data type in each tensor, and physical indices

DMRJtensor.randMPSMethod
psi = randMPS(Qlabel,Ns[,m=2,type=Float64,flux=...])

generates a random MPS from qnums on a given site stored in an array of vectors Qlabel for Ns sites (will repeat if Ns is longer than array); bond dimension m; type for the element types; and overall flux (default zero of type given in Qlabel)

DMRJtensor.randMPSMethod
psi = randMPS(Qlabel,Ns[,m=2,type=Float64,flux=...])

generates a random MPS from qnums on a given site stored in a vector Qlabel for Ns sites; bond dimension m; type for the element types; and overall flux (default zero of type given in Qlabel)

DMRJtensor.randMPSMethod
psi = randMPS(physindvec[,oc=1,m=1])

Generates random MPS with data type Float64, physical index size vector physindvec, with Ns sites, orthogonality center oc, and bond dimension m.

DMRJtensor.randMPSMethod
psi = randMPS(T,physindvec,Ns[,oc=1,m=1])

Generates random MPS with data type T, physical index size vector physindvec (repeating over Ns sites), with Ns sites, orthogonality center oc, and bond dimension m.

DMRJtensor.randMPSMethod
psi = randMPS(physindvec,Ns[,oc=1,m=1])

Generates random MPS with data type Float64, physical index size vector physindvec (repeating over Ns sites, physindvec can be smaller than Ns where the inputs will repeat), orthogonality center oc, and bond dimension m.

DMRJtensor.reorder!Method

reorder!(C[,Ncols=])

Reorders the Ncols columns of C according to the Fiedler vector reordering in place if site is not 0

See also: reorder

DMRJtensor.reorderMethod
reorder(C[,Ncols=])

Reorders the Ncols columns of C according to the Fiedler vector reordering if site is not 0

See also: reorder!

DMRJtensor.rightnormalize!Method
U,D,psi = rightnormalize!(psi)

Creates a right-normalized MPS in-place from psi and returns the external tensors U and D

DMRJtensor.rightnormalizeMethod
U,D,newpsi = rightnormalize(psi)

Creates a right-normalized MPS newpsi from psi and returns the external tensors U and D

DMRJtensor.spinOpsMethod
Sp,Sm,Sz,Sy,Sx,O,Id = spinOps(s)

Generates operators for a heisenberg model (spin-s)

#Outputs:

  • Sx: spin-x operator
  • Sy: spin-y operator
  • Sz: spin-z operator
  • Sp: raising operator
  • Sm: lowering operator
  • H: Hadamard gate
  • O: zero matrix
  • Id: identity matrix
DMRJtensor.spinOpsMethod
Sp,Sm,Sz,Sy,Sx,O,Id = spinOps([,s=0.5])

Generates operators for a heisenberg model (spin-s, default 1/2)

#Outputs:

  • Sx: spin-x operator
  • Sy: spin-y operator
  • Sz: spin-z operator
  • Sp: raising operator
  • Sm: lowering operator
  • H: Hadamard gate
  • O: zero matrix
  • Id: identity matrix
DMRJtensor.substringnumberMethod
substringnumber(stringstart,w)

Used for printing substrings from pauliterm to make sure that operator is identified on the correct site

See also: bulkMPO Omat

DMRJtensor.tJOpsMethod
Cup,Cdn,F,Nup,Ndn,Ndens,Sp,Sm,Sz,O,Id = tJOps()

Operators for a t-J model

#Outputs:
  • Cup: spin-up annihilation operator
  • Cdn: spin-down annihilation operator
  • F: Jordan-Wigner Fermion string
  • Nup: spin-up number operator
  • Ndn: spin-dn number operator
  • Ndens: total-spin number operator
  • Sp: spin-raising operator
  • Sm: spin-lowering operator
  • Sz: spin-z operator
  • O: zero matrix
  • Id: identity matrix
DMRJtensor.tjMPOMethod
tjMPO(i[,t=1.0,mu=0.0,J=1.0])

Creates a bulk MPO of the t-J model for uniform kinetic energy t, onsite energy mu, and spin coupling J

See also: XXZ

DMRJtensor.transfermatrixMethod
transfermatrix(psi,i,j[,transfermat=])

Forms the transfer matrix (an MPS psi) between sites i and j (inclusive). If not specified, the transfermat field will initialize to the transfer matrix from the i-1 site

The form of the transfer matrix must be is as follows (dual wavefunction tensor on top, conjugated)

1 –––––– 3 | | | | 2 –––––– 4

There is no in-place version of this function

DMRJtensor.transfermatrixMethod
transfermatrix(dualpsi,psi,i,j[,transfermat=])

Forms the transfer matrix (an MPS psi and its dual dualpsi contracted along the physical index) between sites i and j (inclusive). If not specified, the transfermat field will initialize to the transfer matrix from the i-1 site

The form of the transfer matrix must be is as follows (dual wavefunction tensor on top, conjugated)

1 –––––– 3 | | | | 2 –––––– 4

There is no in-place version of this function

TensorPACK.add!Method

add!(A,B)

functionality for adding (similar to direct sum) of MPOs together and replacing A; uses joinindex function to make a combined MPO

note: deparallelizes after every addition

See also: deparallelization +

TensorPACK.div!Method
div!(psi,c)

takes input MPS psi and divides orthogonality center by a number c. Some number types require conversaion of psi

See also: convertTensor MPS

TensorPACK.eigenMethod
D,U,truncerr,mag = eigen(H)

Computes eigenvalue decomposition of an input MPO H that is contracted into the Hamiltonian tensor (will give a fault if the resulting array is too large); useful for small systems

#Inputs:

  • A: Any TensType in the library

#Outputs:

  • D: A diagonal matrix containing eigenvalues
  • U: A unitary matrix (UDU' is A)
  • truncerr: total truncation error (L-1 norm)
  • mag: magnitude of the output tensor
TensorPACK.mult!Method

mult!(A,B)

functionality for adding (similar to direct sum) of MPOs together and replacing A; uses joinindex function to make a combined MPO

note: Does not compress the bond dimension (recommend to use compressMPO! afterwards)

See also: compressMPO! *

TensorPACK.mult!Method
mult!(psi,c)

takes input MPS psi and multiplies orthogonality center by a number c. Some number types require conversaion of psi

See also: convertTensor MPS

TensorPACK.mult!Method
mult!(c,psi)

takes input MPS psi and multiplies orthogonality center by a number c. Some number types require conversaion of psi

See also: convertTensor MPS