Fock builders

Exported functions

ElemCo.FockFactory.ao_J2K! — Method
ao_J2K!(J, Ka, Kb, pm::PMSupermatrices, Dt, Da, Db)

The UHF ao_J2K! from the ± store: the shared Coulomb J (from the total density Dt) and both same-spin exchanges Ka,Kb (from Da,Db) in a single sweep — ao_JK!'s twin, one add_coulomb! + two add_exchange! per ket column. hermitian=true (real, all three densities symmetric) takes the mirror-free fast path (ao_J2K_sym!).

source
ElemCo.FockFactory.ao_JK! — Method
ao_JK!(J, K, pm::PMSupermatrices, Dj, Dk)

The ao_JK! Coulomb/exchange contraction from the persisted ± supermatrix store at half the streaming I/O (each stored element read once, ≈ n⁴/4). One PMStore.pm_slab_sweep! of the store; per ket column, add its Coulomb and exchange contributions. Dj, Dk need not be symmetric. Pass hermitian=true when Dj === Dk is a real symmetric density (HF) to take the mirror-free fast path (ao_JK_sym!, ≈2× fewer GEMVs).

source
ElemCo.FockFactory.gen_density_matrix — Method
gen_density_matrix(EC::ECInfo{T}, CMOl::AbstractMatrix, CMOr::AbstractMatrix, occvec)

Generate $D_{\mu\nu}=C^l_{\mu i} C^r_{\nu i}$ with $i$ defined by occvec. Only real part of $D_{\mu\nu}$ is kept unless T is Complex.

source
ElemCo.FockFactory.gen_df3idx_fock — Method
gen_df3idx_fock(EC::ECInfo, h1::AbstractMatrix, mmL::AbstractArray{<:Number,3}, cMO_occ::AbstractMatrix)

Compute closed-shell Fock matrix from 1e-integrals h1 and MO-basis 3-index integrals mmL using occupied MO coefficients cMO_occ (rotation from original to occupied MOs). Uses symmetric decomposition convention: $v_{pr}^{qs} = \sum_L v_{p}^{qL} v_{r}^{sL}$. Lower index of $v$ transforms with $\bar{C}$ (conjugated), upper index with $C$.

source
ElemCo.FockFactory.gen_df3idx_fock — Method
gen_df3idx_fock(EC::ECInfo, h1::AbstractMatrix, mmL::AbstractArray{<:Number,3}, occ::AbstractVector{Int})

Compute closed-shell Fock matrix from 1e-integrals h1 and MO-basis 3-index integrals mmL. occ contains the indices of the occupied orbitals.

$F_p^q = h_p^q + 2 J_p^q - K_p^q$ with $J_p^q = \sum_L v_p^{qL} c^L$, $c^L = \sum_i v_i^{iL}$ and $K_p^q = \sum_{iL} v_p^{iL} v_i^{qL}$.

source
ElemCo.FockFactory.gen_df3idx_fock — Method
gen_df3idx_fock(EC::ECInfo, h1a, h1b, mmL, MML, cMO_occa::AbstractMatrix, cMO_occb::AbstractMatrix)

Compute UHF Fock matrices from 1e-integrals and MO-basis 3-index integrals using occupied MO coefficients (rotations from original to occupied MOs). Uses symmetric decomposition convention: $v_{pr}^{qs} = \sum_L v_{p}^{qL} v_{r}^{sL}$. Lower index of $v$ transforms with $\bar{C}$ (conjugated), upper index with $C$.

Returns SpinMatrix(Fα, Fβ).

source
ElemCo.FockFactory.gen_df3idx_fock — Method
gen_df3idx_fock(EC::ECInfo, h1a, h1b, mmL, MML, occa, occb)

Compute UHF Fock matrices from 1e-integrals h1a/h1b and MO-basis 3-index integrals mmL (α) and MML (β).

Returns SpinMatrix(Fα, Fβ).

source
ElemCo.FockFactory.gen_dffock — Method
gen_dffock(EC::ECInfo, cMO::AbstractMatrix, cPO::AbstractMatrix)

Compute closed-shell DF-HF Fock matrix and the positron Fock matrix in AO basis (using precalculated Cholesky- decomposed integrals and density matrices).

source
ElemCo.FockFactory.gen_dffock — Method
gen_dffock(EC::ECInfo, cMO::AbstractMatrix)

Compute closed-shell DF-HF Fock matrix in AO basis (using precalculated Cholesky-decomposed integrals).

source
ElemCo.FockFactory.gen_dffock — Method
gen_dffock(EC::ECInfo, cMO::Matrix{Float64}, cPO::Matrix{Float64}, bao, bfit)

Compute closed-shell DF-HF electron and positron Fock matrices (integral direct) in AO basis.

