qml.qchem.scf¶
- scf(mol, n_steps=50, tol=1e-08)[source]¶
Return a function that performs the self-consistent-field calculations.
In the Hartree-Fock method, molecular orbitals are typically constructed as a linear combination of atomic orbitals
ϕi(r)=∑μCμiχμ(r),with coefficients Cμi that are initially unknown. The self-consistent-field iterations are performed to find a converged set of molecular orbital coefficients that minimize the total energy of the molecular system. This optimization problem can be reduced to solving a linear system of equations which are usually written as
FC=SCE,where E is a diagonal matrix of eigenvalues, representing the molecular orbital energies, C is the matrix of molecular orbital coefficients, S is the overlap matrix and F is the Fock matrix, which also depends on the coefficients. Fixing an initial guess C0, the corresponding F0 is built and the system F0C0=SC0E is solved to obtain a solution C1. This process is iteratively repeated until the coefficients are converged.
The key step in in this process is constructing the Fock matrix which is defined as
F=H+12J−K,where H, J and K are the core Hamiltonian matrix, Coulomb matrix and exchange matrix, respectively. The entries of H are computed from the electronic kinetic energy and the electron-nuclear attraction integrals, which are integrals over atomic basis functions. The elements of the J and K matrices are obtained from the Coulomb and exchange integrals over the basis functions.
Following the procedure in [Lehtola et al. Molecules 2020, 25, 1218], we express the molecular orbital coefficients in terms of a matrix X as C=X˜C which gives the following transformed equation
˜F˜C=˜S˜CE,where ˜F=XTFX, ˜S=XTSX and S is the overlap matrix. We chose X such that ˜S=1 as
X=VΛ−1/2VT,where V and Λ are the eigenvectors and eigenvalues of S, respectively. This gives the eigenvalue equation
˜F˜C=˜CE,which is solved with conventional methods iteratively.
- Parameters
mol (Molecule) – the molecule object
n_steps (int) – the number of iterations
tol (float) – convergence tolerance
- Returns
function that performs the self-consistent-field calculations
- Return type
function
Example
>>> symbols = ['H', 'H'] >>> geometry = np.array([[0.0, 0.0, 0.0], [0.0, 0.0, 1.0]], requires_grad = False) >>> alpha = np.array([[3.42525091, 0.62391373, 0.1688554], >>> [3.42525091, 0.62391373, 0.1688554]], requires_grad=True) >>> mol = qml.qchem.Molecule(symbols, geometry, alpha=alpha) >>> args = [alpha] >>> v_fock, coeffs, fock_matrix, h_core, rep_tensor = scf(mol)(*args) >>> v_fock array([-0.67578019, 0.94181155])