Skip to content

Commit

Permalink
Merge pull request #196 from tovrstra/update-iodata-segmented
Browse files Browse the repository at this point in the history
Fix compatibility with changes in IOData (prepare_segmented)
  • Loading branch information
leila-pujal authored Aug 6, 2024
2 parents 3e063ad + 08c8dd8 commit 126f558
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ celerybeat-schedule
*.sage.py

# Environments
.envrc
.env
.venv
env/
Expand Down
10 changes: 6 additions & 4 deletions gbasis/wrappers.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"""Module for interfacing to other quantum chemistry packages."""

from gbasis.contractions import GeneralizedContractionShell
import numpy as np

from gbasis.contractions import GeneralizedContractionShell

CONVENTIONS_LIBCINT = {
(5, "p"): ["s5", "s4", "s3", "s2", "s1", "c0", "c1", "c2", "c3", "c4", "c5"],
Expand Down Expand Up @@ -123,7 +123,9 @@ def from_iodata(mol):
raise ValueError("`mol` must be an IOData instance.")

# GBasis can only work with segmented basis sets.
molbasis = mol.obasis.get_segmented()
from iodata.convert import convert_to_segmented

molbasis = convert_to_segmented(mol.obasis)

cart_conventions = {i[0]: j for i, j in molbasis.conventions.items() if i[1] == "c"}
sph_conventions = {i[0]: j for i, j in molbasis.conventions.items() if i[1] == "p"}
Expand Down Expand Up @@ -187,7 +189,7 @@ def angmom_components_sph(self):
if self.angmom not in sph_conventions:
raise ValueError(
"Given convention does not support spherical contractions for the angular "
"momentum {0}".format(self.angmom)
f"momentum {self.angmom}"
)

return tuple(sph_conventions[self.angmom])
Expand Down Expand Up @@ -228,7 +230,7 @@ def permutation_libcint(self):
if molbasis.primitive_normalization != "L2": # pragma: no cover
raise ValueError(
"Only L2 normalization scheme is supported in `gbasis`. Given `IOData` instance uses "
"primitive normalization scheme, {}".format(molbasis.primitive_normalization)
f"primitive normalization scheme, {molbasis.primitive_normalization}"
)

basis = []
Expand Down

0 comments on commit 126f558

Please sign in to comment.