.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "howtos_generated/howto_optimization/optimize_structure.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_howtos_generated_howto_optimization_optimize_structure.py: .. _howto_optimization_relaxation: Simple structure relaxation =========================== .. GENERATED FROM PYTHON SOURCE LINES 7-8 This is a very simple example of a structure relaxation. .. GENERATED FROM PYTHON SOURCE LINES 8-17 .. code-block:: Python from ase.build import molecule from ase.calculators.emt import EMT from ase.optimize import BFGS atoms = molecule('H2O') atoms.calc = EMT() opt = BFGS(atoms, trajectory='H2O.traj') opt.run(fmax=0.05) .. rst-class:: sphx-glr-script-out .. code-block:: none Step Time Energy fmax BFGS: 0 15:29:31 2.619811 7.738365 BFGS: 1 15:29:31 1.912906 1.345448 BFGS: 2 15:29:31 1.882033 0.403474 BFGS: 3 15:29:31 1.879275 0.031663 np.True_ .. _sphx_glr_download_howtos_generated_howto_optimization_optimize_structure.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: optimize_structure.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: optimize_structure.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: optimize_structure.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_