Skip to content
Snippets Groups Projects
Commit b0034d8b authored by Michele Nottoli's avatar Michele Nottoli
Browse files

Update.

parent 76adbf0a
Branches
Tags
No related merge requests found
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment