API

Checkerboard Matrix Type

Checkerboard.CheckerboardMatrixType
CheckerboardMatrix{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 of perm.
  • colors::Matrix{Int}: The bounds of each checkerboard color/group in neighbor_table.
Checkerboard.CheckerboardMatrixMethod
CheckerboardMatrix(neighbor_table::Matrix{Int}, t::AbstractVector{T}, Δτ::E;
    transposed::Bool=false, inverted::Bool=false) where {T<:Continuous, 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.CheckerboardMatrixMethod
CheckerboardMatrix(Γ::CheckerboardMatrix;
    transposed::Bool=false, inverted::Bool=false, new_matrix::Bool=false)

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_matricesFunction
checkerboard_matrices(neighbor_table::Matrix{Int}, t::AbstractMatrix{T}, Δτ::E;
    transposed::Bool=false, inverted::Bool=false)

Return a vector of CheckerboardMatrix, one for each column of t, all sharing the same neighbor_table.

Checkerboard.update!Function
update!(Γ::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}, Δτ::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.sizeFunction
size(Γ::CheckerboardMatrix)

size(Γ::CheckerboardMatrix, dim::Int)

Return the dimensions of the checkerboard decomposition matrix Γ.

Base.transposeFunction
transpose(Γ::CheckerboardMatrix)

Return a transposed/adjoint version of the checkerboard matrix Γ.

Base.adjointFunction
adjoint(Γ::CheckerboardMatrix)

Return a transposed/adjoint version of the checkerboard matrix Γ.

Base.invFunction
inv(Γ::CheckerboardMatrix)

Return the inverse of the checkerboard matrix Γ.

LinearAlgebra.mul!Function
mul!(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!Function
lmul!(Γ::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!Function
rmul!(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!Function
ldiv!(Γ::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!Function
rdiv!(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.AbstractVecOrMatType
AbstractVecOrMat{T} = Union{AbstractVector{T}, AbstractMatrix{T}}

Abstract type defining union of AbstractVector and AbstractMatrix.

Checkerboard.ContinuousType
Continuous = Union{AbstractFloat, Complex{<:AbstractFloat}}

Abstract type to represent continuous real or complex numbers.

Checkerboard.checkerboard_decomposition!Function
checkerboard_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 of neighbor_table according to the checkerboard decomposition.
  • colors::Matrix{Int}: Marks the column indice boundaries for each checkerboard color in neighbor_table.
Checkerboard.checkerboard_lmul!Function
checkerboard_lmul!(B::AbstractMatrix{T}, neighbor_table::Matrix{Int},
    coshΔτt::AbstractVector{T}, sinhΔτt::AbstractVector{T}, colors::Matrix{Int};
    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!(v::AbstractVector{T}, neighbor_table::Matrix{Int},
    coshΔτt::AbstractVector{E}, sinhΔτt::AbstractVector{E}, colors::Matrix{Int};
    transposed::Bool=false, inverted::Bool=false) where {T<:Continuous, E<:Continuous}

Multiply in-place the vector v by the checkerboard matrix.

Checkerboard.checkerboard_rmul!Function
checkerboard_rmul!(B::AbstractMatrix{T}, neighbor_table::Matrix{Int},
    coshΔτt::AbstractVector{E}, sinhΔτt::AbstractVector{E}, colors::Matrix{Int};
    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!Function
checkerboard_color_lmul!(B::AbstractMatrix{T}, color::Int, neighbor_table::Matrix{Int},
    coshΔτt::AbstractVector{T}, sinhΔτt::AbstractVector{T}, colors::Matrix{Int};
    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!(v::AbstractVector{T}, color::Int, neighbor_table::Matrix{Int},
    coshΔτt::AbstractVector{E}, sinhΔτt::AbstractVector{E}, colors::Matrix{Int};
    transposed::Bool=false, inverted::Bool=false) where {T<:Continuous, E<:Continuous}

Multiply in-place the vector v by the color checkerboard color matrix.

Checkerboard.checkerboard_color_rmul!Function
checkerboard_color_rmul!(B::AbstractMatrix{T}, color::Int, neighbor_table::Matrix{Int},
    coshΔτt::AbstractVector{E}, sinhΔτt::AbstractVector{E}, colors::Matrix{Int};
    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.