DMRJtensor.DMRJtensorModule

DMRjulia (version 0.9.6)

(made for julia v1.5.4+ (March 11, 2021), see included license)

Code: https://github.com/bakerte/DMRjulia.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, 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 Modeling of Molecules and Materials
  • Department of Physics & Astronomy, University of Victoria
  • Department of Chemistry, University of Victoria

Running the julia kernel with –check-bounds=no can decrease runtimes by 20%

DMRJtensor.EnvType

Env

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

DMRJtensor.MPOMethod

mpo = MPO(H[,regtens=false])

constructor for MPO with tensors H either a vector of tensors or the MPO. regtens outputs with the julia Array type

DMRJtensor.MPOMethod

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

constructor for MPO with tensors H either a vector of tensors or the MPO; can request an 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

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(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=1])

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)

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

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);
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,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: deparallelizes after every addition

See also: deparallelization add!

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.conj!Method

psi = conj!(psi)

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

See also conj

Base.conjMethod

A = conj(psi)

Conjugates all elements in an MPS and makes a copy A

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 vector of strings names representing the new filenames

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

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

Base.eltypeMethod

G = eltype(Y)

eltype gets element type G of the Env, MPS, or MPO tensor fields

Base.getindexMethod

G = getindex(A,i)

getindex allows to retrieve tensor G at position i from Env, MPS or MPO

Base.getindexMethod

G = getindex(A,r)

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

Base.lastindexMethod

B = psi[end]

lastindex! allows to get the end element of an Env, MPS, or MPO

Base.lengthMethod

G = length(H)

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

Base.setindex!Method

psi[i] = G

setindex! allows to assign elements G to an Env, MPS, or MPO at element i

Base.sizeMethod

G = size(H,i)

size prints out the size tuple G of the tensor field of a Env, MPS, or MPO; this is effectively the number of sites

Base.sizeMethod

G = size(H)

size prints out the size tuple G of the tensor field of a Env, MPS, or MPO; this is effectively the number of sites

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.applyMPOMethod
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
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.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

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.

See also: expect correlationmatrix

DMRJtensor.correlationMethod

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.

See also: expect correlationmatrix

DMRJtensor.correlationmatrixMethod
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

Note:

  • More efficient than using mpoterms
  • Use mpoterm and applyMPO for higher order correlation functions or write a new function
DMRJtensor.correlationmatrixMethod
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

Example:

Cup, Cdn, Nup, Ndn, Ndens, F, O, Id = fermionOps()
rho = correlationmatrix(psi,Cup',Cup,F) #density matrix
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.expectMethod
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

See also: overlap

DMRJtensor.expectMethod
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)

See also: overlap

DMRJtensor.fullHMethod
fullH(mpo)

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

DMRJtensor.fullpsiMethod
fullpsi(psi)

Generates the full wavefunction from an MPS (memory providing)

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
makeBoundary(qind,newArrows[,retType=])

makes a boundary tensor 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.makeEndsMethod
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
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
makeEnv(psi,mpo[,Lbound=,Rbound=])

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

DMRJtensor.makeEnvMethod
makeEnv(dualpsi,psi,mpo[,Lbound=,Rbound=])

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

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

Converts function or vector (H) to each of Ns MPO tensors; 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)

Example:

spinmag = 0.5;Ns = 10
Sx,Sy,Sz,Sp,Sm,O,Id = spinOps(spinmag)
function H(i::Integer)
    return [Id 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 (i.e., from exact diagonalization) for Ns sites and physInd size physical index at orthogonality center oc

DMRJtensor.makeqMPOMethod
makeqMPO(Qlabels,mpo[,arrows])

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)
  • arrows::Array{Bool,1}: arrow convention for quantum numbers (default: [false,false,true,true])
DMRJtensor.makeqMPOMethod
makeqMPO(Qlabels,mpo[,arrows])

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)
  • arrows::Array{Bool,1}: arrow convention for quantum numbers (default: [false,false,true,true])
DMRJtensor.makeqMPSMethod
makeqMPS(mps,Qlabels[,arrows,newnorm=,setflux=,flux=,randomize=,override=])

creates quantum number MPS from regular MPS according to Qlabels

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)
  • arrows::Array{Bool,1}: first entry of this tuple is the arrow convention on MPS tensors (default: [false,true,true])
  • 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
DMRJtensor.makeqMPSMethod
makeqMPS(Qlabels,mps[,arrows,newnorm=,setflux=,flux=,randomize=,override=])

creates quantum number MPS from regular MPS according to Qlabels

Arguments

  • mps::MPS: dense MPS
  • Qlabels::Array{Qnum,1}: quantum number labels on each physical index (uniform physical indices)
  • arrows::Array{Bool,1}: first entry of this tuple is the arrow convention on MPS tensors (default: [false,true,true])
  • 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
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.operator_in_order!Method

operatorinorder!(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.randMPSMethod

psi = randMPS(T,physindsize,Ns[,oc=1,m=1])

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

DMRJtensor.randMPSMethod

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

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

DMRJtensor.randMPSMethod

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

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

DMRJtensor.randMPSMethod

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

Generates 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.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

spinOps([,s=0.5])

Generates operators Sp,Sm,Sz,Sy,Sx,O,Id for a heisenberg model (spin-s, default 1/2)

DMRJtensor.tJOpsMethod
tJOps()

Operators for a t-J model Cup,Cdn,F,Nup,Ndn,Ndens,Sp,Sm,Sz,O,Id

DMRJtensor.transfermatrixMethod

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

Forms the transfer matrix (an MPS tensor and its dual 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. If not set otherwise, dualpsi = psi.

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

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)

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