Documentation for ITensorsOpenSystems.Utils
ITensorsOpenSystems.Utils.MPOtomatrix — FunctionMPOtomatrix(s::MPO)::Matrix{<:Number}Converts and MPO into a standard julia matrix
warning: the matrix dimension can get large quickly. Only use on operators with a small number of sites
ITensorsOpenSystems.Utils.MPStovector — FunctionMPStovector(s::MPS)::Vector{<:Number}Converts and MPS into a standard julia vector
warning: the vector dimension can get large quickly. Only use on states with a small number of sites
ITensorsOpenSystems.Utils.dagprimes — Functiondagprimes(o;kwargs...)Takes the Hermitian conjugate of an MPO or ITensor, using the convention that input indices have prime level 0 and the corresponding output indices are the same index with prime level 1. Accepts the same keyword arguments as dag, prime and similar functions
ITensorsOpenSystems.Utils.dagprimes! — Functiondagprimes!(o;kwargs...)Takes the Hermitian conjugate of an MPO in place, using the convention that input indices have prime level 0 and the corresponding output indices are the same index with prime level 1. Accepts the same keyword arguments as dag, prime and similar functions
see also: dagprimes
ITensorsOpenSystems.Utils.reduced_density_matrix — Functionreduced_density_matrix(ψ::MPS,remaining_indices;kwargs...)::MPOGiven a state as an MPO or MPS calculates the reduced density matrix obtained by tracing all the indices except those in remaining_indices, giving the result as an MPO. If the original state is given as an MPO, an in-place version exists.
A truncation of the MPO can be incorperated. Parameters for this e.g. cutoff, maxdim, etc. can be passed as extra keyword arguments.
Example
s = siteinds("S=1/2",4)
# density matrix for the product state with all spins pointing up
ρ = MPO(s, "ProjUp")
# traces out sites 3 and 4 to give the reduced density matrix on sites 1 and 2
ρ_12 = reduced_density_matrix(ρ,s[1:2])see also: reduced_density_matrix!
ITensorsOpenSystems.Utils.reduced_density_matrix! — Functionreduced_density_matrix!(ρ::MPO,remaining_indices;kwargs...)::MPOGiven a state as an MPO or MPS calculates the reduced density matrix obtained by tracing all the indices except those in remaining_indices, giving the result as an MPO. If the original state is given as an MPO, an in-place version exists.
A truncation of the MPO can be incorperated. Parameters for this e.g. cutoff, maxdim, etc. can be passed as extra keyword arguments.
Example
s = siteinds("S=1/2",4)
# density matrix for the product state with all spins pointing up
ρ = MPO(s, "ProjUp")
# traces out sites 3 and 4 to give the reduced density matrix on sites 1 and 2
reduced_density_matrix!(ρ,s[1:2])see also reduced_density_matrix
ITensorsOpenSystems.Utils.stateequality — Function stateequality(s1::MPS,s2::MPS;kwargs...)::BoolReturns true if the MPSs s1 and s2 correspond to the same tensor, to within numerical precision, and false otherwise. This is useful due to the level of gauge freedom in representing an MPS
It can optionally be passed an atol and rtol to set the absolute and relative numerical tolerance respectively.
ITensorsOpenSystems.Utils.thermofield_mapping — Functionthermofield_mapping(spectral_density::Function,temperature::Real,chemical_potential::Real=0.0;bosonic::Bool=true)::Tuple{Function,Function}
thermofield_mapping(energies::Vector{<:Real},couplings::Vector{<:Real},temperature::Real,chemical_potential::Real=0.0;bosonic::Bool=true)::Tuple{Vector{<:Real},Vector{<:Real}}Computes a thermofield mapping on a bath. Given a spectral density and temperature, and optional chemical potential it will return a pair of functions giving the spectral density on the negative and positive energy states (given in that order)
Given a list of the energies of bath states and the couplings to those states it will return a pair of lists of the couplings to the negative and positive energy thermofield states (again in that order)
If the bosonic keyword is set to true (the default) it will perform the mapping for bosonic bath states. If it is set to false it will perform the mapping for fermionic bath states.