Documentation for ITensorsOpenSystems._VectorizationCore
ITensorsOpenSystems._VectorizationCore.VectorizationError — TypeStruct for error message with message and site type of the failed vectorization
ITensorsOpenSystems._VectorizationCore.basespace — Functionbasespace(idx::ITensors.Index)::StringGiven an index for a vectorized site, returns the name of the site space prior to vectorization
basespace(m::Union{ITensors.MPS,ITensors.MPO})::StringGiven a Union of ...
ITensorsOpenSystems._VectorizationCore.build_vectorized_space — FunctionBuilds the vectorized space for a given site type.
Arguments
basespace_name::String: the name of the base space to vectorizeoperators::Vector{String}: A vector of operatorsconserve_qns::Bool: Should quantum numbers be conservedconserve_qns_options::String: If we are to conserve quantum numbers, how to do so, valid options are "difference" or "independent"additional_parameters::Union{Nothing,Vector{Pair{Symbol,<:Function}}}: Used to vectorize spaces with variable dimension. Expects a list of pairs of keywords and functions which take in a vectorized index and return the value of the keyword used to create them
Examples
julia> build_vectorized_space("S=1/2")
julia> siteind("S=1/2Vec")
(dim=4|id=145|"S=1/2Vec,Site")ITensorsOpenSystems._VectorizationCore.build_vectorized_space_name — Functionbuild_vectorized_space_name(tag::String)Create the vectorized space name
ITensorsOpenSystems._VectorizationCore.leftapply — Functionleftapply(op)Constructs the vectorized operator corresponding to left multiplication by op as an autoMPO object
see also: rightapply, leftrightapply
ITensorsOpenSystems._VectorizationCore.leftrightapply — Functionleftrightapply(leftop,rightop)Takes a pair of autoMPO objects on the unvectorized space and constructs the autoMPO object on the vectorized space corresponding to left multiplying the density matrix by leftop and right multiplying it by rightop
Example
julia> leftop, rightop = OpSum(),OpSum()
julia>leftop += "σx", 1
julia>rightop += "σz", 1
julia>leftrightapply(leftop,rightop)
sum(
1.0, "σzᵀ⊗σx", 1
)see also: leftapply, rightapply, commutatorapply, commutator, lindbladdissipator, dissipator
ITensorsOpenSystems._VectorizationCore.rightapply — Functionrightapply(op)Constructs the vectorized operator corresponding to right multiplication by op as an autoMPO object
see also: leftapply, leftrightapply
ITensorsOpenSystems._VectorizationCore.vectorization_sigil — Constantvectorization_sigilUsed in site tags to designate the vectorised version of a given site space i.e "Fermion" vectorizes to "FermionVec", "S=1/2" vectorizes to "S=1/2Vec", etc.
ITensorsOpenSystems._VectorizationCore.vectorizedop_sigil — Constantvectorizedop_sigilUsed in op names to denote that the op is the vectorized product of two ops on the base space. For example "σxᵀ⊗σy would denote the vectorized operator for left multiplying with σy and right multiplying with σx
ITensorsOpenSystems._VectorizationCore.vectorizer — Functionvectorizer(_dumby;kwargs...)
vectorizer(space::String;kwargs...)Returns the vectorization tensor, which maps a pair of site indices in the vectorized space (with oposite directions), to a single index in the vectorized space.
It is recomended to always use this when combining or separating site indices to esure that a consitent convention for how the different indices correspond is maintained
If the space has conserved quantum numbers the index can be returned with or without them using the conserve_qns keyword.
For spaces with variable dimension, additional keywords can be provided to spesify the dimension of the index returned. In these cases the sample_idx keyword can also used. This expects a vectorized index and adds the keywords used to create that index to the ones passed directly to the function
Example
# We create some local site indices and some corrisponding
# vectoprized indices
s = siteinds("S=1/2", 2)
sv = siteinds("S=1/2Vec",2)
# We create a tensor using those local indices
t = op("Sz", s[1])
# We set the indices on t to match those of the vectorization
# tensor
t *= delta(vectorizer_input("S=1/2"),s[1])
t *= delta(vectorizer_input("S=1/2")', s[1]')
# We combine the indices on t into a single
# vecotorized index
t *= vectorizer("S=1/2")
# We set the single index on t to be one of
# our previously created vectorized indices
t *= delta(vectorizer_output("s=1/2"),sv[1])see also: vectorizer_input, vectorizer_output
ITensorsOpenSystems._VectorizationCore.vectorizer_input — Functionvectorizer_input(_dumby;kwargs...)
vectorizer_input(space::String;kwargs...)Returns the input (unvectorized) indices of the vectorization tensor. The vectorization tensor has two copies of this index, one primed (directed in if there are conserved quantum numbers) corresponding to the left hand index of the unvectorized density matrix and one unprimed (directed out if there are conserved quantum numbers) corresponding to the right hand index of the unvectorized desnity matrix.
If the space has conserved quantum numbers the index can be returned with or without them using the conserve_qns keyword.
For spaces with variable dimension, additional keywords can be provided to spesify the dimension of the index returned. In these cases the sample_idx keyword can also used. This expects a vectorized index and adds the keywords used to create that index to the ones passed directly to the function
Example
# We create some local site indices and some corrisponding
# vectoprized indices
s = siteinds("S=1/2", 2)
sv = siteinds("S=1/2Vec",2)
# We create a tensor using those local indices
t = op("Sz", s[1])
# We set the indices on t to match those of the vectorization
# tensor
t *= delta(vectorizer_input("S=1/2"),s[1])
t *= delta(vectorizer_input("S=1/2")', s[1]')
# We combine the indices on t into a single
# vecotorized index
t *= vectorizer("S=1/2")
# We set the single index on t to be one of
# our previously created vectorized indices
t *= delta(vectorizer_output("s=1/2"),sv[1])see also: vectorizer, vectorizer_output
ITensorsOpenSystems._VectorizationCore.vectorizer_output — Functionvectorizer_output(_dumby;kwargs...)
vectorizer_output(space::String;kwargs...)Returns the output (vectorized) indices of the vectorization tensor. The vectorization tensor has one unprimed (outfacing if quantum numbers are conserved) copy of this index, corresponding to the vectorized index.
If the space has conserved quantum numbers the index can be returned with or without them using the conserve_qns keyword.
For spaces with variable dimension, additional keywords can be provided to spesify the dimension of the index returned. In these cases the sample_idx keyword can also used. This expects a vectorized index and adds the keywords used to create that index to the ones passed directly to the function
Example
# We create some local site indices and some corrisponding
# vectoprized indices
s = siteinds("S=1/2", 2)
sv = siteinds("S=1/2Vec",2)
# We create a tensor using those local indices
t = op("Sz", s[1])
# We set the indices on t to match those of the vectorization
# tensor
t *= delta(vectorizer_input("S=1/2"),s[1])
t *= delta(vectorizer_input("S=1/2")', s[1]')
# We combine the indices on t into a single
# vecotorized index
t *= vectorizer("S=1/2")
# We set the single index on t to be one of
# our previously created vectorized indices
t *= delta(vectorizer_output("s=1/2"),sv[1])see also: vectorizer_input, vectorizer