pyiron.interactive.scipy_minimizer module

class pyiron.interactive.scipy_minimizer.Input(*args, **kwargs)[source]

Bases: pyiron_base.generic.inputlist.InputList

Parameters
  • minimizer (str) – minimizer to use (currently only ‘CG’ and ‘BFGS’ run reliably)

  • ionic_steps (int) – max number of steps

  • ionic_force_tolerance (float) – maximum force tolerance

class pyiron.interactive.scipy_minimizer.ScipyMinimizer(project, job_name)[source]

Bases: pyiron.atomistics.job.interactivewrapper.InteractiveWrapper

Structure optimization class based on Scipy minimizers.

Example I:

# Position optimization >>> pr = Project(‘position’) >>> job = pr.create_job(‘SomeAtomisticJob’, ‘atomistic’) >>> job.structure = pr.create_structure(‘Al’, ‘fcc’, 4.) >>> # it works also in the static mode, but interactive is recommended >>> job.server.run_mode.interactive = True >>> minim = pr.create_job(‘ScipyMinimizer’, ‘scipy’) >>> minim.ref_job = job >>> minim.run()

Example II:

# Volume optimization: >>> pr = Project(‘volume’) >>> job = pr.create_job(‘SomeAtomisticJob’, ‘atomistic’) >>> job.structure = pr.create_structure(‘Al’, ‘fcc’, 4.) >>> # it works also in the static mode, but interactive is recommended >>> job.server.run_mode.interactive = True >>> minim = pr.create_job(‘ScipyMinimizer’, ‘scipy’) >>> minim.ref_job = job >>> minim.calc_minimize(pressure=0, volume_only=True) >>> minim.run()

By setting volume_only, positions are not updated, so that only the pressures are minimized.

It is possible to optimize both the volume and the positions, but since changing the cell also changes the definition of coordinates, it is a mathematically ill-defined problem and therefore it might end up in a physically undefined state. For this reason, it is strongly recommended to launch several jobs using the Murnaghan class (cf. Murnaghan).

In order to perform volume optimization, the child job must have 3x3-pressure output.

calc_minimize(max_iter=100, pressure=None, algorithm='CG', ionic_energy_tolerance=0, ionic_force_tolerance=0.01, pressure_tolerance=0.001, volume_only=False)[source]
Parameters
  • algorithm (str) – scipy algorithm (currently only ‘CG’ and ‘BFGS’ run reliably)

  • pressure (float/list/numpy.ndarray) – target pressures

  • max_iter (int) – maximum number of iterations

  • ionic_energy_tolerance (float) – convergence goal in terms of energy (optional)

  • ionic_force_tolerance (float) – convergence goal in terms of forces (optional)

  • volume_only (bool) – Only pressure minimization

check_convergence()[source]
collect_output()[source]

Collect the output files of the external executable and store the information in the HDF5 file. This method has to be implemented in the individual hamiltonians.

run_static()[source]

The run static function is called by run to execute the simulation.

set_input_to_read_only()[source]

This function enforces read-only mode for the input classes, but it has to be implement in the individual classes.

to_hdf(hdf=None, group_name=None)[source]

Store the InteractiveWrapper in an HDF5 file

Parameters
  • hdf (ProjectHDFio) – HDF5 group object - optional

  • group_name (str) – HDF5 subgroup name - optional

write_input()[source]

Write the input files for the external executable. This method has to be implemented in the individual hamiltonians.

class pyiron.interactive.scipy_minimizer.ScipyMinimizerOutput(job)[source]

Bases: pyiron.atomistics.job.interactive.GenericInteractiveOutput

to_hdf(hdf, group_name='output')[source]