Code Reference

Public API

PsiTK.AdaptiveRandomizedSVDType
AdaptiveRandomizedSVD <: ΓCompressionStrategy

This 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.

source
PsiTK.CoulombGramianType
CoulombGramian <: ΓCompressionStrategy

This 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.

source
PsiTK.compute_coulomb_vertexMethod
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 DFTK
  • n_bands: number of bands to be considered
source
PsiTK.dump_cc4s_filesFunction
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 DFTK
  • folder: the target folder
  • force: if true existing files will be overwritten
  • auxfield_thresh: threshold (in Hartree) for the compression of the Coulomb vertex
  • Ecut_ratio: factor to reduce the plane wave cutoff
source

Developer Reference (Internals)

PsiTK.compress_coulomb_vertexMethod
compress_coulomb_vertex(ΓmnG::AbstractArray{T,5}; thresh=1e-6, compression_strategy::ΓCompressionStrategy=AdaptiveRandomizedSVD())

Arguments

  • ΓmnG: the Coulomb vertex
  • thresh: eigenvalues of Coulomb Gramian to be considered in Hartree
  • compression_strategy: compression strategy, see ΓCompressionStrategy
source
PsiTK.make_lobpcg_callbackMethod

Default callback function to dump status of the DFTK.LOBPCG function

Arguments

  • thresh: the target threshold for the LOBPCG solver
  • description: a prefix string for the output
source