From b0034d8be0c0fa7e1b3675a08e77b9c1df32dcbc Mon Sep 17 00:00:00 2001 From: Michele Nottoli <michele.nottoli@gmail.com> Date: Thu, 19 Oct 2023 13:41:12 +0200 Subject: [PATCH] Update. --- grext/main.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/grext/main.py b/grext/main.py index 61b1c3f..b2057f1 100644 --- a/grext/main.py +++ b/grext/main.py @@ -4,13 +4,16 @@ from typing import Optional import numpy as np from . import grassmann +from . import fitting from .buffer import CircularBuffer class Extrapolator: """Class for performing Grassmann extrapolations. On initialization it requires the number of electrons, the number of basis functions - and the number of atoms of the molecule.""" + and the number of atoms of the molecule. The number of previous + steps used by the extrapolator is an optional argument with default + value of 10.""" def __init__(self, nelectrons: int, nbasis: int, natoms: int, nsteps: int = 10): @@ -41,6 +44,7 @@ class Extrapolator: def guess(self, coords: np.ndarray, overlap: Optional[np.ndarray]): """Get a new electronic density to be used as a guess.""" + coefficients = fitting.linear() def _crop_coeff(self, coeff) -> np.ndarray: """Crop the coefficient matrix to remove the virtual orbitals.""" @@ -56,13 +60,13 @@ class Extrapolator: """Set the tangent point.""" self.tangent = c - def _grassmann_log(self, coeff: np.ndarray): + def _grassmann_log(self, coeff: np.ndarray) -> np.ndarray: """Map from the manifold to the tangent plane.""" if self.tangent is not None: return grassmann.log(coeff, self.tangent) raise ValueError("Tangent point is not set.") - def _grassmann_exp(self, gamma: np.ndarray): + def _grassmann_exp(self, gamma: np.ndarray) -> np.ndarray: """Map from the tangent plane to the manifold.""" if self.tangent is not None: return grassmann.exp(gamma, self.tangent) -- GitLab