API

ModelGeometry Type and Methods

VariationalMC.ModelGeometryType
ModelGeometry{T, B<:AbstractVector{<:AbstractVector{T}}}

A type defining the geometry of a lattice model, including the unit cell, lattice, and bond definitions.

  • unit_cell::UnitCell: contains unit cell definitions.
  • lattice::Lattice: contains lattice definitions including boundary conditions.
  • bond::B: vector of all bond definitions.
source

Internal Methods

VariationalMC.apply_twist_angle!Function
apply_twist_angle!( H_t::Matrix{T},
                    θ_twist::E,
                    model_geometry::ModelGeometry ) where {T<:Number, E<:AbstractFloat}

Applies a twist angle to the hopping matrix by multiplying by an appropriate phase factor.

source
VariationalMC.xFunction
x( i::I, 
   model_geometry::ModelGeometry ) where {I<:Integer}

Convenience function for obtaining the x-coordinate of a lattice site given a lattice spindex.

  • i::I: spindex.
  • model_geometry::ModelGeometry: contains unit cell and lattice quantities.
source
VariationalMC.yFunction
y( i::I, 
   model_geometry::ModelGeometry ) where {I<:Integer}

Convenience function for obtaining the y-coordinate of a lattice site given a lattice spindex.

  • i::I: spindex.
  • model_geometry::ModelGeometry: contains unit cell and lattice quantities.
source
VariationalMC.dFunction
d( p1::I, 
   p2::I, 
   model_geometry::ModelGeometry ) where {I<:Integer}

Given lattice points $p\_1$ and $p_2$, returns the distance between those two points, accounting for the lattice edges under different boundary conditions.

  • p1::I: first lattice point.
  • p2::I: second lattice point.
  • model_geometry::ModelGeometry: contains unit cell and lattice quantities.
source
VariationalMC.reduce_index_2dFunction
reduce_index_2d( i::I, 
                 j::I, 
                 model_geometry::ModelGeometry ) where {I<:Integer}

For two lattice sites $i$ and $j$ on a 2D lattice, returns the irreducible index $k$ between them, where $k$ is an integer.

  • i::I: first lattice site.
  • j::I: second lattice site.
  • model_geometry::ModelGeometry: contains unit cell and lattice quantities.
source
VariationalMC.reduce_index_1dFunction
reduce_index_1d( i::I, 
                 j::I, 
                 model_geometry::ModelGeometry ) where {I<:Integer}

For two lattice sites $i$ and $j$ on a 1D lattice, returns the irreducible index $k$ between them, where $k$ is an integer.

  • i::I: first lattice site.
  • j::I: second lattice site.
  • model_geometry::ModelGeometry: contains unit cell and lattice quantities.
source
VariationalMC.max_distFunction
max_dist( N::I, 
          L::I ) where {I<:Integer}

For a lattice with $N$ sites and extent $L$, returns the maximum irreducible index $k_{\mathrm{max}}$.

  • N::I: total number of lattice sites.
  • L::I: extent of the lattice.
source

Parameters Types and Methods

VariationalMC.TightBindingModelType
TightBindingModel{E<:AbstractFloat}

A type defining a non-interacting tight binding model with nearest, next nearest, and third nearest hopping parameters.

  • t₀::E: zeroth hopping parameter (nearest neighbor)
  • t₁::E: first hopping parameter (next nearest neighbor)
  • t₂::E: second hopping parameter (third nearest neighbor)
source
VariationalMC.SpinModelType
SpinModel{E<:AbstractFloat}

A type defining a non-interacting spin model with nearest, next nearest, and third nearest neighbor exchange coupling parameters.

source
VariationalMC.DeterminantalParametersType
DeterminantalParameters{I<:Integer}

A type defining a set of variational parameters obtained from the auxiliary Hamiltonian, otherwise known as the "determinantal" part of the variational wavefunction.

  • det_pars::NamedTuple: contains parameter names and their values.
  • num_det_pars::I: total number of determinantal parameters.
  • num_det_opts::I: number of determinantal parameters being optimized.
source
VariationalMC.JastrowParametersType
JastrowParameters{S<:AbstractString, K, V, I<:Integer}

A type defining quantities related to Jastrow variational parameters.

  • jastrow_type::S: type of Jastrow parameters: "e-den-den", "e-spn-spn"
  • jpar_map::OrderedDict{K, V}: dictionary of irreducible indices to their correct index pairs and Jastrow parameter.
  • num_jpars::I: total number of Jastrow parameters.
  • num_jpar_opts::I: total number of Jastrow parameters being optimized.
source

Internal Methods

VariationalMC.collect_parametersFunction
collect_parameters( determinantal_parameters::DeterminantalParameters{I}, 
                    jastrow_parameters::JastrowParameters{S, K, V, I} ) where {S<:AbstractString, K, V, I<:Integer}

Concatenates all values of determinantal and Jastrow parameters into a single vector of variational parameters.

  • determinantal_parameters::DeterminantalParameters{I}: current set of determinantal parameters.
  • jastrow_parameters::JastrowParameters{S, K, V, I}: current set of Jastrow parameters.
source
collect_parameters( determinantal_parameters::DeterminantalParameters{I}, 
                    jastrow_parameters_1::JastrowParameters{S, K, V, I},
                    jastrow_parameters_2::JastrowParameters{S, K, V, I} ) where {S<:AbstractString, K, V, I<:Integer}

Concatenates all values of determinantal and Jastrow parameters into a single vector of variational parameters.

  • determinantal_parameters::DeterminantalParameters{I}: current set of determinantal parameters.
  • jastrow_parameters_1::JastrowParameters{S, I, V}: first set of Jastrow parameters.
  • jastrow_parameters_2::JastrowParameters{S, I, V}: second set of Jastrow parameters.
source
VariationalMC.update_parameters!Function
update_parameters!( measurement_container::NamedTuple,
                    new_vpars::AbstractVector, 
                    determinantal_parameters::DeterminantalParameters{I} ) where {I<:Integer}

Updates variational parameters after Stochastic Reconfiguration.

  • measurement_container::NamedTuple: container where measurements are stored.
  • new_vpars::AbstractVector: updated variational parameters.
  • determinantal_parameters::DeterminantalParameters{I}: current set of determinantal variational parameters.
source
update_parameters!( measurement_container::NamedTuple,
                    new_vpars::AbstractVector, 
                    determinantal_parameters::DeterminantalParameters{I}, 
                    jastrow_parameters::JastrowParameters{S, K, V, I} ) where {S<:AbstractString, K, V, I<:Integer}

Updates variational parameters after Stochastic Reconfiguration.

  • measurement_container::NamedTuple: container where measurements are stored.
  • new_vpars::AbstractVector: updated variational parameters.
  • determinantal_parameters::DeterminantalParameters{I}: set of determinantal variational parameters.
  • jastrow_parameters::JastrowParameters{S, K, V, I}: set of Jastrow variational parameters.
source
update_parameters!( measurement_container::NamedTuple,
                    new_vpars::AbstractVector, 
                    determinantal_parameters::DeterminantalParameters{I}, 
                    jastrow_parameters_1::JastrowParameters{S, K, V, I},
                    jastrow_parameters_2::JastrowParameters{S, K, V, I} ) where {S<:AbstractString, K, V, I<:Integer}

Updates variational parameters after Stochastic Reconfiguration.

  • measurement_container::NamedTuple: container where measurements are stored.
  • new_vpars::AbstractVector: updated variational parameters.
  • determinantal_parameters::DeterminantalParameters{I}: current set of determinantal variational parameters.
  • jastrow_parameters::JastrowParameters{S, K, V, I}: first set of Jastrow variational parameters.
  • jastrow_parameters::JastrowParameters{S, K, V, I}: second set of Jastrow variational parameters.
source
VariationalMC.readin_parametersFunction
readin_parameters( filename::S ) where {S<:AbstractString}

Parses TOML file containing initial variational parameters.

  • filename::S: name of parameter summary file in TOML format.
source

Hamiltonian Methods

Internal Methods

VariationalMC.build_auxiliary_hamiltonianFunction
build_auxiliary_hamiltonian( tight_binding_model::TightBindingModel{E}, 
                             determinantal_parameters::DeterminantalParameters{I}, 
                             optimize::NamedTuple, 
                             model_geometry::ModelGeometry, 
                             pht::Bool;
                             q_p::AbstractVector{T} = [0.0, 0.0] ) where {E<:AbstractFloat, I<:Integer}

Constructs an auxiliary Hamiltonian matrix $H_{\mathrm{aux}}$ by combining the non-interacting hopping matrix $H_t$ with matrices of variational terms $H_{\mathrm{var}}$.

  • tight_binding_model::TightBindingModel{E}: parameters for a non-interacting tight-binding model.
  • determinantal_parameters::DeterminantalParameters{I}: set of determinantal variational parameters.
  • optimize::NamedTuple: field of optimization flags.
  • model_geometry::ModelGeometry: contains unit cell and lattice quantities.
  • pht::Bool: whether model is particle-hol transformed.
  • q_p::AbstractVector{T} = [0.0, 0.0]: pairing momentum for density wave pairing.
source
build_auxiliary_hamiltonian( tight_binding_model::TightBindingModel{E}, 
                             determinantal_parameters::DeterminantalParameters{I}, 
                             optimize::NamedTuple, 
                             model_geometry::ModelGeometry, 
                             twist_angles::AbstractRange{E},
                             pht::Bool;
                             q_p::AbstractVector{T} = [0.0, 0.0] ) where {E<:AbstractFloat, I<:Integer}

Constructs an auxiliary Hamiltonian matrix $H_{\mathrm{aux}}^{\theta}$ for $N_\theta$ twist angles by combining the non-interacting hopping matrix $H_t$ with matrices of variational terms $H_{\mathrm{var}}$.

  • tight_binding_model::TightBindingModel{E}: parameters for a non-interacting tight-binding model.
  • determinantal_parameters::DeterminantalParameters{I}: set of determinantal variational parameters.
  • optimize::NamedTuple: field of optimization flags.
  • model_geometry::ModelGeometry: contains unit cell and lattice quantities.
  • twist_angles::AbstractRange{E}: set of twist angles.
  • pht::Bool: whether model is particle-hol transformed.
  • q_p::AbstractVector{T} = [0.0, 0.0]: pairing momentum for density wave pairing.
source
VariationalMC.build_tight_binding_hamiltonianFunction
build_tight_binding_hamiltonian( tight_binding_model::TightBindingModel{E},
                                 model_geometry::ModelGeometry,
                                 pht::Bool ) where {E<:AbstractFloat}

Constructs a $2N$ by $2N$ tight-binding hopping matrix where $N$ is the number of lattice sites, given hopping parameters $t$, $t^{\prime}$, and $t^{\prime\prime}$.

  • tight_binding_model::TightBindingModel{E}: parameters for a non-interacting tight-binding model.
  • model_geometry::ModelGeometry: contains unit cell and lattice quantities.
  • pht::Bool: whether model is particle-hole transformed.
source
VariationalMC.build_variational_hamiltonianFunction
build_variational_hamiltonian( determinantal_parameters::DeterminantalParameters{I}, 
                               model_geometry::ModelGeometry,
                               optimize::NamedTuple, 
                               pht::Bool;
                               q_p::AbstractVector{T} = [0.0, 0.0] ) where {I<:Integer}

Constructs a set of $2N$ by $2N$ matrices for each variational parameter, where N is the number of lattice sites. Returns a total variational Hamiltonian matrix $H_{\mathrm{var}}$ as well has a vector of operators $V$.

  • determinantal_parameters::DeterminantalParameters{I}: set of determinantal variational parameters.
  • model_geometry::ModelGeometry: contains unit cell and lattice quantities.
  • optimize::NamedTuple: field of optimization flags.
  • pht::Bool: whether model is particle-hole transformed.
  • q_p::AbstractVector{T} = [0.0, 0.0]: pairing momentum for density wave pairing.
source
VariationalMC.add_pairing_symmetry!Function
add_pairing_symmetry!( symmetry::S, 
                       optimize::NamedTuple, 
                       H_vpars::Vector{Matrix{T}}, 
                       V::Vector{Matrix{T}}, 
                       model_geometry::ModelGeometry,
                       bonds,
                       dims::I,
                       N::I, 
                       pht::Bool;
                       q_p::AbstractVector{T} = [0.0, 0.0],
                       locs::Vector{Tuple{I, I}} = Tuple{I,I}[] ) where {S<:AbstractString, I<:Integer, T<:Number}

