API
Checkerboard Matrix Type
Checkerboard.CheckerboardMatrix — TypeCheckerboardMatrix{T<:Union{AbstractFloat, Complex{<:AbstractFloat}}}A type to represent a checkerboard decomposition matrix.
Fields
transposed::Bool: If the checkerboard matrix is transposed.inverted::Bool: If the checkerboard matrix is inverted.Nsites::Int: Number of sites/orbitals in lattice.Nneighbors::Int: Number of neighbors.Ncolors::Int: Number of checkerboard colors/groups.neighbor_table::Matrix{Int}: Neighbor table represented by a(2,Nneighbors)dimension matrix, where each column contains a pair of neighboring sites.coshΔτt::Vector{T}: The $\cosh(\Delta\tau t)$ values.sinhΔτt::Vector{T}: The $\sinh(\Delta\tau t)$ values.perm::Vector{Int}: The checkerboard permutation order relative to the ordering of the original neighbor table.inv_perm::Vector{Int}: Inverse permuation ofperm.colors::Matrix{Int}: The bounds of each checkerboard color/group inneighbor_table.
Checkerboard.CheckerboardMatrix — MethodCheckerboardMatrix(
# ARGUMENTS
neighbor_table::Matrix{Int},
t::AbstractVector{T},
Δτ::E;
# KEYWORD ARGUMENTS
transposed::Bool=false,
inverted::Bool=false
) where {T, E<:AbstractFloat}Given a neighbor_table along with the corresponding hopping amplitudes t and discretzation in imaginary time Δτ, construct an instance of the type CheckerboardMatrix.
Checkerboard.CheckerboardMatrix — MethodCheckerboardMatrix(
# ARGUMENTS
Γ::CheckerboardMatrix{T};
# KEYWORD ARGUMENTS
transposed::Bool = Γ.transposed,
inverted::Bool = Γ.inverted,
new_matrix::Bool = false
) where {T}Construct a new instance of CheckerboardMatrix based on a current instance Γ of CheckerboardMatrix. If new_matrix=true then allocate new coshΔτt and sinhΔτt arrays.
Checkerboard.checkerboard_matrices — Functioncheckerboard_matrices(
# ARGUMENTS
neighbor_table::Matrix{Int},
t::AbstractMatrix{T},
# KEYWORD ARGUMENTS
Δτ::E;
transposed::Bool=false,
inverted::Bool=false
) where {T<:Continuous, E<:AbstractFloat}Return a vector of CheckerboardMatrix, one for each column of t, all sharing the same neighbor_table.
Checkerboard.update! — Functionupdate!(
Γ::CheckerboardMatrix{T}, t::AbstractVector{T}, Δτ::E
) where {T<:Continuous, E<:AbstractFloat}Update the CheckerboardMatrix based on new hopping parameters t and discretezation in imaginary time Δτ.
update!(
Γs::AbstractVector{CheckerboardMatrix{T}}, t::AbstractMatrix{T}, Δτ::E
) where {T<:Continuous, E<:AbstractFloat}Update a vector of CheckerboardMatrix based on new hopping parameters t and discretezation in imaginary time Δτ.
update!(
coshΔτt::AbstractVector{T}, sinhΔτt::AbstractVector{T}, t::AbstractVector{T},
perm::AbstractVector{Int}, Δτ::E
) where {T<:Continuous, E<:AbstractFloat}Update the coshΔτt and sinhΔτt associated with a checkerboard decomposition based on new hopping parameters t and discretezation in imaginary time Δτ.
Overloaded Functions
Base.eltype — Functioneltype(Γ::CheckerboardMatrix{T}) where {T}Return the matrix element type T of checkerboard decomposition Γ.
Base.size — Functionsize(Γ::CheckerboardMatrix)
size(Γ::CheckerboardMatrix, dim::Int)Return the dimensions of the checkerboard decomposition matrix Γ.
Base.transpose — Functiontranspose(Γ::CheckerboardMatrix)Return a transposed/adjoint version of the checkerboard matrix Γ.
Base.adjoint — Functionadjoint(Γ::CheckerboardMatrix)Return a transposed/adjoint version of the checkerboard matrix Γ.
Base.inv — Functioninv(Γ::CheckerboardMatrix)Return the inverse of the checkerboard matrix Γ.
LinearAlgebra.mul! — Functionmul!(u::AbstractVecOrMat, Γ::CheckerboardMatrix, v::AbstractVecOrMat)Evaluate the matrix-vector or matrix-matrix product u=Γ⋅v.
mul!(u::AbstractVecOrMat, Γ::CheckerboardMatrix, v::AbstractVecOrMat, color::Int)Evaluate the matrix-vector or matrix-matrix product u=Γ[c]⋅v where Γ[c] is the matrix associated with the color checkerboard color matrix.
mul!(u::AbstractVecOrMat, v::AbstractVecOrMat, Γ::CheckerboardMatrix)Evaluate the matrix-vector or matrix-matrix product u=v⋅Γ.
mul!(u::AbstractVecOrMat, v::AbstractVecOrMat, Γ::CheckerboardMatrix, color::Int)Evaluate the matrix-vector or matrix-matrix product u=v⋅Γ[c] where Γ[c] is the matrix associated with the color checkerboard color matrix.
LinearAlgebra.lmul! — Functionlmul!(Γ::CheckerboardMatrix, u::AbstractVecOrMat)Evaluate in-place the matrix-vector or matrix-matrix product u=Γ⋅u, where u gets over-written.
lmul!(Γ::CheckerboardMatrix, u::AbstractVecOrMat, color::Int)Evaluate in-place the matrix-vector or matrix-matrix product u=Γ[c]⋅u, where Γ[c] is the matrix associated with the color checkerboard color matrix.
LinearAlgebra.rmul! — Functionrmul!(u::AbstractVecOrMat, Γ::CheckerboardMatrix)Evaluate in-place the matrix-vector or matrix-matrix product u=u⋅Γ, where u gets over-written.
rmul!(u::AbstractVecOrMat, Γ::CheckerboardMatrix, color::Int)Evaluate in-place the matrix-vector or matrix-matrix product u=u⋅Γ[c], where Γ[c] is the matrix associated with the color checkerboard color matrix.
LinearAlgebra.ldiv! — Functionldiv!(Γ::CheckerboardMatrix, v::AbstractVecOrMat)Evaluate in-place the matrix-vector or matrix-matrix product v=Γ⁻¹⋅v.
ldiv!(u::AbstractVecOrMat, Γ::CheckerboardMatrix, v::AbstractVecOrMat)Evaluate the matrix-vector or matrix-matrix product u=Γ⁻¹⋅v.
ldiv!(Γ::CheckerboardMatrix, v::AbstractVecOrMat, color::Int)Evaluate in-place the matrix-vector or matrix-matrix product v=Γ⁻¹[c]⋅v where Γ⁻¹[c] is the inverse of the matrix associated with the color checkerboard color matrix.
ldiv!(u::AbstractVecOrMat, Γ::CheckerboardMatrix, v::AbstractVecOrMat, color::Int)Evaluate the matrix-vector or matrix-matrix product u=Γ⁻¹[c]⋅v where Γ⁻¹[c] is the inverse of the matrix associated with the color checkerboard color matrix.
LinearAlgebra.rdiv! — Functionrdiv!(u::AbstractVecOrMat, Γ::CheckerboardMatrix)Evaluate in-place the matrix-vector or matrix-matrix product u=u⋅Γ⁻¹, where u gets over-written.
rdiv!(u::AbstractVecOrMat, v::AbstractVecOrMat, Γ::CheckerboardMatrix)Evaluate the matrix-vector or matrix-matrix product u=v⋅Γ⁻¹, where u gets over-written.
rdiv!(u::AbstractVecOrMat, Γ::CheckerboardMatrix, color::Int)Evaluate in-place the matrix-vector or matrix-matrix product u=u⋅Γ⁻¹[c], where Γ[c] is the matrix associated with the color checkerboard color matrix.
rdiv!(u::AbstractVecOrMat, v::AbstractVecOrMat, Γ::CheckerboardMatrix, color::Int)Evaluate the matrix-vector or matrix-matrix product u=v⋅Γ⁻¹[c], where Γ[c] is the matrix associated with the color checkerboard color matrix.
Developer API
Checkerboard.ContinuousCheckerboard.AbstractVecOrMatcheckerboard_decomposition!checkerboard_lmul!checkerboard_rmul!checkerboard_color_lmul!checkerboard_color_rmul!
Checkerboard.AbstractVecOrMat — TypeAbstractVecOrMat{T} = Union{AbstractVector{T}, AbstractMatrix{T}}Abstract type defining union of AbstractVector and AbstractMatrix.
Checkerboard.Continuous — TypeContinuous = Union{AbstractFloat, Complex{<:AbstractFloat}}Abstract type to represent continuous real or complex numbers.
Checkerboard.checkerboard_decomposition! — Functioncheckerboard_decomposition!(neighbor_table::Matrix{Int})Given a neighbor_table, construct the checkerboard decomposition, which results in the columns of neighbor_table being re-ordered in-place. Two additional arrays are also returned:
perm::Vector{Int}: The permutation used to re-order the columns ofneighbor_tableaccording to the checkerboard decomposition.colors::Matrix{Int}: Marks the column indice boundaries for each checkerboard color inneighbor_table.
Checkerboard.checkerboard_lmul! — Functioncheckerboard_lmul!(
# ARGUMENTS
B::AbstractMatrix{T},
neighbor_table::Matrix{Int},
coshΔτt::AbstractVector{E},
sinhΔτt::AbstractVector{E},
colors::Matrix{Int};
# KEYWORD ARGUMENTS
transposed::Bool=false,
inverted::Bool=false
) where {T<:Continuous, E<:Continuous}Evaluate the matrix-matrix product in-place B=Γ⋅B where Γ is the checkerboard matrix.
checkerboard_lmul!(
# ARGUMENTS
v::AbstractVector{T},
neighbor_table::Matrix{Int},
coshΔτt::AbstractVector{E},
sinhΔτt::AbstractVector{E},
colors::Matrix{Int};
# KEYWORD ARGUMENTS
transposed::Bool=false,
inverted::Bool=false
) where {T<:Continuous, E<:Continuous}Multiply in-place the vector v by the checkerboard matrix.
Checkerboard.checkerboard_rmul! — Functioncheckerboard_rmul!(
# ARGUMENTS
B::AbstractMatrix{T},
neighbor_table::Matrix{Int},
coshΔτt::AbstractVector{E},
sinhΔτt::AbstractVector{E},
colors::Matrix{Int};
# KEYWORD ARGUMENTS
transposed::Bool=false,
inverted::Bool=false
) where {T<:Continuous, E<:Continuous}Evaluate the matrix-matrix product in-place B=B⋅Γ where Γ is the checkerboard matrix.
Checkerboard.checkerboard_color_lmul! — Functioncheckerboard_color_lmul!(
# ARGUMENTS
B::AbstractMatrix{T},
color::Int,
neighbor_table::Matrix{Int},
coshΔτt::AbstractVector{E},
sinhΔτt::AbstractVector{E},
colors::Matrix{Int};
# KEYWORD ARGUMENTS
inverted::Bool=false
) where {T<:Continuous, E<:Continuous}Evaluate the matrix-matrix product in-place B=Γ[c]⋅B where Γ[c] is the color checkerboard color matrix.
checkerboard_color_lmul!(
# ARGUMENTS
v::AbstractVector{T},
color::Int,
neighbor_table::Matrix{Int},
coshΔτt::AbstractVector{E},
sinhΔτt::AbstractVector{E},
colors::Matrix{Int};
# KEYWORD ARGUMENTS
inverted::Bool=false
) where {T<:Continuous, E<:Continuous}Multiply in-place the vector v by the color checkerboard color matrix.
Checkerboard.checkerboard_color_rmul! — Functioncheckerboard_color_rmul!(
# ARGUMENTS
B::AbstractMatrix{T},
color::Int,
neighbor_table::Matrix{Int},
coshΔτt::AbstractVector{E},
sinhΔτt::AbstractVector{E},
colors::Matrix{Int};
# KEYWORD ARGUMENTS
inverted::Bool=false
) where {T<:Continuous, E<:Continuous}Evaluate the matrix-matrix product in-place B=B⋅Γ[c] where Γ[c] is the color checkerboard color matrix.