.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples_generated/tutorials/atomization.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_examples_generated_tutorials_atomization.py: .. _atomization: Atomization energy ================== The following script will calculate the atomization energy of a nitrogen molecule. .. GENERATED FROM PYTHON SOURCE LINES 9-13 .. code-block:: Python from ase import Atoms from ase.calculators.emt import EMT .. GENERATED FROM PYTHON SOURCE LINES 14-17 First, an ``Atoms`` object containing one nitrogen is created and a fast EMT calculator is attached to it simply as an argument. .. GENERATED FROM PYTHON SOURCE LINES 17-21 .. code-block:: Python atom = Atoms('N') atom.calc = EMT() .. GENERATED FROM PYTHON SOURCE LINES 22-25 The total energy for the isolated atom is then calculated and stored in the ``e_atom`` variable. .. GENERATED FROM PYTHON SOURCE LINES 25-28 .. code-block:: Python e_atom = atom.get_potential_energy() .. GENERATED FROM PYTHON SOURCE LINES 29-32 The ``molecule`` object is defined, holding the nitrogen molecule at the experimental bond length ``d=1.1`` Angstrom. .. GENERATED FROM PYTHON SOURCE LINES 32-36 .. code-block:: Python d = 1.1 molecule = Atoms('2N', [(0.0, 0.0, 0.0), (0.0, 0.0, d)]) .. GENERATED FROM PYTHON SOURCE LINES 37-40 The EMT calculator is then attached to the molecule and the total energy is extracted into the ``e_molecule`` variable. .. GENERATED FROM PYTHON SOURCE LINES 40-44 .. code-block:: Python molecule.calc = EMT() e_molecule = molecule.get_potential_energy() .. GENERATED FROM PYTHON SOURCE LINES 45-49 The atomization energy is the energy required to break the bond, meaning that it is the negative energetic difference between the molecule and twice the single atom's energy. .. GENERATED FROM PYTHON SOURCE LINES 49-52 .. code-block:: Python e_atomization = -1.0 * (e_molecule - 2 * e_atom) .. GENERATED FROM PYTHON SOURCE LINES 53-55 Finally we print the relevant energies: .. GENERATED FROM PYTHON SOURCE LINES 55-59 .. code-block:: Python print(f'Nitrogen atom energy: {e_atom:5.2f} eV') print(f'Nitrogen molecule energy: {e_molecule:5.2f} eV') print(f'Atomization energy: {e_atomization:5.2f} eV') .. rst-class:: sphx-glr-script-out .. code-block:: none Nitrogen atom energy: 5.10 eV Nitrogen molecule energy: 0.44 eV Atomization energy: 9.76 eV .. _sphx_glr_download_examples_generated_tutorials_atomization.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: atomization.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: atomization.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: atomization.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_