API
Simulation Information Type and Methods
SmoQyDQMC.SimulationInfo
— TypeSimulationInfo
Contains identification information about simulation, including the location data is written to, the simulation ID, and MPI process ID, and whether this simulation started a new simulation or resumed a previous simulation.
Fields
filepath::String
: File path to where data folder lives.datafolder_prefix
: Prefix for the data folder name.datafolder_name::String
: The data folder name, given by$(datafolder_prefix)_$(sID)
.datafolder::String
: The data folder, including filepath, given byjoinpath(filepath, datafolder_name)
.pID::Int
: MPI process ID, defaults to 0 if MPI not being used.sID::Int
: Simulation ID.resuming::Bool
: Whether current simulation is resuming a previous simulation (true
) or starting a new one (false
).smoqy_version::VersionNumber
: Version of SmoQyDQMC.jl used in simulation.
SmoQyDQMC.SimulationInfo
— MethodSimulationInfo(; datafolder_prefix::String, filepath::String = ".", sID::Int=0, pID::Int=0)
Initialize and return in instance of the type SimulationInfo
.
SmoQyDQMC.initialize_datafolder
— Functioninitialize_datafolder(sim_info::SimulationInfo)
Initalize sim_info.datafolder
directory if it does not already exist.
SmoQyDQMC.model_summary
— Functionmodel_summary(;
simulation_info::SimulationInfo,
β::T, Δτ::T, model_geometry::ModelGeometry,
tight_binding_model::Union{TightBindingModel,Nothing} = nothing,
tight_binding_model_up::Union{TightBindingModel,Nothing} = nothing,
tight_binding_model_dn::Union{TightBindingModel,Nothing} = nothing,
interactions::Tuple
) where {T<:AbstractFloat}
Write model to summary to file. Note that either tight_binding_model
or tight_binding_model_up
and tight_binding_model_dn
need to be specified.
Model Geometry Type and Methods
SmoQyDQMC.ModelGeometry
— TypeModelGeometry{D, T<:AbstractFloat, N}
Contains all the information defining the lattice geometry for the model in D
spatial dimensions.
Comment
The bond ID associated with a bond::Bond{D}
corresponds to the index associated with it into the bonds
vector field.
Fields
unit_cell::UnitCell{D,T,N}
: Defines unit cell.lattice::Lattice{D}
: Defines finite lattice extent.bonds::Vector{Bond{D}}
: All available bond definitions in simulation, with vector indices giving the bond ID.
SmoQyDQMC.ModelGeometry
— MethodModelGeometry(unit_cell::UnitCell, lattice::Lattice)
Initialize and return a ModelGeometry
instance. Defines a "trivial" bond defintion for each orbital in the unit cell that connects an orbital to itself.
SmoQyDQMC.add_bond!
— Functionaddbond!(modelgeometry::ModelGeometry{D,T}, bond::Bond{D}) where {D, T}
Add bond
definition to model_geometry
, returning the bond ID i.e. the index to bond
in the vector model_geometry.bonds
. This method first checks that bond
is not already defined. If it is this method simply returns the corresponding bond ID. If bond
is not already defined, then it is appended to the vector model_geometry.bonds
.
SmoQyDQMC.get_bond_id
— Functionget_bond_id(model_geometry::ModelGeometry{D,T}, bond::Bond{D}) where {D, T}
Return the bond ID associated with the bond defintion bond
, returning bond_id=0
if the it is not a recorded bond.
Fermion Path Integral Type and Methods
SmoQyDQMC.FermionPathIntegral
— TypeFermionPathIntegral{T<:Number, E<:AbstractFloat}
A type to represent a fermion path integral. In particular, this type contains the information required to reconstruct the diagonal on-site energy matrices $V_l$ and hopping matrices $K_l$ for each imaginary time slice $l \in [1, L_\tau],$ where $\tau = \Delta\tau \cdot l$ and $\beta = \Delta\tau \cdot L_\tau.$
Fields
β::E
: Inverse temperature.Δτ::E
: Discretization in imaginary time.Lτ::Int
: Length of the imaginary time axis.N::Int
: Number of orbitals in the lattice.neighbor_table::Matrix{Int}
: Neighbor table for each pair of orbitals in the lattice connected by a hopping.t::Matrix{T}
: Hopping amplitudes for imaginary-time slice $l$ are stored int[:,l]
.V::Matrix{T}
: The diagonal on-site energy matrices $V_l$ for imaginary-time slice $l$ are stored inV[:,l]
.K::Matrix{T}
: Used to construct hopping matrix to cacluate exponentiated hopping matrix if checkerboard approximation is not being used.eigen_ws::HermitianEigenWs{T,Matrix{T},E}
: For calculating eigenvalues and eigenvectors ofK
while avoiding dynamic memory allocations.u::Vector{T}
: Temporary vector to avoid dynamic allocation when performing local updates.v::Vector{T}
: Temporary vector to avoid dynamic allocation when performing local updates.
SmoQyDQMC.FermionPathIntegral
— MethodFermionPathIntegral(;
tight_binding_parameters::TightBindingParameters{T,E},
β::E, Δτ::E
) where {T,E}
Initialize an instance of FermionPathIntegral
an instance of TightBindingParameters
.
SmoQyDQMC.initialize_propagators
— Functioninitialize_propagators(fpi::FermionPathIntegral{T,E}; symmetric::Bool, checkerboard::Bool) where {T,E}
Initialize a propagator for each imaginary time slice, returning a vector of type Vector{<:AbstractPropagators{T,E}}
.
SmoQyDQMC.calculate_propagators!
— Functioncalculate_propagators!(B::Vector{P}, fpi::FermionPathIntegral{T,E};
calculate_exp_V::Bool, calculate_exp_K::Bool) where {T, E, P<:AbstractPropagator{T,E}}
Calculate the propagator matrices $B_l$, given by B[l]
, for all imaginary time slice $\tau = \Delta\tau \cdot l.$ If calculate_exp_V = true
, then calculate the diagonal exponentiated on-site energy matrices. If calculate_exp_K = true
, then calculate the exponentiated hopping matrices.
SmoQyDQMC.calculate_propagator!
— Functioncalculate_propagator!(B::AbstractPropagator{T,E}, fpi::FermionPathIntegral{T,E}, l::Int;
calculate_exp_V::Bool, calculate_exp_K::Bool) where {T,E}
Calculate the propagator matrix $B_l$ for imaginary time slice $\tau = \Delta\tau \cdot l.$ If calculate_exp_V = true
, then calculate the diagonal exponentiated on-site energy matrix. If calculate_exp_K = true
, then calculate the exponentiated hopping matrix.
Update Numerical Stabilization Frequency
SmoQyDQMC.update_stabalization_frequency!
— Functionupdate_stabalization_frequency!(Gup::Matrix{T}, logdetGup::E, sgndetGup::T,
Gdn::Matrix{T}, logdetGdn::E, sgndetGdn::T;
fermion_greens_calculator_up::FermionGreensCalculator{T,E},
fermion_greens_calculator_dn::FermionGreensCalculator{T,E},
Bup::Vector{P}, Bdn::Vector{P}, δG::E, δθ::E, n_stab::Int,
δG_max::E) where {E<:AbstractFloat, T<:Number, P<:AbstractPropagator{T,E}}
If the corrected error in the Green's function matrix is too large, δG > δG_max
, then increase the frequency of numerical stablization by decrementing n_stab
such that it is updated to n_stab = max(n_stab - 1, 1)
, and update the equal-time Green's function matrices and all related variables and types. If the frequency of stabilization is udpated, then δG
and δθ
are reset to zero. This method returns a tuple of the following variables:
(logdetGup, sgndetGdn, logdetGup, sgndetGdn, δG, δθ),
where updated = true
if n_stab
was decremented.
update_stabalization_frequency!(G::Matrix{T}, logdetG::E, sgndetG::T;
fermion_greens_calculator::FermionGreensCalculator{T,E},
B::Vector{P}, δG::E, δθ::E, n_stab::Int,
δG_max::E) where {E<:AbstractFloat, T<:Number, P<:AbstractPropagator{T,E}}
If the corrected error in the Green's function matrix is too large, δG > δG_max
, then increase the frequency of numerical stablization by decrementing n_stab
such that it is updated to n_stab = max(n_stab - 1, 1)
, and update the equal-time Green's function matrices and all related variables and types. If the frequency of stabilization is udpated, then δG
and δθ
are reset to zero. This method returns a tuple of the following variables:
(updated, logdetG, sgndetG, δG, δθ),
where updated = true
if n_stab
was decremented.
Tight-Binding Model
TightBindingModel
TightBindingParameters
measure_onsite_energy
measure_hopping_energy
measure_bare_hopping_energy
measure_hopping_amplitude
measure_hopping_inversion
measure_hopping_inversion_avg
SmoQyDQMC.TightBindingModel
— TypeTightBindingModel{T<:Number, E<:AbstractFloat, D}
Defines a tight binding model in D
dimensions. Note that spin = 1 (spin = 2)
corresponds to spin-up (spin-down), and spin = 0
corresponds to both spin-up and spin-down.
Fields
μ::E
: Chemical potential.ϵ_mean::Vector{E}
: Mean on-site energy for each orbital in the unit cell.ϵ_std::Vector{E}
: Standard deviation of on-site energy for each orbital in the unit cell.t_bond_ids::Vector{Int}
: The bond ID for each bond/hopping definition.t_bonds::Vector{Bond{D}}
: Bond definition for each type of hopping in the tight binding model.t_mean::Vector{T}
: Mean hopping energy for each type of hopping.t_std::Vector{E}
: Standard deviation of hopping energy for each type of hopping.
SmoQyDQMC.TightBindingModel
— MethodTightBindingModel(;
model_geometry::ModelGeometry{D,E,N},
μ::E,
ϵ_mean::Vector{E},
ϵ_std::Vector{E} = zeros(eltype(ϵ_mean), length(ϵ_mean)),
t_bonds::Vector{Bond{D}} = Bond{ndims(model_geometry.unit_cell)}[],
t_mean::Vector{T} = eltype(ϵ_mean)[],
t_std::Vector{E} = zeros(eltype(ϵ_mean), length(t_mean))
) where {T<:Number, E<:AbstractFloat, D, N}
Initialize and return an instance of TightBindingModel
, also adding/recording the bond defintions t_bonds
to the ModelGeometry
instance model_geometry
.
SmoQyDQMC.TightBindingParameters
— TypeTightBindingParameters{T<:Number, E<:AbstractFloat}
A mutable struct containing all the parameters needed to characterize a finite tight-binding Hamiltonian for a single spin species $\sigma$ on a finite lattice with periodic boundary conditions of the form
\[\hat{H}_{0,\sigma}=-\sum_{\langle i,j\rangle}(t_{ij} \hat{c}_{\sigma,i}^{\dagger}\hat{c}_{\sigma,j}+\textrm{h.c.})+\sum_{i}(\epsilon_{i}-\mu)\hat{n}_{\sigma,i},\]
where $\hat{c}_{\sigma,i}^\dagger$ is the fermion creation operator for an electron with spin $\sigma$ on orbital $i,$ $t_{i,j}$ are the hopping energies, $\epsilon_i$ are the on-site energies for each orbital in the lattice, and $\mu$ is the chemical potential.
Fields
μ::E
: The chemical potential $\mu.$const ϵ::Vector{E}
: A vector containing the on-site energy $\epsilon_i$ for each orbital in the lattice.const t::Vector{T}
: The hopping energy $t_{i,j}$ associated with each pair of neighboring orbitals connected by a bond in the lattice.const neighbor_table::Matrix{Int}
: Neighbor table containing all pairs of orbitals in the lattices connected by a bond, with a non-zero hopping energy between them.const bond_ids::Vector{Int}
: The bond ID definitions that define the types of hopping in the lattice.const bond_slices::Vector{UnitRange{Int}}
: Slices ofneighbor_table
corresponding to given bond ID i.e. the neighborsneighbor_table[:,bond_slices[1]]
corresponds thebond_ids[1]
bond defintion.const norbital::Int
: Number of orbitals per unit cell.
SmoQyDQMC.TightBindingParameters
— MethodTightBindingParameters(;
tight_binding_model::TightBindingModel{T,E,D},
model_geometry::ModelGeometry{D,E},
rng::AbstractRNG
) where {T,E,D}
Initialize and return an instance of TightBindingParameters
.
SmoQyDQMC.measure_onsite_energy
— Functionmeasure_onsite_energy(
tight_binding_parameters::TightBindingParameters{T,E},
G::Matrix{T}, orbital_id::Int
) where {T<:Number, E<:AbstractFloat}
Measure and return the on-site energy $\epsilon_\textrm{on-site} = (\epsilon - \mu)\langle \hat{n}_\sigma \rangle$ for the orbital_id
in the unit cell.
SmoQyDQMC.measure_hopping_energy
— Functionmeasure_hopping_energy(
tight_binding_parameters::TightBindingParameters{T,E},
fermion_path_integral::FermionPathIntegral{T,E},
G::Matrix{T}, bond_id::Int
) where {T<:Number, E<:AbstractFloat}
Calculate the average hopping energy $\epsilon_{\rm hopping} = -\langle t_{l,\langle i,j \rangle} \hat{c}^\dagger_{\sigma,i} \hat{c}_{\sigma,j} + {\rm h.c.} \rangle$ for the hopping defined by the bond corresponding to bond_id
.
SmoQyDQMC.measure_bare_hopping_energy
— Functionmeasure_bare_hopping_energy(
tight_binding_parameters::TightBindingParameters{T,E},
G::Matrix{T}, bond_id::Int
) where {T<:Number, E<:AbstractFloat}
Calculate the average bare hopping energy $\epsilon_{\rm hopping} = -\langle t_{\langle i,j \rangle} \hat{c}^\dagger_{\sigma,i} \hat{c}_{\sigma,j} + {\rm h.c.} \rangle$ for the hopping defined by the bond corresponding to bond_id
.
SmoQyDQMC.measure_hopping_amplitude
— Functionmeasure_hopping_amplitude(
tight_binding_parameters::TightBindingParameters{T,E},
fermion_path_integral::FermionPathIntegral{T,E},
bond_id::Int
) where {T<:Number, E<:AbstractFloat}
Calculate the average hopping amplitude for the hopping defined by the bond corresponding to bond_id
.
SmoQyDQMC.measure_hopping_inversion
— Functionmeasure_hopping_inversion(
tight_binding_parameters::TightBindingParameters{T,E},
fermion_path_integral::FermionPathIntegral{T,E},
bond_id::Int
) where {T<:Number, E<:AbstractFloat}
Measure the fraction of time the sign of the instaneous modulated hopping ampltiude $t_{l,(\mathbf{i},\nu),(\mathbf{j},\gamma)}$ is inverted relative to the bare hopping amplitude $t_{(\mathbf{i},\nu),(\mathbf{j},\gamma)}$, where $l$ is the imaginary time-slice index.
SmoQyDQMC.measure_hopping_inversion_avg
— Functionmeasure_hopping_inversion_avg(
tight_binding_parameters::TightBindingParameters{T,E},
fermion_path_integral::FermionPathIntegral{T,E},
bond_id::Int
) where {T<:Number, E<:AbstractFloat}
Measure the fraction of time the sign of the imaginary-time averaged modulated hopping ampltiude $\bar{t}_{(\mathbf{i},\nu),(\mathbf{j},\gamma)}$ is inverted relative to the bare hopping amplitude $t_{(\mathbf{i},\nu),(\mathbf{j},\gamma)}$.
Hubbard Model
Hubbard Model Measurements
Hubbard Ising Hubbard-Stratonovich Transformation Types and Methods
SmoQyDQMC.HubbardModel
— TypeHubbardModel{T<:AbstractFloat}
If shifted = true
, then a Hubbard interaction of the form
\[\hat{H}_{U}=\sum_{\mathbf{i},\nu}U_{\nu,\mathbf{i}}\hat{n}_{\uparrow,\nu,\mathbf{i}}\hat{n}_{\downarrow,\nu,\mathbf{i}}\]
is assumed, where $\mathbf{i}$ specifies the unit cell, and $\nu$ denotes the orbital in the unit cell. For a bipartite lattice with only nearest neighbor hopping, the on-site energy corresponding to half-filling and particle-hole symmetry is $\epsilon_{\nu,\mathbf{i}} = -U_{\nu,\mathbf{i}}/2.$
If shifted = false
, then a Hubbard interaction of the form
\[\hat{H}_{U}=\sum_{\mathbf{i},\nu}U_{\nu,\mathbf{i}}(\hat{n}_{\uparrow,\nu,\mathbf{i}}-\tfrac{1}{2})(\hat{n}_{\downarrow,\nu,\mathbf{i}}-\tfrac{1}{2})\]
is assumed. In this case, for a bipartite lattice with only nearest neighbor hopping, the on-site energy corresponding to half-filling and particle-hole symmetry is $\epsilon_{\nu,\mathbf{i}} = 0.$
Fields
shifted::Bool
: Determines which form for Hubbard interaction is used, and whether the on-site energies need to be shifted.U_orbital::Vector{Int}
: Orbital species in unit cell with finite Hubbard interaction.U_mean::Vector{T}
: Average Hubbard $U_\nu$ for a given orbital species in the lattice.U_std::Vector{T}
: Standard deviation of Hubbard $U_\nu$ for a given orbital species in the lattice.
SmoQyDQMC.HubbardModel
— MethodHubbardModel(;
shifted::Bool,
U_orbital::AbstractVector{Int},
U_mean::AbstractVector{T},
U_std::AbstractVector{T} = zero(U_mean)
) where {T<:AbstractFloat}
Initialize and return an instance of the type HubbardModel
.
SmoQyDQMC.HubbardParameters
— TypeHubbardParameters{T<:AbstractFloat}
Hubbard parameters for finite lattice.
Fields
U::Vector{T}
: On-site Hubbard interaction for each site with finite Hubbard interaction.sites::Vector{Int}
: Site index associated with each finite HubbardU
interaction.orbitals::Vector{Int}
: Orbital species in unit cell with finite Hubbard interaction.shifted::Bool
: Convention used for Hubbard interaction, refer toHubbardModel
for more information.
SmoQyDQMC.HubbardParameters
— MethodHubbardParameters(;
hubbard_model::HubbardModel{T},
model_geometry::ModelGeometry{D,T},
rng::AbstractRNG
) where {D, T<:AbstractFloat}
Initialize an instance of HubbardParameters
.
SmoQyDQMC.initialize!
— Methodinitialize!(
fermion_path_integral_up::FermionPathIntegral{T,E},
fermion_path_integral_dn::FermionPathIntegral{T,E},
hubbard_parameters::HubbardParameters{E}
) where {T,E}
initialize!(
fermion_path_integral::FermionPathIntegral{T,E},
hubbard_parameters::HubbardParameters{E}
) where {T,E}
Initialize the contribution from the Hubbard interaction to a FermionPathIntegral
instance.
Hubbard Model Measurements
SmoQyDQMC.measure_hubbard_energy
— Functionmeasure_hubbard_energy(
hubbard_parameters::HubbardParameters{E},
Gup::Matrix{T}, Gdn::Matrix{T},
orbital_id::Int
) where {T<:Number, E<:AbstractFloat}
Calculate the average Hubbard energy $U \langle \hat{n}_\uparrow \hat{n}_\downarrow \rangle$ if shifted = true
and $U \langle (\hat{n}_\uparrow - \tfrac{1}{2})(\hat{n}_\downarrow - \tfrac{1}{2})\rangle$ if shifted = false
for the orbital corresponding orbital_id
in the unit cell.
Hubbard Ising Hubbard-Stratonovich Transformation Types and Methods
SmoQyDQMC.HubbardIsingHSParameters
— TypeHubbardIsingHSParameters{T<:AbstractFloat}
Parameters associated with decoupling the Hubbard interaction using the standard Ising Hubbard-Stratonovich (HS) transformation.
Fields
β::T
: Inverse temperature.Δτ::T
: Discretization in imaginary time.Lτ::Int
: Length of imaginary time axis.N::Int
: Number of orbitals in the lattice.U::Vector{T}
: Each hubbard interaction.α::Vector{T}
: The constant given by $\cosh(\alpha_i) = e^{\Delta\tau \vert U_i \vert/2}.$sites::Vector{Int}
: Site index associated with each finite HubbardU
interaction.s::Matrix{Int}
: Ising Hubbard-Stratonovich fields.update_perm::Vector{Int}
: Order in which to iterate over HS fields in time slice when performing local updates.
SmoQyDQMC.HubbardIsingHSParameters
— MethodHubbardIsingHSParameters(; β::E, Δτ::E,
hubbard_parameters::HubbardParameters{E},
rng::AbstractRNG) where {E<:AbstractFloat}
Initialize and return an instance of the HubbardIsingHSParameters
type. Note that on-site energies fpi.V
are shifted by $-U_i/2$ if $hm.shifted = true$.
SmoQyDQMC.initialize!
— Methodinitialize!(fermion_path_integral_up::FermionPathIntegral{T,E},
fermion_path_integral_dn::FermionPathIntegral{T,E},
hubbard_ising_parameters::HubbardIsingHSParameters{E}) where {T,E}
Initialize the contribution from the Hubbard interaction to the FermionPathIntegral
instance fermion_path_integral_up
for spin up and fermion_path_integral_dn
spin down.
SmoQyDQMC.initialize!
— Methodinitialize!(fermion_path_integral::FermionPathIntegral{T,E},
hubbard_ising_parameters::HubbardIsingHSParameters{E}) where {T,E}
Initialize the contribution from an attractive Hubbard interaction to the FermionPathIntegral
instance fermion_path_integral
.
SmoQyDQMC.local_updates!
— Methodlocal_updates!(
Gup::Matrix{T}, logdetGup::E, sgndetGup::T,
Gdn::Matrix{T}, logdetGdn::E, sgndetGdn::T,
hubbard_ising_parameters::HubbardIsingHSParameters{E};
fermion_path_integral_up::FermionPathIntegral{T,E},
fermion_path_integral_dn::FermionPathIntegral{T,E},
fermion_greens_calculator_up::FermionGreensCalculator{T,E},
fermion_greens_calculator_dn::FermionGreensCalculator{T,E},
Bup::Vector{P}, Bdn::Vector{P},
δG::E, δθ::E, rng::AbstractRNG,
δG_max::E = 1e-5,
update_stabilization_frequency::Bool = true
) where {T<:Number, E<:AbstractFloat, P<:AbstractPropagator{T,E}}
Sweep through every imaginary time slice and orbital in the lattice, peforming local updates to every Ising Hubbard-Stratonovich (HS) field.
This method returns the a tuple containing (acceptance_rate, logdetGup, sgndetGup, logdetGdn, sgndetGdn, δG, δθ)
.
Arguments
Gup::Matrix{T}
: Spin-up equal-time Green's function matrix.logdetGup::E
: The log of the absolute value of the determinant of the spin-up equal-time Green's function matrix, $\log \vert \det G_\uparrow(\tau,\tau) \vert.$sgndetGup::T
: The sign/phase of the determinant of the spin-up equal-time Green's function matrix, $\det G_\uparrow(\tau,\tau) / \vert \det G_\uparrow(\tau,\tau) \vert.$Gdn::Matrix{T}
: Spin-down equal-time Green's function matrix.logdetGdn::E
: The log of the absolute value of the determinant of the spin-down equal-time Green's function matrix, $\log \vert \det G_\downarrow(\tau,\tau) \vert.$sgndetGdn::T
: The sign/phase of the determinant of the spin-down equal-time Green's function matrix, $\det G_\downarrow(\tau,\tau) / \vert \det G_\downarrow(\tau,\tau) \vert.$hubbard_ising_parameters::HubbardIsingHSParameters{E}
: Ising Hubbard-Stratonovich fields and associated parameters to update.
Keyword Arguments
fermion_path_integral_up::FermionPathIntegral{T,E}
: An instance of theFermionPathIntegral
type for spin-up electrons.fermion_path_integral_dn::FermionPathIntegral{T,E}
: An instance of theFermionPathIntegral
type for spin-down electrons.fermion_greens_calculator_up::FermionGreensCalculator{T,E}
: An instance of theFermionGreensCalculator
type for the spin-up electrons.fermion_greens_calculator_dn::FermionGreensCalculator{T,E}
: An instance of theFermionGreensCalculator
type for the spin-down electrons.Bup::Vector{P}
: Spin-up propagators for each imaginary time slice.Bdn::Vector{P}
: Spin-dn propagators for each imaginary time slice.δG_max::E
: Maximum allowed error corrected by numerical stabilization.δG::E
: Previously recorded maximum error in the Green's function corrected by numerical stabilization.δθ::T
: Previously recorded maximum error in the sign/phase of the determinant of the equal-time Green's function matrix corrected by numerical stabilization.rng::AbstractRNG
: Random number generator used in method instead of global random number generator, important for reproducibility.update_stabilization_frequency::Bool=true
: If true, allows the stabilization frequencyn_stab
to be dynamically adjusted.
SmoQyDQMC.local_updates!
— Methodlocal_updates!(
G::Matrix{T}, logdetG::E, sgndetG::T,
hubbard_ising_parameters::HubbardIsingHSParameters{E};
fermion_path_integral::FermionPathIntegral{T,E},
fermion_greens_calculator::FermionGreensCalculator{T,E},
B::Vector{P}, δG::E, δθ::E, rng::AbstractRNG,
δG_max::E = 1e-5,
update_stabilization_frequency::Bool = true
) where {T<:Number, E<:AbstractFloat, P<:AbstractPropagator{T,E}}
Sweep through every imaginary time slice and orbital in the lattice, performing local updates to every Ising Hubbard-Stratonovich (HS) field, assuming strictly attractive Hubbard interactions and perfect spin symmetry.
This method returns the a tuple containing (acceptance_rate, logdetG, sgndetG, δG, δθ)
.
Arguments
G::Matrix{T}
: Equal-time Green's function matrix.logdetG::E
: The log of the absolute value of the determinant of theequal-time Green's function matrix, $\log \vert \det G_\uparrow(\tau,\tau) \vert.$sgndetG::T
: The sign/phase of the determinant of the equal-time Green's function matrix, $\det G_\uparrow(\tau,\tau) / \vert \det G_\uparrow(\tau,\tau) \vert.$hubbard_ising_parameters::HubbardIsingHSParameters{E}
: Ising Hubbard-Stratonovich fields and associated parameters to update.
Keyword Arguments
fermion_path_integral::FermionPathIntegral{T,E}
: An instance of theFermionPathIntegral
type.fermion_greens_calculator::FermionGreensCalculator{T,E}
: An instance of theFermionGreensCalculator
type.B::Vector{P}
: Propagators for each imaginary time slice.δG_max::E
: Maximum allowed error corrected by numerical stabilization.δG::E
: Previously recorded maximum error in the Green's function corrected by numerical stabilization.δθ::T
: Previously recorded maximum error in the sign/phase of the determinant of the equal-time Green's function matrix corrected by numerical stabilization.rng::AbstractRNG
: Random number generator used in method instead of global random number generator, important for reproducibility.update_stabilization_frequency::Bool=true
: If true, allows the stabilization frequencyn_stab
to be dynamically adjusted.
SmoQyDQMC.reflection_update!
— Methodreflection_update!(
Gup::Matrix{T}, logdetGup::E, sgndetGup::T,
Gdn::Matrix{T}, logdetGdn::E, sgndetGdn::T,
hubbard_ising_parameters::HubbardIsingHSParameters{E};
fermion_path_integral_up::FermionPathIntegral{T,E},
fermion_path_integral_dn::FermionPathIntegral{T,E},
fermion_greens_calculator_up::FermionGreensCalculator{T,E},
fermion_greens_calculator_dn::FermionGreensCalculator{T,E},
fermion_greens_calculator_up_alt::FermionGreensCalculator{T,E},
fermion_greens_calculator_dn_alt::FermionGreensCalculator{T,E},
Bup::Vector{P}, Bdn::Vector{P},
rng::AbstractRNG
) where {T<:Number, E<:AbstractFloat, P<:AbstractPropagator{T,E}}
Perform a reflection update where the sign of every Ising Hubbard-Stratonovich field on a randomly chosen orbital in the lattice is changed. This function returns (accepted, logdetGup, sgndetGup, logdetGdn, sgndetGdn)
.
Arguments
Gup::Matrix{T}
: Spin-up eqaul-time Greens function matrix.logdetGup::E
: Log of the determinant of the spin-up eqaul-time Greens function matrix.sgndetGup::T
: Sign/phase of the determinant of the spin-up eqaul-time Greens function matrix.Gdn::Matrix{T}
: Spin-down eqaul-time Greens function matrix.logdetGdn::E
: Log of the determinant of the spin-down eqaul-time Greens function matrix.sgndetGdn::T
: Sign/phase of the determinant of the spin-down eqaul-time Greens function matrix.hubbard_ising_parameters::HubbardIsingHSParameters{E}
: Ising Hubbard-Stratonovich fields and associated parameters to update.
Keyword Arguments
fermion_path_integral_up::FermionPathIntegral{T,E}
: An instance ofFermionPathIntegral
type for spin-up electrons.fermion_path_integral_dn::FermionPathIntegral{T,E}
: An instance ofFermionPathIntegral
type for spin-down electrons.fermion_greens_calculator_up::FermionGreensCalculator{T,E}
: Contains matrix factorization information for current spin-up sector state.fermion_greens_calculator_dn::FermionGreensCalculator{T,E}
: Contains matrix factorization information for current spin-down sector state.fermion_greens_calculator_up_alt::FermionGreensCalculator{T,E}
: Used to calculate matrix factorizations for proposed spin-up sector state.fermion_greens_calculator_dn_alt::FermionGreensCalculator{T,E}
: Used to calculate matrix factorizations for proposed spin-up sector state.Bup::Vector{P}
: Spin-up propagators for each imaginary time slice.Bdn::Vector{P}
: Spin-down propagators for each imaginary time slice.rng::AbstractRNG
: Random number generator used in method instead of global random number generator, important for reproducibility.
SmoQyDQMC.reflection_update!
— Methodreflection_update!(
G::Matrix{T}, logdetG::E, sgndetG::T,
hubbard_ising_parameters::HubbardIsingHSParameters{E};
fermion_path_integral::FermionPathIntegral{T,E},
fermion_greens_calculator::FermionGreensCalculator{T,E},
fermion_greens_calculator_alt::FermionGreensCalculator{T,E},
B::Vector{P},
rng::AbstractRNG
) where {T<:Number, E<:AbstractFloat, P<:AbstractPropagator{T,E}}
Perform a reflection update where the sign of every Ising Hubbard-Stratonovich field on a randomly chosen orbital in the lattice is changed. This function returns (accepted, logdetG, sgndetG)
. This method assumes strictly attractive Hubbard interactions.
Arguments
G::Matrix{T}
: Eqaul-time Greens function matrix.logdetG::E
: Log of the determinant of the eqaul-time Greens function matrix.sgndetG::T
: Sign/phase of the determinant of the eqaul-time Greens function matrix.hubbard_ising_parameters::HubbardIsingHSParameters{E}
: Ising Hubbard-Stratonovich fields and associated parameters to update.
Keyword Arguments
fermion_path_integral::FermionPathIntegral{T,E}
: An instance ofFermionPathIntegral
type.fermion_greens_calculator::FermionGreensCalculator{T,E}
: Contains matrix factorization information for current state.fermion_greens_calculator_alt::FermionGreensCalculator{T,E}
: Used to calculate matrix factorizations for proposed state.B::Vector{P}
: Propagators for each imaginary time slice.rng::AbstractRNG
: Random number generator used in method instead of global random number generator, important for reproducibility.
SmoQyDQMC.swap_update!
— Methodswap_update!(
Gup::Matrix{T}, logdetGup::E, sgndetGup::T,
Gdn::Matrix{T}, logdetGdn::E, sgndetGdn::T,
hubbard_ising_parameters::HubbardIsingHSParameters{E};
fermion_path_integral_up::FermionPathIntegral{T,E},
fermion_path_integral_dn::FermionPathIntegral{T,E},
fermion_greens_calculator_up::FermionGreensCalculator{T,E},
fermion_greens_calculator_dn::FermionGreensCalculator{T,E},
fermion_greens_calculator_up_alt::FermionGreensCalculator{T,E},
fermion_greens_calculator_dn_alt::FermionGreensCalculator{T,E},
Bup::Vector{P}, Bdn::Vector{P},
rng::AbstractRNG
) where {T<:Number, E<:AbstractFloat, P<:AbstractPropagator{T,E}}
Perform a swap update where the HS fields associated with two randomly chosen sites in the lattice are exchanged. This function returns (accepted, logdetGup, sgndetGup, logdetGdn, sgndetGdn)
.
Arguments
Gup::Matrix{T}
: Spin-up eqaul-time Greens function matrix.logdetGup::E
: Log of the determinant of the spin-up eqaul-time Greens function matrix.sgndetGup::T
: Sign/phase of the determinant of the spin-up eqaul-time Greens function matrix.Gdn::Matrix{T}
: Spin-down eqaul-time Greens function matrix.logdetGdn::E
: Log of the determinant of the spin-down eqaul-time Greens function matrix.sgndetGdn::T
: Sign/phase of the determinant of the spin-down eqaul-time Greens function matrix.hubbard_ising_parameters::HubbardIsingHSParameters{E}
: Ising Hubbard-Stratonovich fields and associated parameters to update.
Keyword Arguments
fermion_path_integral_up::FermionPathIntegral{T,E}
: An instance ofFermionPathIntegral
type for spin-up electrons.fermion_path_integral_dn::FermionPathIntegral{T,E}
: An instance ofFermionPathIntegral
type for spin-down electrons.fermion_greens_calculator_up::FermionGreensCalculator{T,E}
: Contains matrix factorization information for current spin-up sector state.fermion_greens_calculator_dn::FermionGreensCalculator{T,E}
: Contains matrix factorization information for current spin-down sector state.fermion_greens_calculator_up_alt::FermionGreensCalculator{T,E}
: Used to calculate matrix factorizations for proposed spin-up sector state.fermion_greens_calculator_dn_alt::FermionGreensCalculator{T,E}
: Used to calculate matrix factorizations for proposed spin-up sector state.Bup::Vector{P}
: Spin-up propagators for each imaginary time slice.Bdn::Vector{P}
: Spin-down propagators for each imaginary time slice.rng::AbstractRNG
: Random number generator used in method instead of global random number generator, important for reproducibility.
SmoQyDQMC.swap_update!
— Methodswap_update!(
G::Matrix{T}, logdetG::E, sgndetG::T,
hubbard_ising_parameters::HubbardIsingHSParameters{E};
fermion_path_integral::FermionPathIntegral{T,E},
fermion_greens_calculator::FermionGreensCalculator{T,E},
fermion_greens_calculator_alt::FermionGreensCalculator{T,E},
B::Vector{P}, rng::AbstractRNG
) where {T<:Number, E<:AbstractFloat, P<:AbstractPropagator{T,E}}
For strictly attractive Hubbard interactions, perform a swap update where the HS fields associated with two randomly chosen sites in the lattice are exchanged. This function returns (accepted, logdetG, sgndetG)
.
Arguments
G::Matrix{T}
: Eqaul-time Greens function matrix.logdetG::E
: Log of the determinant of the eqaul-time Greens function matrix.sgndetG::T
: Sign/phase of the determinant of the eqaul-time Greens function matrix.hubbard_ising_parameters::HubbardIsingHSParameters{E}
: Ising Hubbard-Stratonovich fields and associated parameters to update.
Keyword Arguments
fermion_path_integral::FermionPathIntegral{T,E}
: An instance ofFermionPathIntegral
type.fermion_greens_calculator::FermionGreensCalculator{T,E}
: Contains matrix factorization information for current state.fermion_greens_calculator_alt::FermionGreensCalculator{T,E}
: Used to calculate matrix factorizations for proposed state.B::Vector{P}
: Propagators for each imaginary time slice.rng::AbstractRNG
: Random number generator used in method instead of global random number generator, important for reproducibility.
Electron-Phonon Model
Electron-Phonon Model Types and Method
ElectronPhononModel
PhononMode
HolsteinCoupling
SSHCoupling
PhononDispersion
add_phonon_mode!
add_holstein_coupling!
add_ssh_coupling!
add_phonon_dispersion!
Electron-Phonon Parameter Types and Methods
ElectronPhononParameters
SmoQyDQMC.PhononParameters
SmoQyDQMC.HolsteinParameters
SmoQyDQMC.SSHParameters
SmoQyDQMC.DispersionParameters
initialize!
update!
Electron-Phonon Measurements
measure_phonon_kinetic_energy
measure_phonon_potential_energy
measure_phonon_position_moment
measure_holstein_energy
measure_ssh_energy
measure_ssh_sgn_switch
measure_dispersion_energy
Electron-Phonon Updates
Electron-Phonon Model Types and Method
SmoQyDQMC.ElectronPhononModel
— TypeElectronPhononModel{T<:Number, E<:AbstractFloat, D}
Defines an electron-phonon model.
Fields
phonon_modes::Vector{PhononModes{E}}
: A vector ofPhononMode
definitions.phonon_dispersions::Vector{PhononDispersion{E,D}}
: A vector ofPhononDispersion
defintions.holstein_couplings_up::Vector{HolsteinCoupling{E,D}}
: A vector ofHolsteinCoupling
definitions for spin-up.holstein_couplings_dn::Vector{HolsteinCoupling{E,D}}
: A vector ofHolsteinCoupling
definitions for spin-down.ssh_couplings_up::Vector{SSHCoupling{T,E,D}}
: A vector ofSSHCoupling
defintions for spin-up.ssh_couplings_dn::Vector{SSHCoupling{T,E,D}}
: A vector ofSSHCoupling
defintions for spin-down.
SmoQyDQMC.ElectronPhononModel
— MethodElectronPhononModel(;
model_geometry::ModelGeometry{D,E},
tight_binding_model::Union{TightBindingModel{T,E,D}, Nothing} = nothing,
tight_binding_model_up::Union{TightBindingModel{T,E,D}, Nothing} = nothing,
tight_binding_model_dn::Union{TightBindingModel{T,E,D}, Nothing} = nothing
) where {T<:Number, E<:AbstractFloat, D}
Initialize and return a null (empty) instance of ElectronPhononModel
. Note that either tight_binding_model
or tight_binding_model_up
and tight_binding_model_dn
needs to be specified.
SmoQyDQMC.PhononMode
— TypePhononMode{E<:AbstractFloat}
Defines a phonon mode on the orbital species orbital
in the unit cell. Specifically, it defines the phonon Hamiltonian terms
\[\hat{H}_{{\rm ph}} = \sum_{\mathbf{i}} \left[ \frac{1}{2} M_{\mathbf{i},\nu}\Omega_{\mathbf{i},\nu}^{2}\hat{X}_{\mathbf{i},\nu}^{2} + \frac{1}{12}M_{\mathbf{i},\nu}\Omega_{4,\mathbf{i},\nu}^{2}\hat{X}_{\mathbf{i},\nu}^{4} + \frac{1}{2M_{\mathbf{i},\nu}}\hat{P}_{\mathbf{i},\nu}^{2} \right],\]
where the sum runs over unit cell $\mathbf{i}$, $\nu$ denotes the orbital species orbital
in the unit cell, $M_{\mathbf{i},\nu}$ is the phonon mass M
, $\Omega_{\mathbf{i},\nu}$ is the phonon frequency that is distributed according to a normal distribution with mean Ω_mean
and standard deviation Ω_std
. Lastly, $\Omega_{4,\mathbf{i},\nu}$ is the anhmaronic coefficient, and is distributed according to a normal distribution with mean Ω4_mean
and standard deviation Ω4_std
.
Fields
orbital::Int
: Orbital species $\nu$ in the unit cell.M::E
:: The phonon mass $M_{\mathbf{i},\nu}.$Ω_mean::E
: Mean of normal distribution the phonon frequency $\Omega_{\mathbf{i},\nu}$ is sampled from.Ω_std::E
: Standard deviation of normal distribution the phonon frequency $\Omega_{\mathbf{i},\nu}$ is sampled from.Ω4_mean::E
: Mean of normal distribution the anharmonic coefficient $\Omega_{4,\mathbf{i},\nu}$ is sampled from.Ω4_std::E
: Standard deviation of normal distribution the anharmonic coefficient $\Omega_{4,\mathbf{i},\nu}$ is sampled from.
SmoQyDQMC.PhononMode
— MethodPhononMode(;
orbital::Int, Ω_mean::E, Ω_std::E = 0.,
M::E = 1., Ω4_mean::E = 0.0, Ω4_std::E = 0.0
) where {E<:AbstractFloat}
Initialize and return a instance of PhononMode
.
SmoQyDQMC.HolsteinCoupling
— TypeHolsteinCoupling{E<:AbstractFloat, D}
Defines a Holstein coupling between a specified phonon mode and orbital density. Specifically, if shifted = true
a Holstein interaction term is given by
\[\begin{align*} H = \sum_{\mathbf{i}} \Big[ & (\alpha_{\mathbf{i},(\mathbf{r},\kappa,\nu)} \hat{X}_{\mathbf{i},\nu} + \alpha_{3,\mathbf{i},(\mathbf{r},\kappa,\nu)} \hat{X}^3_{\mathbf{i},\nu}) \ (\hat{n}_{\sigma,\mathbf{i}+\mathbf{r},\kappa}-\tfrac{1}{2})\\ & + (\alpha_{2,\mathbf{i},(\mathbf{r},\kappa,\nu)} \hat{X}^2_{\mathbf{i},\nu} + \alpha_{4,\mathbf{i},(\mathbf{r},\kappa,\nu)} \hat{X}^4_{\mathbf{i},\nu}) \ \hat{n}_{\sigma,\mathbf{i}+\mathbf{r},\kappa} \Big] \end{align*},\]
whereas if shifted = false
then it is given by
\[\begin{align*} H = \sum_{\mathbf{i}} \Big[ & (\alpha_{\mathbf{i},(\mathbf{r},\kappa,\nu)} \hat{X}_{\mathbf{i},\nu} + \alpha_{3,\mathbf{i},(\mathbf{r},\kappa,\nu)} \hat{X}^3_{\mathbf{i},\nu}) \ \hat{n}_{\sigma,\mathbf{i}+\mathbf{r},\kappa}\\ & + (\alpha_{2,\mathbf{i},(\mathbf{r},\kappa,\nu)} \hat{X}^2_{\mathbf{i},\nu} + \alpha_{4,\mathbf{i},(\mathbf{r},\kappa,\nu)} \hat{X}^4_{\mathbf{i},\nu}) \ \hat{n}_{\sigma,\mathbf{i}+\mathbf{r},\kappa} \Big] \end{align*}.\]
In the above, $\sigma$ specifies the sum, and the sum over $\mathbf{i}$ runs over unit cells in the lattice. In the above $\nu$ and $\kappa$ specify orbital species in the unit cell, and $\mathbf{r}$ is a static displacement in unit cells.
Fields
shifted::Bool
: If the odd powered interaction terms are shifted to render them particle-hole symmetric in the atomic limit.phonon_mode::Int
: The phonon mode getting coupled to.bond::Bond{D}
: Static displacement from $\hat{X}_{\mathbf{i},\nu}$ to $\hat{n}_{\sigma,\mathbf{i}+\mathbf{r},\kappa}.$bond_id::Int
: Bond ID associtated withbond
field.α_mean::E
: Mean of the linear Holstein coupling coefficient $\alpha_{1,\mathbf{i},(\mathbf{r},\kappa,\nu)}.$α_std::E
: Standard deviation of the linear Holstein coupling coefficient $\alpha_{1,\mathbf{i},(\mathbf{r},\kappa,\nu)}.$α2_mean::E
: Mean of the squared Holstein coupling coefficient $\alpha_{2,\mathbf{i},(\mathbf{r},\kappa,\nu)}.$α2_std::E
: Standard deviation of the squared Holstein coupling coefficient $\alpha_{2,\mathbf{i},(\mathbf{r},\kappa,\nu)}.$α3_mean::E
: Mean of the cubic Holstein coupling coefficient $\alpha_{3,\mathbf{i},(\mathbf{r},\kappa,\nu)}.$α3_std::E
: Standard deviation of the cubic Holstein coupling coefficient $\alpha_{3,\mathbf{i},(\mathbf{r},\kappa,\nu)}.$α4_mean::E
: Mean of the quartic Holstein coupling coefficient $\alpha_{4,\mathbf{i},(\mathbf{r},\kappa,\nu)}.$α4_std::E
: Standard deviation of the quartic Holstein coupling coefficient $\alpha_{4,\mathbf{i},(\mathbf{r},\kappa,\nu)}.$
Comment
Note that the initial orbital bond.orbital[1]
must match the orbital species associated with phonon mode PhononMode
getting coupled to.
SmoQyDQMC.HolsteinCoupling
— MethodHolsteinCoupling(;
model_geometry::ModelGeometry{D,E},
phonon_mode::Int,
bond::Bond{D},
α_mean::E, α_std::E = 0.0,
α2_mean::E = 0.0, α2_std::E = 0.0,
α3_mean::E = 0.0, α3_std::E = 0.0,
α4_mean::E = 0.0, α4_std::E = 0.0,
shifted::Bool = true
) where {D, E<:AbstractFloat}
Initialize and return a instance of HolsteinCoupling
.
SmoQyDQMC.SSHCoupling
— TypeSSHCoupling{T<:Number, E<:AbstractFloat, D}
Defines a Su-Schrieffer-Heeger (SSH) coupling between a pair of phonon modes. Specifically, it defines the SSH interaction term
\[\hat{H}_{{\rm ssh}} = -\sum_{\sigma,\mathbf{i}} \left[ t_{\mathbf{i},(\mathbf{r},\kappa,\nu)} - \left( \sum_{n=1}^{4}\alpha_{n,\mathbf{i},(\mathbf{r},\kappa,\nu)} \left( \hat{X}_{\mathbf{i}+\mathbf{r},\kappa} - \hat{X}_{\mathbf{i},\nu}\right)^{n}\right) \right] \left( \hat{c}_{\sigma,\mathbf{i}+\mathbf{r},\kappa}^{\dagger}\hat{c}_{\sigma,\mathbf{i},\nu}+{\rm h.c.} \right),\]
where $\sigma$ specifies the sum, and the sum over $\mathbf{i}$ runs over unit cells in the lattice. In the above $\nu$ and $\kappa$ specify orbital species in the unit cell, and $\mathbf{r}$ is a static displacement in unit cells. In that above expression $t_{\mathbf{i},(\mathbf{r},\kappa,\nu)}$ is the bare hopping amplitude, which is not specified here.
Fields
phonon_modes::NTuple{2,Int}
: Pair of phonon modes getting coupled together.bond::Bond{D}
: Static displacement seperating the two phonon modes getting coupled.bond_id::Int
: Bond ID associated with thebond
field.α_mean::T
: Mean of the linear SSH coupling constant $\alpha_{1,\mathbf{i},(\mathbf{r},\kappa,\nu)}.$α_std::T
: Standard deviation of the linear SSH coupling constant $\alpha_{1,\mathbf{i},(\mathbf{r},\kappa,\nu)}.$α2_mean::T
: Mean of the quadratic SSH coupling constant $\alpha_{2,\mathbf{i},(\mathbf{r},\kappa,\nu)}.$α2_std::T
: Standard deviation of the quadratic SSH coupling constant $\alpha_{2,\mathbf{i},(\mathbf{r},\kappa,\nu)}.$α3_mean::T
: Mean of the cubic SSH coupling constant $\alpha_{3,\mathbf{i},(\mathbf{r},\kappa,\nu)}.$α3_std::T
: Standard deviation of the cubic SSH coupling constant $\alpha_{3,\mathbf{i},(\mathbf{r},\kappa,\nu)}.$α4_mean::T
: Mean of the quartic SSH coupling constant $\alpha_{4,\mathbf{i},(\mathbf{r},\kappa,\nu)}.$α4_std::T
: Standard deviation of the quartic SSH coupling constant $\alpha_{4,\mathbf{i},(\mathbf{r},\kappa,\nu)}.$
Comment
The pair of orbitals appearing in bond.orbitals
must correspond to the orbital species associated with the two coupling phonon modes specified by phonon_modes
.
SmoQyDQMC.SSHCoupling
— MethodSSHCoupling(;
model_geometry::ModelGeometry{D,E},
tight_binding_model::TightBindingModel{T,E,D},
phonon_modes::NTuple{2,Int},
bond::Bond{D},
α_mean::Union{T,E}, α_std::E = 0.0,
α2_mean::Union{T,E} = 0.0, α2_std::E = 0.0,
α3_mean::Union{T,E} = 0.0, α3_std::E = 0.0,
α4_mean::Union{T,E} = 0.0, α4_std::E = 0.0
) where {D, T<:Number, E<:AbstractFloat}
Initialize and return a instance of SSHCoupling
.
SmoQyDQMC.PhononDispersion
— TypePhononDispersion{E<:AbstractFloat, D}
Defines a dispersive phonon coupling between phonon modes. Specifically, it defines the dispersive phonon term
\[\hat{H}_{{\rm disp}} = \sum_{\mathbf{i}} \left( \frac{M_{\mathbf{i}+\mathbf{r},\kappa}M_{\mathbf{i},\nu}}{M_{\mathbf{i}+\mathbf{r},\kappa}+M_{\mathbf{i},\nu}} \right) \bigg[ \Omega_{\mathbf{i},(\mathbf{r},\kappa,\nu)}^{2}\Big(\hat{X}_{\mathbf{i}+\mathbf{r},\kappa}-\hat{X}_{\mathbf{i},\nu}\Big)^{2} +\frac{1}{12}\Omega_{4,\mathbf{i},(\mathbf{r},\kappa,\nu)}^{2}\Big(\hat{X}_{\mathbf{i}+\mathbf{r},\kappa}-\hat{X}_{\mathbf{i},\nu}\Big)^{4} \bigg]\]
where the sum over $\mathbf{i}$ runs over unit cells in the lattice. In the above $\nu$ and $\kappa$ specify orbital species in the unit cell, and $\mathbf{r}$ is a static displacement in unit cells.
Fields
phonon_modes::NTuple{2,Int}
: Pair of phonon modes getting coupled together.bond::Bond{D}
: Static displacement seperating the two phonon modes getting coupled.bond_id::Int
: Bond ID associated with thebond
field.Ω_mean::E
: Mean dispersive phonon frequency $\Omega_{\mathbf{i},(\mathbf{r},\kappa,\nu)}.$Ω_std::E
: Standard deviation of dispersive phonon frequency $\Omega_{\mathbf{i},(\mathbf{r},\kappa,\nu)}.$Ω4_mean::E
: Mean quartic dispersive phonon coefficient $\Omega_{4,\mathbf{i},(\mathbf{r},\kappa,\nu)}.$Ω4_std::E
: Standard deviation of quartic dispersive phonon coefficient $\Omega_{4,\mathbf{i},(\mathbf{r},\kappa,\nu)}.$
Comment
The pair of orbitals appearing in bond.orbitals
must correspond to the orbital species associated with the two coupling phonon modes specified by phonon_modes
.
SmoQyDQMC.PhononDispersion
— MethodPhononDispersion(;
model_geometry::ModelGeometry{D,E},
phonon_modes::NTuple{2,Int},
bond::Bond{D},
Ω_mean::E, Ω_std::E=0.0,
Ω4_mean::E=0.0, Ω4_std::E=0.0
) where {E<:AbstractFloat, D}
Initialize and return a instance of PhononDispersion
.
SmoQyDQMC.add_phonon_mode!
— Functionadd_phonon_mode!(;
electron_phonon_model::ElectronPhononModel{T,E,D},
phonon_mode::PhononMode{E}
) where {T<:Number, E<:AbstractFloat, D}
Add a PhononMode
to an ElectronPhononModel
.
SmoQyDQMC.add_holstein_coupling!
— Functionadd_holstein_coupling!(;
model_geometry::ModelGeometry{D,E},
electron_phonon_model::ElectronPhononModel{T,E,D},
holstein_coupling::Union{HolsteinCoupling{E,D}, Nothing} = nothing,
holstein_coupling_up::Union{HolsteinCoupling{E,D}, Nothing} = nothing,
holstein_coupling_dn::Union{HolsteinCoupling{E,D}, Nothing} = nothing
) where {T,E,D}
Add the HolsteinCoupling
to an ElectronPhononModel
. Note that either holstein_coupling
or holstein_coupling_up
and holstein_coupling_dn
must be specified.
SmoQyDQMC.add_ssh_coupling!
— Functionadd_ssh_coupling!(;
electron_phonon_model::ElectronPhononModel{T,E,D},
tight_binding_model::Union{TightBindingModel{T,E,D}, Nothing} = nothing,
ssh_coupling::Union{SSHCoupling{T,E,D}, Nothing} = nothing,
tight_binding_model_up::Union{TightBindingModel{T,E,D}, Nothing} = nothing,
tight_binding_model_dn::Union{TightBindingModel{T,E,D}, Nothing} = nothing,
ssh_coupling_up::Union{SSHCoupling{T,E,D}, Nothing} = nothing,
ssh_coupling_dn::Union{SSHCoupling{T,E,D}, Nothing} = nothing
) where {T,E,D}
Add a SSHCoupling
to an ElectronPhononModel
. Note that either ssh_coupling
and tight_binding_model
or ssh_coupling_up
, ssh_coupling_dn
, tight_binding_model_up
and tight_binding_model_dn
need to be specified.
SmoQyDQMC.add_phonon_dispersion!
— Functionadd_phonon_dispersion!(;
electron_phonon_model::ElectronPhononModel{T,E,D},
phonon_dispersion::PhononDispersion{E,D},
model_geometry::ModelGeometry{D,E}
) where {T,E,D}
Add a PhononDispersion
to an ElectronPhononModel
.
Electron-Phonon Parameter Types and Methods
SmoQyDQMC.ElectronPhononParameters
— TypeElectronPhononParameters{T<:Number, E<:AbstractFloat}
Describes all parameters in the electron-phonon model.
Fields
β::E
: Inverse temperature.Δτ::E
: Discretization in imaginary time.Lτ::Int
: Length of imaginary time axis.x::Matrix{E}
: Phonon fields, where each column represents the phonon fields for a given imaginary time slice.phonon_parameters::PhononParameters{E}
: Refer toPhononParameters
.holstein_parameters_up::HolsteinParameters{E}
: Spin upHolsteinParameters
.holstein_parameters_dn::HolsteinParameters{E}
: Spin downHolsteinParameters
.ssh_parameters_up::SSHParameters{T}
: Spin upSSHParameters
.ssh_parameters_dn::SSHParameters{T}
: Spin downSSHParameters
.dispersion_parameters::DispersionParameters{E}
: Refer toDispersionParameters
.
SmoQyDQMC.ElectronPhononParameters
— MethodElectronPhononParameters(;
β::E, Δτ::E,
model_geometry::ModelGeometry{D,E},
tight_binding_parameters::Union{TightBindingParameters{T,E}, Nothing} = nothing,
tight_binding_parameters_up::Union{TightBindingParameters{T,E}, Nothing} = nothing,
tight_binding_parameters_dn::Union{TightBindingParameters{T,E}, Nothing} = nothing,
electron_phonon_model::ElectronPhononModel{T,E,D},
rng::AbstractRNG
) where {T,E,D}
Initialize and return an instance of ElectronPhononParameters
.
SmoQyDQMC.PhononParameters
— TypePhononParameters{E<:AbstractFloat}
Defines the parameters for each phonon in the lattice, includes the phonon field configuration.
Fields
nphonon::Int
: Number of type of phonon modes.Nphonon::Int
: Total number of phonon modes in finite lattice.M::Int
: Mass of each phonon mode.Ω::Int
: Frequency of each phonon mode.Ω4::Int
: Quartic phonon coefficient for each phonon mode.phonon_to_site::Vector{Int}
: Map each phonon to the site it lives on in the lattice.site_to_phonons::Vector{Vector{Int}}
: Maps the site to the phonon modes on it, allowing for multiple modes to reside on a single site.
SmoQyDQMC.HolsteinParameters
— TypeHolsteinParameters{E<:AbstractFloat}
Defines the Holstein coupling parameters in lattice.
Fields
nholstein::Int
: The number of type of holstein couplings.Nholstein::Int
: Total number of Holstein couplings in lattice.α::Vector{T}
: Linear Holstein coupling.α2::Vector{T}
: Quadratic Holstein coupling.α3::Vector{T}
: Cubic Holstein coupling.α4::Vector{T}
: Quartic Holstein coupling.shifted::Vector{Bool}
: If the density multiplying the odd powered interaction terms is shifted.neighbor_table::Matrix{Int}
: Neighbor table where the first row specifies the site where the phonon mode is located, and the second row specifies the site corresponding to the density getting coupled to.coupling_to_phonon::Vector{Int}
: Maps each Holstein coupling in the lattice to the corresponding phonon mode.phonon_to_coupling::Vector{Vector{Int}}
: Maps each phonon model to correspond Holstein couplings.
SmoQyDQMC.SSHParameters
— TypeSSHParameters{T<:Number}
Defines the SSH coupling parameters in lattice.
Fields
nssh::Int
: Number of types of SSH couplings.Nssh::Int
: Number of SSH couplings in lattice.α::Vector{T}
: Linear SSH coupling.α2::Vector{T}
: Quadratic SSH coupling.α3::Vector{T}
: Cubic SSH coupling.α4::Vector{T}
: Quartic SSH coupling.`neighbor_table::Matrix{Int}
: Neighbor table to SSH coupling.coupling_to_phonon::Matrix{Int}
: Maps each SSH coupling onto that pair of coupled phonons.init_phonon_to_coupling::Vector{Vector{Int}}
: Maps initial phonon mode to corresponding SSH coupling(s).final_phonon_to_coupling::Vector{Vector{Int}}
: Maps final phonon mode to corresponding SSH coupling(s).hopping_to_couplings::Vector{Vector{Int}}
: Maps hopping in the tight-binding model onto SSH couplings.coupling_to_hopping::Vector{Int}
: Maps each SSH coupling onto the corresponding hopping in the tight-binding model.
SmoQyDQMC.DispersionParameters
— TypeDispersionParameters{E<:AbstractFloat}
Defines the dispersive phonon coupling parameters in the lattice.
Fields
ndispersion::Int
: Number of types of dispersive couplings.Ndispersion::Int
: Number of dispersive couplings in the lattice.Ω::Vector{E}
: Frequency of dispersive phonon coupling.Ω4::Vector{E}
: Quartic coefficient for the phonon dispersion.dispersion_to_phonon::Matrix{Int}
: Pair of phonon modes in lattice coupled by dispersive coupling.init_phonon_to_coupling::Vector{Vector{Int}}
: Maps initial phonon mode to corresponding dispersive phonon coupling.final_phonon_to_coupling::Vector{Vector{Int}}
: Maps final phonon mode to corresponding dispersive phonon coupling.
SmoQyDQMC.initialize!
— Methodinitialize!(
fermion_path_integral_up::FermionPathIntegral{T,E},
fermion_path_integral_dn::FermionPathIntegral{T,E},
electron_phonon_parameters::ElectronPhononParameters{T,E}
) where {T,E}
Initialize the contribution of an ElectronPhononParameters
to a FermionPathIntegral
.
SmoQyDQMC.initialize!
— Methodinitialize!(
fermion_path_integral::FermionPathIntegral{T,E},
electron_phonon_parameters::ElectronPhononParameters{T,E};
spin::Int = +1,
) where {T,E}
Initialize the contribution of an ElectronPhononParameters
to a FermionPathIntegral
.
SmoQyDQMC.update!
— Methodupdate!(
fermion_path_integral_up::FermionPathIntegral{T,E},
fermion_path_integral_dn::FermionPathIntegral{T,E},
electron_phonon_parameters::ElectronPhononParameters{T,E},
x′::Matrix{E},
x::Matrix{E}
) where {T,E}
Update a FermionPathIntegral
to reflect a change in the phonon configuration from x
to x′
.
SmoQyDQMC.update!
— Methodupdate!(
fermion_path_integral::FermionPathIntegral{T,E},
electron_phonon_parameters::ElectronPhononParameters{T,E},
x′::Matrix{E},
x::Matrix{E};
spin::Int = +1
) where {T,E}
Update a FermionPathIntegral
to reflect a change in the phonon configuration from x
to x′
.
SmoQyDQMC.update!
— Methodupdate!(fermion_path_integral::FermionPathIntegral{T,E},
electron_phonon_parameters::ElectronPhononParameters{T,E},
x::Matrix{E},
sgn::Int;
spin::Int = +1
) where {T,E}
Update a FermionPathIntegral
according to sgn * x
.
Electron-Phonon Measurements
SmoQyDQMC.measure_phonon_kinetic_energy
— Functionmeasure_phonon_kinetic_energy(electron_phonon_parameters::ElectronPhononParameters{T,E},
n::Int) where {T<:Number, E<:AbstractFloat}
Evaluate the average phonon kinetic energy for phonon mode n
. The measurement is made using the expression
\[\langle K \rangle = \frac{1}{2\Delta\tau} - \frac{M}{2}\bigg\langle\frac{(x_{l+1}-x_{l})^{2}}{\Delta\tau^{2}}\bigg\rangle. \]
SmoQyDQMC.measure_phonon_potential_energy
— Functionmeasure_phonon_potential_energy(electron_phonon_parameters::ElectronPhononParameters{T,E},
n::Int) where {T<:Number, E<:AbstractFloat}
Calculate the average phonon potential energy, given by
\[U = \frac{1}{2} M \Omega^2 \langle \hat{X}^2 \rangle + \frac{1}{24} M \Omega_4^2 \langle \hat{X}^4 \rangle,\]
for phonon mode n
in the unit cell.
SmoQyDQMC.measure_phonon_position_moment
— Functionmeasure_phonon_position_moment(electron_phonon_parameters::ElectronPhononParameters{T,E},
n::Int, m::Int) where {T<:Number, E<:AbstractFloat}
Measure $\langle X^m \rangle$ for phonon mode n
in the unit cell.
SmoQyDQMC.measure_holstein_energy
— Functionmeasure_holstein_energy(
electron_phonon_parameters::ElectronPhononParameters{T,E},
Gup::Matrix{T}, Gdn::Matrix{T},
holstein_id::Int
) where {T<:Number, E<:AbstractFloat}
Calculate and return both the spin-resolved Holstein interaction energy
\[\epsilon_{{\rm hol},\sigma} = \left\langle [ \alpha \hat{X} + \alpha_2 \hat{X}^2 + \alpha_3 \hat{X}^3 + \alpha_4 \hat{X}^4 ] \left( \hat{n}_\sigma - \frac{1}{2} \right) \right\rangle,\]
and the total Holstein interaction energy coupling definition corresponding to holstein_id
. The method returns (ϵ_hol, ϵ_hol_up, ϵ_hol_dn)
where ϵ_hol = ϵ_hol_up + ϵ_hol_dn
.
SmoQyDQMC.measure_ssh_energy
— Functionmeasure_ssh_energy(
electron_phonon_parameters::ElectronPhononParameters{T,E},
Gup::Matrix{T}, Gdn::Matrix{T},
ssh_id::Int
) where {T<:Number, E<:AbstractFloat}
Calculate the return the SSH interaction energy
\[\epsilon_{\rm ssh} = \sum_\sigma \left\langle [\alpha \hat{X} + \alpha_2 \hat{X}^2 \alpha_3 \hat{X}^3 + \alpha_4 \hat{X}^4] (\hat{c}^\dagger_{\sigma,i} \hat{c}_{\sigma,j} + {\rm h.c.}) \right\rangle\]
for coupling definition specified by ssh_id
.
measure_ssh_energy(
ssh_parameters::SSHParameters{T},
G::Matrix{T}, x::Matrix{E}, ssh_id::Int
) where {T<:Number, E<:AbstractFloat}
Calculate the return the SSH interaction energy
\[\epsilon_{\rm ssh} = \left\langle [\alpha \hat{X} + \alpha_2 \hat{X}^2 \alpha_3 \hat{X}^3 + \alpha_4 \hat{X}^4] (\hat{c}^\dagger_{\sigma,i} \hat{c}_{\sigma,j} + {\rm h.c.}) \right\rangle\]
for coupling definition specified by ssh_id
.
SmoQyDQMC.measure_ssh_sgn_switch
— Functionmeasure_ssh_sgn_switch(
electron_phonon_parameters::ElectronPhononParameters{T,E},
tight_binding_parameters::TightBindingParameters{T,E},
ssh_id::Int;
spin::Int = +1
) where {T<:Number, E<:AbstractFloat}
Calculate the fraction of the time the sign of the hopping is changed as a result of the SSH coupling associated with ssh_id
.
SmoQyDQMC.measure_dispersion_energy
— Functionmeasure_dispersion_energy(electron_phonon_parameters::ElectronPhononParameters{T,E},
dispersion_id::Int) where {T<:Number, E<:AbstractFloat}
Evaluate the average dispersion energy
\[\epsilon_{\rm disp} = \frac{1}{2} M_{\rm red} \Omega^2 \langle(\hat{X}_i - \hat{X}_j)^2\rangle + \frac{1}{24} M{\rm red} \Omega_4^2 \langle(\hat{X}_i - \hat{X}_j)^4\rangle,\]
where $M_{\rm red} = \frac{M_i M_j}{M_i + M_j}$ is the reduced mass, for the dispersive coupling definition specified by dispersion_id
.
Electron-Phonon Updates
SmoQyDQMC.HMCUpdater
— TypeHMCUpdater{T<:Number, E<:AbstractFloat, PFFT, PIFFT}
Defines a hybrid/hamiltonian monte carlo (HMC) update for the phonon degrees of freedom.
Fields
Nt::Int
: Mean trajectory length in terms of the number of fermionic time-steps.Δt::E
: Average fermionic time-step size used in HMC update.nt::Int
: Number of bosonic time-steps per fermionic time-step using a bosonic time-stepΔt′=Δt/nt
.δ::E
: Time-step used in HMC update is jittered by an amountΔt = Δt * (1 + δ*(2*rand(rng)-1))
.M::FourierMassMatrix{E,PFFT,PIFFT}
: Defines theFourierMassMatrix
.dSdx::Matrix{E}
: Array to contain derivative of fermionic and bosonic action during HMC trajectory.dSfdx0::Matrix{E}
: Initial derivative of fermionic action associated with the initial phonon configuration.Gup′::Matrix{T}
: Matrix to contain itermediate spin-up Green's function matrices.Gdn′::Matrix{T}
: Matrix to contain itermediate spin-down Green's function matrices.x′::Matrix{E}
: Array to record intermediate phonon configurations.x0::Matrix{E}
: Array to record initial phonon configuration.v::Matrix{E}
: Conjugate momentum to phonon fields in HMC trajectory.first_update::Bool
: A flag indicating whether the next update will be the first update
SmoQyDQMC.HMCUpdater
— MethodHMCUpdater(;
electron_phonon_parameters::ElectronPhononParameters{T,E},
G::Matrix{T},
Nt::Int,
Δt::E,
nt::Int,
reg::E
) where {T,E}
Initialize and return an instance of HMCUpdater
.
Arguments
electron_phonon_parameters::ElectronPhononParameters{T,E}
: Defines electron phonon model.G::Matrix{T}
: Template Green's function matrix.Nt::Int
: Number of fermionic timesteps in HMC trajectory.Δt::E
: Fermionic time-step.nt::Int
: Number of bosonic time-steps per fermionic time-step.reg::E
: Regularization parameter for defining an instance ofFourierMassMatrix
.δ::E = 0.05
: Proportion by which the HMC time-step is jittered befored each update.
SmoQyDQMC.EFAHMCUpdater
— TypeEFAHMCUpdater{T<:Number, E<:AbstractFloat, PFFT, PIFFT}
Defines an Exact Fourier Acceleration Hamiltonian/Hybrid Monte Carlo (EFA-HMC) update for the phonon degrees of freedom.
Fields
Nt::Int
: Number of time-steps in HMC trajectory.Δt::E
: Average time-step size used in HMC update.δ::E
: Time-step used in EFA-HMC update is jittered by an amountΔt = Δt * (1 + δ*(2*rand(rng)-1))
.x::Matrix{E}
: Records initial phonon configuration in position space.p::Matrix{E}
: Conjugate momentum in HMC dynamics.dSdx::Matrix{E}
: Stores the derivative of the action.Gup′::Matrix{T}
: Intermediate spin-up Green's function matrix during HMC trajectory.Gdn′::Matrix{T}
: Intermediate spin-down Green's function matrix during HMC trajectory.efa::ExactFourierAccelerator{E,PFFT,PIFFT}
: Type to perform exact integration of equations of motion of quantum harmonic oscillator.
SmoQyDQMC.EFAHMCUpdater
— MethodEFAHMCUpdater(;
# Keyword Arguments Start Here
electron_phonon_parameters::ElectronPhononParameters{T,E},
G::Matrix{T},
Nt::Int,
Δt::E,
reg::E = 0.0,
δ::E = 0.05
) where {T<:Number, E<:AbstractFloat}
Arguments
electron_phonon_parameters::ElectronPhononParameters{T,E}
: Defines electron-phonon model.G::Matrix{T}
: Sample Green's function matrix.Nt::Int
: Number of time-steps used in EFA-HMC update.Δt::E
: Average step size used for HMC update.reg::E = Inf
: Regularization used for mass in equations of motion.δ::E = 0.05
: Amount of jitter added to time-step used in EFA-HMC update.
SmoQyDQMC.hmc_update!
— Methodhmc_update!(
Gup::Matrix{T}, logdetGup::E, sgndetGup::T,
Gdn::Matrix{T}, logdetGdn::E, sgndetGdn::T,
electron_phonon_parameters::ElectronPhononParameters{T,E},
hmc_updater::HMCUpdater{T,E};
# Keyword Arguments Start Here
fermion_path_integral_up::FermionPathIntegral{T,E},
fermion_path_integral_dn::FermionPathIntegral{T,E},
fermion_greens_calculator_up::FermionGreensCalculator{T,E},
fermion_greens_calculator_dn::FermionGreensCalculator{T,E},
fermion_greens_calculator_up_alt::FermionGreensCalculator{T,E},
fermion_greens_calculator_dn_alt::FermionGreensCalculator{T,E},
Bup::Vector{P}, Bdn::Vector{P},
δG::E, δθ::E, rng::AbstractRNG,
update_stabilization_frequency::Bool = false,
δG_max::E = 1e-5,
δG_reject::E = 1e-2,
initialize_force::Bool = true,
recenter!::Function = identity,
Nt::Int = hmc_updater.Nt,
nt::Int = hmc_updater.nt,
Δt::E = hmc_updater.Δt,
δ::E = hmc_updater.δ
) where {T<:Number, E<:AbstractFloat, P<:AbstractPropagator{T,E}}
Perform HMC update to the phonon degrees of freedom. This method returns (accepted, logdetGup, sgndetGup, logdetGdn, sgndetGdn, δG, δθ)
, where accepted
is a boolean field indicating whether the proposed HMC update was accepted or rejected.
SmoQyDQMC.hmc_update!
— Methodhmc_update!(
G::Matrix{T}, logdetG::E, sgndetG::T,
electron_phonon_parameters::ElectronPhononParameters{T,E},
hmc_updater::HMCUpdater{T,E};
# Keyword Arguments Start Here
fermion_path_integral::FermionPathIntegral{T,E},
fermion_greens_calculator::FermionGreensCalculator{T,E},
fermion_greens_calculator_alt::FermionGreensCalculator{T,E},
B::Vector{P}, δG::E, δθ::E, rng::AbstractRNG,
update_stabilization_frequency::Bool = false,
δG_max::E = 1e-5,
δG_reject::E = 1e-2,
initialize_force::Bool = true,
recenter!::Function = identity,
Nt::Int = hmc_updater.Nt,
nt::Int = hmc_updater.nt,
Δt::E = hmc_updater.Δt,
δ::E = hmc_updater.δ
) where {T<:Number, E<:AbstractFloat, P<:AbstractPropagator{T,E}}
Perform HMC update to the phonon degrees of freedom assuming the spin-up and spin-down sectors are equivalent. This method returns (accepted, logdetG, sgndetG, δG, δθ)
, where accepted
is a boolean field indicating whether the proposed HMC update was accepted or rejected.
SmoQyDQMC.hmc_update!
— Methodhmc_update!(
Gup::Matrix{T}, logdetGup::E, sgndetGup::T,
Gdn::Matrix{T}, logdetGdn::E, sgndetGdn::T,
electron_phonon_parameters::ElectronPhononParameters{T,E},
hmc_updater::EFAHMCUpdater{T,E};
# Keyword Arguments Start Here
fermion_path_integral_up::FermionPathIntegral{T,E},
fermion_path_integral_dn::FermionPathIntegral{T,E},
fermion_greens_calculator_up::FermionGreensCalculator{T,E},
fermion_greens_calculator_dn::FermionGreensCalculator{T,E},
fermion_greens_calculator_up_alt::FermionGreensCalculator{T,E},
fermion_greens_calculator_dn_alt::FermionGreensCalculator{T,E},
Bup::Vector{P}, Bdn::Vector{P},
δG::E, δθ::E, rng::AbstractRNG,
update_stabilization_frequency::Bool = false,
δG_max::E = 1e-5,
δG_reject::E = 1e-2,
recenter!::Function = identity,
Nt::Int = hmc_updater.Nt,
Δt::E = hmc_updater.Δt,
δ::E = hmc_updater.δ
) where {T, E, P<:AbstractPropagator{T,E}}
Perform EFA-HMC update to the phonon degrees of freedom. This method returns (accepted, logdetGup, sgndetGup, logdetGdn, sgndetGdn, δG, δθ)
, where accepted
is a boolean field indicating whether the proposed HMC update was accepted or rejected.
SmoQyDQMC.hmc_update!
— Methodhmc_update!(
G::Matrix{T}, logdetG::E, sgndetG::T,
electron_phonon_parameters::ElectronPhononParameters{T,E},
hmc_updater::EFAHMCUpdater{T,E};
fermion_path_integral::FermionPathIntegral{T,E},
fermion_greens_calculator::FermionGreensCalculator{T,E},
fermion_greens_calculator_alt::FermionGreensCalculator{T,E},
B::Vector{P},
δG::E, δθ::E, rng::AbstractRNG,
update_stabilization_frequency::Bool = false,
δG_max::E = 1e-5,
δG_reject::E = 1e-2,
recenter!::Function = identity,
Nt::Int = hmc_updater.Nt,
Δt::E = hmc_updater.Δt,
δ::E = hmc_updater.δ
) where {T, E, P<:AbstractPropagator{T,E}}
Perform EFA-HMC update to the phonon degrees of freedom. This method returns (accepted, logdetG, sgndetG, δG, δθ)
, where accepted
is a boolean field indicating whether the proposed HMC update was accepted or rejected.
SmoQyDQMC.FourierMassMatrix
— TypeFourierMassMatrix{E<:AbstractFloat, PFFT, PIFFT}
Defines the mass matrix that implements fourier acceleration when performing either hybrid/hamiltonian monte carlo or langevin monte carlo updates to the phonon fields.
Fields
M̃::Matrix{E}
: Matrix elements of fourier mass matrix in frequency space.v′::Matrix{Complex{E}}
: Temporary storage array to contain velocities as complex numbers to avoid dynamic memory allocations.ṽ::Matrix{Complex{E}}
: Temporary storage to avoid some dynamic memory allocations when performing fourier transforms.pfft::PFFT
: Forward FFT plan to perform transformation from imaginary time to frequency space without allocations.pifft::PIFFT
: Inverse FFT plan to perform transformation from frequency to imaginary time space without allocations.is_scalar::Bool
: If the mass matrix is equivalent to a simple scalar.
SmoQyDQMC.reflection_update!
— Methodreflection_update!(Gup::Matrix{T}, logdetGup::E, sgndetGup::T,
Gdn::Matrix{T}, logdetGdn::E, sgndetGdn::T,
electron_phonon_parameters::ElectronPhononParameters{T,E};
fermion_path_integral_up::FermionPathIntegral{T,E},
fermion_path_integral_dn::FermionPathIntegral{T,E},
fermion_greens_calculator_up::FermionGreensCalculator{T,E},
fermion_greens_calculator_dn::FermionGreensCalculator{T,E},
fermion_greens_calculator_up_alt::FermionGreensCalculator{T,E},
fermion_greens_calculator_dn_alt::FermionGreensCalculator{T,E},
Bup::Vector{P}, Bdn::Vector{P}, rng::AbstractRNG,
phonon_types = nothing) where {T<:Number, E<:AbstractFloat, P<:AbstractPropagator{T,E}}
Randomly sample a phonon mode in the lattice, and propose an update that reflects all the phonon fields associated with that phonon mode $x \rightarrow -x.$ This function returns (accepted, logdetGup, sgndetGup, logdetGdn, sgndetGdn)
.
Arguments
Gup::Matrix{T}
: Spin-up eqaul-time Greens function matrix.logdetGup::E
: Log of the determinant of the spin-up eqaul-time Greens function matrix.sgndetGup::T
: Sign/phase of the determinant of the spin-up eqaul-time Greens function matrix.Gdn::Matrix{T}
: Spin-down eqaul-time Greens function matrix.logdetGdn::E
: Log of the determinant of the spin-down eqaul-time Greens function matrix.sgndetGdn::T
: Sign/phase of the determinant of the spin-down eqaul-time Greens function matrix.electron_phonon_parameters::ElectronPhononParameters{T,E}
: Electron-phonon parameters, including the current phonon configuration.
Keyword Arguments
fermion_path_integral_up::FermionPathIntegral{T,E}
: An instance ofFermionPathIntegral
type for spin-up electrons.fermion_path_integral_dn::FermionPathIntegral{T,E}
: An instance ofFermionPathIntegral
type for spin-down electrons.fermion_greens_calculator_up::FermionGreensCalculator{T,E}
: Contains matrix factorization information for current spin-up sector state.fermion_greens_calculator_dn::FermionGreensCalculator{T,E}
: Contains matrix factorization information for current spin-down sector state.fermion_greens_calculator_up_alt::FermionGreensCalculator{T,E}
: Used to calculate matrix factorizations for proposed spin-up sector state.fermion_greens_calculator_dn_alt::FermionGreensCalculator{T,E}
: Used to calculate matrix factorizations for proposed spin-up sector state.Bup::Vector{P}
: Spin-up propagators for each imaginary time slice.Bdn::Vector{P}
: Spin-down propagators for each imaginary time slice.rng::AbstractRNG
: Random number generator used in method instead of global random number generator, important for reproducibility.phonon_types = nothing
: Collection of phonon types in the unit cell to randomly sample a phonon mode from. Ifnothing
then all phonon modes in the unit cell are considered.
SmoQyDQMC.reflection_update!
— Methodreflection_update!(G::Matrix{T}, logdetG::E, sgndetG::T,
electron_phonon_parameters::ElectronPhononParameters{T,E};
fermion_path_integral::FermionPathIntegral{T,E},
fermion_greens_calculator::FermionGreensCalculator{T,E},
fermion_greens_calculator_alt::FermionGreensCalculator{T,E},
B::Vector{P}, rng::AbstractRNG,
phonon_types = nothing) where {T<:Number, E<:AbstractFloat, P<:AbstractPropagator{T,E}}
Randomly sample a phonon mode in the lattice, and propose an update that reflects all the phonon fields associated with that phonon mode $x \rightarrow -x.$ This function returns (accepted, logdetG, sgndetG)
.
Arguments
G::Matrix{T}
: Eqaul-time Greens function matrix.logdetG::E
: Log of the determinant of the eqaul-time Greens function matrix.sgndetG::T
: Sign/phase of the determinant of the eqaul-time Greens function matrix.electron_phonon_parameters::ElectronPhononParameters{T,E}
: Electron-phonon parameters, including the current phonon configuration.
Keyword Arguments
fermion_path_integral::FermionPathIntegral{T,E}
: An instance ofFermionPathIntegral
type.fermion_greens_calculator::FermionGreensCalculator{T,E}
: Contains matrix factorization information for current state.fermion_greens_calculator_alt::FermionGreensCalculator{T,E}
: Used to calculate matrix factorizations for proposed state.B::Vector{P}
: Propagators for each imaginary time slice.rng::AbstractRNG
: Random number generator used in method instead of global random number generator, important for reproducibility.phonon_types = nothing
: Collection of phonon types in the unit cell to randomly sample a phonon mode from. Ifnothing
then all phonon modes in the unit cell are considered.
SmoQyDQMC.swap_update!
— Methodswap_update!(Gup::Matrix{T}, logdetGup::E, sgndetGup::T,
Gdn::Matrix{T}, logdetGdn::E, sgndetGdn::T,
electron_phonon_parameters::ElectronPhononParameters{T,E};
fermion_path_integral_up::FermionPathIntegral{T,E},
fermion_path_integral_dn::FermionPathIntegral{T,E},
fermion_greens_calculator_up::FermionGreensCalculator{T,E},
fermion_greens_calculator_dn::FermionGreensCalculator{T,E},
fermion_greens_calculator_up_alt::FermionGreensCalculator{T,E},
fermion_greens_calculator_dn_alt::FermionGreensCalculator{T,E},
Bup::Vector{P}, Bdn::Vector{P}, rng::AbstractRNG,
phonon_type_pairs = nothing) where {T<:Number, E<:AbstractFloat, P<:AbstractPropagator{T,E}}
Randomly sample a pairs of phonon modes and exchange the phonon fields associated with the pair of phonon modes. This function returns (accepted, logdetGup, sgndetGup, logdetGdn, sgndetGdn)
.
Arguments
Gup::Matrix{T}
: Spin-up eqaul-time Greens function matrix.logdetGup::E
: Log of the determinant of the spin-up eqaul-time Greens function matrix.sgndetGup::T
: Sign/phase of the determinant of the spin-up eqaul-time Greens function matrix.Gdn::Matrix{T}
: Spin-down eqaul-time Greens function matrix.logdetGdn::E
: Log of the determinant of the spin-down eqaul-time Greens function matrix.sgndetGdn::T
: Sign/phase of the determinant of the spin-down eqaul-time Greens function matrix.electron_phonon_parameters::ElectronPhononParameters{T,E}
: Electron-phonon parameters, including the current phonon configuration.
Keyword Arguments
fermion_path_integral_up::FermionPathIntegral{T,E}
: An instance ofFermionPathIntegral
type for spin-up electrons.fermion_path_integral_dn::FermionPathIntegral{T,E}
: An instance ofFermionPathIntegral
type for spin-down electrons.fermion_greens_calculator_up::FermionGreensCalculator{T,E}
: Contains matrix factorization information for current spin-up sector state.fermion_greens_calculator_dn::FermionGreensCalculator{T,E}
: Contains matrix factorization information for current spin-down sector state.fermion_greens_calculator_up_alt::FermionGreensCalculator{T,E}
: Used to calculate matrix factorizations for proposed spin-up sector state.fermion_greens_calculator_dn_alt::FermionGreensCalculator{T,E}
: Used to calculate matrix factorizations for proposed spin-up sector state.Bup::Vector{P}
: Spin-up propagators for each imaginary time slice.Bdn::Vector{P}
: Spin-down propagators for each imaginary time slice.rng::AbstractRNG
: Random number generator used in method instead of global random number generator, important for reproducibility.phonon_type_pairs = nothing
: Collection of phonon type pairs in the unit cell to randomly sample a phonon modes from. Ifnothing
then all phonon mode pairs in the unit cell are considered.
SmoQyDQMC.swap_update!
— Methodswap_update!(G::Matrix{T}, logdetG::E, sgndetG::T,
electron_phonon_parameters::ElectronPhononParameters{T,E};
fermion_path_integral::FermionPathIntegral{T,E},
fermion_greens_calculator::FermionGreensCalculator{T,E},
fermion_greens_calculator_alt::FermionGreensCalculator{T,E},
B::Vector{P}, rng::AbstractRNG,
phonon_type_pairs = nothing) where {T<:Number, E<:AbstractFloat, P<:AbstractPropagator{T,E}}
Randomly sample a pairs of phonon modes and exchange the phonon fields associated with the pair of phonon modes. This function returns (accepted, logdetG, sgndetG)
.
Arguments
G::Matrix{T}
: Eqaul-time Greens function matrix.logdetG::E
: Log of the determinant of the eqaul-time Greens function matrix.sgndetG::T
: Sign/phase of the determinant of the eqaul-time Greens function matrix.electron_phonon_parameters::ElectronPhononParameters{T,E}
: Electron-phonon parameters, including the current phonon configuration.
Keyword Arguments
fermion_path_integral::FermionPathIntegral{T,E}
: An instance ofFermionPathIntegral
type.fermion_greens_calculator::FermionGreensCalculator{T,E}
: Contains matrix factorization information for current state.fermion_greens_calculator_alt::FermionGreensCalculator{T,E}
: Used to calculate matrix factorizations for proposed state.B::Vector{P}
: Propagators for each imaginary time slice.rng::AbstractRNG
: Random number generator used in method instead of global random number generator, important for reproducibility.phonon_type_pairs = nothing
: Collection of phonon type pairs in the unit cell to randomly sample a phonon modes from. Ifnothing
then all phonon mode pairs in the unit cell are considered.
Density and Chemical Potential Tuning
SmoQyDQMC.update_chemical_potential!
— Functionupdate_chemical_potential!(
Gup::Matrix{T}, logdetGup::E, sgndetGup::T,
Gdn::Matrix{T}, logdetGdn::E, sgndetGdn::T;
chemical_potential_tuner::MuTunerLogger{E,T},
tight_binding_parameters::Union{TightBindingParameters{T,E}, Nothing} = nothing,
tight_binding_parameters_up::Union{TightBindingParameters{T,E}, Nothing} = nothing,
tight_binding_parameters_dn::Union{TightBindingParameters{T,E}, Nothing} = nothing,
fermion_path_integral_up::FermionPathIntegral{T,E},
fermion_path_integral_dn::FermionPathIntegral{T,E},
fermion_greens_calculator_up::FermionGreensCalculator{T,E},
fermion_greens_calculator_dn::FermionGreensCalculator{T,E},
Bup::Vector{P}, Bdn::Vector{P}
) where {T<:Number, E<:AbstractFloat, P<:AbstractPropagator{T,E}}
Update the chemical potential $\mu$ in the simulation to approach the target density/filling. This method returns the new values for (logdetGup, sgndetGup, logdetGup, sgndetGup)
. Note that either the keywork tight_binding_parameters
needs to be specified, or tight_binding_parameters_up
and tight_binding_parameters_dn
both need to be specified.
update_chemical_potential!(
G::Matrix{T}, logdetG::E, sgndetG::T;
chemical_potential_tuner::MuTunerLogger{E,T},
tight_binding_parameters::TightBindingParameters{T,E},
fermion_path_integral::FermionPathIntegral{T,E},
fermion_greens_calculator::FermionGreensCalculator{T,E},
B::Vector{P}
) where {T<:Number, E<:AbstractFloat, P<:AbstractPropagator{T,E}}
Update the chemical potential $\mu$ in the simulation to approach the target density/filling. This method returns the new values for (logdetG, sgndetG)
.
SmoQyDQMC.save_density_tuning_profile
— Functionsave_density_tuning_profile(simulation_info::SimulationInfo,
chemical_potential_tuner::MuTunerLogger{E,T}) where {E,T}
Write the full density tuning history to a CSV file, typically done at the end of a simulation.
Measurement Methods
Initialize Measurements
initialize_measurement_container
initialize_measurements!
initialize_correlation_measurements!
initialize_composite_correlation_measurement!
initialize_measurement_directories
Make Measurements
Write Measurements
Process Measurements
save_simulation_info
process_measurements
process_correlation_measurement
composite_correlation_stat
compute_correlation_ratio
compute_composite_correlation_ratio
global_measurement_bins_to_csv
local_measurement_bins_to_csv
correlation_bins_to_csv
compress_jld2_bins
decompress_jld2_bins
delete_jld2_bins
SmoQyDQMC.GLOBAL_MEASUREMENTS
— Constantconst GLOBAL_MEASUREMENTS = (
"logdetGup",
"logdetGdn",
"sgndetGup",
"sgndetGdn",
"sgn",
"action_total",
"action_bosonic",
"action_fermionic",
"density",
"density_up",
"density_dn",
"double_occ",
"Nsqrd"
)
List of all the global measurements that are made.
SmoQyDQMC.LOCAL_MEASUREMENTS
— Constantconst LOCAL_MEASUREMENTS = Base.ImmutableDict(
"density" => "ORBITAL_ID",
"density_up" => "ORBITAL_ID",
"density_dn" => "ORBITAL_ID",
"double_occ" => "ORBITAL_ID",
"onsite_energy" => "ORBITAL_ID",
"onsite_energy_up" => "ORBITAL_ID",
"onsite_energy_dn" => "ORBITAL_ID",
"bare_hopping_energy" => "HOPPING_ID",
"bare_hopping_energy_up" => "HOPPING_ID",
"bare_hopping_energy_dn" => "HOPPING_ID",
"hopping_energy" => "HOPPING_ID",
"hopping_energy_up" => "HOPPING_ID",
"hopping_energy_dn" => "HOPPING_ID",
"hopping_amplitude_up" => "HOPPING_ID",
"hopping_amplitude_dn" => "HOPPING_ID",
"hopping_amplitude" => "HOPPING_ID",
"hopping_inversion_avg_up" => "HOPPING_ID",
"hopping_inversion_avg_dn" => "HOPPING_ID",
"hopping_inversion_avg" => "HOPPING_ID",
"hopping_inversion_up" => "HOPPING_ID",
"hopping_inversion_dn" => "HOPPING_ID",
"hopping_inversion" => "HOPPING_ID",
"hubbard_energy" => "ORBITAL_ID",
"phonon_kin_energy" => "PHONON_ID",
"phonon_pot_energy" => "PHONON_ID",
"X" => "PHONON_ID",
"X2" => "PHONON_ID",
"X3" => "PHONON_ID",
"X4" => "PHONON_ID",
"holstein_energy" => "HOLSTEIN_ID",
"holstein_energy_up" => "HOLSTEIN_ID",
"holstein_energy_dn" => "HOLSTEIN_ID",
"ssh_energy" => "SSH_ID",
"ssh_energy_up" => "SSH_ID",
"ssh_energy_dn" => "SSH_ID",
"dispersion_energy" => "DISPERSION_ID"
)
List of all the local measurements than can be made, with a mapping to the corresponding type of ID each measurement is reported in terms of.
SmoQyDQMC.CORRELATION_FUNCTIONS
— ConstantCORRELATION_FUNCTIONS = Base.ImmutableDict(
"greens" => "ORBITAL_ID",
"greens_up" => "ORBITAL_ID",
"greens_dn" => "ORBITAL_ID",
"greens_tautau" => "ORBITAL_ID",
"greens_tautau_up" => "ORBITAL_ID",
"greens_tautau_dn" => "ORBITAL_ID",
"density" => "ORBITAL_ID",
"density_upup" => "ORBITAL_ID",
"density_dndn" => "ORBITAL_ID",
"density_updn" => "ORBITAL_ID",
"density_dnup" => "ORBITAL_ID",
"spin_x" => "ORBITAL_ID",
"spin_z" => "ORBITAL_ID",
"pair" => "BOND_ID",
"bond" => "BOND_ID",
"bond_upup" => "BOND_ID",
"bond_dndn" => "BOND_ID",
"bond_updn" => "BOND_ID",
"bond_dnup" => "BOND_ID",
"current" => "HOPPING_ID",
"current_upup" => "HOPPING_ID",
"current_dndn" => "HOPPING_ID",
"current_updn" => "HOPPING_ID",
"current_dnup" => "HOPPING_ID",
"phonon_greens" => "PHONON_ID"
)
List of all the correlation functions that can be measured, along with the corresponding type of ID the correlation measurement is reported in terms of. Correlation functions are well defined in both position and momentum space.
Initialize Measurements
SmoQyDQMC.initialize_measurement_container
— Functioninitialize_measurement_container(
model_geometry::ModelGeometry{D,T,N},
β::T, Δτ::T
) where {T<:AbstractFloat, D, N}
Initialize and return a measurement container of type NamedTuple
.
SmoQyDQMC.initialize_measurements!
— Functioninitialize_measurements!(
measurement_container::NamedTuple,
tight_binding_model_up::TightBindingModel{T,E},
tight_binding_model_dn::TightBindingModel{T,E},
) where {T<:Number, E<:AbstractFloat}
initialize_measurements!(
measurement_container::NamedTuple,
tight_binding_model::TightBindingModel{T,E}
) where {T<:Number, E<:AbstractFloat}
Initialize tight-binding model related measurements.
Initialized Measurements
onsite_energy
: Refer tomeasure_onsite_energy
.onsite_energy_up
: Refer tomeasure_onsite_energy
.onsite_energy_dn
: Refer tomeasure_onsite_energy
.hopping_energy
: Refer tomeasure_hopping_energy
.hopping_energy_up
: Refer tomeasure_hopping_energy
.hopping_energy_dn
: Refer tomeasure_hopping_energy
.
initialize_measurements!(
measurement_container::NamedTuple,
hubbard_model::HubbardModel{T}
) where {T<:AbstractFloat}
Initialize Hubbard model related measurements.
Initialized Measurements:
hubbard_energy
: Refer tomeasure_hopping_energy
.
initialize_measurements!(
measurement_container::NamedTuple,
electron_phonon_model::ElectronPhononModel{T, E, D}
) where {T<:Number, E<:AbstractFloat, D}
Initialize electron-phonon model related measurements.
Initialized Measurements:
phonon_kinetic_energy
: Refer tomeasure_phonon_kinetic_energy
.phonon_potential_energy
: Refer tomeasure_phonon_potential_energy
.X
: Measure $\langle \hat{X} \rangle$, refer tomeasure_phonon_position_moment
.X2
: Measure $\langle \hat{X}^2 \rangle$, refer tomeasure_phonon_position_moment
.X3
: Measure $\langle \hat{X}^3 \rangle$, refer tomeasure_phonon_position_moment
.X4
: Measure $\langle \hat{X}^4 \rangle$, refer tomeasure_phonon_position_moment
.holstein_energy
: Refer tomeasure_holstein_energy
.holstein_energy_up
: Refer tomeasure_holstein_energy
.holstein_energy_dn
: Refer tomeasure_holstein_energy
.ssh_energy
: Refer tomeasure_ssh_energy
.ssh_energy_up
: Refer tomeasure_ssh_energy
.ssh_energy_dn
: Refer tomeasure_ssh_energy
.ssh_sgn_switch_up
: Refer tomeasure_ssh_sgn_switch
.ssh_sgn_switch_dn
: Refer tomeasure_ssh_sgn_switch
.dispersion_energy
: Refer tomeasure_dispersion_energy
.
SmoQyDQMC.initialize_correlation_measurements!
— Functioninitialize_correlation_measurements!(;
measurement_container::NamedTuple,
model_geometry::ModelGeometry{D,T,N},
correlation::String,
pairs::AbstractVector{NTuple{2,Int}},
time_displaced::Bool,
integrated::Bool = false
) where {T<:AbstractFloat, D, N}
Initialize measurements of correlation
for all ID pairs; refer to CORRELATION_FUNCTIONS
for ID type associated with each correlation measurement. The name correlation
must therefore also appear in [CORRELATION_FUNCTIONS
]@ref. If time_displaced = true
then time-displaced and integrated correlation measurements are made. If time_displaced = false
and integrated = false
, then just equal-time correlation measurements are made. If time_displaced = false
and integrated = true
, then both equal-time and integrated correlation measurements are made.
SmoQyDQMC.initialize_composite_correlation_measurement!
— Functioninitialize_composite_correlation_measurement!(;
measurement_container::NamedTuple,
model_geometry::ModelGeometry{D,T,N},
name::String,
correlation::String,
ids,
coefficients,
time_displaced::Bool,
integrated::Bool = false
) where {T<:AbstractFloat, D, N}
Initialize a composite correlation measurement called name
based on a linear combination of local operators used in a standard correlation
measurement, with ids
and coefficients
specifying the linear combination.
SmoQyDQMC.initialize_measurement_directories
— Functioninitialize_measurement_directories(;
simulation_info::SimulationInfo,
measurement_container::NamedTuple
)
initialize_measurement_directories(;
# Keyword Arguments
simulation_info::SimulationInfo,
measurement_container::NamedTuple
)
Initialize the measurement directories for simulation.
Make Measreuments
SmoQyDQMC.make_measurements!
— Functionmake_measurements!(
measurement_container::NamedTuple,
logdetGup::E, sgndetGup::T, Gup::AbstractMatrix{T},
Gup_ττ::AbstractMatrix{T}, Gup_τ0::AbstractMatrix{T}, Gup_0τ::AbstractMatrix{T},
logdetGdn::E, sgndetGdn::T, Gdn::AbstractMatrix{T},
Gdn_ττ::AbstractMatrix{T}, Gdn_τ0::AbstractMatrix{T}, Gdn_0τ::AbstractMatrix{T};
# Keyword Arguments Start Here
fermion_path_integral_up::FermionPathIntegral{T,E},
fermion_path_integral_dn::FermionPathIntegral{T,E},
fermion_greens_calculator_up::FermionGreensCalculator{T,E},
fermion_greens_calculator_dn::FermionGreensCalculator{T,E},
Bup::Vector{P}, Bdn::Vector{P},
model_geometry::ModelGeometry{D,E,N},
tight_binding_parameters::Union{Nothing, TightBindingParameters{T,E}} = nothing,
tight_binding_parameters_up::Union{Nothing, TightBindingParameters{T,E}} = nothing,
tight_binding_parameters_dn::Union{Nothing, TightBindingParameters{T,E}} = nothing,
coupling_parameters::Tuple,
δG::E, δθ::E, δG_max::E = 1e-6
) where {T<:Number, E<:AbstractFloat, D, N, P<:AbstractPropagator{T,E}}
Make measurements, including time-displaced correlation and zero Matsubara frequency measurements. This method also returns (logdetGup, sgndetGup, logdetGdn, sgndetGdn, δG, δθ)
. Note that either the keywork tight_binding_parameters
needs to be specified, or tight_binding_parameters_up
and tight_binding_parameters_dn
both need to be specified.
make_measurements!(
measurement_container::NamedTuple,
logdetG::E, sgndetG::T, G::AbstractMatrix{T},
G_ττ::AbstractMatrix{T}, G_τ0::AbstractMatrix{T}, G_0τ::AbstractMatrix{T};
# Keyword Arguments Start Here
fermion_path_integral::FermionPathIntegral{T,E},
fermion_greens_calculator::FermionGreensCalculator{T,E},
B::Vector{P},
model_geometry::ModelGeometry{D,E,N},
tight_binding_parameters::TightBindingParameters{T,E},
coupling_parameters::Tuple,
δG::E, δθ::E, δG_max::E = 1e-6
) where {T<:Number, E<:AbstractFloat, D, N, P<:AbstractPropagator{T,E}}
Make measurements, including time-displaced correlation and zero Matsubara frequency measurements. This method also returns (logdetG, sgndetG, δG, δθ)
.
Write Measreuments
SmoQyDQMC.write_measurements!
— Functionwrite_measurements!(;
measurement_container::NamedTuple,
simulation_info::SimulationInfo,
model_geometry::ModelGeometry{D, E, N},
bin::Int, bin_size::Int, Δτ::E
) where {D, E<:AbstractFloat, N}
Write the measurements contained in measurement_container
to file. Measurements are written to file in a binary format using the JLD2.jl
package.
This function also does a few other things:
- Normalizes all the measurements by the
bin_size
i.e. the number of measurements that were accumlated into the measurement container. - Take position space correlation function measurements and fourier transform them to momentum space.
- Integrate relevant time-displaced correlation function measurements over imaginary time to get the corresponding zero matsubara frequency correlation function.
- Reset all the measurements in
measurement_container
to zero after the measurements are written to file.
Process Measurements
SmoQyDQMC.save_simulation_info
— Functionsave_simulation_info(sim_info::SimulationInfo, additional_info = nothing)
Save the contents sim_info
to a TOML file, and add an optional additional table to the output file based on the contents of a dictionary additional_info
.
SmoQyDQMC.process_measurements
— Functionprocess_measurements(
# ARGUMENTS
folder::String,
N_bins::Int,
pIDs::Union{Vector{Int},Int} = Int[];
# KEYWORD ARGUMENTS
time_displaced::Bool = false
)
process_measurements(
# ARGUMENTS
comm::MPI.Comm,
folder::String,
N_bins::Int,
pIDs::Union{Vector{Int},Int} = Int[];
# KEYWORD ARGUMENTS
time_displaced::Bool = false
)
Process the measurements recorded in the simulation directory folder
, where N_bins
is the number of bins the data is grouped into for calculating error bars. Note that this method will over-write an existing correlation stats file if there already is one. The boolean flag time_displaced
determines whether or not to calculate error bars for time-displaced correlation measurements, as this can take a non-negligible amount of time for large system, especially when many simulations were run in parallel. Note that using pIDs
argument you can filter which MPI walker to use when calculting the statistics.
SmoQyDQMC.process_global_measurements
— Functionprocess_global_measurements(
folder::String,
N_bins::Int,
pIDs::Union{Vector{Int},Int} = Int[]
)
process_global_measurements(
comm::MPI.Comm,
folder::String,
N_bins::Int,
pIDs::Vector{Int} = Int[]
)
Process global measurents for the specified process IDs, calculating the average and error for all global measurements and writing the result to CSV file. If pIDs
is not specified, then results for all MPI walkers are averaged over.
SmoQyDQMC.process_local_measurements
— Functionprocess_local_measurements(
folder::String,
N_bins::Int,
pIDs::Union{Vector{Int},Int} = Int[]
)
process_local_measurements(
comm::MPI.Comm,
folder::String,
N_bins::Int,
pIDs::Vector{Int} = Int[]
)
Process local measurents for the specified process IDs, calculating the average and error for all local measurements and writing the result to CSV file. If pIDs
is not specified, then the statistics are calculated using all MPI walker results.
SmoQyDQMC.process_correlation_measurements
— Functionprocess_correlation_measurements(
folder::String,
N_bins::Int,
pIDs::Union{Vector{Int},Int} = Int[],
types::Vector{String} = ["equal-time", "time-displaced", "integrated"],
spaces::Vector{String} = ["position", "momentum"]
)
function process_correlation_measurements(
comm::MPI.Comm,
N_bins::Int,
pIDs::Vector{Int} = Int[],
types::Vector{String} = ["equal-time", "time-displaced", "integrated"],
spaces::Vector{String} = ["position", "momentum"]
)
Process correlation measurements, calculating the average and errors and writing the result to CSV file.
SmoQyDQMC.process_correlation_measurement
— Functionprocess_correlation_measurement(
folder::String,
correlation::String,
type::String,
space::String,
N_bins::Int,
pIDs::Union{Vector{Int}, Int} = Int[]
)
Process results for the specified correlation function, calculating the associated average and error statistics for it and writing the result to CSV file. If pIDs
is not specified, then the calculated statistics are arrived at by averaging over the results for all MPI walkers.
SmoQyDQMC.composite_correlation_stat
— Functioncomposite_correlation_stat(;
folder::String,
correlations::Vector{String},
spaces::Vector{String},
types::Vector{String},
ids::Vector{NTuple{2,Int}},
locs::Vector{NTuple{D,Int}},
Δls::Vector{Int} = Int[],
num_bins::Int = 0,
pIDs::Vector{Int} = Int[],
f::Function = identity
) where {D}
function composite_correlation_stat(
comm::MPI.Comm;
# Keyword Arguments Below
folder::String,
correlations::Vector{String},
spaces::Vector{String},
types::Vector{String},
ids::Vector{NTuple{2,Int}},
locs::Vector{NTuple{D,Int}},
Δls::Vector{Int} = Int[],
num_bins::Int = 0,
pIDs::Vector{Int} = Int[],
f::Function = identity
) where {D}
Calaculate the mean and error for a composite correlation measurement based on the function f
. Note that D
indicates the spatial dimension of the system.
Keywords
folder::String
: The directory all the simulation results were written to.correlations::Vector{String}
: Vector specifying the correlation types.spaces::Vector{String}:
Space of each correlation measurement"position"
or"momentum"
.types::Vector{String}
: The type of each correlation measurement"equal-time"
,"time-displaced"
or"integrated"
.ids::Vector{NTuple{2,Int}}
: Vector of ID pairs to read for each correlation.locs::Vector{NTuple{D,Int}}
: Species displacement vector for position space, or k-point for momentum space.Δls::Vector{Int} = Int[]
: Displacement in imaginary time for time-displaced correlation measurements. Igonored otherwise.num_bins::Int = 0
: Number of bins used to calcuate error for each MPI walker, defaults to the number of JLD2 binary data files.pIDs::Vector{Int} = Int[]
: MPI walkers to average over when calculating states, defaults to using all MPI walkers if not specified.f::Function = identity
: Function evaluated to calculate the composite correlation that is measured.
SmoQyDQMC.compute_correlation_ratio
— Functioncompute_correlation_ratio(
comm::MPI.Comm;
folder::String,
correlation::String,
type::String,
ids,
id_pairs::Vector{NTuple{2,Int}} = NTuple{2,Int}[],
coefs,
k_point,
num_bins::Int = 0,
pIDs::Vector{Int} = Int[],
)
compute_correlation_ratio(;
# Keyword Arguments
folder::String,
correlation::String,
type::String,
ids,
id_pairs::Vector{NTuple{2,Int}} = NTuple{2,Int}[],
coefs,
k_point,
num_bins::Int = 0,
pIDs::Vector{Int} = Int[],
)
Compute the correlation ratio at the $\mathbf{k}$-point using a linear combination of standard correlation function measurements. The linear combination of correlation functions used is defined by id_pairs
and coefs
. If id_pairs
is empty, then all possible combinations of ID pairs are construct based passed ids
, with coefficients similarly expanded out. If type
is "equal-time"
or "time-displaced"
then the equal-time correlation ratio is calculated. If type
is "integrated" then the integrated correlation ratio is calculated.
SmoQyDQMC.compute_composite_correlation_ratio
— Functioncompute_composite_correlation_ratio(
comm::MPI.Comm;
# Keyword Arguments
folder::String,
correlation::String,
type::String,
k_point,
num_bins::Int = 0,
pIDs::Vector{Int} = Int[],
)
compute_composite_correlation_ratio(;
# Keyword Arguments
folder::String,
correlation::String,
type::String,
k_point,
num_bins::Int = 0,
pIDs::Vector{Int} = Int[],
)
Compute the correlation ratio for a specified $\mathbf{k}$-point for the specified composite correlation
function. If type
is "equal-time"
or "time-displaced"
then the equal-time correlation ratio is calculated. If type
is "integrated" then the integrated correlation ratio is calculated.
SmoQyDQMC.global_measurement_bins_to_csv
— Functionglobal_measurement_bins_to_csv(
folder::String,
pID::Int = -1
)
Write the binned global measurements to file corresponding to process ID pID
. If pID = -1
, then write binned global measurements for all processes to file.
SmoQyDQMC.local_measurement_bins_to_csv
— Functionlocal_measurement_bins_to_csv(
folder::String,
measurement::String,
pID::Int = -1
)
Write the binned values for the local measurement measurement
to a CSV file for process ID pID
. If pID = -1
, then write it to file for all process IDs.
SmoQyDQMC.correlation_bins_to_csv
— Functioncorrelation_bins_to_csv(
pID::Int = -1;
folder::String,
correlation::String,
type::String,
space::String,
write_index_key::Bool = true
)
Write binned correlation
data for pID
to a CSV file. The field type
must be set equal to "equal-time"
, "time-displaced"
or "integrated"
, and the field space
but bet set to either "position"
or "momentum"
. If pID = -1
, then write binned data for all walkers to file.
SmoQyDQMC.compress_jld2_bins
— Functioncompress_jld2_bins(
# ARGUMENTS
comm::MPI.Comm;
# KEYWORD ARGUMENTS
folder::String,
pID::Int = -1,
compress::Bool = true
)
compress_jld2_bins(;
# KEYWORD ARGUMENTS
folder::String,
pID::Int = -1,
compress::Bool = true
)
Combine the many JLD2 binary files containing the binned data into a single JLD2 file. If pID ≥ 0
, then only the binned files corresponding to the passed pID values merged into a single file binned_data_pID-$(pID).jld2
. If pID = -1
, then all the binned files, regardless are merged into a single filed called binned_data.jld2
. Note that if many simulations were run in parallel, this can take quite a while, and doing it for a single pID
at a time may be advisable.
SmoQyDQMC.decompress_jld2_bins
— Functiondecompress_jld2_bins(;
# KEYWORD ARGUMENTS
folder::String,
pID::Int = -1
)
Decompress compressed binned data stored in a single JLD2 file into the original population of many JLD2 files, eaching containing the binned data for a certain type of measurement. If pID ≥ 0
, then the file binary_data_pID-$(pID).jld2
will be decompressed. If pID = -1
, then the file binary_data.jld2
will be decompressed.
SmoQyDQMC.delete_jld2_bins
— Functiondelete_jld2_bins(;
# KEYWORD ARGUMENTS
folder::String,
pID::Int = -1
)
Go through and delete all the binary files in the data folder directory. Please be cautious, once done this operation cannot be undone, data will be lost permanently!