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

Renamed to gext.

parent 93887ac1
No related branches found
No related tags found
1 merge request!3Renamed to gext.
Pipeline #1945 passed
......@@ -5,7 +5,7 @@ stages:
variables:
PYLINT_CMD: >
(pylint grext --exit-zero > pylint.out) || true
(pylint gext --exit-zero > pylint.out) || true
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
default:
......@@ -35,7 +35,7 @@ lint:
stage: lint
script:
- mkdir -p ./public
- pylint grext --exit-zero | tee pylint.out
- pylint gext --exit-zero | tee pylint.out
- score=$(sed -n 's/^Your code has been rated at \([-0-9.]*\)\/.*/\1/p' pylint.out)
- echo "Pylint score was $score"
- anybadge --value=$score --file=public/pylint_badge.svg pylint
......
![CI_Badge](https://gitlab.mathematik.uni-stuttgart.de/nottolme/grext/badges/main/pipeline.svg)
![Pylint Badge](https://gitlab.mathematik.uni-stuttgart.de/nottolme/grext/-/jobs/artifacts/main/raw/public/pylint_badge.svg?job=lint)
![Coverage Badge](https://gitlab.mathematik.uni-stuttgart.de/nottolme/grext/-/jobs/artifacts/main/raw/public/coverage.svg?job=coverage)
![CI_Badge](https://gitlab.mathematik.uni-stuttgart.de/nottolme/gext/badges/main/pipeline.svg)
![Pylint Badge](https://gitlab.mathematik.uni-stuttgart.de/nottolme/gext/-/jobs/artifacts/main/raw/public/pylint_badge.svg?job=lint)
![Coverage Badge](https://gitlab.mathematik.uni-stuttgart.de/nottolme/gext/-/jobs/artifacts/main/raw/public/coverage.svg?job=coverage)
# grext: Grassmann Extrapolation Library
# gext: Grassmann Extrapolation Library
This library define an `Extrapolator` class to be used for providing guesses in QM simulations. It is designed in such a way that requires minimum modifications on the QM code side.
......@@ -15,10 +15,10 @@ The library can be installed using `pip`:
## Usage
The usage requires only four lines of code:
- Add an import statement `import grext`.
- Add an import statement `import gext`.
- Initialize a new extrapolator by inserting the line:
`extrapolator = grext.Extrapolator(nelectrons, nbasis, natoms)`.
`extrapolator = gext.Extrapolator(nelectrons, nbasis, natoms)`.
**Note:** the extrapolator can be finely controlled by passing additional keyword arguments. This is explained in the next section.
- When a new SCF calculation has been performed, load the resulting data in the extrapolator by running:
......@@ -39,7 +39,7 @@ The usage requires only four lines of code:
## Further options
The behavior can be finely controlled by passing additional keyword arguments to the
`grext.Extrapolator()` constructor. **Note: many options are not yet implemented.**
`gext.Extrapolator()` constructor. **Note: many options are not yet implemented.**
This is an up to date list of available keyword options:
......
"""The package grext provides tools for generating new guesses for the
"""The package gext provides tools for generating new guesses for the
self consistent field in molecular dynamics simulations."""
from .main import Extrapolator
File moved
File moved
File moved
File moved
File moved
from setuptools import setup, find_packages
setup(
name="grext",
name="gext",
version="0.5.0",
packages=find_packages(),
install_requires=["numpy", "scipy"],
......
......@@ -4,7 +4,7 @@ import sys
import numpy as np
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
from grext.buffer import CircularBuffer
from gext.buffer import CircularBuffer
def test_buffer():
......
......@@ -4,10 +4,10 @@ import sys
import numpy as np
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
import grext
import grext.descriptors
import grext.fitting
import grext.grassmann
import gext
import gext.descriptors
import gext.fitting
import gext.grassmann
import utils
SMALL = 1e-10
......@@ -23,7 +23,7 @@ def test_descriptor_fitting(datafile):
nframes = data["trajectory"].shape[0]
# initialize an extrapolator
extrapolator = grext.Extrapolator(nelectrons, nbasis, natoms, nframes)
extrapolator = gext.Extrapolator(nelectrons, nbasis, natoms, nframes)
# load data in the extrapolator
for (coords, coeff, overlap) in zip(data["trajectory"],
......@@ -37,8 +37,8 @@ def test_descriptor_fitting(datafile):
for start in range(0, 9):
vectors = descriptors[start:-1]
fit_coefficients = grext.fitting.linear(vectors, target)
fitted_target = grext.fitting.linear_combination(vectors, fit_coefficients)
fit_coefficients = gext.fitting.linear(vectors, target)
fitted_target = gext.fitting.linear_combination(vectors, fit_coefficients)
errors.append(np.linalg.norm(target - fitted_target, ord=np.inf))
assert errors[0] < errors[-1]
......@@ -47,7 +47,7 @@ def test_descriptor_fitting(datafile):
# used for the fitting
vectors = descriptors[:-1]
vectors[0] = target
fit_coefficients = grext.fitting.linear(vectors, target)
fitted_target = grext.fitting.linear_combination(vectors, fit_coefficients)
fit_coefficients = gext.fitting.linear(vectors, target)
fitted_target = gext.fitting.linear_combination(vectors, fit_coefficients)
assert np.linalg.norm(target - fitted_target, ord=np.inf) < SMALL
......@@ -4,8 +4,8 @@ import sys
import numpy as np
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
import grext
import grext.grassmann
import gext
import gext.grassmann
import utils
SMALL = 1e-10
......@@ -26,7 +26,7 @@ def test_extrapolation(datafile):
assert n < nframes
# initialize an extrapolator
extrapolator = grext.Extrapolator(nelectrons, nbasis, natoms, n)
extrapolator = gext.Extrapolator(nelectrons, nbasis, natoms, n)
# load data in the extrapolator up to index n - 1
for (coords, coeff, overlap) in zip(data["trajectory"][:n],
......
......@@ -4,8 +4,8 @@ import sys
import numpy as np
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
import grext
import grext.grassmann
import gext
import gext.grassmann
import utils
SMALL = 1e-10
......@@ -21,7 +21,7 @@ def test_grassmann(datafile):
nframes = data["trajectory"].shape[0]
# initialize an extrapolator
extrapolator = grext.Extrapolator(nelectrons, nbasis, natoms, nframes)
extrapolator = gext.Extrapolator(nelectrons, nbasis, natoms, nframes)
# load data in the extrapolator
for (coords, coeff, overlap) in zip(data["trajectory"],
......@@ -44,7 +44,7 @@ def test_grassmann(datafile):
assert np.trace(d) - nelectrons < SMALL
# compute the density from the inverse Grassmann map: Exp(Log(D))
coeff_1 = grext.grassmann.exp(gamma, c0)
coeff_1 = gext.grassmann.exp(gamma, c0)
d_1 = coeff_1 @ coeff_1.T
# standard check on the second density
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment