pyiron.yaff.yaff module

class pyiron.yaff.yaff.Yaff(project, job_name)[source]

Bases: pyiron.atomistics.job.atomistic.AtomisticGenericJob

calc_md(temperature=None, pressure=None, nsteps=1000, time_step=41.341373336646825, n_print=5, timecon_thermo=4134.137333664683, timecon_baro=41341.37333664682)[source]

Set an MD calculation within Yaff. Nosé Hoover chain is used by default.

Arguments

temperature (None/float): Target temperature. If set to None, an NVE calculation is performed.

It is required when the pressure is set

pressure (None/float): Target pressure. If set to None, an NVE or an NVT calculation is performed. nsteps (int): Number of md steps time_step (float): Step size between two steps. n_print (int): Print frequency timecon_thermo (float): The time associated with the thermostat adjusting the temperature. timecon_baro (float): The time associated with the barostat adjusting the temperature.

calc_minimize(cell=False, gpos_tol=1e-08, dpos_tol=1e-06, grvecs_tol=1e-08, drvecs_tol=1e-06, max_iter=1000, n_print=5)[source]

Set up an optimization calculation.

Arguments

cell (bool): Set True if the cell also has to be optimized gpos_tol (float): Convergence criterion for RMS of gradients towards atomic coordinates dpos_tol (float): Convergence criterion for RMS of differences of atomic coordinates grvecs_tol (float): Convergence criterion for RMS of gradients towards cell parameters drvecs_tol (float): Convergence criterion for RMS of differences of cell parameters max_iter (int): Maximum number of optimization steps n_print (int): Print frequency

calc_static()[source]

Set up a static force field calculation.

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.

detect_ffatypes(ffatypes=None, ffatype_rules=None, ffatype_level=None)[source]

Define atom types by explicitely giving them through the ffatypes keyword, defining atype rules using the ATSELECT language implemented in Yaff (see the Yaff documentation at http://molmod.github.io/yaff/ug_atselect.html) or by specifying the ffatype_level employing the built-in routine in QuickFF.

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

Recreates instance from the hdf5 file :param hdf: Path to the hdf5 file :type hdf: str :param group_name: Name of the group which contains the object :type group_name: str

get_structure(iteration_step=- 1, wrap_atoms=True)[source]

Overwrite the get_structure routine from AtomisticGenericJob because we want to avoid defining a unit cell when one does not exist

get_yaff_ff(system=None)[source]
get_yaff_system(snapshot=0)[source]
load_chk(fn)[source]

Load the atom types, atom type ids and structure by reading a .chk file.

Arguments

fn the path to the chk file

log()[source]
mtd_sum_hills_1d(fn=None)[source]

Creates a fes.dat file for plotting the free energy surface after a mtd simulation.

Arguments

fn path to the hills file or hills files (comma separated)

plot(ykey, xkey='generic/steps', xunit='au', yunit='au', ref=None, linestyle='-', rolling_average=False)[source]
plot_multi(ykeys, xkey='generic/steps', xunit='au', yunit='au', ref=None, linestyle='-', rolling_average=False)[source]
set_mtd(ics, height, sigma, pace, fn='HILLS', fn_colvar='COLVAR', stride=10, temp=300)[source]

Setup a Metadynamics run using PLUMED along the internal coordinates defined in the ICs argument.

Arguments

ics a list of entries defining each internal coordinate. Each

of these entries should be of the form (kind, [i, j, …])

Herein, kind defines the kind of IC as implemented in PLUMED:

i.e. distance, angle, torsion, volume, cell, … see https://www.plumed.org/doc-v2.5/user-doc/html/_colvar.html for more information).

and [i, j, …] is a list of atom indices, starting from 0, involved in this IC. If no atom indices are required for e.g. volume, provide an empty list.

An example for a 1D metadynamica using the distance between atoms 2 and 4:

ics = [(‘distance’, [2,4])]

height the height of the Gaussian hills, can be a single value

(the gaussian hills for each IC have identical height) or a list of values, one for each IC defined.

sigmas the sigma of the Gaussian hills, can be a single value

(the gaussian hills for each IC have identical height) or a list of values, one for each IC defined.

pace the number of steps after which the gaussian hills are

updated.

fn the PLUMED output file for the gaussian hills

fn_colvar

the PLUMED output file for logging of collective variables

stride the number of steps after which the internal coordinate

values and bias are printed to the COLVAR output file.

temp the system temperature

set_us(ics, kappa, loc, fn_colvar='COLVAR', stride=10, temp=300)[source]

Setup an Umbrella sampling run using PLUMED along the internal coordinates defined in the ICs argument.

Arguments

ics a list of entries defining each an internal coordinate. Each

of these entries should be of the form (kind, [i, j, …])

Herein, kind defines the kind of IC as implemented in PLUMED:

i.e. distance, angle, torsion, volume, cell, … see https://www.plumed.org/doc-v2.5/user-doc/html/_colvar.html for more information).

and [i, j, …] is a list of atom indices, starting from 0, involved in this IC. If no atom indices are required for e.g. volume, provide an empty list.

An example for a 1D metadynamica using the distance between atoms 2 and 4:

ics = [(‘distance’, [2,4])]

kappa the value of the force constant of the harmonic bias potential,

can be a single value (the harmonic bias potential for each IC has identical kappa) or a list of values, one for each IC defined.

loc the location of the umbrella

(should have a length equal to the number of ICs)

fn_colvar

the PLUMED output file for logging of collective variables

stride the number of steps after which the internal coordinate

values and bias are printed to the COLVAR output file.

temp the system temperature

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

Store the GenericJob 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.yaff.yaff.YaffInput(input_file_name=None)[source]

Bases: pyiron.base.generic.parameters.GenericParameters

load_default()[source]

Loading the default settings for the input file.

pyiron.yaff.yaff.collect_output(output_file)[source]
pyiron.yaff.yaff.hdf2dict(h5)[source]
pyiron.yaff.yaff.read_colvar(output_file, output_dict)[source]
pyiron.yaff.yaff.write_chk(input_dict, working_directory='.')[source]
pyiron.yaff.yaff.write_pars(input_dict, working_directory='.')[source]
pyiron.yaff.yaff.write_plumed_enhanced(input_dict, working_directory='.')[source]
pyiron.yaff.yaff.write_yhess(input_dict, working_directory='.')[source]
pyiron.yaff.yaff.write_ynpt(input_dict, working_directory='.')[source]
pyiron.yaff.yaff.write_ynve(input_dict, working_directory='.')[source]
pyiron.yaff.yaff.write_ynvt(input_dict, working_directory='.')[source]
pyiron.yaff.yaff.write_yopt(input_dict, working_directory='.')[source]
pyiron.yaff.yaff.write_yopt_cell(input_dict, working_directory='.')[source]
pyiron.yaff.yaff.write_ysp(input_dict, working_directory='.')[source]