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

Merge branch 'docs' into 'main'

Documentation and lint.

See merge request !7
parents 8095f62d 18a0b79e
No related branches found
No related tags found
1 merge request!7Documentation and lint.
Pipeline #1968 passed
...@@ -39,7 +39,7 @@ The usage requires only four lines of code: ...@@ -39,7 +39,7 @@ The usage requires only four lines of code:
## Further options ## Further options
The behavior can be finely controlled by passing additional keyword arguments to the The behavior can be finely controlled by passing additional keyword arguments to the
`gext.Extrapolator()` constructor. **Note: many options are not yet implemented.** `gext.Extrapolator()` constructor. **Note:** some options might be implemented in the future.
This is an up to date list of available keyword options: This is an up to date list of available keyword options:
...@@ -58,6 +58,6 @@ Some options can be piped to the fitting modules. ...@@ -58,6 +58,6 @@ Some options can be piped to the fitting modules.
This work is based on these papers: This work is based on these papers:
1. F. Pes, È. Polack, P. Mazzeo, G. Dusson, B. Stamm, and F. Lipparini, “A Quasi Time-Reversible scheme based on density matrix extrapolation on the Grassmann manifold for Born-Oppenheimer Molecular Dynamics.arXiv, 2023. doi: 10.48550/ARXIV.2307.05653. 1. F. Pes, É. Polack, P. Mazzeo, G. Dusson, B. Stamm, and F. Lipparini, “A Quasi Time-Reversible Scheme Based on Density Matrix Extrapolation on the Grassmann Manifold for BornOppenheimer Molecular Dynamics,The Journal of Physical Chemistry Letters, vol. 14, no. 43. American Chemical Society (ACS), pp. 9720–9726, Oct. 25, 2023. doi: 10.1021/acs.jpclett.3c02098.
2. É. Polack, G. Dusson, B. Stamm, and F. Lipparini, “Grassmann Extrapolation of Density Matrices for Born–Oppenheimer Molecular Dynamics,” Journal of Chemical Theory and Computation, vol. 17, no. 11. American Chemical Society (ACS), pp. 6965–6973, Oct. 08, 2021. doi: 10.1021/acs.jctc.1c00751. 2. É. Polack, G. Dusson, B. Stamm, and F. Lipparini, “Grassmann Extrapolation of Density Matrices for Born–Oppenheimer Molecular Dynamics,” Journal of Chemical Theory and Computation, vol. 17, no. 11. American Chemical Society (ACS), pp. 6965–6973, Oct. 08, 2021. doi: 10.1021/acs.jctc.1c00751.
3. É. Polack, A. Mikhalev, G. Dusson, B. Stamm, and F. Lipparini, “An approximation strategy to compute accurate initial density matrices for repeated self-consistent field calculations at different geometries,” Molecular Physics, vol. 118, no. 19–20. Informa UK Limited, p. e1779834, Jun. 22, 2020. doi: 10.1080/00268976.2020.1779834. 3. É. Polack, A. Mikhalev, G. Dusson, B. Stamm, and F. Lipparini, “An approximation strategy to compute accurate initial density matrices for repeated self-consistent field calculations at different geometries,” Molecular Physics, vol. 118, no. 19–20. Informa UK Limited, p. e1779834, Jun. 22, 2020. doi: 10.1080/00268976.2020.1779834.
...@@ -70,7 +70,7 @@ class LeastSquare(AbstractFitting): ...@@ -70,7 +70,7 @@ class LeastSquare(AbstractFitting):
class QuasiTimeReversible(AbstractFitting): class QuasiTimeReversible(AbstractFitting):
"""Quasi time reversible fitting scheme. Not yet implemented.""" """Quasi time reversible fitting scheme."""
supported_options = { supported_options = {
"regularization": 0.0, "regularization": 0.0,
...@@ -85,7 +85,8 @@ class QuasiTimeReversible(AbstractFitting): ...@@ -85,7 +85,8 @@ class QuasiTimeReversible(AbstractFitting):
raise ValueError("Unsupported value for regularization") raise ValueError("Unsupported value for regularization")
def fit(self, vectors: List[np.ndarray], target: np.ndarray): def fit(self, vectors: List[np.ndarray], target: np.ndarray):
"""Time reversible least square minimization fitting.""" """Given a set of vectors and a target return the fitting
coefficients in a quasi time reversible scheme."""
past_target = vectors[0] past_target = vectors[0]
matrix = np.array(vectors[1:]).T matrix = np.array(vectors[1:]).T
......
...@@ -25,7 +25,8 @@ class Extrapolator: ...@@ -25,7 +25,8 @@ class Extrapolator:
def __init__(self, nelectrons: int, nbasis: int, natoms: int, **kwargs): def __init__(self, nelectrons: int, nbasis: int, natoms: int, **kwargs):
if not (type(nelectrons) == int and type(nbasis) == int and type(natoms) == int): if not (isinstance(nelectrons, int) and isinstance(nbasis, int) \
and isinstance(natoms, int)):
raise ValueError("Dimensions are not integers") raise ValueError("Dimensions are not integers")
self.nelectrons = nelectrons self.nelectrons = nelectrons
...@@ -33,11 +34,13 @@ class Extrapolator: ...@@ -33,11 +34,13 @@ class Extrapolator:
self.natoms = natoms self.natoms = natoms
self.set_options(**kwargs) self.set_options(**kwargs)
self.gammas = CircularBuffer(self.options["nsteps"], (self.nelectrons//2, self.nbasis)) self.gammas = CircularBuffer(self.options["nsteps"],
(self.nelectrons//2, self.nbasis))
self.descriptors = CircularBuffer(self.options["nsteps"], self.descriptors = CircularBuffer(self.options["nsteps"],
((self.natoms - 1)*self.natoms//2, )) ((self.natoms - 1)*self.natoms//2, ))
if self.options["store_overlap"]: if self.options["store_overlap"]:
self.overlaps = CircularBuffer(self.options["nsteps"], (self.nbasis, self.nbasis)) self.overlaps = CircularBuffer(self.options["nsteps"],
(self.nbasis, self.nbasis))
self.tangent: Optional[np.ndarray] = None self.tangent: Optional[np.ndarray] = None
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment