The physical model
A KSEModel collects everything that defines what problem is being solved: the nucleus, the number of electrons, and which exchange–correlation approximation stands in for the true electron–electron interaction beyond the (explicit) Hartree term.
AtomicKohnSham.KSEModel — TypeKSEModel(; Z::Real, N::Real, hartree::Real = 1, ex = NoFunctional(1), ec = NoFunctional(1))Structure for storing the parameters of an extended Kohn–Sham model (LDA/LSDA). Encodes physical and modeling parameters for atomic or ionic simulations.
Arguments
Z::Real: Nuclear charge (number of protons).N::Real: Number of electrons.hartree::Real = 1: Scaling factor for the Hartree term:0disables electron-electron repulsion.1uses the full Hartree interaction.
ex: Exchange functional (e.g. a LibxcFunctional, orNoFunctional(nspin)to disable it).ec: Correlation functional (same convention asex).
Exchange–correlation functionals
ex and ec accept any of:
- Libxc.jl functionals, e.g.
Functional(:lda_x; n_spin = 1)for Slater exchange, orFunctional(:lda_c_pw; n_spin = 2)for Perdew–Wang correlation in a spin-polarized (LSDA) calculation. This gives access to the full LDA/LSDA catalog implemented by Libxc. NoFunctional(n_spin), to disable exchange or correlation entirely (e.g. for a reduced Hartree–Fock-like model).- Built-in functionals (
BuiltinFunctional), implemented directly in this package to be run at arbitrary precision (Double64, etc.), which Libxc'sFloat64-only C implementation cannot do. Currently only Slater exchange (:lda_x) is available this way.
ex/ec must agree on the number of spin channels; model.nspin is inferred automatically as max(ex.n_spin, ec.n_spin).
Convenience constructors
For the two most common setups:
AtomicKohnSham.RHF — FunctionRHF(; Z::Real, N::Real)Convenience constructor for the Hartree–Fock model using the extended Kohn–Sham framework.
Creates a KSEModel with the specified nuclear charge Z and number of electrons N, and disables the exchange–correlation.
Arguments
Z::Real: Nuclear charge (e.g., 2.0 for helium).N::Real: Number of electrons.
Returns
KSEModelwith no exchange–correlation and no Hartree term.
AtomicKohnSham.Slater — FunctionSlater(; Z::Real, N::Real)Convenience constructor for an extended Kohn–Sham model with the Slater exchange functional.
Creates a KSEModel with the specified nuclear charge Z and number of electrons N, and uses the Slater exchange-only approximation (no correlation term and no Hartree term).
Arguments
Z::Real: Nuclear charge (e.g., 10.0 for neon).N::Real: Number of electrons.
Returns
KSEModelusing the Slater Xα exchange functional.
Example
The rest of this manual builds up a single running example — the ground state of a spin-unpolarized sodium atom with the Slater exchange functional — one piece per page.
using AtomicKohnSham
using Libxc
model = KSEModel(Z = 11, N = 11, ex = Functional(:lda_x; n_spin = 1), ec = NoFunctional(1))
model.nspin1Continue to Discretization to turn this model into a solvable finite-dimensional problem.