Reference
Contents
Index
FastFermionSampling.AHmodelFastFermionSampling.AHmodelFastFermionSampling.GutzwillerFastFermionSampling.LatticeRectangularFastFermionSampling.MCCarlo.init!Carlo.register_evaluablesFastFermionSampling.FFSFastFermionSampling.add_diagonal_term!FastFermionSampling.add_hop!FastFermionSampling.add_hopping_terms!FastFermionSampling.add_hubbard_terms!FastFermionSampling.add_onsite_terms!FastFermionSampling.add_spin_hopping!FastFermionSampling.check_shellFastFermionSampling.classify_termFastFermionSampling.compute_contributionFastFermionSampling.fast_G_updateFastFermionSampling.generate_and_invert_matricesFastFermionSampling.getHmatFastFermionSampling.getOLFastFermionSampling.getOgFastFermionSampling.getxprimeFastFermionSampling.is_occupiedFastFermionSampling.site_occupationFastFermionSampling.tilde_U
FastFermionSampling.AHmodel — Type
Anderson-Hubbard Model
lattice:LatticeRectangular{B}The lattice structuret:Float64Hopping parameterW:Float64Disorder strength, on site energy is sampled fromN(0, W/2)U:Float64On-site interaction strengthNup:IntNumber of up spinsNdown:IntNumber of down spinsomega:Vector{Float64}Random on-site energiesU_up:Matrix{Float64}Unitary matrix for up spinsU_down:Matrix{Float64}Unitary matrix for down spins
FastFermionSampling.AHmodel — Method
AHmodel(lattice::LatticeRectangular{B}, t::Float64, W::Float64, U::Float64, N_up::Int, N_down::Int)Generate Anderson-Hubbard model and get the sampling ensemble
Raise warning if the shell of degenerate eigenstates are not whole-filled
FastFermionSampling.Gutzwiller — Type
Gutzwiller Ansatz
g:Float64Gutzwiller factor
Store the Gutzwiller factor parameter g.
The Gutzwiller factor is defined as $G = \exp(-g/2 \sum_i (n_i - n_{mean})^2)$.
FastFermionSampling.LatticeRectangular — Method
LatticeRectangular(nx::Int, ny::Int, B::Periodic)
LatticeRectangular(nx::Int, ny::Int, B::Open)Generate a rectangular lattice with periodic or open boundary conditions
nx: number of sites in x-directionny: number of sites in y-directionB: boundary condition, eitherPeriodicorOpen
FastFermionSampling.MC — Method
MC(params::AbstractDict)Create a Monte Carlo object
Carlo.init! — Method
Carlo.init!(mc::MC, ctx::MCContext, params::AbstractDict)Initialize the Monte Carlo object params
nx:Intnumber of sites in x directionny:Intnumber of sites in y directionB:AbstractBoundaryboundary condition,PeriodicorOpent:Float64hopping parameterW:Float64disorder strengthU:Float64on-site interaction strengthN_up:Intnumber of up spinsN_down:Intnumber of down spins
Carlo.register_evaluables — Method
$fg$ the gradient of ⟨E_g⟩
Get the gradient of the observable, $f_g = - ∂ ⟨E_g⟩/ ∂ g$.
``math \begin{align} fk &= -2 ℜ[⟨OL(x)^* × (Og(x)- ⟨Og⟩) ⟩ ]\ &= -2 ℜ[⟨OL(x)^* × Og(x) ⟩ - ⟨OL(x)^* ⟩ × ⟨Og⟩ ]\ \end{align} ``
Fisher Scalar
Get the Fisher Matrix of the observable, $S_{k,k'} = ℜ⟨⟨O_k O_{k'}⟩⟩ = ℜ( ⟨O_k O_{k'}⟩ -⟨O_k⟩ ⟨O_{k'}⟩ )$ where $k$ and $k'$ are labels of the parameters of the model.
When ansatz has only one parameter, the Fisher Matrix is a scalar, and the Fisher Information is the inverse of the Fisher Matrix.
Structure Factor in low momentum
$N_q = ⟨⟨n_qn_{-q}⟩⟩_{disorder}- ⟨⟨n_q⟩⟨n_{-q}⟩⟩_{disorder}$
FastFermionSampling.FFS — Method
FFS([rng=default_rng()], ensemble_matrix::AbstractMatrix)Employs the Fast Fermion Sampling Algorithm to sample free fermion states.
Arguments
rng: Random number generator (optional)ensemble_matrix: Matrix of size L×N where:- L is the number of energy states
- N is the number of fermions
- Columns represent single-particle states
Returns
κ: Vector of Int, length L indicating the order in which states were sampled
Throws
ArgumentError: If matrix dimensions are invalid or N ≤ 0LinearAlgebra.SingularException: If null space calculation fails
FastFermionSampling.add_diagonal_term! — Method
Add a diagonal term to the Hamiltonian
FastFermionSampling.add_hop! — Method
Add a single hopping term to the Hamiltonian
FastFermionSampling.add_hopping_terms! — Method
Add hopping terms for both spin species
FastFermionSampling.add_hubbard_terms! — Method
Add Hubbard interaction terms
FastFermionSampling.add_onsite_terms! — Method
Add on-site energy terms
FastFermionSampling.add_spin_hopping! — Method
Add hopping terms for a specific spin
FastFermionSampling.check_shell — Method
check_shell(E::AbstractArray, Nup::Int, ns::Int)Check if the whole degenerate shell of single particle eigenstates are filled.
FastFermionSampling.classify_term — Method
Classify the type of Hamiltonian term based on its key.
FastFermionSampling.compute_contribution — Method
Compute contribution to local energy from a specific term.
FastFermionSampling.fast_G_update — Method
fast_G_update(κup::Vector{Int}, κdown::Vector{Int}, g::Float64; K::Int, l::Int, spin::Spin) -> Float64Compute the Gutzwiller factor ratio for a single electron hop.
The Gutzwiller factor ratio for an electron hopping from site R_l to site K(=R_l' is:
\[\begin{aligned} \frac{G_{new}}{G_{old}} &= \exp(-\frac{g}{2}[(n_K+1 - n_{mean})^2 - (n_K-n_{mean})^2 + (n_{R_l}-1-n_{mean})^2 - (n_{R_l}-n_{mean})^2]) \\ &= \exp(-\frac{g}{2}[(2n_K + 1 - 2n_{mean}) - (2n_{R_l}-1-2n_{mean})]) \\ &= \exp(-g[n_K - n_{R_l} + 1]) \end{aligned}\]
Returns
ratio::Float64: The ratio of new to old Gutzwiller factors
Throws
ArgumentError: If indices are invalid or state not found
FastFermionSampling.generate_and_invert_matrices — Method
generate_and_invert_matrices(model, I; max_retries=10)Attempts to generate stable tilde_U matrices from a model and invert them. Retries the process up to max_retries times if the matrices are singular.
Returns a tuple (U_upinvs, U_downinvs, κup, κdown, tilde_U_up, tilde_U_down) on success. Throws an error if all attempts fail.
FastFermionSampling.getHmat — Method
getHmat(lattice::LatticeRectangular{B}, t::Float64, omega::Vector{Float64}, N_up::Int, N_down::Int)'Get the non-interacting Anderson model Hamiltonian Matrix to construct Slater Determinants
FastFermionSampling.getOL — Method
getOL(mc::MC{B}) -> Float64Compute the local energy $O_L = \frac{⟨x|H|\psi_G⟩}{⟨x|\psi_G⟩}$.
This includes:
- Diagonal terms (on-site energy and Hubbard interaction)
- Up-spin hopping terms
- Down-spin hopping terms
Returns
OL::Float64: The local energy
FastFermionSampling.getOg — Method
getOg(orbitals::AHmodel{B}, conf_up::BitVector, conf_down::BitVector)The local operator to update the variational parameter g $mathcal{O}_k(x)=\frac{\partial \ln \Psi_\alpha(x)}{\partial \alpha_k}$
FastFermionSampling.getxprime — Method
getxprime(orb::AHmodel{B}, κup::Vector{Int}, κdown::Vector{Int})Compute $|x'> = H|x>$ where $H = -t ∑_{<i,j>} c_i^† c_j + U ∑_i n_{i↓} n_{i↑} + ∑_i ω_i n_i$
FastFermionSampling.is_occupied — Method
is_occupied(kappa::Vector{Int}, l::Int) -> BoolCheck if site l is occupied in the kappa configuration vector.
Throws: BoundsError: if l is outside the valid range of kappa
FastFermionSampling.site_occupation — Method
Calculate electron occupation (0 or 1) at a site.
FastFermionSampling.tilde_U — Method
tilde_U(U::AbstractMatrix, kappa::Vector{Int})Creates a tilde matrix by rearranging rows of U according to kappa indices.
Parameters:
U: Source matrix of size (n × m)kappa: Vector of indices where each non-zero value l indicates that row Rl of U should be placed at row l of the output
Returns:
- A matrix of size (m × m) with same element type as U