Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

114 add support for pesscan calculations in ams #144

Merged
merged 6 commits into from
Feb 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions src/tcutility/job/ams.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,44 @@ def IRC(self, direction: str = 'both', hess_file: str = None, step_size: float =
self.add_postscript(tcutility.job.postscripts.clean_workdir)
self.add_postscript(tcutility.job.postscripts.write_converged_geoms)

def PESScan(self, distances: list = None, angles: list = None, dihedrals: list = None, sumdists: list = None, difdists: list = None, npoints: int = 10):
'''
Set the task of the job to potential energy surface scan (PESScan).

Args:
distances: sequence of tuples or lists containing ``[atom_index1, atom_index2, start, end]``.
Atom indices start at 1. Distances are given in |angstrom|.
angles: sequence of tuples or lists containing ``[atom_index1, atom_index2, atom_index3, start, end]``.
Atom indices start at 1. Angles are given in degrees
dihedrals: sequence of tuples or lists containing ``[atom_index1, atom_index2, atom_index3, atom_index4, start, end]``.
Atom indices start at 1. Angles are given in degrees
sumdists: sequence of tuples or lists containing ``[atom_index1, atom_index2, atom_index3, atom_index4, start, end]``.
Atom indices start at 1. Sum of distances is given in |angstrom|.
difdists: sequence of tuples or lists containing ``[atom_index1, atom_index2, atom_index3, atom_index4, start, end]``.
Atom indices start at 1. Difference of distances is given in |angstrom|.
npoints: the number of PES points to optimize.

.. note::
Currently we only support generating settings for 1-dimensional PESScans.
We will add support for N-dimensional PESScans later.
'''
self._task = 'PESScan'
self.settings.input.ams.task = 'PESScan'
self.settings.input.ams.PESScan.ScanCoordinate.nPoints = npoints
if distances is not None:
self.settings.input.ams.PESScan.ScanCoordinate.Distance = [" ".join([str(x) for x in dist]) for dist in distances]
if angles is not None:
self.settings.input.ams.PESScan.ScanCoordinate.Angle = [" ".join([str(x) for x in ang]) for ang in angles]
if dihedrals is not None:
self.settings.input.ams.PESScan.ScanCoordinate.Dihedral = [" ".join([str(x) for x in dihedral]) for dihedral in dihedrals]
if sumdists is not None:
self.settings.input.ams.PESScan.ScanCoordinate.SumDist = [" ".join([str(x) for x in dist]) for dist in sumdists]
if difdists is not None:
self.settings.input.ams.PESScan.ScanCoordinate.DifDist = [" ".join([str(x) for x in dist]) for dist in difdists]

self.add_postscript(tcutility.job.postscripts.clean_workdir)
self.add_postscript(tcutility.job.postscripts.write_converged_geoms)

def vibrations(self, enable: bool = True, NegativeFrequenciesTolerance: float = -5):
'''
Set the calculation of vibrational modes.
Expand Down
Loading