Adds a pairing term to the auxiliary Hamiltonian along with its perturbative operator.

  • symmetry::S: type of pairing symmetry: "s", "d", "sLO", "sFF", "dLO", or "dFF".
  • optimize::NamedTuple: field of optimization flags.
  • H_vpars::Vector{Matrix{T}}: vector of variational Hamiltonian matrices.
  • V::Vector{Matrix{T}}: vector of variational operators.
  • model_geometry::ModelGeometry: contains lattice and unit cell quantities.
  • dims::I: dimensions of the lattice.
  • bonds: lattice bonds.
  • N::I: number of sites in the lattice.
  • pht::Bool: whether model is particle-hole transformed.
  • q_p::AbstractVector{T} = [0.0, 0.0]: pairing momentum for density wave pairing.
  • locs::Vector{Tuple{I, I}} = Tuple{I,I}[]: contains all positions (or locations) of each lattice site.
source
VariationalMC.add_spin_order!Function
add_spin_order!( order::S, 
                 optimize::NamedTuple, 
                 H_vpars::Vector{Matrix{T}}, 
                 V::Vector{Matrix{T}}, 
                 model_geometry::ModelGeometry,
                 locs::,
                 dims::I,
                 N::I, 
                 pht::Bool )::Nothing

Adds a spin ordering term to the auxiliary Hamiltonian along with its perturbative operator.

  • order::String: type of spin order: "spin-x", "spin-z", or "site-dependent"
  • optimize::NamedTuple: field of optimization flags.
  • H_vpars::Vector{Any}: vector of variational Hamiltonian matrices.
  • V::Vector{Any}: vector of variational operators.
  • model_geometry::ModelGeometry: contains unit cell and lattice quantities.
  • locs::: preallocated
  • dims::I: dimensions of the lattice.
  • N::I: number of sites in the lattice.
  • pht::Bool: whether model if particle-hole transformed.
source
VariationalMC.add_charge_order!Function
add_charge_order!( order::S, 
                   optimize::NamedTuple, 
                   H_vpars::Vector{Matrix{T}}, 
                   V::Vector{Matrix{T}}, 
                   model_geometry::ModelGeometry,
                   locs::,
                   dims::I,
                   N::I, 
                   pht::Bool ) where {S<:AbstractString, I<:Integer, T<:Number}

Adds a charge ordering term to the auxiliary Hamiltonian along with its perturbative operator.

  • order::S: type of spin order: "density wave" or "site-dependent"
  • optimize::NamedTuple: field of optimization flags.
  • H_vpars::Vector{Matrix{T}}: vector of variational Hamiltonian matrices.
  • V::Vector{Matrix{T}}: vector of variational operators.
  • model_geometry::ModelGeometry: contains unit cell and lattice quantities.
  • locs:::
  • dims::I: dimensions of the lattice.
  • N::I: number of sites in the lattice.
  • pht::Bool: whether model if particle-hole transformed.
source
VariationalMC.add_chemical_potential!Function
add_chemical_potential!( optimize::NamedTuple, 
                         H_vpars::Vector{Matrix{T}}, 
                         V::Vector{Matrix{T}}, 
                         N::I, 
                         pht::Bool ) where {T<:Number, I<:Integer}

Adds a chemical potential term to the auxiliary Hamiltonian.

  • optimize::NamedTuple: field of optimization flags.
  • H_vpars::Vector{Matrix{T}}: vector of variational Hamiltonian matrices.
  • V::Vector{Matrix{T}}: vector of variational operators.
  • N::I: number of sites in the lattice.
  • pht::Bool: whether model if particle-hole transformed.
source
VariationalMC.diagonalize!Function
diagonalize!( H::Matrix{T} ) where {T<:Number}

Returns all eigenenergies $\varepsilon$ and all eigenstates $\phi$ of the auxiliary Hamiltonian matrix. All eigenstates are stored in the columns of a unitary matrix U_aux.

  • H::Matrix{T}: auxiliary Hamiltonian matrix.
source
VariationalMC.is_openshellFunction
is_openshell( ε::Vector{E},  
              Np::I,
              pht::Bool ) where {E<:AbstractFloat, I<:Integer}

Checks whether a mean-field energy configuration is open shell.

  • ε::Vector{E}: vector of mean-field energies.
  • Np::I: total number of particles in the system.
  • pht::Bool: whether the model is particle-hole transformed.
source
VariationalMC.get_variational_matricesFunction
get_variational_matrices( V::Vector{Matrix{T1}}, 
                          U_aux::Matrix{T2}, 
                          ε::Vector{E}, 
                          Np::I
                          N::I ) where {T1<:Number, T2<:Number, E<:AbstractFloat, I<:Integer}

Returns a set of variational parameter matrices $A_k$ constructed from each variational operator $V_k$ by computing

\[Q_k = \frac{(U^{\dagger}V_{k}U)_{\eta\nu}}{(\varepsilon_{\eta} - \varepsilon_{\nu})},\]

where $\eta > N_p$ and $\nu \leq N_p$.

  • V::Vector{Matrix{T1}: vector of variational operators.
  • U_aux::Matrix{T2}: matrix which diagonalizes the auxiliary Hamiltonian.
  • ε::Vector{E}: initial energies.
  • Np::I: number of particles in the system.
  • N::I: number of lattice sites.
source
VariationalMC.get_tb_chem_potFunction
get_tb_chem_pot( Ne::I, 
                 tight_binding_model::TightBindingModel{E}, 
                 model_geometry::ModelGeometry ) where {I<:Integer, E<:AbstractFloat}

Computes the appropriate chemical potential $\mu$ for a non-interacting tight-binding model on a finite lattice.

  • Ne::I: total number of electrons.
  • tight_binding_model::TightBindingModel{E}: parameters for a non-interacting tight-binding model.
  • model_geometry::ModelGeometry: contains unit cell and lattice quantities.
source

DeterminantalWavefunction Type and Methods

VariationalMC.DeterminantalWavefunctionType
DeterminantalWavefunction{T<:Number, Q, E<:AbstractFloat, I<:Integer}

A type defining quantities related to a determinantal wavefunction.

  • W::Matrix{T}: equal-time Green's function matrix.
  • D::Matrix{T}: Slater matrix.
  • M::AbstractMatrix{T}: reduced U_aux matrix.
  • U_aux::Matrix{T}: unitary matrix that diagonalizes the auxiliary Hamiltonian.
  • A::Vector{Q}: variational parameter matrices.
  • ε::Vector{E}: vector of mean-field energies.
  • pconfig::Vector{I}: particle configuration.
  • nq_updates_W::I: tracker for the number for quick updates to the W matrix.
source
VariationalMC.DeterminantalWavefunctionTABCType
DeterminantalWavefunctionTABC{T<:Number, Q, E<:AbstractFloat, I<:Integer}

A type defining quantities related to a determinantal wavefunction over a range of twist angles.

  • W_θ::Vector{Matrix{T}}: set of equal-time Green's function matrices.
  • D_θ::Vector{Matrix{T}}: set of Slater matrices.
  • M_θ::Vector{AbstractMatrix{T}}: set of reduced U_aux matrices.
  • U_θ::Vector{Matrix{T}}: set of unitary matrices that diagonalizes the auxiliary Hamiltonian.
  • A_θ::Vector{Vector{Q}}: set of variational parameter matrices.
  • ε_θ::Vector{Vector{E}}: vector of mean-field energies.
  • pconfig::Vector{I}: particle configuration.
  • N_θ::I: number of twist angles to average over.
  • twist_angles::AbstractRange{E}: set of twist angles.
  • nq_updates_W::I: tracker for the number for quick updates to the W matrix.
source
VariationalMC.get_determinantal_wavefunctionFunction
get_determinantal_wavefunction( tight_binding_model::TightBindingModel{E}, 
                                determinantal_parameters::DeterminantalParameters{I}, 
                                optimize::NamedTuple, 
                                Np::I, 
                                nup::I, 
                                ndn::I, 
                                model_geometry::ModelGeometry, 
                                rng::AbstractRNG, 
                                pht::Bool,
                                pconfig::Vector{I} = Int[];
                                q_p::AbstractVector{T} = [0.0, 0.0] ) where {E<:AbstractFloat, I<:Integer, T<:Number}

Constructs a variational wavefunction $|\Phi_0\rangle$ based on parameters given by the tight-binding model and determinantal parameter and returns an instance of the DeterminantalWavefunction type. If no initial particle configuration is specified, a random configuration will be generated.

  • tight_binding_model::TightBindingModel{E}: parameters for a non-interacting tight-binding model.
  • determinantal_parameters::DeterminantalParameters{I}: set of determinantal variational parameters.
  • optimize::NamedTuple: field of optimization flags.
  • Np::I: total number of particles in the system.
  • nup::I: number of spin-up electrons.
  • ndn::I: number of spin-down electrons.
  • model_geometry::ModelGeometry: contains unit cell and lattice quantities.
  • rng::AbstractRNG: random number generator.
  • pht::Bool: whether model is particle-hole transformed.
  • pconfig::Vector{I} = Int[]: optional initial particle configuration.
  • q_p::AbstractVector{T} = [0.0, 0.0]: pairing momentum for density wave pairing.
source
get_determinantal_wavefunction( tight_binding_model::TightBindingModel{E}, 
                                determinantal_parameters::DeterminantalParameters{I}, 
                                optimize::NamedTuple, 
                                Np::I, 
                                nup::I, 
                                ndn::I, 
                                model_geometry::ModelGeometry, 
                                N_θ::I,
                                twist_angles::AbstractRange{E},
                                rng::AbstractRNG, 
                                pht::Bool,
                                pconfig::Vector{I} = Int[] ) where {E<:AbstractFloat, I<:Integer}

Constructs a variational wavefunction $|\Phi_{0}^{\theta}\rangle$ for N_\theta twist angles based on parameters given by the tight-binding model and determinantal parameter and returns an instance of the DeterminantalWavefunctionTABC type. If no initial particle configuration is specified, a random configuration will be generated.

  • tight_binding_model::TightBindingModel{E}: parameters for a non-interacting tight-binding model.
  • determinantal_parameters::DeterminantalParameters{I}: set of determinantal variational parameters.
  • optimize::NamedTuple: field of optimization flags.
  • Np::I: total number of particles in the system.
  • nup::I: number of spin-up electrons.
  • ndn::I: number of spin-down electrons.
  • model_geometry::ModelGeometry: contains unit cell and lattice quantities.
  • N_θ::I: number of twist angles.
  • twist_angles::AbstractRange{E}: list of twist angles.
  • rng::AbstractRNG: random number.
  • pht::Bool: whether model is particle-hole transformed.
  • pconfig::Vector{I} = Int[]: optional initial particle configuration.
source

Jastrow Types and Methods

VariationalMC.JastrowFactorType
JastrowFactor{E<:AbstractFloat, I<:Integer}

A type defining quantities related to a Jastrow factor.

  • Tvec_f::Vector{E}: fermionic T vector.
  • Tvec_b::Vector{E}: bosonic or phononic T vector.
  • nq_updates_T::I: tracker for the number of quick updates to the T vector.
source
VariationalMC.get_jastrow_factorFunction
get_jastrow_factor( jastrow_parameters::JastrowParameters{S, K, V, I}, 
                    detwf::DeterminantalWavefunction{T, Q, E, I}, 
                    model_geometry::ModelGeometry, 
                    pht::Bool )::JastrowFactor

Given a set of Jastrow parameters, constructs the relevant Jastrow factor $\mathcal{J}_n$ and returns a instance of the JastrowFactor type.

  • jastrow_parameters::JastrowParameters{S, K, V, I}: current set of Jastrow parameters.
  • detwf::DeterminantalWavefunction{T, Q, E, I}: current variational wavefunction.
  • model_geometry::ModelGeometry: contains unit cell and lattice quantities.
  • pht::Bool: whether model is particle-hole transformed.
source

Internal Methods

VariationalMC.get_fermionic_TvecFunction
get_fermionic_Tvec( jastrow_type::S,  
                    jpar_map::OrderedDict{Any, Any},
                    detwf::DeterminantalWavefunction{T, Q, E, I}, 
                    N::I,
                    pht::Bool )

Returns a fermionic T vector with elements $T_{i} = \sum_{j} v_{ij} n_{i}$ where $v\_{ij}$ are the Jastrow peseudopotentials and $n_{i}$ are the total fermion occupations.

  • jastrow_type::S: either "e-den-den" or "e-spn-spn.
  • jpar_map::OrderedDict{Any, Any}: current map of Jastrow parameters.
  • detwf::DeterminantalWavefunction{T, Q, E, I}: current variational wavefunction.
  • N::I: number of lattice sites.
  • pht::Bool: whether model is particle-hole transformed.
source
VariationalMC.update_fermionic_Tvec!Function
update_fermionic_Tvec!( markov_move::MarkovMove{I}, 
                        spin::I, 
                        jastrow_parameters::JastrowParameters{S, K, V, I},
                        jastrow_factor::JastrowFactor{E}, 
                        detwf::DeterminantalWavefunction,
                        model_geometry::ModelGeometry, 
                        n_stab_T::I, 
                        δT::E, 
                        pht::Bool ) where {S<:AbstractString, K, V, I<:Integer, E<:AbstractFloat}

Updates elements $T_{i}$ of the fermion-type T vector after an accepted Metropolis step.

  • markov_move::MarkovMove{I}: quantities related to a Markov process.
  • spin::I: spin of the current particle.
  • jastrow_parameters::JastrowParameters{S, K, V, I}: current set of Jastrow variational parameters.
  • jastrow::JastrowFactor{E}: current Jastrow factor.
  • detwf::DeterminantalWavefunction: current determinantal wavefunction.
  • model_geometry::ModelGeometry: contains unit cell and lattice quantities.
  • n_stab_T::I: frequency of T vector stabilization setps.
  • δT::E: deviation threshold for the T vector.
  • pht::Bool: whether model is particle-hole transformed.
source
VariationalMC.get_fermionic_jastrow_ratioFunction
get_fermionic_jastrow_ratio( markov_move::MarkovMove{I}, 
                             jastrow_parameters::JastrowParameters{S, K, V, I},
                             jastrow_factor::JastrowFactor{E}, 
                             pht::Bool, 
                             spin::I, 
                             model_geometry::ModelGeometry ) where {I<:Integer, S<:AbstractString, K, V, E<:AbstractFloat}

Calculates ratio of fermionic Jastrow factors

\[\frac{\mathcal{J}_1}{\mathcal{J}_2} = \exp[s(T_{l} - T_{k}) + v_{ll} - v_{lk}],\]

after a single particle completes a move from site $k$ to site $l$ using the corresponding T vectors $T_k$ and $T_l$.

  • markov_move::MarkovMove{I}: quantities related to a Markov process.
  • jastrow_parameters::JastrowParameters{S, K, V, I}: current set of Jastrow variational parameters.
  • jastrow_factor::JastrowFactor{E}: current Jastrow factor.
  • pht::Bool: whether model is particle-hole transformed.
  • spin::I: spin of the current particle.
  • model_geometry::ModelGeometry: contains unit cell and lattice quantities.
source
get_fermionic_jastrow_ratio( k::I, 
                             l::I, 
                             jastrow_parameters::JastrowParameters{S, K, V, I},
                             jastrow_factor::JastrowFactor{E}, 
                             pht::Bool, 
                             spin::I, 
                             model_geometry::ModelGeometry ) where {I<:Integer, S<:AbstractString, K, V, E<:AbstractFloat}

Calculates ratio of fermionic Jastrow factors

\[\frac{\mathcal{J}_1}{\mathcal{J}_2} = \exp[-s(T_{l} - T_{k}) + v_{ll} - v_{lk}],\]

after a single particle completes a move from site $k$ to site $l$ using the corresponding T vectors $T_k$ and $T_l$.

  • k::Int: initial site of the current particle.
  • l::Int: final site of the current particle.
  • jastrow_parameters::JastrowParameters: current set of Jastrow variational parameters.
  • jastrow_factor::JastrowFactor: current Jastrow factor.
  • pht::Bool: whether model is particle-hole transformed.
  • spin::Int: spin of the current particle.
  • model_geometry::ModelGeometry: contains unit cell and lattice quantities.
source
VariationalMC.map_jastrow_parametersFunction
map_jastrow_parameters( model_geometry::ModelGeometry, 
                        rng::AbstractRNG )

Generates a dictionary of irreducible index keys $k$ with values being a tuple of all lattice index pairs $(i,j)$, which generate $k$, and their associated Jastrow parameter $v_{ij}$. The parameter corresponding to the largest irreducible index is initialized to zero.

  • model_geometry::ModelGeometry: contains unit cell and lattice quantities.
  • rng::AbstractRNG: random number generator.
source
map_jastrow_parameters( model_geometry::ModelGeometry, 
                        init_jpars::Vector{E} ) where {E<:AbstractFloat}

Given an initial set of Jastrow parameters from file, generates a dictionary of irreducible index keys $k$ with values being a tuple of all lattice index pairs $(i,j)$, which generate $k$, and their associated Jastrow parameter $v_{ij}$. The parameter corresponding to the largest irreducible index is initialized to zero.

  • model_geometry::ModelGeometry: contains unit cell and lattice qunatities.
  • init_jpars::Vector{E}: initial Jastrow parameters from file.
source

Markov Methods

VariationalMC.local_fermion_update!Function
local_fermion_update!( detwf::DeterminantalWavefunction{T, V, E, I},
                       Np::I, 
                       model_geometry::ModelGeometry, 
                       n_stab_W::I,
                       δW::E, 
                       rng::AbstractRNG ) where {T<:Number, V, E<:AbstractFloat, I<:Integer}

Performs a local update to the fermionic sector by attempting to move a particle $\beta$ at a randomly selected lattice site $k$ to another random site $l$, with the move accepted or rejected by the Meteropolis algorithm.

  • detwf::DeterminantalWavefunction{T, V, E, I}: current determinantal variational wavefunction.
  • Np::I: total number of particles in the system.
  • model_geometry::ModelGeometry: contains unit cell and lattice quantities.
  • n_stab_W::I: frequency of Green's function stabilization steps.
  • δW::E: error threshold for the Green's function.
  • rng::AbstractRNG: random number generator.
source
local_fermion_update!( detwf::DeterminantalWavefunction{T, Q, E, I}, 
                       jastrow_factor::JastrowFactor{E}, 
                       jastrow_parameters::JastrowParameters{S, K, V, I},
                       Np::I, 
                       model_geometry::ModelGeometry, 
                       pht::Bool, 
                       n_stab_W::I,
                       n_stab_T::Int,
                       δW::E, 
                       δT::E, 
                       rng::AbstractRNG ) where {T<:Number, Q, E<:AbstractFloat, I<:Integer, K, V}

Performs a local update to the fermionic sector by attempting to move a particle $\beta$ at a randomly selected lattice site $k$ to another random site $l$, with the move accepted or rejected by the Meteropolis algorithm.

  • detwf::DeterminantalWavefunction{T, Q, E, I}: current determinantal variational wavefunction.
  • jastrow_facor::JastrowFactor{E}: current Jastrow factor.
  • jastrow_parameters::JastrowParameters{S, K, V, I}: current set of Jastrow variational parameters.
  • Np::I: total number of particles in the system.
  • model_geometry::ModelGeometry: contains unit cell and lattice quantities.
  • pht::Bool: whether model is particle-hole transformed.
  • n_stab_W::I: frequency of Green's function stabilization steps.
  • n_stab_T::I: frequency of T vector stabilization steps.
  • δW::E: error threshold for the Green's function.
  • δT::E: error treshold for the Jastrow T vector.
  • rng::AbstractRNG: random number generator.
source
local_fermion_update!( detwf::DeterminantalWavefunction{T, Q, E, I}, 
                       jastrow_factor_1::JastrowFactor{E}, 
                       jastrow_factor_2::JastrowFactor{E}, 
                       jastrow_parameters_1::JastrowParameters{S, K, V, I},
                       jastrow_parameters_2::JastrowParameters{S, K, V, I},
                       Np::I, 
                       model_geometry::ModelGeometry, 
                       pht::Bool, 
                       n_stab_W::I,
                       n_stab_T::I,
                       δW::E, 
                       δT::E, 
                       rng::Xoshiro ) where {T<:Number, Q, E<:AbstractFloat, I<:Integer, K, V}

Performs a local update to the fermionic sector by attempting to move a particle $\beta$ at a randomly selected lattice site $k$ to another random site $l$, with the move accepted or rejected by the Meteropolis algorithm.

  • detwf::DeterminantalWavefunction{T, Q, E, I}: current determinantal variational wavefunction.
  • jastrow_factor_1::Jastrow{E}: first Jastrow factor.
  • jastrow_factor_2::Jastrow{E}: second Jastrow factor.
  • jastrow_parameters_1::JastrowParameters{S, K, V, I}: first set of Jastrow variational parameters.
  • jastrow_parameters_2::JastrowParameters{S, K, V, I}: second set of Jastrow variational parameters.
  • Np::I: total number of particles in the system.
  • model_geometry::ModelGeometry: contains unit cell and lattice quantities.
  • n_stab_W::I: frequency of Green's function stabilization steps.
  • n_stab_T::I: frequency of T vector stabilization steps.
  • δW::E: error threshold for the Green's function.
  • δT::E: error treshold for the Jastrow T vector.
  • rng::AbstractRNG: random number generator.
source

Internal Methods

VariationalMC.metropolis_stepFunction
metropolis_step( detwf::DeterminantalWavefunction{T, Q, E, I}, 
                 Np::I, 
                 n_stab_W::I, 
                 δW::E,
                 model_geometry::ModelGeometry, 
                 rng::AbstractRNG ) where {T<:Number, Q, E<:AbstractFloat, I<:Integer}

Attempts to move particle $\beta$ at lattice site $k$ to a randomly selected site $l$.

  • detwf::DeterminantalWavefunction{T, Q, E, I}: current determinantal variational wavefunction.
  • Np::I: total number of particles in the system.
  • n_stab_W::I: frequency of Green's function stabilization steps.
  • δW::E: error threshold for the Green's function.
  • model_geometry::ModelGeometry: contains unit cell and lattice quantities.
  • rng::AbstractRNG: random number generator.
source
metropolis_step( detwf::DeterminantalWavefunction{T, Q, E, I}, 
                 jastrow_factor::JastrowFactor{E}, 
                 jastrow_parameters::JastrowParameters{S, K, V, I},
                 Np::I, 
                 n_stab_W::I, 
                 n_stab_T::I, 
                 δW::E, 
                 δT::E, 
                 model_geometry::ModelGeometry, 
                 pht::Bool, 
                 rng::AbstractRNG ) where {T<:Number, Q, E<:AbstractFloat, I<:Integer, S<:AbstractString, K, V}

Attempts to move particle $\beta$ at lattice site $k$ to a randomly selected site $l$.

  • detwf::DeterminantalWavefunction{T, Q, E, I}: current variational wavefunction.
  • jastrow_factor::JastrowFactor{E}: current Jastrow factor.
  • jastrow_parameters::JastrowParameters{S, K, V, I}: current set of Jastrow parameters.
  • Np::I: total number of particles in the system.
  • n_stab_W::I: frequency of Green's function stabilization steps.
  • n_stab_T::I: frequency of T vector stabilization steps.
  • δW::E: error threshold for the Green's function.
  • δT::E: error threshold for the T vector.
  • model_geometry::ModelGeometry: contains unit cell and lattice quantities.
  • pht::Bool: whether model is particle-hole transformed.
  • rng::AbstractRNG: random number generator.
source
metropolis_step( detwf::DeterminantalWavefunction{T, Q, E, I}, 
                 jastrow_factor_1::JastrowFactor{E}, 
                 jastrow_factor_2::JastrowFactor{E},
                 jastrow_parameters_1::JastrowParameters{S, K, V, I}, 
                 jastrow_parameters_2::JastrowParameters{S, K, V, I},
                 Np::I, 
                 n_stab_W::I, 
                 n_stab_T::I, 
                 δW::E, 
                 δT::E, 
                 model_geometry::ModelGeometry, 
                 pht::Bool, 
                 rng::Xoshiro ) where {T<:Number, Q, E<:AbstractFloat, I<:Integer, S<:AbstractString, K, V}

Attempts to move particle $\beta$ at lattice site $k$ to a randomly selected site $l$.

  • detwf::DeterminantalWavefunction{T, Q, E, I}: current variational wavefunction.
  • jastrow_factor_1::JastrowFactor{E}: first Jastrow factor.
  • jastrow_factor_2::JastrowFactor{E}: second Jastrow factor.
  • jastrow_parameters_1::JastrowParameters{S, K, V, I}: first set of Jastrow parameters.
  • jastrow_parameters_2::JastrowParameters{S, K, V, I}: second set of Jastrow parameters.
  • Np::I: total number of particles in the system.
  • n_stab_W::I: frequency of Green's function stabilization steps.
  • n_stab_T::I: frequency of T vector stabilization steps.
  • δW::E: error threshold for the Green's function.
  • δT::E: error threshold for the T vector.
  • model_geometry::ModelGeometry: contains unit cell and lattice quantities.
  • pht::Bool: whether model is particle-hole transformed.
  • rng::AbstractRNG: random number generator.
source

ParticleConfiguration Types and Methods

VariationalMC.get_particle_densityFunction
get_particle_density( density::E, 
                      model_geometry::ModelGeometry,
                      pht::Bool ) where {E<:AbstractFloat}

Given a particle density, returns the total number of particles $N_p$, the total number of electrons $N_e$ number of spin-up fermions $n_{\uparrow}$, number of spin-down fermions $n_{\downarrow}$. In cases where the given density is not a commensurate filling, a new density will be calculated to correspond with the new particle number.

  • density::E: desired electronic density.
  • model_geometry::ModelGeometry: contains unit cell and lattice quantities.
  • pht::Bool: whether model is particle-hole transformed.
source
get_particle_density( Np::I,
                      model_geometry::ModelGeometry,
                      pht::Bool ) where {I<:Integer}

Given the total number of particles in the lattice $N_p$, returns the particle density, the total number of electrons $N_e$, the number of spin-up fermions $n_{\uparrow}$ and the number of spin-down fermions $n_{\downarrow}$.

  • Np::I: total number of particles.
  • model_geometry::ModelGeometry: contains unit cell and lattice quantities.
  • pht::Bool: whether model is particle-hole transformed.
source
get_particle_density( nup::I, 
                      ndn::I,
                      model_geometry::ModelGeometry, 
                      pht::Bool ) where {I<:Integer}

Given the number of spin-up fermions $n_{\uparrow}$, and number of spin-down fermions $n_{\downarrow}$, returns the particle density, total number of particles $N_p$, and the total number of electrons $N_e$.

  • nup::I: number of spin-up fermions.
  • ndn::I: number of spin-down fermions.
  • model_geometry::ModelGeometry: contains unit cell and lattice quantities.
  • pht::Bool: whether model is particle-hole transformed.
source

Internal Types and Methods

VariationalMC.MarkovMoveType
MarkovMove{I<:Integer}

A type defining a Markov process where a particle is proposed to moved from spindex $k$ to spindex $l$ and a Boolean denoting whether said move is possible.

  • particle::I: the particle undergoing a Markov process.
  • k::I: initial spindex of the particle.
  • l::I: final spindex of the particle.
  • possible::B: whether the Markov process is possible.
source
VariationalMC.propose_random_moveFunction
propose_random_move( Np::I, 
                     pconfig::AbstractVector{I}, 
                     model_geometry::ModelGeometry, 
                     rng::AbstractRNG ) where {I<:Integer}

Proposes randomly moving (via hopping or exchange) a particle from some intial spindex $k$ to a neighboring spindex $l$ and returns an instance of MarkovMove.

  • Np::I: total number of particles in the system.
  • pconfig::AbstractVector{I}: current particle configuration.
  • model_geometry::ModelGeometry: contains unit cell and lattice quantities.
  • rng::AbstractRNG: random number generator.
source
VariationalMC.hop!Function
hop!( markov_move::MarkovMove{I}, 
      pconfig::AbstractVector{I} ) where {I<:Integer}

If a proposed move (hopping) is accepted, updates the particle positions in the currenrt configuration.

  • markov_move::MarkovMove{I}: quantities related to a Markov process.
  • pconfig::AbstractVector{I}: current particle configuration.
source
VariationalMC.generate_initial_fermion_configuration!Function
generate_initial_fermion_configuration!( pconfig::AbstractVector{I},
                                         nup::I, 
                                         ndn::I, 
                                         model_geometry::ModelGeometry, 
                                         rng::AbstractRNG ) where {I<:Integer}

Generates a random initial configuration of spin-up and spin-down fermions. The first N elements correspond to spin-up and the last N correspond to spin-down. Occupation is denoted by a positive integer corresponding to that particle's creation operator label.

  • pconfig::Vector{I}: vector to store configurations.
  • nup::I: number of spin-up fermions.
  • ndn::I: number of spin-down fermions.
  • model_geometry::ModelGeometry: contains unit cell and lattice quantities.
  • rng::AbstractRNG: random number generator.
source
VariationalMC.get_onsite_fermion_occupationFunction
get_onsite_fermion_occupation( site::I, 
                               pconfig::AbstractVector{I},
                               N::I ) where {I<:Integer}

Returns the number of spin-up and spin-down fermions occupying a real lattice site i.

  • site::I: lattice site.
  • pconfig::AbstractVector{I}: current particle configuration.
  • N::I: total number of sites.
source
VariationalMC.get_spindex_typeFunction
get_spindex_type( spindex::I, 
                  model_geometry::ModelGeometry ) where {I<:Integer}

Returns the spin species at a given spindex.

  • spindex::I: spin index.
  • model_geometry::ModelGeometry: contains unit cell and lattice quantities.
source
VariationalMC.get_index_from_spindexFunction
get_index_from_spindex( spindex::I, 
                        model_geometry::ModelGeometry ) where {I<:Integer}

Returns the lattice site $i$ for a given spindex.

  • spindex::I: spin index.
  • model_geometry::ModelGeometry: contains unit cell and lattice quantities.
source
VariationalMC.get_spindices_from_indexFunction
get_spindices_from_index( index::I, 
                          model_geometry::ModelGeometry ) where {I<:Integer}

Returns spin-up and spin-down indices from a given site index.

  • index::I: lattice site index.
  • model_geometry::ModelGeometry: contains unit cell and lattice quantities.
source
VariationalMC.get_linked_spindexFunction
get_linked_spindex( i::I, 
                    N::I ) where {I<:Integer}

Given an index $i$ in the spin-up sector, returns an index in the spin-down sector.

  • i::I: lattice index in the spin-up sector.
  • N::I: total number of lattice sites.
source

Optimizer Methods

VariationalMC.optimize_parameters!Function
optimize_parameters!( measurement_container::NamedTuple, 
                      determinantal_parameters::DeterminantalParameters{I}, 
                      η::E, 
                      dt::E, 
                      bin_size::I ) where {I<:Integer, E<:AbstractFloat}

Optimizes and updates variational parameters using the Stochastic Reconfiguration method, in which the variation in parameter $\alpha_k$ can be found by solving $\delta\alpha_k = (S + \eta\mathbb{I})f^{-1}$, where $S$ is the covariance matrix, $f$ is the force vector, and $\eta$ is a stabilization parameter.

  • measurement_container::NamedTuple: container where measurements are stored.
  • determinantal_parameters::DeterminantalParameters{I}: set of determinantal variational parameters.
  • η::E: optimization stabilization factor.
  • dt::E: optimization rate.
  • bin_size::I: length of the bins.
source
optimize_parameters!( measurement_container::NamedTuple, 
                      determinantal_parameters::DeterminantalParameters{I}, 
                      jastrow_parameters::JastrowParameters{T, K, V, I}, 
                      η::E, 
                      dt::E, 
                      dt_J::E,
                      bin_size::I ) where {I<:Integer, T<:AbstractString, K, V, E<:AbstractFloat}

Optimizes and updates variational parameters using the Stochastic Reconfiguration method, in which the variation in parameter $\alpha_k$ can be found by solving $\delta\alpha_k = (S + \eta\mathbb{I})f^{-1}$, where $S$ is the covariance matrix, $f$ is the force vector, and $\eta$ is a stabilization parameter.

  • measurement_container::NamedTuple: container where measurements are stored.
  • determinantal_parameters::DeterminantalParameters{I}: set of determinantal variational parameters.
  • jastrow_parameters::JastrowParameters{T, K, V, I}: set of Jastrow variational parameters.
  • η::E: optimization stabilization factor.
  • dt::E: optimization rate.
  • dt_J::E: boost in the optimization rate of the Jastrow parameters.
  • bin_size::I: length of the bins.
source
optimize_parameters!( measurement_container::NamedTuple, 
                      determinantal_parameters::DeterminantalParameters{I}, 
                      jastrow_parameters_1::JastrowParameters{T, K, V, I},
                      jastrow_parameters_2::JastrowParameters{T, K, V, I}, 
                      η::E, 
                      dt::E, 
                      bin_size::I ) where {I<:Integer, T<:AbstractString, K, V, E<:AbstractFloat}

Optimizes and updates variational parameters using the Stochastic Reconfiguration method, in which the variation in parameter $\alpha_k$ can be found by solving $\delta\alpha_k = (S + \eta\mathbb{I})f^{-1}$, where $S$ is the covariance matrix, $f$ is the force vector, and $\eta$ is a stabilization parameter.

  • measurement_container::NamedTuple: container where measurements are stored.
  • determinantal_parameters::DeterminantalParameters{I}: set of determinantal variational parameters.
  • jastrow_parameters_1::JastrowParameters{T, K, V, I}: set of Jastrow variational parameters.
  • jastrow_parameters_2::JastrowParameters{T, K, V, I}: set of Jastrow variational parameters.
  • η::E: optimization stabilization factor.
  • dt::E: optimization rate.
  • bin_size::I: length of the bins.
source

Internal Methods

VariationalMC.get_ΔkFunction
get_Δk( optimize::NamedTuple, 
        determinantal_parameters::DeterminantalParameters{I}, 
        detwf::DeterminantalWavefunction{T, V, E, I}, 
        model_geometry::ModelGeometry, 
        Np::I ) where {I<:Integer, T<:Number, V, E<:AbstractFloat}

Calculates the local logarithmic derivative $\Delta_k = \frac{\partial\ln\Psi_{T}}{\partial\alpha_k}$, for each determinantal variational parameter $\alpha_k$ and returns a vector of derivatives.

  • optimize::NamedTuple: field of optimization flags.
  • determinantal_parameters::DeterminantalParameters{I}: set of determinantal variational parameters.
  • detwf::DeterminantalWavefunction{T, V, E, I}: current variational wavefunction.
  • `model_geometry::ModelGeometry: contains unit cell and lattice quantities.
  • Np::I: total number of particles in the system.
source
get_Δk( optimize::NamedTuple, 
        jastrow_parameters::JastrowParameters{T, K, V, I},
        detwf::DeterminantalWavefunction{Q, F, E, I}, 
        pht::Bool ) where {T<:AbstractString, K, V, I<:Integer, Q<:Number, F, E<:AbstractFloat}

Calculates the local logarithmic derivative $\Delta_k = \frac{\partial\ln\Psi_{T}}{\partial\alpha_k}$, for each determinantal variational parameter $\alpha_k$ and returns a vector of derivatives.

  • optimize::NamedTuple: field of optimization flags.
  • jastrow_parameters::JastrowParameters{T, K, V, I}: current set of Jastrow variational parameters.
  • detwf::DeterminantalWavefunction{Q, F, E, I}: current variational wavefunction.
  • model_geometry::ModelGeometry: contains unit cell and lattice quantities.
  • pht::Bool: whether model is particle-hole transformed.
source
VariationalMC.get_covariance_matrixFunction
get_covariance_matrix( measurement_container::NamedTuple, 
                       opt_bin_size::I ) where {I<:Integer}

Calculates the covariance matrix $S$ with elements $S_{kk}' = \langle \Delta_{k}\Delta_{k^\prime}\rangle - \langle \Delta_{k} \rangle\langle \Delta_{k^\prime} \rangle$.

  • measurement_container::NamedTuple: container where measurements are stored.
  • opt_bin_size::I: length of the current bin.
source
VariationalMC.get_force_vectorFunction
get_force_vector( measurement_container::NamedTuple, 
                  opt_bin_size::I ) where {I<:Integer}

Constructs force vector $f$ with elements $f_k = \langle \Delta_{k} \rangle\langle H\rangle - \langle \Delta_{k}H\rangle$.

  • measurement_container::NamedTuple: container where measurements are stored.
  • opt_bin_size::I: length of the current bin.
source

Measurement Methods

Intitialize Measurements

VariationalMC.initialize_measurement_containerFunction
initialize_measurement_container( N_opt::I, 
                                  opt_bin_size::I, 
                                  N_sim::I, 
                                  sim_bin_size::I,
                                  determinantal_parameters::DeterminantalParameters{I}, 
                                  model_geometry::ModelGeometry ) where {I<:Integer}

Initializes a set of dictionaries containing generic arrays for storing measurements.

  • N_opt::I: number of optimization updates.
  • opt_bin_size::I: length of an optimization bin.
  • N_sim::I: number of simulation bins.
  • sim_bin_size::I: length of a simulation bin.
  • determinantal_parameters::DeterminantalParameters{I}: set of determinantal variational parameters.
  • model_geometry::ModelGeometry: contains unit cell and lattice quantities.
source
initialize_measurement_container( N_opt::I, 
                                  opt_bin_size::I, 
                                  N_sim::I, 
                                  sim_bin_size::I,
                                  determinantal_parameters::DeterminantalParameters{I}, 
                                  jastrow_parameters::JastrowParameters{S, K, V, I},
                                  model_geometry::ModelGeometry ) where {I<:Integer, S<:AbstractString, K, V}

Initializes a set of dictionaries containing generic arrays for storing measurements.

  • N_opt::I: number of optimization updates.
  • opt_bin_size::I: length of an optimization bin.
  • N_sim::I: number of simulation bins.
  • sim_bin_size::I: length of a simulation bin.
  • determinantal_parameters::DeterminantalParameters{I}: set of determinantal variational parameters.
  • jastrow_parameters::JastrowParameters{S, K, V, I}: set of Jastrow variational parameters.
  • model_geometry::ModelGeometry: contains unit cell and lattice quantities.
source
initialize_measurement_container( N_opt::I, 
                                  opt_bin_size::I, 
                                  N_sim::I, 
                                  sim_bin_size::I,
                                  determinantal_parameters::DeterminantalParameters{I}, 
                                  jastrow_parameters_1::JastrowParameters{S, K, V, I},
                                  jastrow_parameters_2::JastrowParameters{S, K, V, I},
                                  model_geometry::ModelGeometry ) where {I<:Integer, S<:AbstractString, K, V}

Initializes a set of dictionaries containing generic arrays for storing measurements.

  • N_opt::I: number of optimization updates.
  • opt_bin_size::I: length of an optimization bin.
  • N_sim::I: number of simulation bins.
  • sim_bin_size::I: length of a simulation bin.
  • determinantal_parameters::DeterminantalParameters{I}: set of determinantal variational parameters.
  • jastrow_parameters_1::JastrowParameters{S, K, V, I}: first set of Jastrow variational parameters.
  • jastrow_parameters_2::JastrowParameters{S, K, V, I}: second set of Jastrow variational parameters.
  • model_geometry::ModelGeometry: contains unit cell and lattice quantities.
source
VariationalMC.initialize_measurement_directoriesFunction
initialize_measurement_directories(;
    simulation_info::SimulationInfo,
    measurement_container::NamedTuple
)

initialize_measurement_directories(
        comm::MPI.Comm;
        simulation_info::SimulationInfo,
        measurement_container::NamedTuple
)

initialize_measurement_directories(
    simulation_info::SimulationInfo,
    measurement_container::NamedTuple
)

initialize_measurement_directories(
        comm::MPI.Comm,
        simulation_info::SimulationInfo,
        measurement_container::NamedTuple
)

Initialize the measurement directories for simulation. If using MPI and a comm::MPI.Comm object is passed as the first argument, then none of the MPI processes will proceed beyond this function call until the measurement directories have been initialized.

source

Scalar Measurements

Internal Methods

VariationalMC.get_local_energyFunction
get_local_energy( detwf::DeterminantalWavefunction{T, Q, E, I}, 
                  tight_binding_model::TightBindingModel{E}, 
                  model_geometry::ModelGeometry, 
                  U::E,
                  Np::I, 
                  pht::Bool ) where {T<:Number, Q, E<:AbstractFloat, I<:Integer}

Calculates the local variational energy $E_{\mathrm{var}}$ per site for a Hubbard model.

  • detwf::DeterminantalWavefunction{T, Q, E, I}: current variational wavefunction.
  • tight_binding_model::TightBindingModel{E}: parameters for a non-interacting tight-binding model.
  • model_geometry::ModelGeometry: contains unit cell and lattice quantities.
  • U::E: Hubbard interaction.
  • Np::I: total number of particles in the system.
  • pht::Bool: whether model is particle-hole transformed.
source
get_local_energy( detwf::DeterminantalWavefunction{T, Q, E, I}, 
                  tight_binding_model::TightBindingModel{E},
                  jastrow_parameters::JastrowParameters{S, K, V, I}, 
                  jastrow_factor::JastrowFactor{E},
                  model_geometry::ModelGeometry,
                  U::E,
                  Np::I,
                  pht::Bool ) where {T<:Number, Q, E<:AbstractFloat, I<:Integer}

Calculates the local variational energy $E_{\mathrm{var}}$ per site for a Hubbard model.

  • detwf::DeterminantalWavefunction{T, Q, E, I}: current variational wavefunction.
  • tight_binding_model::TightBindingModel{E}: parameters for a non-interacting tight-binding model.
  • jastrow_parameters::JastrowParameters{S, K, V, I}: current set of Jastrow variational parameters.
  • jastrow_factor::JastrowFactor{E}: current Jastrow factor.
  • model_geometry::ModelGeometry: contains unit cell and lattice quantities.
  • U::E: Hubbard interaction.
  • Np::I: total number of particles in the system.
  • pht::Bool: whether model is particle-hole transformed.
source
get_local_energy( detwf::DeterminantalWavefunction{T, Q, E, I}, 
                  tight_binding_model::TightBindingModel,
                  jastrow_parameters_1::JastrowParameters{S, K, V, I},
                  jastrow_parameters_2::JastrowParameters{S, K, V, I}, 
                  jastrow_factor_1::JastrowFactor{E},
                  jastrow_factor_2::JastrowFactor{E},
                  model_geometry::ModelGeometry,
                  U::E,
                  Np::I,
                  pht::Bool ) where {T<:Number, Q, E<:AbstractFloat, I<:Integer, S<:AbstractString, K, V}

Calculates the local variational energy $E_{\mathrm{var}}$ per site for a Hubbard model.

  • detwf::DeterminantalWavefunction{T, Q, E, I}: current variational wavefunction.
  • tight_binding_model::TightBindingModel{E}: parameters for a non-interacting tight-binding model.
  • jastrow_parameters_1::JastrowParameters{S, K, V, I}: first set of Jastrow variational parameters.
  • jastrow_parameters_2::JastrowParameters{S, K, V, I}: second set of Jastrow variational parameters.
  • jastrow_factor_1::JastrowFactor{E}: first Jastrow factor.
  • jastrow_factor_2::JastrowFactor{E}: second Jastrow factor.
  • model_geometry::ModelGeometry: contains unit cell and lattice quantities.
  • U::E: Hubbard interaction.
  • Np::I: total number of particles in the system.
  • pht::Bool: whether model is particle-hole transformed.
source
VariationalMC.get_local_kinetic_energyFunction
get_local_kinetic_energy( detwf::DeterminantalWavefunction{T, Q, E, I}, 
                          tight_binding_model::TightBindingModel{E}, 
                          model_geometry::ModelGeometry, 
                          Np::I
                          pht::Bool ) where {T<:Number, Q, E<:AbstractFloat, I<:Integer}

Calculates the local kinetic energy $E_{\mathrm{kin}}$ .

  • detwf::DeterminantalWavefunction{T, Q, E, I}: current variational wavefunction.
  • tight_binding_model::TightBindingModel{E}: parameters for a non-interacting tight-binding model.
  • model_geometry::ModelGeometry: contains unit cell and lattice quantities.
  • Np::I: total number of particles in the system.
  • pht::Bool: whether model is particle-hole transformed.
source
get_local_kinetic_energy( detwf::DeterminantalWavefunction{T, Q, E, I}, 
                          tight_binding_model::TightBindingModel{E}, 
                          jastrow_parameters::JastrowParameters{S, K, V, I},
                          jastrow_factor::JastrowFactor{E}, 
                          model_geometry::ModelGeometry, 
                          Np::I,
                          pht::Bool ) where {T<:Number, Q, E<:AbstractFloat, I<:Integer, S<:AbstractString, K, V}

Calculates the local kinetic energy $E_{\mathrm{kin}}$ .

  • detwf::DeterminantalWavefunction{T, Q, E, I}: current variational wavefunction.
  • tight_binding_model::TightBindingModel{E}: parameters for a non-interacting tight-binding model.
  • jastrow_parameters::JastrowParameters{S, K, V, I}: current set of Jastrow variational parameters.
  • jastrow_factor::JastrowFactor{E}: current Jastrow factor.
  • model_geometry::ModelGeometry: contains unit cell and lattice quantities.
  • Np::I: total number of particles in the system.
  • pht::Bool: whether model is particle-hole transformed.
source
get_local_kinetic_energy( detwf::DeterminantalWavefunctionT, Q, E, I}, 
                          tight_binding_model::TightBindingModel{E}, 
                          jastrow_parameters_1::JastrowParameters{S, K, V, I},
                          jastrow_parameters_2::JastrowParameters{S, K, V, I},
                          jastrow_factor_1::JastrowFactor{E},
                          jastrow_factor_2::JastrowFactor{E}, 
                          model_geometry::ModelGeometry, 
                          Np::I,
                          pht::Bool ) where {T<:Number, Q, E<:AbstractFloat, I<:Integer, S<:AbstractString, K, V}

Calculates the local kinetic energy $E_{\mathrm{kin}}$ .

  • detwf::DeterminantalWavefunction{T, Q, E, I}: current variational wavefunction.
  • tight_binding_model::TightBindingModel{E}: parameters for a non-interacting tight-binding model.
  • jastrow_parameters_1::JastrowParameters{S, K, V, I}: first set of Jastrow variational parameters.
  • jastrow_parameters_2::JastrowParameters{S, K, V, I}: second set of Jastrow variational parameters.
  • jastrow_factor_1::JastrowFactor{E}: first Jastrow factor.
  • jastrow_factor_2::JastrowFactor{E}: second Jastrow factor.
  • model_geometry::ModelGeometry: contains unit cell and lattice quantities.
  • Np::I: total number of particles in the system.
  • pht::Bool: whether model is particle-hole transformed.
source
VariationalMC.get_local_hubbard_energyFunction
get_local_hubbard_energy( U::E, 
                          detwf::DeterminantalWavefunction{T, Q, E, I}, 
                          model_geometry::ModelGeometry, 
                          pht::Bool ) where {E<:AbstractFloat, T<:Number, Q, I<:Integer}

Calculates the energy due to on-site Hubbard interaction $U$.

  • U::E: Hubbard interaction.
  • detwf::DeterminantalWavefunction{T, Q, E, I}: current variational wavefunction.
  • model_geometry::ModelGeometry: contains unit cell and lattice quantities.
  • pht::Bool: whether model is particle-hole transformed.
source
VariationalMC.get_double_occFunction
get_double_occ( detwf::DeterminantalParameters{T, Q, E, I}, 
                model_geometry::ModelGeometry, 
                pht::Bool ) where {T<:Number, Q, E<:AbstractFloat, I<:Integer}

Calculates the average double occupancy$D = \sum_{i} n_{\boldsymbol{i},\uparrow}n_{\boldsymbol{i},\downarrow}$.

  • detwf::DeterminantalWavefunction{T, Q, E, I}: current variational wavefunction.
  • model_geometry::ModelGeometry: contains unit cell and lattice quantities.
  • pht::Bool: whether model is particle-hole transformed.
source
VariationalMC.get_nFunction
get_n( detwf::DeterminantalWavefunction{T, Q, E, I}, 
       model_geometry::ModelGeometry,
       pht::Bool ) where {T<:Number, Q, E<:AbstractFloat, I<:Integer}

Calculate the average particle density $n = \sum_{i} (n_{\boldsymbol{i},\uparrow} + n_{\boldsymbol{i},\downarrow})$.

  • detwf::DeterminantalWavefunction{T, Q, E, I}: current variational wavefunction.
  • model_geometry::ModelGeometry: contains unit cell and lattice quantities.
  • pht::Bool: whether model is particle-hole transformed.
source
VariationalMC.get_SzFunction
get_Sz( detwf::DeterminantalWavefunction{T, Q, E, I}, 
        model_geometry::ModelGeometry,
        pht::Bool ) where {T<:Number, Q, E<:AbstractFloat, I<:Integer}

Calculate the average value of the operator $S_z = \frac{1}{2} \sum_{i} (n_{\boldsymbol{i},\uparrow} - n_{\boldsymbol{i},\downarrow})$.

  • detwf::DeterminantalWavefunction{T, Q, E, I}: current variational wavefunction.
  • model_geometry::ModelGeometry: contains unit cell and lattice quantities.
  • pht::Bool: whether model is particle-hole transformed.
source

Optimization Measurements

Internal Methods

VariationalMC.measure_Δk!Function
measure_Δk!( measurement_container::NamedTuple, 
             detwf::DeterminantalWavefunction{T, Q, E, I}, 
             determinantal_parameters::DeterminantalParameters{I}, 
             optimize::NamedTuple,
             model_geometry::ModelGeometry, 
             Np::I ) where {T<:Number, Q, E<:AbstractFloat, I<:Integer}

Measures the logarithmic derivative $\Delta_k$ for $k$ variational parameters and then writes them to the measurement container.

  • measurement_container::NamedTuple: container where measurements are stored.
  • detwf::DeterminantalWavefunction{T, Q, E, I}: current variational wavefunction.
  • determinantal_parameters::DeterminantalParameters{I}: current set of determinantal variational parameters.
  • optimize::NamedTuple:: tuple of optimization flags.
  • model_geometry::ModelGeometry: contains unit cell and lattice quantities.
  • Np::I: total number of particles in the system.
source
measure_Δk!( measurement_container::NamedTuple, 
             detwf::DeterminantalWavefunction{T, Q, E, I}, 
             determinantal_parameters::DeterminantalParameters{I}, 
             jastrow_parameters::JastrowParameters{S, K, V, I}, 
             optimize::NamedTuple,
             model_geometry::ModelGeometry, 
             Np::I, 
             pht::Bool ) where {T<:Number, Q, E<:AbstractFloat, I<:Integer, S<:AbstractString, K, V}

Measures the logarithmic derivative $\Delta_k$ for `k variational parameters and then writes them to the measurement container.

  • measurement_container::NamedTuple: container where measurements are stored.
  • detwf::DeterminantalWavefunction{T, Q, E, I}: current variational wavefunction.
  • determinantal_parameters::DeterminantalParameters: current set of determinantal variational parameters.
  • jastrow_parameters::JastrowParameters{S, K, V, I}: first set of Jastrow variational parameters.
  • optimize::NamedTuple:: tuple of optimization flags.
  • model_geometry::ModelGeometry: contains unit cell and lattice quantities.
  • Np::I: total number of particles in the system.
  • pht::Bool: whether model is particle-hole transformed.
source
measure_Δk!( measurement_container::NamedTuple, 
             detwf::DeterminantalWavefunction{T, Q, E, I}, 
             determinantal_parameters::DeterminantalParameters{I}, 
             jastrow_parameters_1::JastrowParameters{S, K, V, I},
             jastrow_parameters_2::JastrowParameters{S, K, V, I},
             optimize::NamedTuple,
             model_geometry::ModelGeometry, 
             Np::I, 
             pht::Bool ) where {T<:Number, Q, E<:AbstractFloat, I<:Integer, S<:AbstractString, K, V}

Measures the logarithmic derivative $\Delta_k$ for `k variational parameters and then writes them to the measurement container.

  • measurement_container::NamedTuple: container where measurements are stored.
  • detwf::DeterminantalWavefunction: current variational wavefunction.
  • determinantal_parameters::DeterminantalParameters: current set of determinantal variational parameters.
  • jastrow_parameters_1::JastrowParameters: first set of Jastrow variational parameters.
  • jastrow_parameters_2::JastrowParameters: second set of Jastrow variational parameters.
  • optimize::NamedTuple:: tuple of optimization flags.
  • model_geometry::ModelGeometry: contains unit cell and lattice quantities.
  • Np::Int: total number of particles in the system.
  • pht::Bool: whether model is particle-hole transformed.
source
VariationalMC.measure_ΔkΔkp!Function
measure_ΔkΔkp!( measurement_container::NamedTuple, 
                detwf::DeterminantalWavefunction{T, Q, E, I}, 
                determinantal_parameters::DeterminantalParameters{I}, 
                optimize::NamedTuple,
                model_geometry::ModelGeometry, 
                Np::I ) where {T<:Number, Q, E<:AbstractFloat, I<:Integer}

Measures the product of logarithmic derivatives $\Delta_{k}\Delta_{k}^\prime$ and then writes them to the measurement container.

  • measurement_container::NamedTuple: container where measurements are stored.
  • detwf::DeterminantalWavefunction: current variational wavefunction.
  • determinantal_parameters::DeterminantalParameters: current variational determinantal parameters.
  • optimize::NamedTuple:: tuple of optimization flags.
  • model_geometry::ModelGeometry: contains unit cell and lattice quantities.
  • Np::Int: total number of particles in the system.
source
measure_ΔkΔkp!( measurement_container::NamedTuple, 
                detwf::DeterminantalWavefunction{T, Q, E, I}, 
                determinantal_parameters::DeterminantalParameters{I}, 
                jastrow_parameters::JastrowParameters{S, K, V, I},
                optimize::NamedTuple,
                model_geometry::ModelGeometry, 
                Np::I, 
                pht::Bool ) where {T<:Number, Q, E<:AbstractFloat, I<:Integer, S<:AbstractString, K, V}

Measures the product of logarithmic derivatives $\Delta_{k}\Delta_{k}^\prime$ and then writes them to the measurement container.

  • measurement_container::NamedTuple: container where measurements are stored.
  • detwf::DeterminantalWavefunction: current variational wavefunction.
  • determinantal_parameters::DeterminantalParameters: current set of determinantal variational parameters.
  • jastrow_parameters::JastrowParameters: current set of Jastrow variational parameters.
  • optimize::NamedTuple:: tuple of optimization flags.
  • model_geometry::ModelGeometry: contains unit cell and lattice quantities.
  • Np::Int: total number of particles in the system.
  • pht::Bool: whether model is particle-hole transformed.
source
measure_ΔkΔkp!( measurement_container::NamedTuple, 
                detwf::DeterminantalWavefunction{T, Q, E, I}, 
                determinantal_parameters::DeterminantalParameters{I}, 
                jastrow_parameters_1::JastrowParameters{S, K, V, I},
                jastrow_parameters_2::JastrowParameters{S, K, V, I},
                optimize::NamedTuple,
                model_geometry::ModelGeometry, 
                Np::I, 
                pht::Bool ) where {T<:Number, Q, E<:AbstractFloat, I<:Integer, S<:AbstractString, K, V}

Measures the product of logarithmic derivatives $\Delta_{k}\Delta_{k}^\prime$ and then writes them to the measurement container.

  • measurement_container::NamedTuple: container where measurements are stored.
  • detwf::DeterminantalWavefunction: current variational wavefunction.
  • determinantal_parameters::DeterminantalParameters: current set of determinantal variational parameters.
  • jastrow_parameters_1::JastrowParameters: first set of Jastrow variational parameters.
  • jastrow_parameters_2::JastrowParameters: second set of Jastrow variational parameters.
  • optimize::NamedTuple:: tuple of optimization flags.
  • model_geometry::ModelGeometry: contains unit cell and lattice quantities.
  • Np::Int: total number of particles in the system.
  • pht::Bool: whether model is particle-hole transformed.
source
VariationalMC.measure_ΔkE!Function
measure_ΔkE!( measurement_container::NamedTuple, 
              detwf::DeterminantalWavefunction{T, Q, E, I}, 
              tight_binding_model::TightBindingModel{E}, 
              determinantal_parameters::DeterminantalParameters{I}, 
              optimize::NamedTuple,
              model_geometry::ModelGeometry, 
              U::E,
              Np::I, 
              pht::Bool )where {T<:Number, Q, E<:AbstractFloat, I<:Integer}

Measures the product of logarithmic derivatives with the local energy $\Delta_{k}E$ and then writes them to the measurement container.

  • measurement_container::NamedTuple: container where measurements are stored.
  • detwf::DeterminantalWavefunction: current variational wavefunction.
  • tight_binding_model::TightBindingModel: parameter for a non-interacting tight-binding model.
  • determinantal_parameters::DeterminantalParameters: current set of determinantal variational parameters.
  • optimize::NamedTuple:: tuple of optimization flags.
  • model_geometry::ModelGeometry: contains unit cell and lattice quantities.
  • U::E: Hubbard repulsion.
  • Np::Int: total number of particles in the system.
  • pht::Bool: whether model is particle-hole transformed.
source
measure_ΔkE!( measurement_container::NamedTuple, 
              detwf::DeterminantalWavefunction{T, Q, E, I}, 
              tight_binding_model::TightBindingModel{E}, 
              determinantal_parameters::DeterminantalParameters{I}, 
              jastrow_parameters::JastrowParameters{S, K, V, I}, 
              jastrow_factor::JastrowFactor{E, I},
              optimize::NamedTuple,
              model_geometry::ModelGeometry, 
              U::E,
              Np::I, 
              pht::Bool ) where {T<:Number, Q, E<:AbstractFloat, I<:Integer, S<:AbstractString, K, V}

Measures the product of logarithmic derivatives with the local energy $\Delta_{k}E$ and then writes them to the measurement container.

  • measurement_container::NamedTuple: container where measurements are stored.
  • detwf::DeterminantalWavefunction: current variational wavefunction.
  • tight_binding_model::TightBindingModel: parameters for a non-interacting tight-binding model.
  • determinantal_parameters::DeterminantalParameters: current set of determinantal variational parameters.
  • jastrow_parameters::JastrowParameters: current set of Jastrow variational parameters.
  • jastrow_factor::JastrowFactor: current Jastrow factor.
  • optimize::NamedTuple:: tuple of optimization flags.
  • model_geometry::ModelGeometry: contains unit cell and lattice quantities.
  • U::E: Hubbard repulsion.
  • Np::Int: total number of particles in the system.
  • pht::Bool: whether model is particle-hole transformed.
source
measure_ΔkE!( measurement_container::NamedTuple, 
              detwf::DeterminantalWavefunction{T, Q, E, I}, 
              tight_binding_model::TightBindingModel{E}, 
              determinantal_parameters::DeterminantalParameters{I}, 
              jastrow_parameters_1::JastrowParameters{S, K, V, I},
              jastrow_parameters_2::JastrowParameters{S, K, V, I}, 
              jastrow_factor_1::JastrowFactor{E, I},
              jastrow_factor_2::JastrowFactor{E, I},
              optimize::NamedTuple,
              model_geometry::ModelGeometry, 
              U::E,
              Np::I, 
              pht::Bool ) where {T<:Number, Q, E<:AbstractFloat, I<:Integer, S<:AbstractString, K, V}

Measures the product of logarithmic derivatives with the local energy $\Delta_{k}E$ and then writes them to the measurement container.

  • measurement_container::NamedTuple: container where measurements are stored.
  • detwf::DeterminantalWavefunction: current variational wavefunction.
  • tight_binding_model::TightBindingModel: parameters for a non-interacting tight-binding model.
  • determinantal_parameters::DeterminantalParameters: current set of determinantal variational parameters.
  • jastrow_parameters_1::JastrowParameters: first set of Jastrow variational parameters.
  • jastrow_parameters_2::JastrowParameters: second set of Jastrow variational parameters.
  • jastrow_factor_1::JastrowFactor: first Jastrow factor.
  • jastrow_factor_2::JastrowFactor: second Jastrow factor.
  • optimize::NamedTuple:: tuple of optimization flags.
  • model_geometry::ModelGeometry: contains unit cell and lattice quantities.
  • U::E: Hubbard repulsion.
  • Np::Int: total number of particles in the system.
  • pht::Bool: whether model is particle-hole transformed.
source

Simulation Measurements

Internal Methods

VariationalMC.measure_local_energy!Function
measure_local_energy!( measurement_container::NamedTuple, 
                       detwf::DeterminantalWavefunction{T, Q, E, I}, 
                       tight_binding_model::TightBindingModel{E}, 
                       model_geometry::ModelGeometry,
                       U::E,
                       Np::I,
                       pht::Bool ) where {T<:Number, Q, E<:AbstractFloat, I<:Integer}

Measures the total local energy $E_{\mathrm{loc}}$ for a Hubbard model and writes to the measurement container.

  • measurement_container::NamedTuple: container where measurements are stored.
  • detwf::DeterminantalWavefunction{T, Q, E, I}: current variational wavefunction.
  • tight_binding_model::TightBindingModel{E}: parameters for a non-interacting tight-binding model.
  • model_geometry::ModelGeometry: contains unit cell and lattice quantities.
  • U::E: Hubbard interaction.
  • Np::I: total number of particles in the system.
  • pht::Bool: whether model is particle-hole transformed.
source
measure_local_energy!( measurement_container::NamedTuple, 
                       detwf::DeterminantalWavefunction{T, Q, E, I}, 
                       tight_binding_model::TightBindingModel{E}, 
                       jastrow_parameters::JastrowParameters{S, K, V, I},
                       jastrow_factor::JastrowFactor{E}, 
                       model_geometry::ModelGeometry,
                       U::E,
                       Np::I, 
                       pht::Bool ) where {T<:Number, Q, E<:AbstractFloat, I<:Integer}

Measures the total local energy $E_{\mathrm{loc}}$ for a Hubbard model and writes to the measurement container.

  • measurement_container::NamedTuple: container where measurements are stored.
  • detwf::DeterminantalWavefunction{T, Q, E, I}: current variational wavefunction.
  • tight_binding_model::TightBindingModel{E}: parameters for a non-interacting tight-binding model.
  • jastrow_parameters::JastrowParameters{S, K, V, I}: current set of Jastrow variational parameters.
  • jastrow_factor::JastrowFactor{E}: current Jastrow factor.
  • model_geometry::ModelGeometry: contains unit cell and lattice quantities.
  • U::E: Hubbard interaction.
  • Np::I: total number of particles in the system.
  • pht::Bool: whether model is particle-hole transformed.
source
measure_local_energy!( measurement_container::NamedTuple, 
                       detwf::DeterminantalWavefunction{T, Q, E, I}, 
                       tight_binding_model::TightBindingModel{E}, 
                       jastrow_parameters_1::JastrowParameters{S, K, V, I},
                       jastrow_parameters_2::JastrowParameters{S, K, V, I},
                       jastrow_factor_1::JastrowFactor{E},
                       jastrow_factor_2::JastrowFactor{E}, 
                       model_geometry::ModelGeometry,
                       U::E,
                       Np::I, 
                       pht::Bool ) where {T<:Number, Q, E<:AbstractFloat, I<:Integer, S<:AbstractString, K, V}

Measures the total local energy $E_{\mathrm{loc}}$ for a Hubbard model and writes to the measurement container.

  • measurement_container::NamedTuple: container where measurements are stored.
  • detwf::DeterminantalWavefunction{T, Q, E, I}: current variational wavefunction.
  • tight_binding_model::TightBindingModel{E}: parameters for a non-interacting tight-binding model.
  • jastrow_parameters_1::JastrowParameters{S, K, V, I}: first set of Jastrow variational parameters.
  • jastrow_parameters_2::JastrowParameters{S, K, V, I}: second set of Jastrow variational parameters.
  • jastrow_factor_1::JastrowFactor{E}: first Jastrow factor.
  • jastrow_factor_2::JastrowFactor{E}: second Jastrow factor.
  • model_geometry::ModelGeometry: contains unit cell and lattice quantities.
  • U::E: Hubbard interaction.
  • Np::I: total number of particles in the system.
  • pht::Bool: whether model is particle-hole transformed.
source
VariationalMC.measure_double_occ!Function
measure_double_occ!( measurement_container::NamedTuple, 
                     detwf::DeterminantalWavefunction{T, Q, E, I}, 
                     model_geometry::ModelGeometry, 
                     pht::Bool ) where {T<:Number, Q, E<:AbstractFloat, I<:Integer}

Measures the average double occupancy $\langle D\rangle$.

  • measurement_container::NamedTuple: container where measurements are stored.
  • detwf::DeterminantalWavefunction{T, Q, E, I}: current variational wavefunction.
  • model_geometry::ModelGeometry: contains unit cell and lattice quantities.
  • pht::Bool: whether model is particle-hole transformed.
source
VariationalMC.measure_n!Function
measure_n!( type::String,
            measurement_container::NamedTuple, 
            detwf::DeterminantalWavefunction{T, Q, E, I}, 
            model_geometry::ModelGeometry,
            pht::Bool ) where {T<:Number, Q, E<:AbstractFloat, I<:Integer}

Measures the local or site-dependent particle density averaged over all sites $\langle n\rangle$.

  • type::String: type of measurement. Either "local" or "site-dependent".
  • measurement_container::NamedTuple: container where measurements are stored.
  • detwf::DeterminantalWavefunction{T, Q, E, I}: current variational wavefunction.
  • model_geometry::ModelGeometry: contains unit cell and lattice quantities.
  • pht::Bool: whether model is particle-hole transformed.
source
VariationalMC.measure_Sz!Function
measure_Sz!( type::String,
             measurement_container::NamedTuple, 
             detwf::DeterminantalWavefunction{T, Q, E, I}, 
             model_geometry::ModelGeometry,
             pht::Bool ) where {T<:Number, Q, E<:AbstractFloat, I<:Integer}

Measures the local or site-dependent spin z-component over averaged all sites $\langle S_z\rangle$.

  • type::String: type of measurement. Either "local" or "site-dependent".
  • measurement_container::NamedTuple: container where measurements are stored.
  • detwf::DeterminantalWavefunction{T, Q, E, I}: current variational wavefunction.
  • model_geometry::ModelGeometry: contains unit cell and lattice quantities.
  • pht::Bool: whether model is particle-hole transformed.
source

Correlation Measurements

Internal Methods

VariationalMC.measure_density_correlation!Function
measure_density_correlation!( measurement_container::NameTuple,
                              detwf::DeterminantalWavefunction{T, Q, E, I},
                              model_geometry::ModelGeometry,
                              pht::Bool ) where {T<:Number, Q, E<:AbstractFloat, I<:Integer}

Measures the equal-time density-density correlation function $\langle \hat{n}_{i}\hat{n}_{j}\rangle$.

  • measurement_container::NamedTuple: container where measurements are stroed.
  • detwf::DeterminantalWavefunction{T, Q, E, I}: current variational wavefunction.
  • model_geometry::ModelGeometry: contains unit cell and lattice quantities.
  • pht::Bool: whether model is particle-hole transform.
source
VariationalMC.measure_spin_correlation!Function
measure_spin_correlation!( measurement_container::NamedTuple,
                           detwf::DeterminantalWavefunction{T, Q, E, I},
                           model_geometry::ModelGeometry,
                           pht::Bool ) where {T<:Number, Q, E<:AbstractFloat, I<:Integer}

Measures the equal-time spin-spin correlation function $\langle \hat{S}_{i}\hat{S}_{j}\rangle$.

  • measurement_container::NamedTuple: container where measurements are stroed.
  • detwf::DeterminantalWavefunction{T, Q, E, I}: current variational wavefunction.
  • model_geometry::ModelGeometry: contains unit cell and lattice quantities.
  • pht::Bool: whether model is particle-hole transform.
source
VariationalMC.get_site_dependent_nFunction
get_site_dependent_n( detwf::DeterminantalWavefunction{T, Q, E, I}, 
                      model_geometry::ModelGeometry,
                      pht::Bool ) where {T<:Number, Q, E<:AbstractFloat, I<:Integer}

Calculates the local density $n_{\boldsymbol{i}}$ on each lattice site.

  • detwf::DeterminantalWavefunction{T, Q, E, I}: current variational wavefunction.
  • model_geometry::ModelGeometry: contains unit cell and lattice quantities.
  • pht::Bool: whether model is particle-hole transformed.
source
VariationalMC.get_site_dependent_sFunction
get_site_dependent_s( detwf::DeterminantalParameters{T, Q, E, I}
                      model_geometry::ModelGeometry,
                      pht::Bool )

Calculates the local spin $S_{\boldsymbol{i}}$ on each lattice site.

  • detwf::DeterminantalParameters{T, Q, E, I}: current variational wavefunction.
  • model_geometry::ModelGeometry: contains unit cell and lattice quantities.
  • pht::Bool: whether model is particle-hole transformed.
source

Make Measurements

VariationalMC.make_measurements!Function
make_measurements!( measurement_container::NamedTuple, 
                    detwf::DeterminantalWavefunction{T, Q, E, I}, 
                    tight_binding_model::TightBindingModel{E}, 
                    determinantal_parameters::DeterminantalParameters{I}, 
                    optimize::NamedTuple,
                    model_geometry::ModelGeometry,
                    U::E,
                    Np::I, 
                    pht::Bool ) where {T<:Number, Q, E<:AbstractFloat, I<:Integer}

Measures optimization and simulation observables including the local energy $\langle E_{\mathrm{loc}}\rangle$, logarithmic derivatives $\langle\Delta_k\rangle$, $\langle\Delta_{k}\Delta_{k}^\prime\rangle$, $\langle\Delta_{k}E\rangle$, average double occupancy $\langle D\rangle$, and average density $\langle n\rangle$. Also records the current particle configuration $|x\rangle$.

  • measurement_container::NamedTuple: container where measurements are stored.
  • detwf::DeterminantalWavefunction{T, Q, E, I}: current determinantal wavefunction.
  • tight_binding_model::TightBindingModel{E}: non-interacting tight-binding model.
  • determinantal_parameters{I}::DeterminantalParameters{I}: set of determinantal variational parameters.
  • optimize::NamedTuple:: tuple of optimization flags.
  • model_geometry::ModelGeometry: contains unit cell and lattice quantities.
  • U::E: Hubbard interaction.
  • Np::I: total number of particles in the system.
  • pht::Bool: whether or not model is particle-hole transformed.
source
make_measurements!( measurement_container::NamedTuple, 
                    detwf::DeterminantalWavefunction{T, Q, E, I}, 
                    tight_binding_model::TightBindingModel{E},
                    determinantal_parameters::DeterminantalParameters{I},
                    jastrow_parameters::JastrowParameters{S, K, V, I},
                    jastrow_factor::JastrowFactor{E, I},
                    optimize::NamedTuple,
                    model_geometry::ModelGeometry, 
                    U::E,
                    Np::I, 
                    pht::Bool ) where {T<:Number, Q, E<:AbstractFloat, I<:Integer, S<:AbstractString, K, V}

Measures optimization and simulation observables including the local energy $\langle E_{\mathrm{loc}}\rangle$, logarithmic derivatives $\langle\Delta_k\rangle$, $\langle\Delta_{k}\Delta_{k}^\prime\rangle$, $\langle\Delta_{k}E\rangle$, average double occupancy $\langle D\rangle$, and average density $\langle n\rangle$. Also records the current particle configuration $|x\rangle$.

  • measurement_container::NamedTuple: container where measurements are stored.
  • detwf::DeterminantalWavefunction{T, Q, E, I}: current determinantal wavefunction.
  • tight_binding_model::TightBindingModel{E}: non-interacting tight-binding model.
  • determinantal_parameters::DeterminantalParameters{I}: set of determinantal variational parameters.
  • jastrow_parameters::JastrowParameters{S, K, V, I}: current set of Jastrow variational parameters.
  • jastrow_factor::JastrowFactor{E, I}: current Jastrow factor.
  • optimize::NamedTuple:: tuple of optimization flags.
  • model_geometry::ModelGeometry: contains unit cell and lattice quantities.
  • U::E: Hubbard interaction.
  • Np::I: total number of particles in the system.
  • pht::Bool: whether or not model is particle-hole transformed.
source
make_measurements!( measurement_container::NamedTuple, 
                    detwf::DeterminantalWavefunction{T, Q, E, I}, 
                    tight_binding_model::TightBindingModel{E},
                    determinantal_parameters::DeterminantalParameters{I},
                    jastrow_parameters_1::JastrowParameters{S, K, V, I},
                    jastrow_parameters_2::JastrowParameters{S, K, V, I},
                    jastrow_factor_1::JastrowFactor{E, I},
                    jastrow_factor_2::JastrowFactor{E, I}, 
                    optimize::NamedTuple,
                    model_geometry::ModelGeometry, 
                    U::E,
                    Np::I, 
                    pht::Bool ) where {T<:Number, Q, E<:AbstractFloat, I<:Integer, S<:AbstractString, K, V}

Measures optimization and simulation observables including the local energy $\langle E_{\mathrm{loc}}\rangle$, logarithmic derivatives $\langle\Delta_k\rangle$, $\langle\Delta_{k}\Delta_{k}^\prime\rangle$, $\langle\Delta_{k}E\rangle$, average double occupancy $\langle D\rangle$, and average density $\langle n\rangle$. Also records the current particle configuration $|x\rangle$.

  • measurement_container::NamedTuple: container where measurements are stored.
  • detwf::DeterminantalWavefunction{T, Q, E, I}: current determinantal wavefunction.
  • tight_binding_model::TightBindingModel{E}: non-interacting tight-binding model.
  • determinantal_parameters::DeterminantalParameters: set of determinantal variational parameters.
  • jastrow_parameters_1::JastrowParameters{S, K, V, I}: first set of Jastrow variational parameters.
  • jastrow_parameters_2::JastrowParameters{S, K, V, I}: second set of Jastrow variational parameters.
  • jastrow_factor_1::JastrowFactor{E, I}: first Jastrow factor.
  • jastrow_factor_2::JastrowFactor{E, I}: second Jastrow factor.
  • optimize::NamedTuple:: tuple of optimization flags.
  • model_geometry::ModelGeometry: contains unit cell and lattice quantities.
  • U::E: Hubbard interaction.
  • Np::I: total number of particles in the system.
  • pht::Bool: whether or not model is particle-hole transformed.
source
make_measurements!( measurement_container::NamedTuple, 
                    detwf::DeterminantalWavefunction{T, Q, E, I}, 
                    tight_binding_model::TightBindingModel{E}, 
                    model_geometry::ModelGeometry, 
                    U::E,
                    Np::I, 
                    pht::Bool ) where {T<:Number, Q, E<:AbstractFloat, I<:Integer}

Measures simulation observables including the local energy $\langle E_{\mathrm{loc}}\rangle$, average double occupancy $\langle D\rangle$, and average density $\langle n\rangle$. Also records the current particle configuration $|x\rangle$.

  • measurement_container::NamedTuple: container where measurements are stored.
  • detwf::DeterminantalWavefunction{T, Q, E, I}: current determinantal wavefunction.
  • tight_binding_model::TightBindingModel{E}: non-interacting tight-binding model.
  • model_geometry::ModelGeometry: contains unit cell and lattice quantities.
  • U::E: Hubbard interaction.
  • Np::I: total number of particles in the system.
  • pht::Bool: whether or not model is particle-hole transformed.
source
make_measurements!( measurement_container::NamedTuple, 
                    detwf::DeterminantalWavefunction{T, Q, E, I}, 
                    tight_binding_model::TightBindingModel{E}, 
                    jastrow_parameters::JastrowParameters{S, K, V, I},
                    jastrow_factor::JastrowFactor{E}, 
                    model_geometry::ModelGeometry, 
                    U::E,
                    Np::I, 
                    pht::Bool ) where {T<:Number, Q, E<:AbstractFloat, I<:Integer, S<:AbstractString, K, V}

Measures simulation observables including the local energy $\langle E_{\mathrm{loc}}\rangle$, average double occupancy $\langle D\rangle$, and average density $\langle n\rangle$. Also records the current particle configuration $|x\rangle$.

  • measurement_container::NamedTuple: container where measurements are stored.
  • detwf::DeterminantalWavefunction{T, Q, E, I}: current determinantal wavefunction.
  • tight_binding_model::TightBindingModel{E}: non-interacting tight-binding model.
  • jastrow_parameters::JastrowParameters{S, K, V, I}: current set of Jastrow variational parameters.
  • jastrow_factor::JastrowFactor{E}: current Jastrow factor.
  • model_geometry::ModelGeometry: contains unit cell and lattice quantities.
  • U::E: Hubbard interaction.
  • Np::I: total number of particles in the system.
  • pht::Bool: whether or not model is particle-hole transformed.
source
make_measurements!( measurement_container::NamedTuple, 
                    detwf::DeterminantalWavefunction{T, Q, E, I}, 
                    tight_binding_model::TightBindingModel{E}, 
                    jastrow_parameters_1::JastrowParameters{S, K, V, I},
                    jastrow_parameters_2::JastrowParameters{S, K, V, I},
                    jastrow_factor_1::JastrowFactor{E},
                    jastrow_factor_2::JastrowFactor{E}, 
                    model_geometry::ModelGeometry, 
                    U::E,
                    Np::I, 
                    pht::Bool ) where {T<:Number, Q, E<:AbstractFloat, I<:Integer, S<:AbstractString, K, V}

Measures simulation observables including the local energy $\langle E_{\mathrm{loc}}\rangle$, average double occupancy $\langle D\rangle$, and average density $\langle n\rangle$. Also records the current particle configuration $|x\rangle$.

  • measurement_container::NamedTuple: container where measurements are stored.
  • detwf::DeterminantalWavefunction{T, Q, E, I}: current determinantal wavefunction.
  • tight_binding_model::TightBindingModel{E}: non-interacting tight-binding model.
  • jastrow_parameters_1::JastrowParameters{S, K, V, I}: first set of Jastrow variational parameters.
  • jastrow_parameters_2::JastrowParameters{S, K, V, I}: second set of Jastrow variational parameters.
  • jastrow_factor_1::JastrowFactor{E}: first Jastrow factor.
  • jastrow_factor_2::JastrowFactor{E}: second Jastrow factor.
  • model_geometry::ModelGeometry: contains unit cell and lattice quantities.
  • U::E: Hubbard interaction.
  • Np::I: total number of particles in the system.
  • pht::Bool: whether or not model is particle-hole transformed.
source

Internal Methods

VariationalMC.reset_measurements!Function
reset_measurements!( measurements::Dict{S, T}; 
                     in_place::Bool = false ) where {S<:AbstractString, T}

Resets values in the measurement container to zero.

  • measurements::Dict{S, T}: measurement container.
  • in_place::Bool = false: whether to perform in-place update of measurements. Best to set to false to prevent undesired mutation.
source

Write Measurements

VariationalMC.write_measurements!Function
write_measurements!( step::AbstractString
                     bin::I, 
                     bin_size::I,
                     measurement_container::NamedTuple, 
                     simulation_info::SimulationInfo;
                     write_parameters=false ) where {I<:Integer}

Writes simulation and correlation (if measured) measurements in the current bin to file. Files created are in HDF5 format.

  • step::AbstractString: VMC step: opt or sim, optimization or simulation.
  • bin::I: current bin.
  • bin_size::I: size of the current bins.
  • measurement_container::NamedTuple: container where measurements are stored.
  • simulation_info::SimulationInfo: contains datafolder names.
  • write_parameters=false: whether parameters are written to file. Set to true during optimization.

Data in each file can be accessed by doing:

h5open(simfile, "r") do f # list all top-level measurements println(keys(f)) # e.g., ["globaldensity", "double_occ", ...]

# access a specific dataset
data = read(f["/local_energy/bin-1/"])  # returns a Julia array
println(data)

end

for num in 1:Noptbins h5open(opt_file, "r") do f data = read(f["/parameters/bin-num/"]) println(data) end end

source

Internal Methods

VariationalMC.normalize_measurementsFunction
normalize_measurements( data, 
                        bin_size::I, 
                        key::AbstractString )

Normalizes different types of data by the length of a bin.

  • data: data of abstract type.
  • bin_size::I: length of the bin.
  • key::AbstractString: name of measurement.
source

Process Measurements

VariationalMC.process_measurementsFunction
process_measurements( measurement_container::NamedTuple,
                      simulation_info::SimulationInfo,
                      determinantal_parameters::DeterminantalParameters,
                      model_geometry::ModelGeometry )

Processes all simulation and optimization measurements by organinzing them into CSV files.

  • measurement_container::NamedTuple: contains measurement quantities.
  • simulation_info::SimulationInfo: contains all simulation info.
  • determinantal_parameters::DeterminantalParameters: set of determinantal variational parameters.
  • model_geometry::ModelGeometry: contains unit cell and lattice quantities.
source
process_measurements( measurement_container::NamedTuple,
                      simulation_info::SimulationInfo,
                      determinantal_parameters::DeterminantalParameters,
                      jastrow_parameters::JastrowParameters,
                      model_geometry::ModelGeometry )

Processes all simulation and optimization measurements by organinzing them into CSV files.

  • measurement_container::NamedTuple: contains measurement quantities.
  • simulation_info::SimulationInfo: contains all simulation info.
  • determinantal_parameters::DeterminantalParameters: set of determinantal variational parameters.
  • jastrow_parameters::JastrowParameters: set of Jastrow parameters.
  • model_geometry::ModelGeometry: contains unit cell and lattice quantities.
source
process_measurements( measurement_container::NamedTuple,
                      simulation_info::SimulationInfo,
                      determinantal_parameters::DeterminantalParameters,
                      jastrow_parameters_1::JastrowParameters,
                      jastrow_parameters_2::JastrowParameters,
                      model_geometry::ModelGeometry )

Processes all simulation and optimization measurements by organinzing them into CSV files.

  • measurement_container::NamedTuple: contains measurement quantities.
  • simulation_info::SimulationInfo: contains all simulation info.
  • determinantal_parameters::DeterminantalParameters: set of determinantal variational parameters.
  • jastrow_parameters_1::JastrowParameters: first set of Jastrow parameters.
  • jastrow_parameters_2::JastrowParameters: second set of Jastrow parameters.
  • model_geometry::ModelGeometry: contains unit cell and lattice quantities.
source

Internal Methods

VariationalMC.process_scalar_measurementsFunction
process_scalar_measurements( datafolder::T,
                             pID::I,
                             measurement::T;
                             N_bins::Union{I, Nothing}=nothing;
                             bins_to_avg::Union{I, Nothing}=nothing ) where {T<:AbstractString, I<:Integer}

Write binned simulation measurements to CSV.

  • datafolder::T: path to folder where simulation files are written.
  • pID::I: processor ID/MPI rank
  • measurement::T: "localenergy", "doubleocc", "globaldensity", "site-dependentdensity", "pconfig", "localspin-z", or "site-dependentspin-z".
  • N_bins::Union{I, Nothing}=nothing: (optional) total number of bins.
  • bins_to_avg::Union{I, Nothing}=nothing: number of bins to average over when performing jackknife resampling.
source
VariationalMC.process_optimization_measurementsFunction
process_optimization_measurements( datafolder::T,
                                   pID::I,
                                   determinantal_parameters::DeterminantalParameters;
                                   N_bins::Union{I, Nothing}=nothing ) where {T<:AbstractString, I<:Integer}

Writes binned optimization measurements to CSV.

  • datafolder::T: path to folder where simulation files are written.
  • pID::I: processor ID/MPI rank
  • determinantal_parameters::DeterminantalParameters: set of determinantal variational parameters.
  • N_bins::Union{I, Nothing}=nothing: (optional) total number of bins.
source
process_optimization_measurements( datafolder::T,
                                   pID::I,
                                   determinantal_parameters::DeterminantalParameters,
                                   jastrow_parameters::JastrowParameters;
                                   N_bins::Union{I, Nothing}=nothing ) where {T<:AbstractString, I<:Integer}

Writes binned optimization measurements to CSV.

  • datafolder::T: path to folder where simulation files are written.
  • pID::I: processor ID/MPI rank
  • determinantal_parameters::DeterminantalParameters: set of determinantal variational parameters.
  • jastrow_parameters::JastrowParameters: set of Jastrow parameters.
  • N_bins::Union{I, Nothing}=nothing: (optional) total number of bins.
source
process_optimization_measurements( datafolder::T,
                                   pID::I,
                                   determinantal_parameters::DeterminantalParameters,
                                   jastrow_parameters_1::JastrowParameters,
                                   jastrow_parameters_2::JastrowParameters;
                                   N_bins::Union{I, Nothing}=nothing ) where {T<:AbstractString, I<:Integer}

Writes binned optimization measurements to CSV.

  • datafolder::T: path to folder where simulation files are written.
  • pID::I: processor ID/MPI rank
  • determinantal_parameters::DeterminantalParameters: set of determinantal variational parameters.
  • jastrow_parameters_1::JastrowParameters: first set of Jastrow parameters.
  • jastrow_parameters_2::JastrowParameters: second set of Jastrow parameters.
  • N_bins::Union{I, Nothing}=nothing: (optional) total number of bins.
source