Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
selimsami committed Oct 7, 2024
1 parent f6490dc commit 9254867
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 18 deletions.
29 changes: 15 additions & 14 deletions qforce/molecule/dihedral_terms.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def get_dtype(topo, *args):

for atoms in atoms_comb:
d_type = get_dtype(topo, *atoms)
phi = get_dihed(topo.coords[atoms])[0]
# phi = get_dihed(topo.coords[atoms])[0]
# add_term('rigid', topo, atoms, phi, d_type)
add_term('rigid', topo, atoms, 2., np.pi, d_type+'_mult2')

Expand All @@ -247,13 +247,15 @@ def get_dtype(topo, *args):
for r in topo.rings)]

for atoms in atoms_in_ring:
phi = get_dihed(topo.coords[atoms])[0]
# phi = get_dihed(topo.coords[atoms])[0]
d_type = get_dtype(topo, *atoms)

if abs(phi) < 0.43625: # check planarity < 25 degrees
add_term('rigid', topo, atoms, phi, d_type)
else:
add_term('inversion', topo, atoms, phi, d_type)
add_term('rigid', topo, atoms, 2., np.pi, d_type+'_mult2')

# if abs(phi) < 0.43625: # check planarity < 25 degrees
# add_term('rigid', topo, atoms, 2., np.pi, d_type+'_mult2')
# else:
# add_term('inversion', topo, atoms, phi, d_type)

else:
for atoms in atoms_comb:
Expand Down Expand Up @@ -296,17 +298,16 @@ def get_dtype(topo, *args):
# continue
imp_type = f"ki_{topo.types[i]}"
if abs(phi) < 0.43625: # check planarity < 25 degrees
# add_term('improper', topo, atoms, phi, imp_type)
add_term('improper', topo, [atoms[0], atoms[1], atoms[2], atoms[3]], phi, imp_type)
add_term('improper', topo, [atoms[0], atoms[1], atoms[3], atoms[2]], phi, imp_type)
add_term('improper', topo, [atoms[0], atoms[2], atoms[3], atoms[1]], phi, imp_type)
else:
add_term('inversion', topo, [atoms[0], atoms[1], atoms[2], atoms[3]], phi, imp_type)
add_term('inversion', topo, [atoms[0], atoms[1], atoms[3], atoms[2]], phi, imp_type)
add_term('inversion', topo, [atoms[0], atoms[2], atoms[1], atoms[3]], phi, imp_type)
add_term('inversion', topo, [atoms[0], atoms[2], atoms[3], atoms[1]], phi, imp_type)
add_term('inversion', topo, [atoms[0], atoms[3], atoms[1], atoms[2]], phi, imp_type)
add_term('inversion', topo, [atoms[0], atoms[3], atoms[2], atoms[1]], phi, imp_type)
# else:
# add_term('inversion', topo, [atoms[0], atoms[1], atoms[2], atoms[3]], phi, imp_type)
# add_term('inversion', topo, [atoms[0], atoms[1], atoms[3], atoms[2]], phi, imp_type)
# add_term('inversion', topo, [atoms[0], atoms[2], atoms[1], atoms[3]], phi, imp_type)
# add_term('inversion', topo, [atoms[0], atoms[2], atoms[3], atoms[1]], phi, imp_type)
# add_term('inversion', topo, [atoms[0], atoms[3], atoms[1], atoms[2]], phi, imp_type)
# add_term('inversion', topo, [atoms[0], atoms[3], atoms[2], atoms[1]], phi, imp_type)

# add_term('pitorsion', topo, [1, 0, 3, 2, 4, 5], 0, 'test')
# add_term('pitorsion', topo, [0, 2, 3, 1, 4, 5], 0, 'test')
Expand Down
4 changes: 2 additions & 2 deletions qforce/pathkeeper.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ class Pathways:

pathways = Pathlib({
# folders
'preopt': '0_preopt',
'hessian': '1_hessian',
'preopt': 'crest',
'hessian': 'hessian',
'addstruct': '5_additional',
'hessian_charge': ['hessian', 'charge'],
'hessian_energy': ['hessian', '${idx}_en_conformer'],
Expand Down
7 changes: 5 additions & 2 deletions qforce/qm/crest.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ def from_config(cls, config):
return cls()

def _commands(self, filename, basename, ncores):
return [f'bash {filename} > {filename}.shellout']
print(filename, basename)
return [f'bash {filename} > {basename}.out']


class Crest(QMInterface):
Expand Down Expand Up @@ -169,7 +170,9 @@ def opt(self, file, job_name, settings, coords, atnums):
base, filename = os.path.split(name)
# Given that the xTB input has to be given in the command line.
# We create the xTB command template here.
cmd = f'crest {job_name}_input.xyz {self.config.xtb_command} -T {settings.n_proc} '\
cmd = f'crest {job_name}_input.xyz --chrg {settings.charge} ' \
f'--uhf {settings.multiplicity - 1} ' \
f'{self.config.xtb_command} -T {settings.n_proc} -alpb water\n'
# Write the hessian.inp which is the command line input
file.write(cmd)
# Write the coordinates, which is the standard xyz file.
Expand Down
1 change: 1 addition & 0 deletions qforce/qm/qm.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ def get_hessian(self):
with open(calculation.inputfile, 'w') as file:
self.write_hessian(file, calculation.base, coords, atnums)
hessians.append(calculation)
break

folder = self.pathways.getdir("hessian")
#
Expand Down

0 comments on commit 9254867

Please sign in to comment.