From 33e962054b35aede001ad9a36d04e5e4ef6ea831 Mon Sep 17 00:00:00 2001
From: Michele Nottoli <michele.nottoli@gmail.com>
Date: Fri, 3 Nov 2023 15:19:28 +0100
Subject: [PATCH] Now allowing to guess coefficients.

---
 gext/main.py | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/gext/main.py b/gext/main.py
index 7b4e3e5..1c9e692 100644
--- a/gext/main.py
+++ b/gext/main.py
@@ -94,7 +94,12 @@ class Extrapolator:
         self.overlaps.push(overlap)
 
     def guess(self, coords: np.ndarray, overlap = None) -> np.ndarray:
-        """Get a new electronic density to be used as a guess."""
+        """Get a new electronic density matrix to be used as a guess."""
+        c_guess = self.guess_coefficients(coords, overlap)
+        return c_guess @ c_guess.T
+
+    def guess_coefficients(self, coords: np.ndarray, overlap = None) -> np.ndarray:
+        """Get a new coefficient matrix to be used as a guess."""
 
         if self.options["allow_partially_filled"]:
             n = min(self.options["nsteps"], self.descriptors.count)
@@ -125,7 +130,7 @@ class Extrapolator:
         c_guess = self._grassmann_exp(gamma)
         c_guess = inverse_sqrt_overlap @ c_guess
 
-        return c_guess @ c_guess.T
+        return c_guess
 
     def _get_tangent(self) -> np.ndarray:
         """Get the tangent point."""
-- 
GitLab