Skip to content
This repository has been archived by the owner on Sep 24, 2024. It is now read-only.

Commit

Permalink
add minimise doc
Browse files Browse the repository at this point in the history
  • Loading branch information
hatemhelal committed Apr 23, 2024
1 parent b4f3744 commit cc51830
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion mess/hamiltonian.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright (c) 2024 Graphcore Ltd. All rights reserved.
from typing import Tuple
import equinox as eqx
import jax
import jax.numpy as jnp
Expand Down Expand Up @@ -191,7 +192,19 @@ def orthonormalise(self, Z: FloatNxN) -> FloatNxN:


@jax.jit
def minimise(H: Hamiltonian):
def minimise(H: Hamiltonian) -> Tuple[ScalarLike, FloatNxN, optx.Solution]:
"""Solve for the electronic coefficients that minimise the total energy
Args:
H (Hamiltonian): the Hamiltonian for the given basis set and molecular structure
Returns:
Tuple[ScalarLike, FloatNxN, optimistix.Solution]: Tuple with elements:
- total energy in atomic units
- coefficient matrix C that minimises the Hamiltonian
- the optimistix.Solution object
"""

def f(Z, _):
C = H.orthonormalise(Z)
P = H.basis.density_matrix(C)
Expand Down

0 comments on commit cc51830

Please sign in to comment.