Skip to content

Commit

Permalink
Simplified check for fragpart.mol
Browse files Browse the repository at this point in the history
  • Loading branch information
ShaunWeatherly committed Jan 17, 2025
1 parent b4e2b5a commit 8253907
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions src/quemb/molbe/fragment.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,23 +84,18 @@ def __init__(
if frozen_core:
self.ncore, self.no_core_idx, self.core_list = get_core(self.mol)

if frag_type != "hchain_simple" and self.mol is None:
raise ValueError("Provide pyscf gto.M object in fragpart() and restart!")

# Check type of fragmentation function
if frag_type == "hchain_simple":
# This is an experimental feature.
self.hchain_simple()

elif frag_type == "chain":
if mol is None:
raise ValueError(
"Provide pyscf gto.M object in fragpart() and restart!"
)
self.chain(mol, frozen_core=frozen_core, closed=closed)
self.chain(self.mol, frozen_core=frozen_core, closed=closed)

elif frag_type == "graphgen":
if self.mol is None:
raise ValueError(
"Provide pyscf gto.M object in fragpart() and restart!"
)
fragment_map = graphgen(
mol=self.mol.copy(),
be_type=be_type,
Expand All @@ -120,10 +115,6 @@ def __init__(
self.Nfrag = len(self.fsites)

elif frag_type == "autogen":
if mol is None:
raise ValueError(
"Provide pyscf gto.M object in fragpart() and restart!"
)
fgs = autogen(
mol,
be_type=be_type,
Expand Down

0 comments on commit 8253907

Please sign in to comment.