Code Reference
Public API
PsiTK.AdaptiveRandomizedSVD — Type
AdaptiveRandomizedSVD <: ΓCompressionStrategyThis strategy compresses the Coulomb vertex $\Gamma_{mn}^{G}$ via an adaptive randomized SVD.
The algorithm approximates the range of the row space of $\Gamma$ (the orbital indices are considered as superindex) through a thin basis Q, such that
\[\Gamma \approx \Gamma Q Q^\dagger\]
where $\Gamma$ is a $N_{pp} \times N_G$ and $Q$ a $N_G \times N_F$ matrix. This is done through a stochastic Q and a diagonalization of
\[H = -\tilde \Gamma^\dagger \tilde \Gamma = U \Lambda U^\dagger\]
where $\tilde \Gamma = \Gamma Q$. The compressed $\Gamma$ is then obtained via $\Gamma_\text{compressed} = \tilde \Gamma U$.
The dimension $N_F$ is found by a preceding adaptive range finder. This finder iteratively increases the columns of Q (i.e. $N_F$) in steps of $\sqrt{N_{pp}}$ and stops when the error for a stochastic test vector $\omega$
\[\varepsilon = \frac{ \Vert (1 - QQ^\dagger)\Gamma^\dagger \omega \Vert}{\Vert \omega \Vert}\]
is smaller than thresh/10.
PsiTK.CoulombGramian — Type
CoulombGramian <: ΓCompressionStrategyThis strategy compresses the Coulomb vertex $\Gamma_{mn}^{G}$ through the largest eigenvalues of the Coulomb Gramian
\[H = - \Gamma^\dagger \Gamma = U \Lambda U^\dagger\]
The compressed $\Gamma$ is then obtained via $\Gamma_\text{compressed} = \Gamma U$, where the columns of $U$ are restricted such that $\lambda >$ thresh.
PsiTK.compute_coulomb_vertex — Method
compute_coulomb_vertex(
scfres::NamedTuple;
n_bands=scfres.n_bands_converge
)Compute the Coulomb vertex
\[Γ_{mn \bm G} = \int_Ω \; \sqrt{v(\bm G)} \; \psi_{m}(\bm r)^∗ \psi_{n}(\bm r) \; e^{-i\bm r \bm G} \; d^3 r\]
where $v(\bm G)$ is the Coulomb potential, e.g.
\[v(\bm G) = \sqrt{\frac{4π}{\bm G^2}}\]
Arguments
scfres: the self-consistent field solution from DFTKn_bands: number of bands to be considered
PsiTK.dump_cc4s_files — Function
dump_cc4s_files(
scfres::NamedTuple,
folder::AbstractString=joinpath(pwd(), "cc4s");
force=false,
auxfield_thresh=1e-6,
Ecut_ratio=2/3
)Write Cc4s input files (*.yaml and *.elements):
- EigenEnergies
- CoulombVertex
Arguments
scfres: the SCF result from DFTKfolder: the target folderforce: if true existing files will be overwrittenauxfield_thresh: threshold (in Hartree) for the compression of the Coulomb vertexEcut_ratio: factor to reduce the plane wave cutoff
Developer Reference (Internals)
PsiTK.ΓCompressionStrategy — Type
ΓCompressionStrategyAbstract type for different strategies of compressing the Coulomb vertex $\Gamma_{nm}^G$.
Available models:
CoulombGramianAdaptiveRandomizedSVD(default)
PsiTK.chain_callbacks — Method
Combines multiple callbacks into one.
PsiTK.compress_coulomb_vertex — Method
compress_coulomb_vertex(ΓmnG::AbstractArray{T,5}; thresh=1e-6, compression_strategy::ΓCompressionStrategy=AdaptiveRandomizedSVD())Arguments
ΓmnG: the Coulomb vertexthresh: eigenvalues of Coulomb Gramian to be considered in Hartreecompression_strategy: compression strategy, seeΓCompressionStrategy
PsiTK.make_lobpcg_callback — Method
Default callback function to dump status of the DFTK.LOBPCG function
Arguments
thresh: the target threshold for the LOBPCG solverdescription: a prefix string for the output