API
Propagator Types
AbstractPropagator
AbstractExactPropagator
AbstractChkbrdPropagator
SymExactPropagator
AsymExactPropagator
SymChkbrdPropagator
AsymChkbrdPropagator
SymPropagators
JDQMCFramework.AbstractPropagator
— Typeabstract type AbstractPropagator{T<:Continuous, E<:Continuous} end
Abstract type to represent imaginary time propagator matrices $B$. All specific propagators types inherit from this abstract type. In the above T
is data type of the matrix elements of the exponentiated kintetic energy matrix $e^{-\Delta\tau K_l}$ appearing in $B_l$, and E
is data type of the matrix elements appearing in the diagonal exponentiated potential energy matrix $e^{-\Delta\tau V_l}$.
JDQMCFramework.AbstractExactPropagator
— Typeabstract type AbstractExactPropagator{T,E} <: AbstractPropagator{T,E} end
Abstract type to represent imaginary time propagator matrices $B$ defined with an exactly exponentiated hopping matrix $K$.
JDQMCFramework.AbstractChkbrdPropagator
— Typeabstract type AbstractChkbrdPropagator{T,E} <: AbstractPropagator{T,E} end
Abstract type to represent imaginary time propagator matrices $B$ defined with the exponentiated hopping matrix $K$ represented by the checkerboard approximation.
JDQMCFramework.SymExactPropagator
— TypeSymExactPropagator{T, E} <: AbstractExactPropagator{T,E}
Represents imaginary time propagator matrix as using the symmetric form
\[B_l = e^{-\Delta\tau K_l/2} e^{-\Delta\tau V_l} e^{-\Delta\tau K_l/2},\]
where $K_l$ is the strictly off-diagonal hopping matrix and $V_l$ is the diagonal total on-site energy matrix.
Fields
expmΔτV::Vector{E}
: A vector representing the diagonal exponeniated on-site energy matrix $e^{-\Delta\tau V_l}.$expmΔτKo2::Matrix{T}
: The exponentiated hopping matrix $e^{-\Delta\tau K_l/2}.$exppΔτKo2::Matrix{T}
: Inverse of the exponentiated hopping matrix $e^{+\Delta\tau K_l/2}.$
JDQMCFramework.AsymExactPropagator
— TypeAsymExactPropagator{T, E} <: AbstractExactPropagator{T,E}
Represents imaginary time propagator matrix as using the symmetric form
\[B_l = e^{-\Delta\tau V_l} e^{-\Delta\tau K_l},\]
where $K_l$ is the strictly off-diagonal hopping matrix and $V_l$ is the diagonal total on-site energy matrix.
Fields
expmΔτV::Vector{E}
: A vector representing the diagonal exponeniated on-site energy matrix $e^{-\Delta\tau V_l}.$expmΔτK::Matrix{T}
: The exponentiated hopping matrix $e^{-\Delta\tau K_l}.$exppΔτK::Matrix{T}
: Inverse of the exponentiated hopping matrix $e^{+\Delta\tau K_l}.$
JDQMCFramework.SymChkbrdPropagator
— TypeSymChkbrdPropagator{T, E} <: AbstractChkbrdPropagator{T,E}
Represents imaginary time propagator matrix as using the symmetric form
\[B_l = e^{-\Delta\tau K_l/2} e^{-\Delta\tau V_l} [e^{-\Delta\tau K_l/2}]^\dagger,\]
where $K_l$ is the strictly off-diagonal hopping matrix and $V_l$ is the diagonal total on-site energy matrix. The exponentiated hopping matrix $e^{-\Delta\tau K/2}$ is represented by the checkerboard approximation.
Fields
expmΔτV::Vector{E}
: A vector representing the diagonal exponeniated on-site energy matrix $e^{-\Delta\tau V_l}.$expmΔτKo2::CheckerboardMatrix{T}
: The exponentiated hopping matrix $e^{-\Delta\tau K_l/2}$ represented by the checkerboard approximation.
JDQMCFramework.AsymChkbrdPropagator
— TypeAsymChkbrdPropagator{T, E} <: AbstractChkbrdPropagator{T,E}
Represents imaginary time propagator matrix as using the symmetric form
\[B_l = e^{-\Delta\tau V_l} e^{-\Delta\tau K_l},\]
where $K_l$ is the strictly off-diagonal hopping matrix and $V_l$ is the diagonal total on-site energy matrix. The exponentiated hopping matrix $e^{-\Delta\tau K}$ is represented by the checkerboard approximation.
Fields
expmΔτV::Vector{E}
: The vector representing the diagonal exponeniated on-site energy matrix $e^{-\Delta\tau V_l}.$expmΔτK::CheckerboardMatrix{T}
: The exponentiated hopping matrix $e^{-\Delta\tau K_l}$ represented by the checkerboard approximation.
JDQMCFramework.SymPropagators
— TypeSymPropagators
A union of the all the symmetric propagators types to help test whether a propagator type is symmetric. Assuming typeof{B} <: AbstractPropagator
returns true
, if typeof(B) <: SymPropagators
returns true
, then B
represents a symmetric propagator, otherwise it represents an asymmetric propagator.
FermionGreensCalculator Type
JDQMCFramework.FermionGreensCalculator
— TypeFermionGreensCalculator{T<:Continuous, E<:AbstractFloat}
A type to facilitate calculating the single-particle fermion Green's function matrix.
Fields
forward::Bool
: Iftrue
then iterate over imaginary time slices from $l=1$ to $l=L_\tau$, iffalse
then iterate over imaginary time slices from $l=L_\tau$ to $l=1$.l::Int
: The current imaginary time slice $\tau = l \cdot \Delta\tau$.n_stab::Int
: Frequency with which numerical stabilization is performed, i.e. every $n_s$ imaginary time slices the equal-time Green's function is recomputed from scratch.N_stab::Int
: Number of numerical stabilization intervals, $N_s = \left\lceil L_\tau / n_s \right\rceil.$N::Int
: Orbitals in system.β::E
: The inverse temperature $\beta=1/T,$ where $T$ is temperature.Δτ::E
: Discretization in imaginary time.Lτ::Int
: Length of imaginary time axis, $L_\tau = \beta / \Delta\tau.$B_bar::Vector{Matrix{T}}
: A multidimensional array where the matrixB_bar[:,:,n]
represents $\bar{B}_n.$F::Vector{LDR{T,E}}
: A vector of $N_s$ LDR factorizations to represent the matrices $B(0,\tau)$ and $B(\tau,\beta)$.G′::Matrix{T}
: Matrix used for calculating the error corrected by numerical stabilization of the equal time Green's function.ldr_ws::LDRWorkspace{T}
: Workspace for performing LDR factorization while avoiding dynamic memory allocations.
JDQMCFramework.FermionGreensCalculator
— MethodFermionGreensCalculator(
+ B::AbstractVector{P},
+ β::E, Δτ::E, n_stab::Int
+) where {T<:Number, E<:AbstractFloat, P<:AbstractPropagator{T}}
Initialize and return FermionGreensCalculator
struct based on the vector of propagators B
passed to the function.
JDQMCFramework.FermionGreensCalculator
— MethodFermionGreensCalculator(fgc::FermionGreensCalculator{T,E}) where {T,E}
Return a new FermionGreensCalculator
that is a copy of fgc
.
DQMC Building Block Routines
calculate_equaltime_greens!
propagate_equaltime_greens!
stabilize_equaltime_greens!
initialize_unequaltime_greens!
propagate_unequaltime_greens!
stabilize_unequaltime_greens!
local_update_det_ratio
local_update_greens!
partially_wrap_greens_forward!
partially_wrap_greens_reverse!
JDQMCFramework.calculate_equaltime_greens!
— Functioncalculate_equaltime_greens!(
+ G::AbstractMatrix{T},
+ fgc::FermionGreensCalculator{T,E}
+)::Tuple{E,T} where {T,E}
Calculate the equal-time Greens function $G(0,0) = G(\beta,\beta) = [I + B(\beta,0)]^{-1}$ using a numerically stable procedure. This method also returns $\log(\vert \det G \vert)$ and $\textrm{sign}(\det G).$ Note that this routine requires fgc.l == 1
or fgc.l == fgc.Lτ
.
calculate_equaltime_greens!(
+ G::AbstractMatrix{T},
+ fgc::FermionGreensCalculator{T,E},
+ B::AbstractVector{P}
+)::Tuple{E,T} where {T, E, P<:AbstractPropagator{T}}
Calculate the equal-time Greens function $G(0,0) = G(\beta,\beta) = [I + B(\beta,0)]^{-1}$ using a numerically stable procedure. Also re-calculate the $\bar{B}_n$ matrices and the LDR matrix factorizations representing either $B(\tau,0)$ or $B(\beta,\tau)$ stored in fgc.F
. This routine is useful for implementing global updates where every propagator matrix $B_l$ has been modified, and the equal-time Green's function needs to be re-calculated from scratch. This method also returns $\log(\vert \det G \vert)$ and $\textrm{sign}(\det G).$ Note that this routine requires fgc.l == 1
or fgc.l == fgc.Lτ
.
JDQMCFramework.propagate_equaltime_greens!
— Functionpropagate_equaltime_greens!(
+ G::AbstractMatrix{T},
+ fgc::FermionGreensCalculator{T,E},
+ B::AbstractVector{P}
+) where {T, E, P<:AbstractPropagator{T}}
Propagate the equal-time Green's function matrix G
from the previous imaginary time slice to the current imaginary time slice fgc.l
. If iterating over imaginary time in the forward direction (fgc.forward = true
) the relationship
\[G(\tau+\Delta\tau,\tau+\Delta\tau) = B_{l+1} \cdot G(\tau,\tau) \cdot B_{l+1}^{-1}\]
is used, and if iterating over imaginary time in the reverse direction (fgc.forward = false
) the relationship
\[G(\tau-\Delta\tau,\tau-\Delta\tau)= B_{l}^{-1} \cdot G(\tau,\tau) \cdot B_{l}\]
is used instead, where the $B_l$ propagator is given by B[l]
.
JDQMCFramework.stabilize_equaltime_greens!
— Functionstabilize_equaltime_greens!(
+ G::AbstractMatrix{T},
+ logdetG::E, sgndetG::T,
+ fgc::FermionGreensCalculator{T,E},
+ B::AbstractVector{P};
+ # KEYWORD ARGUMENTS
+ update_B̄::Bool=true
+)::Tuple{E,T,E,E} where {T, E, P<:AbstractPropagator{T}}
Stabilize the equal-time Green's function as iterating through imaginary time $\tau = \Delta\tau \cdot l.$ For a given imaginary time slice fgc.l
, this routine should be called after all changes to the $B_l$ propagator have been made. When iterating through imaginary time in the forwards direction (fgc.forward = true
), this function re-computes
\[G(\tau,\tau) = [I + B(\tau,0)B(\beta,\tau)]^{-1}\]
when at imaginary time slice fgc.l
every fgc.n_stab
imaginary time slice. When iterating through imaginary time in the reverse direction (fgc.forward = false
), this function instead re-computes
\[G(\tau-\Delta\tau,\tau-\Delta\tau) = [I + B(\tau-\Delta\tau,0)B(\beta,\tau-\Delta\tau)]^{-1}\]
for fgc.l
.
This method returns four values. The first two values returned are $\log(\vert \det G(\tau,\tau) \vert)$ and $\textrm{sign}(\det G(\tau,\tau))$. The latter two are the maximum error in a Green's function corrected by numerical stabilization $\vert \delta G \vert$, and the error in the phase of the determinant corrected by numerical stabilization $\delta\theta,$ relative to naive propagation of the Green's function matrix in imaginary time occuring instead. If no stabilization was performed, than $\vert \delta G \vert = 0$ and $\delta \theta = 0.$
This method also computes the LDR matrix factorizations representing $B(\tau, 0)$ or $B(\beta, \tau-\Delta\tau)$ when iterating through imaginary time $\tau = \Delta\tau \cdot l$ in the forward and reverse directions respectively. If update_B̄ = true
, then the $\bar{B}_n$ matrices are re-calculated as needed, but if update_B̄ = false,
then they are left unchanged.
JDQMCFramework.initialize_unequaltime_greens!
— Functioninitialize_unequaltime_greens!(
+ Gτ0::AbstractMatrix{T},
+ G0τ::AbstractMatrix{T},
+ Gττ::AbstractMatrix{T},
+ G00::AbstractMatrix{T}
+) where {T<:Number}
Initialize the Green's function matrices $G(\tau,0),$ $G(0,\tau),$ and $G(\tau,\tau)$ for $\tau = 0$ based on the matrix $G(0,0).$
JDQMCFramework.propagate_unequaltime_greens!
— Functionpropagate_unequaltime_greens!(
+ Gτ0::AbstractMatrix{T},
+ G0τ::AbstractMatrix{T},
+ Gττ::AbstractMatrix{T},
+ fgc::FermionGreensCalculator{T,E},
+ B::AbstractVector{P}
+) where {T, E, P<:AbstractPropagator{T}}
Propagate the Green's function matrices $G(\tau,0)$, $G(0,\tau)$ and $G(\tau,\tau)$ from the previous imaginary time slice to the current imaginary time slice fgc.l
. If iterating over imaginary time in the forward direction (fgc.forward = true
) the relationships
\[\begin{align} +G(\tau,0) = & B_{l} \cdot G(\tau-\Delta\tau, 0) \\ +G(0,\tau) = & G(0, \tau-\Delta\tau) \cdot B^{-1}_{l} \\ +G(\tau,\tau) = & B_{l} \cdot G(\tau-\Delta\tau, \tau-\Delta\tau) \cdot B_{l}^{-1} +\end{align}\]
are used, and if iterating over imaginary time in the reverse direction (fgc.forward = false
) the relationships
\[\begin{align} +G(\tau,0) = & B_{l+1}^{-1} \cdot G(\tau+\Delta\tau, 0) \\ +G(0,\tau) = & G(0, \tau + \Delta\tau) \cdot B_{l+1} \\ +G(\tau,\tau) = & B_{l+1}^{-1} \cdot G(\tau+\Delta\tau, \tau+\Delta\tau) \cdot B_{l+1} +\end{align}\]
are used instead, where the $B_l$ propagator is given by B[l]
.
JDQMCFramework.stabilize_unequaltime_greens!
— Functionstabilize_unequaltime_greens!(
+ Gτ0::AbstractMatrix{T},
+ G0τ::AbstractMatrix{T},
+ Gττ::AbstractMatrix{T},
+ logdetG::E, sgndetG::T,
+ fgc::FermionGreensCalculator{T,E},
+ B::AbstractVector{P};
+ # KEYWORD ARGUMENTS
+ update_B̄::Bool=true
+)::Tuple{E,T,E,E} where {T, E, P<:AbstractPropagator{T}}
Stabilize the Green's function matrice $G(\tau,0)$, $G(0,\tau)$ and $G(\tau,\tau)$ as iterating through imaginary time $\tau = \Delta\tau \cdot l.$ For a given imaginary time slice fgc.l
, this routine should be called after all changes to the $B_l$ propagator have been made. When iterating through imaginary time in the forwards direction (fgc.forward = true
), this function re-computes
\[\begin{align} +G(\tau,0) = & [B^{-1}(\tau,0) + B(\beta,\tau)]^{-1} \\ +G(0, \tau) = & [B^{-1}(\beta,\tau) + B(\tau,0)]^{-1} \\ +G(\tau,\tau) = & [I + B(\tau,0)B(\beta,\tau)]^{-1} +\end{align}\]
when at imaginary time slice fgc.l
every fgc.n_stab
imaginary time slice. When iterating through imaginary time in the reverse direction (fgc.forward = false
), this function instead re-computes
\[\begin{align*} +G(\tau-\Delta\tau,0) = & [B^{-1}(\tau-\Delta\tau,0) + B(\beta,\tau-\Delta\tau)]^{-1} \\ +G(0,\tau-\Delta\tau) = & [B^{-1}(\beta,\tau-\Delta\tau) + B(\tau-\Delta\tau,0)]^{-1} \\ +G(\tau-\Delta\tau,\tau-\Delta\tau) = & [I + B(\tau-\Delta\tau,0)B(\beta,\tau-\Delta\tau)]^{-1} +\begin{align*}\]
for fgc.l
.
This method returns four values. The first two values returned are $\log(\vert \det G(\tau,\tau) \vert)$ and $\textrm{sign}(\det G(\tau,\tau))$. The latter two are the maximum error in a Green's function corrected by numerical stabilization $\vert \delta G \vert$, and the error in the phase of the determinant corrected by numerical stabilization $\delta\theta,$ relative to naive propagation of the Green's function matrix in imaginary time occuring instead. If no stabilization was performed, than $\vert \delta G \vert = 0$ and $\delta \theta = 0.$
This method also computes the LDR matrix factorizations representing $B(\tau, 0)$ or $B(\beta, \tau-\Delta\tau)$ when iterating through imaginary time $\tau = \Delta\tau \cdot l$ in the forward and reverse directions respectively. If update_B̄ = true
, then the $\bar{B}_n$ matrices are re-calculated as needed, but if update_B̄ = false,
then they are left unchanged.
JDQMCFramework.local_update_det_ratio
— Functionlocal_update_det_ratio(
+ G::AbstractMatrix{T},
+ B::AbstractPropagator{T},
+ V′::T, i::Int, Δτ::E
+)::Tuple{T,T} where {T,E}
Calculate the determinant ratio $R_{l,i}$ associated with a local update to the equal-time Green's function $G(\tau,\tau).$ Also returns $\Delta_{l,i},$ which is defined below.
Arguments
G::AbstractMatrix{T}
: Equal-time Green's function matrix $G(\tau,\tau).$B::AbstractPropagator{T,E}
: Represents the propagator matrix $B_l,$ where $\tau = \Delta\tau \cdot l.$V′::T
: The new value for the $V^{\prime}_{l,i,i}$ matrix element in the diagonal on-site energy matrix $V_l.$i::Int
: Diagonal matrix element index in $V_l$ being updated.Δτ::E
: Discretization in imaginary time $\Delta\tau.$
Algorithm
The propagator matrix $B_l$ above is given by
\[B_l = \Lambda_l \cdot \Gamma_l(\Delta\tau),\]
where, assuming the we are working in the orbital basis, $\Gamma_l(\Delta\tau) = e^{-\Delta\tau K_l}$ represents the exponentiated hopping matrix $K_l$, and $\Lambda_l = e^{-\Delta\tau V_l}$ represents the exponentiated diagonal on-site energy matrix $V_l.$
Given a proposed update to the $(i,i)$ matrix element of the diagonal on-site energy matrix $V_l$, ($V_{l,i,i} \rightarrow V^\prime_{l,i,i}),$ the corresponding determinant ratio associated with this proposed udpate is given by
\[R_{l,i} = \frac{\det G(\tau,\tau)}{\det G^\prime(\tau,\tau)} = 1+\Delta_{i,i}(\tau,i)\left(1-G_{i,i}(\tau,\tau)\right),\]
where
\[\Delta_{l,i} = \frac{\Lambda^\prime_{l,i,i}}{\Lambda_{l,i,i}} - 1 = e^{-\Delta\tau (V^\prime_{l,i,i} - V_{l,i,i})} - 1.\]
This routine returns the scalar quantities $R_{l,i}$ and $\Delta_{l,i}.$
Note that if the propagator matrix is instead represented using the symmetric form
\[B_l = \Gamma_l(\Delta\tau/2) \cdot \Lambda_l \cdot \Gamma^\dagger_l(\Delta\tau/2),\]
then the matrix G
needs to instead represent the transformed equal-time Green's function matrix
\[\tilde{G}(\tau,\tau) = \Gamma_l^{-1}(\Delta\tau/2) \cdot G(\tau,\tau) \cdot \Gamma_l(\Delta\tau/2).\]
JDQMCFramework.local_update_greens!
— Functionlocal_update_greens!(
+ G::AbstractMatrix{T}, logdetG::E, sgndetG::T,
+ B::AbstractPropagator{T},
+ R::T, Δ::T, i::Int,
+ u::AbstractVector{T}, v::AbstractVector{T}
+)::Tuple{E,T} where {T, E<:AbstractFloat}
Update the equal-time Green's function matrix G
resulting from a local update in-place.
Arguments
G::AbstractMatrix{T}
: Equal-time Green's function matrix $G(\tau,\tau)$ that will be updated in-place.logdetG::E
: The log of the absolute value of the initial Green's function matrix, $\log( \vert \det G(\tau,\tau) \vert ).$sgndetG::T
: The sign/phase of the determinant of the initial Green's function matrix, $\textrm{sign}( \det G(\tau,\tau) ).$B::AbstractPropagator{T,E}
: Propagator that needs to be updated to reflect accepted local update.R::T
: The determinant ratio $R_{l,i} = \frac{\det G(\tau,\tau)}{\det G^\prime(\tau,\tau)}.$Δ::T
: Change in the exponentiated on-site energy matrix, $\Delta_{l,i} = e^{-\Delta\tau (V^\prime_{l,(i,i)} - V_{l,(i,i)})} - 1.$i::Int
: Matrix element of diagonal on-site energy matrix $V_l$ that is being updated.u::AbstractVector{T}
: Vector of lengthsize(G,1)
that is used to avoid dynamic memory allocations.v::AbstractVector{T}
: Vector of lengthsize(G,2)
that is used to avoid dynamic memory allocations.
Algorithm
The equal-time Green's function matrix is updated using the relationship
\[G_{j,k}^{\prime}\left(\tau,\tau\right)=G_{j,k}\left(\tau,\tau\right)-\frac{1}{R_{l,i}}G_{j,i}\left(\tau,\tau\right)\Delta_{l,i}\left(\delta_{i,k}-G_{i,k}\left(\tau,\tau\right)\right).\]
The $B_l$ progpagator B
is also udpated. Additionally, this method returns $\log( \vert \det G^\prime(\tau,\tau) \vert )$ and $\textrm{sign}( \det G^\prime(\tau,\tau) ).$
An important note is that if the propagator matrices are represented in a symmetric form, then G′
and G
need to correspond to the transformed eqaul-time Green's function matrices $\tilde{G}^\prime(\tau,\tau)$ and $\tilde{G}(\tau,\tau).$ Refer to the local_update_det_ratio
docstring for more information.
JDQMCFramework.partially_wrap_greens_forward!
— Functionpartially_wrap_greens_forward!(
+ G::Matrix{T},
+ B::P,
+ M::Matrix{T} = similar(G)
+) where {T, E, P<:AbstractPropagator{T,E}}
If the propagator B
is represented in the symmetric form
\[B_l = \Gamma_l(\Delta\tau/2) \cdot \Lambda_l(\Delta\tau) \cdot \Gamma_l^\dagger(\Delta\tau/2)\]
with $\tau = l \cdot \Delta\tau,$ where $\Gamma(\Delta\tau/2) = e^{-\Delta\tau K_l/2}$ and $\Lambda(\Delta\tau) = e^{-\Delta\tau V_l}$, then apply the transformation
\[\tilde{G}(\tau,\tau) = \Gamma^{-1}_l(\Delta\tau/2) \cdot G(\tau,\tau) \cdot \Gamma_l(\Delta\tau/2)\]
to the equal-time Green's function matrix G
in-place.
JDQMCFramework.partially_wrap_greens_reverse!
— Functionpartially_wrap_greens_reverse!(
+ G::Matrix{T},
+ B::P,
+ M::Matrix{T} = similar(G)
+) where {T, E, P<:AbstractPropagator{T,E}}
If the propagator B
is represented in the symmetric form
\[B_l = \Gamma_l(\Delta\tau/2) \cdot \Lambda_l(\Delta\tau) \cdot \Gamma_l^\dagger(\Delta\tau/2)\]
with $\tau = l \cdot \Delta\tau,$ where $\Gamma(\Delta\tau/2) = e^{-\Delta\tau K_l/2}$ and $\Lambda(\Delta\tau) = e^{-\Delta\tau V_l}$, then apply the transformation
\[G(\tau,\tau) = \Gamma_l(\Delta\tau/2) \cdot \tilde{G}(\tau,\tau) \cdot \Gamma_l^{-1}(\Delta\tau/2)\]
to the equal-time Green's function matrix G
in-place.
Overloaded Functions
Base.iterate
— Functioniterate(iter::FermionGreensCalculator)
+
+iterate(iter::FermionGreensCalculator, state)
Iterate over imaginary time slices, alternating between iterating in the forward direction from $l=1$ to $l=L_\tau$ and in the reverse direction from $l=L_\tau$ to $l=1$. The iter.forward
boolean field in the FermionGreensCalculator
type determines whether the imaginary time slices are iterated over in forward or reverse order. The iter.forward
field is updated as needed automatically and should not be adjusted manually.
Base.eltype
— Functioneltype(B::AbstractPropagator{T,E}) where {T,E}
Return the matrix element type of the propagator T
.
eltype(fgc::FermionGreensCalculator{T,E}) where {T,E}
Return matrix element type T
associated with an instance of FermionGreensCalculator
.
Base.resize!
— Functionresize!(
+ fgc::FermionGreensCalculator{T,E},
+ G::Matrix{T}, logdetG::E, sgndetG::T,
+ B::Vector{P}, n_stab::Int
+) where {T<:Number, E<:AbstractFloat, P<:AbstractPropagator{T}}
+
+resize!(
+ fgc::FermionGreensCalculator{T,E}, n_stab::Int
+) where {T,E}
Update fgc
to reflect a new stabilizaiton frequency n_stab
. If G
, logdetG
, sgndetG
and B
are also passed then the equal-time Green's function G
is re-calculated and the corresponding updated values for (logdetG, sgndetG)
are returned.
Base.size
— Functionsize(B::AbstractPropagator)
+
+size(B::AbstractPropagator, dim)
Return the size of a propagator.
Base.copyto!
— Functioncopyto!(B′::SymExactPropagator{T,E}, B::SymExactPropagator{T,E}) where {T,E}
+
+copyto!(B′::AsymExactPropagator{T,E}, B::AsymExactPropagator{T,E}) where {T,E}
+
+copyto!(B′::SymChkbrdPropagator{T,E}, B::SymChkbrdPropagator{T,E}) where {T,E}
+
+copyto!(B′::AsymChkbrdPropagator{T,E}, B::AsymChkbrdPropagator{T,E}) where {T,E}
Copy the propagator B
to B′
.
copyto!(
+ fgc_out::FermionGreensCalculator{T,E},
+ fgc_in::FermionGreensCalculator{T,E}
+) where {T,E}
Copy the contents of fgc_in
to fgc_out
. If fgc_out.n_stab != fgc_in.n_stab
is true, then fgc_out
will be resized using resize!
to match fgc_in
.
LinearAlgebra.ishermitian
— Functionishermitian(B::AbstractPropagator)
Return whether a propagator is hermitian or not.
LinearAlgebra.mul!
— Functionmul!(A::AbstractMatrix{T}, B::SymExactPropagator{T}, C::AbstractMatrix{T};
+ M::AbstractMatrix{T}=similar(A)) where {T}
+
+mul!(A::AbstractMatrix{T}, B::AsymExactPropagator{T}, C::AbstractMatrix{T};
+ M::AbstractMatrix{T}=similar(A)) where {T}
+
+mul!(A::AbstractMatrix{T}, B::AbstractChkbrdPropagator{T}, C::AbstractMatrix{T};
+ M=nothing) where {T}
Calculate the product $A := B \cdot C$, where $B$ is a propagator matrix represented by an instance of a type inheriting from AbstractPropagator
. If B
is asymmetric and B.adjointed = true
, then $A = B^\dagger \cdot C$ is evaluated instead.
mul!(A::AbstractMatrix{T}, C::AbstractMatrix{T}, B::SymExactPropagator{T};
+ M::AbstractMatrix{T} = similar(A)) where {T}
+
+mul!(A::AbstractMatrix{T}, C::AbstractMatrix{T}, B::AsymExactPropagator{T};
+ M::AbstractMatrix{T} = similar(A)) where {T}
+
+mul!(A::AbstractMatrix{T}, C::AbstractMatrix{T}, B::AbstractChkbrdPropagator{T};
+ M=nothing) where {T}
Calculate the matrix product $A := C \cdot B$, where $B$ is a propagator matrix represented by an instance of a type inheriting from AbstractPropagator
. If B
is asymmetric and B.adjointed = true
, then $A = C \cdot B^\dagger$ is evaluated instead.
LinearAlgebra.lmul!
— Functionlmul!(B::SymExactPropagator{T}, A::AbstractMatrix{T};
+ M::AbstractMatrix{T} = similar(A)) where {T}
+
+lmul!(B::AsymExactPropagator{T}, A::AbstractMatrix{T};
+ M::AbstractMatrix{T} = similar(A)) where {T}
+
+lmul!(B::AsymExactPropagator{T}, A::AbstractMatrix{T};
+ M::AbstractMatrix{T} = similar(A)) where {T}
+
+lmul!(B::AsymChkbrdPropagator{T}, A::AbstractMatrix{T};
+ M = nothing) where {T}
Calculate the matrix product $A := B \cdot A$, where $B$ is a propagator matrix represented by an instance of a type inheriting from AbstractPropagator
. If B
is asymmetric and B.adjointed = true
, when $A := B^\dagger \cdot A$ is evaluated instead.
LinearAlgebra.rmul!
— Functionrmul!(A::AbstractMatrix{T}, B::SymExactPropagator{T};
+ M::AbstractMatrix{T} = similar(A)) where {T}
+
+rmul!(A::AbstractMatrix{T}, B::AsymExactPropagator{T};
+ M::AbstractMatrix{T} = similar(A)) where {T}
+
+rmul!(A::AbstractMatrix{T}, B::SymChkbrdPropagator{T};
+ M = nothing) where {T}
+
+rmul!(A::AbstractMatrix{T}, B::AsymChkbrdPropagator{T};
+ M = nothing) where {T}
Calculate the matrix product $A := A \cdot B$, where $B$ is a propagator matrix represented by an instance of a type inheriting from AbstractPropagator
. If B
is asymmetric and B.adjointed = true
, then $A := A \cdot B^\dagger$ is evaluated instead.
LinearAlgebra.ldiv!
— Functionldiv!(A::AbstractMatrix{T}, B::AbstractExactPropagator{T}, C::AbstractMatrix{T};
+ M::AbstractMatrix{T} = similar(A)) where {T}
+
+ldiv!(A::AbstractMatrix{T}, B::AbstractChkbrdPropagator{T}, C::AbstractMatrix{T};
+ M = nothing) where {T}
Calculate the matrix product $A := B^{-1} \cdot C$, where $B$ is a propagator matrix represented by an instance of a type inheriting from AbstractPropagator
. If B
is asymmetric and B.adjointed = true
, then $A = [B^\dagger]^{-1} \cdot C$ is evaluated instead.
ldiv!(B::SymExactPropagator{T}, A::AbstractMatrix{T};
+ M::AbstractMatrix{T} = similar(A)) where {T}
+
+ldiv!(B::AsymExactPropagator{T}, A::AbstractMatrix{T};
+ M::AbstractMatrix{T} = similar(A)) where {T}
+
+ldiv!(B::SymChkbrdPropagator{T}, A::AbstractMatrix{T};
+ M = nothing) where {T}
+
+ldiv!(B::AsymChkbrdPropagator{T}, A::AbstractMatrix{T};
+ M = nothing) where {T}
Calculate the matrix product $A := B^{-1} \cdot A$, where $B$ is a propagator matrix represented by an instance of a type inheriting from AbstractPropagator
. If B
is asymmetric and B.adjointed = true
, then $A := [B^\dagger]^{-1} \cdot A$ is evaluated instead.
LinearAlgebra.rdiv!
— Functionrldiv!(A::AbstractMatrix{T}, C::AbstractMatrix{T}, B::AbstractExactPropagator{T};
+ M::AbstractMatrix{T} = similar(A)) where {T}
+
+rdiv!(A::AbstractMatrix{T}, C::AbstractMatrix{T}, B::AbstractChkbrdPropagator{T};
+ M = nothing) where {T}
Calculate the matrix product $A := C \cdot B^{-1}$, where $B$ is a propagator matrix represented by an instance of a type inheriting from AbstractPropagator
. If B
is asymmetric and B
is asymmetric and B.adjointed = true
, then $A = C \cdot [B^\dagger]^{-1}$ is evaluated instead.
rdiv!(A::AbstractMatrix{T}, B::SymExactPropagator{T};
+ M::AbstractMatrix{T} = similar(A)) where {T}
+
+rdiv!(A::AbstractMatrix{T}, B::AsymExactPropagator{T};
+ M::AbstractMatrix{T} = similar(A)) where {T}
+
+rdiv!(A::AbstractMatrix{T}, B::SymChkbrdPropagator{T};
+ M = nothing) where {T}
+
+rdiv!(A::AbstractMatrix{T}, B::AsymChkbrdPropagator{T};
+ M = nothing) where {T}
Calculate the matrix product $A := A \cdot B^{-1}$, where $B$ is a propagator matrix represented by an instance of a type inheriting from AbstractPropagator
. If B
is asymmetric and B.adjointed = true
, then $A := A \cdot [B^\dagger]^{-1}$ is evaluated instead.
Utility Functions
JDQMCFramework.eval_length_imaginary_axis
— Functioneval_length_imaginary_axis(
+ β::T,
+ Δτ::T
+)::Int where {T<:AbstractFloat}
Given an inverse temperature β
and discretization in imaginary time Δτ
, return the length of the imaginary time axis Lτ
.
JDQMCFramework.exp!
— Functionexp!(
+ expαH::AbstractMatrix{T},
+ H::AbstractMatrix{T},
+ α::E;
+ # KEYWORD ARGUMENTS
+ workspace::HermitianEigenWs{T,Matrix{T},R} = HermitianEigenWs(H),
+ tol::R = 1e-6
+) where {T<:Number, E<:Number, R<:AbstractFloat}
Given a Hermitian matrix H
, calculate the matrix exponentials $e^{\alpha H}.$ Note that H
is left modified by this method. The workspace
field is of type HermitianEigenWs
, which is exported from the FastLapackInterface.jl
package, is used to avoid dynamic memory allocations.
exp!(
+ exppαH::AbstractMatrix{T},
+ expmαH::AbstractMatrix{T},
+ H::AbstractMatrix{T}, α::E;
+ # KEYWORD ARGUMENTS
+ workspace::HermitianEigenWs{T,Matrix{T},R} = HermitianEigenWs(H),
+ tol::R = 1e-6
+) where {T<:Number, E<:Number, R<:AbstractFloat}
Given a Hermitian matrix H
, calculate the matrix exponentials $e^{+\alpha H}$ and $e^{-\alpha H}$, which are written to exppαH
and expmαH
respectively. Note that H
is left modified by this method. The workspace
field is of type HermitianEigenWs
, which is exported from the FastLapackInterface.jl
package, is used to avoid dynamic memory allocations.
JDQMCFramework.build_hopping_matrix!
— Functionbuild_hopping_matrix!(
+ K::AbstractMatrix{T},
+ neighbor_table::Matrix{Int},
+ t::AbstractVector{T}
+) where {T<:Continuous}
Construct a hopping matrix K
using neighbor_table
along with the corresponding hopping amplitudes t
. Each column of neighbor_table
stores a pair of neighboring orbitals in the lattice, such that size(neighbor_table,1) = 2
.
Developer API
JDQMCFramework.Continuous
JDQMCFramework.update_factorizations!
JDQMCFramework.update_B̄!
JDQMCFramework.calculate_B̄!
JDQMCFramework.stabilization_interval
JDQMCFramework.Continuous
— TypeContinuous = Union{AbstractFloat,Complex{<:AbstractFloat}}
An abstract type to represent continuous real and complex numbers.
JDQMCFramework.update_factorizations!
— Functionupdate_factorizations!(
+ fgc::FermionGreensCalculator{T,E},
+ B::AbstractVector{P}
+) where {T, E, P<:AbstractPropagator{T}}
If current imaginary time slice fgc.l
corresponds to the boundary of a stabilization interval, calculate a LDR factorization to represent $B(0, \tau)$ or $B(\tau-\Delta\tau, \beta)$ if iterating over imaginary time in the forward (fgc.forward = true
) or reverse (fgc.forward = false
) directions respectively. This method should be called after all changes to the current time slice propagator matrix $B_l$ have been made This method will also recompute $\bar{B}_n$ as needed.
update_factorizations!(
+ fgc::FermionGreensCalculator{T,E}
+) where {T, E}
If current imaginary time slice fgc.l
corresponds to the boundary of a stabilization interval, calculate a LDR factorization to represent $B(\tau, 0)$ or $B(\beta, \tau-\Delta\tau)$ if iterating over imaginary time in the forward (fgc.forward = true
) or reverse (fgc.forward = false
) directions respectively. This method should be called after all changes to the current time slice propagator matrix $B_l$ have been made, and any required updates to a $\bar{B}_n$ matrix have been performed using the JDQMCFramework.update_B̄!
routine.
JDQMCFramework.update_B̄!
— Functionupdate_B̄!(
+ fgc::FermionGreensCalculator{T,E},
+ B::AbstractVector{P}
+) where {T,E,P<:AbstractPropagator{T}}
Recalculate $\bar{B}_n$ if the current timeslice fgc.l
corresponds to the boundary of a stabilization interval, accounting for whether imaginary time is being iterated over in the forward (fgc.forward = true
) or reverse (fgc.forward = false
) direction.
JDQMCFramework.calculate_B̄!
— Functioncalculate_B̄!(
+ fgc::FermionGreensCalculator{T,E},
+ B::AbstractVector{P}, n::Int
+) where {T,E,P<:AbstractPropagator{T}}
Given B
, a vector of all the propagator matrices $B_l$, calculate the matrix product
\[\bar{B}_{\sigma,n}=\prod_{l=(n-1)\cdot n_{s}+1}^{\min(n\cdot n_{s},L_{\tau})}B_{\sigma,l},\]
with the result getting written to fgc.B_bar[n]
.
JDQMCFramework.stabilization_interval
— Functionstabilization_interval(
+ fgc::FermionGreensCalculator
+)::Tuple{Int,Int}
Given the current imaginary time slice fgc.l
, return the corresponding stabilization interval n = ceil(Int, fgc.l/fgc.n_stab)
, and the relative location within that stabilization interval l′ = mod1(fgc.l, fgc.n_stab)
, such that l′∈[1,n_stab]
.