User:Tamcd00dle/sandbox

 

KSSOLV is a MATLAB toolbox for solving a class of nonlinear eigenvalue problems known as the Kohn-Sham equations. Developed by Chao Yang and Juan C. Meza from the Lawrence Berkeley National Laboratory, KSSOLV is designed using the objected oriented programming features available in MATLAB. It allows users to assemble an atomistic system and facilitates development and comparison of new numerical methods for solving the Kohn-Sham equations.

Background Information
Solving the Kohn-Sham equations is a problem that arises from electronic structure calculation, used to study the microscopic quantum mechanical properties of molecules, solids and other nanoscale materials. Through the density functional theory (DFT) formalism, the many-body Schrödinger equation can be reduced to a set of single-electron equations with fewer degrees of freedom.

The Kohn-Sham equations have the form

$$ H(\rho) \psi_i = \lambda_i \psi_i, \ \ i = 1, 2, ..., n_e, $$

where $$ n_e $$ is the number of electrons in the system,

$$ \{\psi_i(r)\} $$ ($$i = 1,2,..., n_e $$) is a set of single electron wavefunctions that are mutually orthonormal, $$ \rho(r) $$ is the total electron charge defined by

$$ \rho(r) = \sum_{i=1}^{n_e} | \psi_i(r) |^2, $$

and

$$ \lambda_1 \leq \lambda_2 \leq ... \leq \lambda_{n_e} $$

are the $$ n_e $$ smallest eigenvalues of $$ H(\rho) $$, a linear operator that depends on $$ \rho $$. The operator $$ H $$ is known as the Kohn-Sham Hamiltonian and defined by

$$ H(\rho) = -\frac{1}{2}\Delta + V_{ion}(r) + \rho \star \frac{1}{|r|} + V_{xc}(\rho), $$

where $$ \Delta $$ is the Laplacian operator, $$ V_{ion} $$ and $$ V_{xc} $$ are known as the ionic and exchange-correlation potentials respectively, and $$ \star $$ denotes the convolution operator.

The Kohn-Sham equations are the the Euler-Lagrange equations for the total energy minimization problem

$$ \min E_{total}^{KS}(\psi_i) $$

$$ \mbox{s.t.} $$  $$ \psi_i^{\ast}\psi_j = \delta_{i,j}, $$

where

$$ E_{total}^{KS} = \frac{1}{2}\sum_{i=1}^{n_e} \int_{\Omega} +\frac{1}{2}\int_{\Omega} \int_{\Omega} \frac{\rho(r_1)\rho(r_2)}{|r_1 - r_2|} dr_1 dr_2 + E_{xc}(\rho), $$
 * \nabla \psi_i|^2 dr + \int_{\Omega}\rho V_{ion} dr

$$ E_{xc}(\rho) $$ is the exchange-correlation energy.

The Kohn-Sham equations are different from the standard linear eigenvalue problem in that the matrix operators are functions of the eigenvectors to be computed. Due to this nonlinear coupling between the matrix operator and its eigenvector, the Kohn-Sham equations are more difficult to solve. Currently, the most widely used numerical method for solving the this type of problem is the Self Consistent Field (SCF) iteration. An alternative approach is designed to minimize the total energy directly. Both methods have been implemented in KSSOLV to allow users to compute the solution to the Kohn-Sham equations associated with various molecules and solids.

Several classes are created in KSSOLV to define both physical objects such as atoms and molecules and mathematical entities such as wavefunctions and Hamiltonians. These classes are defined in a hierarchical fashion so that a molecule object can be constructed from atom objects.

Setup
KSSOLV is built around the MATLAB language. The environmental variable KSSOLVPATH should be defined prior to running KSSOLV.

Test Problems
KSSOLV contains a number of test problems designed for experimentation:

Molecular Systems
A molecular system is defined by creating an Molecule object, using

Properties of this object are specified using the set method associated with the object. For example,

Atoms can be specified by their chemical symbols or atomic numbers; for example, the silicon atom can be defined by or

The position of each atom in the atom list is specified by an na× 3 array; the ith row of this array gives the $$x,y,z$$ coordinates of the ith atom in the atom list. The unit of the coordinates should be in Bohr (1 Bohr = 0.5291772083 Angstrom).

Alternatively, the relative position of each atom in a unit (super)cell (of a periodic lattice) can first be specified by three lattice vectors c1, c2, and c3. If the relative displacement of the atom along ci is denoted by $$\xi_i$$, then the absolute $$x,y,z$$ coordinates of the atom correspond to the three components of the row vector

$$ r = \xi_1 \mathbf{c}_1^T + \xi_2 \mathbf{c}_2^T +  \xi_3 \mathbf{c}_3^T = (\xi_1 \xi_2 \xi_3) C $$,

where $$ C = \left( \begin{array}{c} \mathbf{c}_1^T \\ \mathbf{c}_2^T \\ \mathbf{c}_3^T \\ \end{array} \right) $$. The 3 × 3 matrix C defines a unit supercell in KSSOLV. It can be used to set the  'supercell'  attribute of a Molecule object. For example, sets the unit supercell of mol to a 10×10×10 cube.

In order to discretize the Kohn-Sham equations with an appropriate number of planewave basis functions, a kinetic energy cutoff Ecut must be specified through where cutoff value is a user-supplied number in the unit of Rydberg (Ryd).

The Silane molecule might be set up as follows:

Solving the Kohn-Sham Equations
Once an Molecule object is properly set up, computing the electron wavefunctions associated with the minimum total energy of the molecular system can be performed in KSSOLV by calling one of the available functions.

Visualization
The electron charge density, total potential and single particle wavefunctions can be visualized using either the MATLAB’s isosurface rendering function isosurface or the volume rendering function written by Joe Conti (see External Links), which is also included in KSSOLV.