source
ElemCo.FockFactory.gen_dffock — Method
gen_dffock(EC::ECInfo{T}, cMO::SpinMatrix, bao, bfit)

Compute unrestricted DF-HF Fock matrices SpinMatrix(Fα, Fβ) in AO basis (integral direct).

source
ElemCo.FockFactory.gen_dffock — Method
gen_dffock(EC::ECInfo, cMO::MOs)

Compute unrestricted DF-HF Fock matrices [Fα, Fβ] in AO basis (using precalculated Cholesky-decomposed integrals).

source
ElemCo.FockFactory.gen_fock — Method
gen_fock(EC::ECInfo, CMOl::AbstractMatrix, CMOr::AbstractMatrix)

Calculate closed-shell fock matrix from FCIDump integrals and orbitals CMOl, CMOr.

source
ElemCo.FockFactory.gen_fock — Method
gen_fock(EC::ECInfo, den::AbstractMatrix)

Calculate closed-shell fock matrix from FCIDump integrals and density matrix den.

source
ElemCo.FockFactory.gen_fock — Method
gen_fock(EC::ECInfo, ints, h1::AbstractMatrix, CMOl::AbstractMatrix, CMOr::AbstractMatrix)

Closed-shell AO Fock matrix h1 + 2J − K from explicitly given spin-free 2-e integrals ints and orbitals CMOl, CMOr. ints is the persisted ± supermatrix store (PMSupermatrices), the only exact-AO integral representation — ao_JK! contracts it directly (the ± store halves the integral I/O). The contraction is basis-agnostic (physicists' notation), so feeding AO integrals + AO density yields the AO Fock; no dense nao⁴ tensor is formed. nao is taken from the orbitals.

source
ElemCo.FockFactory.gen_fock — Method
gen_fock(EC::ECInfo, spincase::Symbol, den::AbstractMatrix, denOS::AbstractMatrix)

Calculate UHF fock matrix from FCIDump integrals and density matrices den (for spincase) and denOS (opposite spin to spincase).

source
ElemCo.FockFactory.gen_fock — Method
gen_fock(EC::ECInfo, spincase::Symbol, CMOl::AbstractMatrix, CMOr::AbstractMatrix)

Calculate UHF fock matrix from FCIDump integrals for spincase∈{:α,:β} and orbitals CMOl, CMOr and orbitals for the opposite-spin CMOlOS and CMOrOS.

source
ElemCo.FockFactory.gen_frac_density_matrix — Method
gen_frac_density_matrix(EC::ECInfo{T}, CMOl::AbstractMatrix, CMOr::AbstractMatrix, occupation)

Generate $D_{\mu\nu}=C^l_{\mu i} C^r_{\nu i} n_i$ with $n_i$ provided in occupation. Only real part of $D_{\mu\nu}$ is kept unless T is Complex.

source
ElemCo.FockFactory.gen_ufock — Method
gen_ufock(EC::ECInfo, ints, h1::AbstractMatrix, cMOl::SpinMatrix, cMOr::SpinMatrix)

UHF AO Fock matrix from explicitly given spin-free 2-e integrals ints (the ± store; ao_J2K! dispatches) and 1-e integrals h1 (same for both spins). The shared Coulomb term (total density) is built once and both same-spin exchange terms in a single streaming pass; no dense nao⁴ tensor is formed. nao is taken from the orbitals.

source
ElemCo.FockFactory.gen_ufock — Method
gen_ufock(EC::ECInfo, CMOl::SpinMatrix, CMOr::SpinMatrix)

Calculate UHF fock matrix from FCIDump integrals and orbitals cMOl, cMOr with cMOl[1] and cMOr[1] - α-MO transformation coefficients and cMOl[2] and cMOr[2] - β-MO transformation coefficients.

source

Internal functions

ElemCo.FockFactory.add_coulomb! — Method
add_coulomb!(J, s::PMSlab, D)

Add the Coulomb contribution of the slab s (⟨μν|ρσ⟩, ket pair (s.ρ,s.σ)): the native role J[:,ρ] += ⟨··|ρσ⟩·D[:,σ] (+ the ket-swap ⟨··|σρ⟩ = Gᵀ for ρ<σ) and the Hermitian mirror role into the rows J[ρ,:]/J[σ,:]. The simple per-slab routine ao_JK! calls in its eachslab loop.

source
ElemCo.FockFactory.add_exchange! — Method
add_exchange!(K, s::PMSlab, D)

Add the exchange contribution of the slab s. Same two roles as add_coulomb! with the (ρ,σ) output/density roles swapped (and the mirror transpose flag flipped): native K[:,σ] += ⟨··|ρσ⟩·D[:,ρ] (+ Gᵀ for ρ<σ), plus the mirror into rows K[ρ,:]/K[σ,:].

source