From 652430536fef1e37c530757d55b8f8384e7b4dbf Mon Sep 17 00:00:00 2001 From: "Michael F. Herbst" Date: Thu, 30 Nov 2017 11:40:35 +0100 Subject: [PATCH 1/3] Bugfix: Evaluation of Gaussians not at centre --- src/interface/python/gint/gaussian/_gaussian_shells.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/interface/python/gint/gaussian/_gaussian_shells.py b/src/interface/python/gint/gaussian/_gaussian_shells.py index b9dafe0..f630842 100644 --- a/src/interface/python/gint/gaussian/_gaussian_shells.py +++ b/src/interface/python/gint/gaussian/_gaussian_shells.py @@ -122,7 +122,7 @@ def cartesian_shell(x, y, z, l, centre, coefficient, zeta, ordering): # _shell_expressions.py norm = expr.normalisation_cartesian_gaussians(l, zeta) - if np.all(centre != np.zeros(3)): + if np.any(centre != np.zeros(3)): xs = x - centre[0] ys = y - centre[1] zs = z - centre[2] @@ -194,7 +194,7 @@ def pure_shell(x, y, z, l, centre, coefficient, zeta): if np.min(zeta) <= 0: raise ValueError("All exponents (zeta) need to be larger than zero") - if np.all(centre != np.zeros(3)): + if np.any(centre != np.zeros(3)): xs = x - centre[0] ys = y - centre[1] zs = z - centre[2] From 2600077cb90775973bc1b4c5a0ce8bdcd22d07f1 Mon Sep 17 00:00:00 2001 From: "Michael F. Herbst" Date: Sat, 2 Dec 2017 09:04:48 +0100 Subject: [PATCH 2/3] Extend Structure object to allow empty structures --- src/interface/python/gint/Structure.py | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/src/interface/python/gint/Structure.py b/src/interface/python/gint/Structure.py index d5f2340..062c19d 100644 --- a/src/interface/python/gint/Structure.py +++ b/src/interface/python/gint/Structure.py @@ -26,23 +26,22 @@ class Structure: - def __init__(self, atoms, coords=None): - """Setup a structure object. + def __init__(self, atoms=[], coords=[]): + """Setup a structure object representing the structure of a chemical system. atoms: List of all atoms of the structure. Either symbol or atomic numbers - or names are accepted. + or names of the elements are accepted. coords: List of the coordinates of the involved atoms. If there is only a single atom, then coords may be absent and atoms may be just a single atom number or atom name/symbol. """ - if not isinstance(atoms, (list, tuple, np.ndarray)): - if coords is None: - atoms = [atoms] - else: - raise TypeError("atoms needs to be a list or tuple") + if isinstance(atoms, (int, str)): + atoms = [atoms] + elif not isinstance(atoms, (list, tuple, np.ndarray)): + raise TypeError("atoms needs to be a list or tuple") - if coords is None: + if atoms and not coords: if len(atoms) == 1: coords = [[0, 0, 0]] else: @@ -54,7 +53,8 @@ def __init__(self, atoms, coords=None): self.atom_numbers = np.array(element.to_atom_numbers(atoms)) self.coords = np.array(coords) - if self.coords.shape[1] != 3: + + if coords and self.coords.shape[1] != 3: raise ValueError("The coords list needs to have exactly 3 items per " "coordinate.") @@ -70,4 +70,8 @@ def n_atoms(self): @property def total_charge(self): """Compute the total charge of the atoms in the structure""" - return sum(self.atom_numbers) + return self.atom_numbers.sum() + + @property + def empty(self): + return self.n_atoms == 0 From 37abbfead8325ab69e9cb40311eb67479f3bcdf4 Mon Sep 17 00:00:00 2001 From: "Michael F. Herbst" Date: Sat, 2 Dec 2017 09:05:07 +0100 Subject: [PATCH 3/3] Point to future location gint --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index aafdd7b..693a60f 100644 --- a/README.md +++ b/README.md @@ -90,5 +90,6 @@ Further external dependencies required by `libcint`: - BLAS ### Sturmians: sturmint -Sturmint is currently not released (but this is planned for the near future). +[`sturmint`](https://molsturm.org/sturmint) +is currently not released (but this is planned for the near future). It can be enabled using the option `-DGINT_ENABLE_STURMINT=ON`.