File: run_optimization.py

package info (click to toggle)
votca 2025.1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 132,424 kB
  • sloc: xml: 345,964; cpp: 80,067; python: 15,957; sh: 4,580; perl: 2,169; javascript: 202; makefile: 34
file content (19 lines) | stat: -rwxr-xr-x 440 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/env python3
"""Example to optimize the geometry of CO"""
from pyxtp import xtp
from ase.io import write
from ase.build import molecule
from ase.optimize import QuasiNewton

atoms = molecule('CO')
atoms.rattle()

calc = xtp(nthreads=2)
calc.select_force(energy='singlets', level=0, dynamic=False)
atoms.calc = calc

atoms.get_forces()

dyn = QuasiNewton(atoms, trajectory='test.traj')
dyn.run(fmax=0.01)
write('final.xyz', atoms)