Skip to content

Commit

Permalink
Merge pull request #297 from TheoChem-VU/densfjob-improvements
Browse files Browse the repository at this point in the history
Improvements related to `DensfJob`
  • Loading branch information
YHordijk authored Aug 23, 2024
2 parents 5940b8e + 2d38bfe commit 3398526
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/tcutility/job/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from . import postscripts # noqa: F401
from .generic import Job # noqa: F401
from .ams import AMSJob # noqa: F401
from .adf import ADFJob, ADFFragmentJob # noqa: F401
from .adf import ADFJob, ADFFragmentJob, DensfJob # noqa: F401
from .dftb import DFTBJob # noqa: F401
from .crest import CRESTJob, QCGJob # noqa: F401
from .xtb import XTBJob # noqa: F401
Expand Down
14 changes: 8 additions & 6 deletions src/tcutility/job/adf.py
Original file line number Diff line number Diff line change
Expand Up @@ -525,9 +525,9 @@ def orbital(self, orbital: 'pyfmo.orbitals.sfo.SFO' or 'pyfmo.orbitals.mo.MO'):
'''
import pyfmo

if isinstance(orbital, pyfmo.orbitals.sfo.SFO):
if isinstance(orbital, (pyfmo.orbitals.sfo.SFO, pyfmo.orbitals2.objects.SFO)):
self._sfos.append(orbital)
elif isinstance(orbital, pyfmo.orbitals.mo.MO):
elif isinstance(orbital, (pyfmo.orbitals.mo.MO, pyfmo.orbitals2.objects.MO)):
self._mos.append(orbital)
else:
raise ValueError(f'Unknown object {orbital} of type{type(orbital)}. It should be a pyfmo.orbitals.sfo.SFO or pyfmo.orbitals.mos.MO object.')
Expand All @@ -552,7 +552,7 @@ def _setup_job(self):
if len(self._mos) > 0:
inpf.write('Orbitals SCF\n')
for orb in self._mos:
inpf.write(f' {orb.symmetry} {orb.index}\n')
inpf.write(f' {orb.symmetry} {orb.index_in_symlabel + 1}\n')
inpf.write('END\n')

if len(self._sfos) > 0:
Expand Down Expand Up @@ -582,11 +582,13 @@ def output_cub_paths(self):
cuboutput = f'{os.path.split(self.settings.ADFFile)[0]}/{self.settings.grid}'

for mo in self._mos:
paths.append(f'{cuboutput}%SCF_{mo.symmetry}%{mo.index}.cub')
spin_part = '' if mo.spin == 'AB' else f'_{mo.spin}'
paths.append(f'{cuboutput}%SCF_{mo.symmetry}{spin_part}%{mo.index_in_symlabel + 1}.cub')

for sfo in self._sfos:
paths.append(f'{cuboutput}%SFO_{sfo.symmetry}%{sfo.index}.cub')

spin_part = '' if sfo.spin == 'AB' else f'_{sfo.spin}'
paths.append(f'{cuboutput}%SFO_{sfo.symmetry}{spin_part}%{sfo.index}.cub')
print(paths)
return paths

def can_skip(self):
Expand Down

0 comments on commit 3398526

Please sign in to comment.