Update optimizer test docs

parent f6a3a6e7
Pipeline #21452387 passed with stage
in 2 minutes and 43 seconds
......@@ -14,107 +14,23 @@ Different optimizers may perform the same number of steps, but along a different
path, so the time spent on calculation of energy/forces may be different
due to different convergence of the self-consistent field.
PBE relaxation of molecules from the G2 set.
On the plots: the number of optimizer force calls (stats), the total run time,
the systems with the largest number of optimizer force calls, and the number of
systems for which optimization failed.
In the corresponding tables: the most common value of the total energy
("relaxed energy"), and the differences (optimizer - "relaxed energy").
The dot sign denotes the above difference below a threshold
(same as the printed precision of "relaxed energy" in eV),
and "N/A" denotes an optimization failure.
Only the systems that fail to converge or converge to a
total energy above the threshold are given in the tables.
Calculator used: GPAW mode='lcao' (see :git:`~doc/devel/ase_optimize/g2_dzp.py`)
Limit of optimizer steps: 25
.. csv-table::
:file: g2_dzp.csv
:header: optimizer, failed, time, steps
Relaxation of Cu surface.
Calculator used: EMT
.. csv-table::
:file: N2Cu-surf.csv
N2 adsorption on relaxed Ru surface
Calculator used: EMT
.. csv-table::
:file: N2Cu-N2.csv
Bulk relaxation of Cu where atoms has been rattled.
Calculator used: EMT
.. csv-table::
:file: Cu_bulk.csv
CO adsorption on Au
Calculator used: EMT
.. csv-table::
:file: CO_Au111.csv
Geometry optimization of gas-phase molecule.
Calculator used: EMT
.. csv-table::
:file: H2-emt.csv
Calculator used: GPAW
.. csv-table::
:file: H2-gpaw.csv
Geometry optimization of gas-phase molecule.
Calculator used: GPAW (lcao)
.. csv-table::
:file: C5H12-gpaw.csv
Test systems
Adsorption of a NH on a Pd nanoparticle.
Calculator used: GPAW (lcao)
.. csv-table::
:file: nanoparticle.csv
:file: systems.csv
Diffusion of gold atom on Al(100) surface.
Calculator used: EMT
EMT calculations
.. csv-table::
:file: neb-emt.csv
:file: emt.csv
Calculator used: GPAW (lcao)
GPAW-LCAO calculations
.. csv-table::
:file: neb-gpaw.csv
:file: lcao.csv
......@@ -17,6 +17,8 @@ except ImportError:
from urllib.request import urlopen
from urllib.error import HTTPError
import os
from pathlib import Path
srcpath = 'http://wiki.fysik.dtu.dk/gpaw-files'
agtspath = 'http://wiki.fysik.dtu.dk'
......@@ -148,16 +150,15 @@ get('static', ['NOMAD_Logo_supported_by.png'])
def setup(app):
# Get png files and other stuff from the AGTS scripts that run
# Get png and csv files and other stuff from the AGTS scripts that run
# every weekend:
from gpaw.test.big.agts import AGTSQueue
queue = AGTSQueue()
names = set()
for job in queue.jobs:
if not job.creates:
for path in Path().glob('**/*agts.py'):
line1 = path.read_text().split('\n', 1)[0]
if not line1.startswith('# Creates:'):
for name in job.creates:
for name in line1.split(':')[1].split(','):
name = name.strip()
if name in names:
raise RuntimeError(
'The name {0!r} is used in more than one place!'
......@@ -165,8 +166,8 @@ def setup(app):
# the files are saved by the weekly tests under agtspath/agts-files
# now we are copying them back to their original run directories
path = os.path.join(job.dir, name)
if os.path.isfile(path):
file = path.with_name(name)
if file.is_file():
print(path, 'copied from', agtspath)
get('agts-files', [name], job.dir, source=agtspath)
print(file, 'copied from', agtspath)
get('agts-files', [name], str(file.parent), source=agtspath)
# Creates: Al_conv_ecut.png, Al_conv_k.png
import matplotlib.pyplot as plt
from ase.eos import EquationOfState
from ase.io import read
def fit(filename):
configs = read(filename + '@:')
volumes = [a.get_volume() for a in configs]
energies = [a.get_potential_energy() for a in configs]
eos = EquationOfState(volumes, energies)
v0, e0, B = eos.fit()
return (4 * v0)**(1 / 3.0)
cutoffs = range(200, 501, 50)
a = [fit('Al-%d.txt' % ecut) for ecut in cutoffs]
plt.figure(figsize=(6, 4))
plt.plot(cutoffs, a, 'o-')
plt.axis(ymin=4.03, ymax=4.05)
plt.xlabel('Plane-wave cutoff energy [eV]')
plt.ylabel('lattice constant [Ang]')
kpoints = range(4, 17)
plt.figure(figsize=(6, 4))
a = [fit('Al-%02d.txt' % k) for k in kpoints]
plt.plot(kpoints, a, '-')
plt.xlabel('number of k-points')
plt.ylabel('lattice constant [Ang]')
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment