aiida_gulp.potentials package

Submodules

aiida_gulp.potentials.base module

class aiida_gulp.potentials.base.PotentialContent(content, number_of_flags, number_flagged)

Bases: tuple

used for returning the content creation for a potential

Parameters
  • content (str) – the potential file content

  • number_of_flags (int) – number of potential flags for fitting

  • number_flagged (int) – number of variables flagged to fit

__getnewargs__()

Return self as a plain tuple. Used by copy and pickle.

static __new__(_cls, content, number_of_flags, number_flagged)

Create new instance of PotentialContent(content, number_of_flags, number_flagged)

__repr__()

Return a nicely formatted representation string

property content

Alias for field number 0

property number_flagged

Alias for field number 2

property number_of_flags

Alias for field number 1

class aiida_gulp.potentials.base.PotentialWriterAbstract[source]

Bases: object

abstract class for creating gulp inter-atomic potential inputs, from a data dictionary.

sub-classes should override the get_description, get_schema, _make_string and read_exising methods

create_content(data, species_filter=None, fitting_data=None)[source]

create string for inter-atomic potential section for main.gin file

Parameters
  • data (dict) – dictionary of data required to create potential

  • species_filter (list[str] or None) – list of atomic symbols to filter by

  • fitting_data (dict or None) – a dictionary specifying which variables to flag for optimisation, of the form; {<type>: {<index>: [variable1, …]}} if None, no flags will be added

Returns

Return type

PotentialContent

classmethod get_description()[source]

return description of the potential type

classmethod get_fitting_schema()[source]

return the schema to validate input data

Returns

Return type

dict

classmethod get_schema()[source]

return the schema to validate input data

Returns

Return type

dict

static read_atom_section(lines, lineno, number_atoms, global_args=None)[source]

read a section of a potential file, e.g.

H core  He shell 1.00000000E+00 2.00000000E+00 12.00000 0 1
H B 3.00000000E+00 4.00000000E+00 0.00 12.00000 1 0
Parameters
  • lines (list[str]) – the lines in the file

  • lineno (int) – the current line number, should be the line below the option line

  • number_atoms (int) – the number of interacting atoms expected

  • global_args (dict) – additional arguments to add to the result of each line

Returns

  • int (lineno) – the final line of the section

  • set (species_set) – a set of species identified in the section

  • dict (results) – {tuple[species]: {“values”: str, “global”: global_args}}

Raises

IOError – If a parsing error occurs

read_exising(lines)[source]

read an existing potential file

NOTE: this should be overriden by the subclass

Parameters

lines (list[str]) –

Returns

the potential data

Return type

dict

Raises

IOError – on parsing failure

aiida_gulp.potentials.common module

aiida_gulp.potentials.common.filter_by_species(data, species)[source]

filter a potential dict by a subset of species

Parameters
  • data (dict) – a potential or fitting dict

  • species (list[str]) – the species to filter by

Returns

data filtered by species and with all species index keys re-indexed

Return type

dict

Raises
  • KeyError – if the data does not adhere to the potential or fitting jsonschema

  • AssertionError – if the filter set is not a subset of the available species

aiida_gulp.potentials.lj module

class aiida_gulp.potentials.lj.PotentialWriterLJ[source]

Bases: aiida_gulp.potentials.base.PotentialWriterAbstract

class for creating gulp lennard-jones type inter-atomic potential inputs

classmethod get_description()[source]

return description of the potential type

read_exising(lines)[source]

read an existing potential file

Parameters

lines (list[str]) –

Returns

the potential data

Return type

dict

Raises

IOError – on parsing failure

aiida_gulp.potentials.raw_reaxff module

aiida_gulp.potentials.raw_reaxff.create_gulp_fields(data, data_type, fields, species_val_fmt, conditions=None, arguments=None, fitting_data=None)[source]

Create a subsection of the gulp output file.

aiida_gulp.potentials.raw_reaxff.format_gulp_value(data, data_type, indices, key, species_val_fmt)[source]

Format values, using GULP specific conversions.

aiida_gulp.potentials.raw_reaxff.format_lammps_value(value)[source]
aiida_gulp.potentials.raw_reaxff.read_lammps_format(lines, tolerances=None)[source]

Read a reaxff file, in lammps format, to a standardised potential dictionary.

Parameters
  • lines (list[str]) –

  • tolerances (dict or None) – tolerances to set, that are not specified in the file.

Returns

Return type

dict

Notes

Default tolerances:

  • anglemin: 0.001

  • angleprod: 0.001

  • hbondmin: 0.01

  • hbonddist: 7.5

  • torsionprod: 1e-05

aiida_gulp.potentials.raw_reaxff.write_gulp_format(data, fitting_data=None, global_val_fmt='{:.5E}', species_val_fmt='{:.5E}')[source]

Write a reaxff file, in GULP format, from a standardised potential dictionary

NOTE: GULP only read a line up to ~80 characters, & can be used to break a line into two lines NOTE GULP outputs to 6 dp

energies should be supplied in kcal (the default of the lammps file format)

aiida_gulp.potentials.raw_reaxff.write_lammps_format(data)[source]

Write a reaxff file, in lammps format, from a standardised potential dictionary.

aiida_gulp.potentials.reaxff module

class aiida_gulp.potentials.reaxff.PotentialWriterReaxff[source]

Bases: aiida_gulp.potentials.base.PotentialWriterAbstract

class for creating gulp reaxff type inter-atomic potential inputs

classmethod get_description()[source]

return description of the potential type

classmethod get_schema()[source]

return the schema to validate input data

Returns

Return type

dict

Module contents