aiida_gulp.parsers.raw package

Submodules

aiida_gulp.parsers.raw.parse_output_common module

Common parsing functions for GULP output files.

aiida_gulp.parsers.raw.parse_output_common.read_energy_components(lines, lineno)[source]

read the ‘components of energy’ section of a GULP stdout file

If a primitive cell is supplied:

Components of energy:

--------------------------------------------------------------------------------
Interatomic potentials     =          35.51766004 eV
Monopole - monopole (real) =        -115.57703545 eV
Monopole - monopole (recip)=        -163.05984388 eV
Monopole - monopole (total)=        -278.63687932 eV
--------------------------------------------------------------------------------
Total lattice energy       =        -243.11921928 eV
--------------------------------------------------------------------------------
Total lattice energy       =          -23457.2882 kJ/(mole unit cells)
--------------------------------------------------------------------------------

If a non-primitive cell is supplied:

--------------------------------------------------------------------------------
Interatomic potentials     =          59.49169464 eV
Monopole - monopole (real) =         -65.58576691 eV
Monopole - monopole (recip)=        -309.07920869 eV
Monopole - monopole (total)=        -374.66497560 eV
--------------------------------------------------------------------------------
Total lattice energy :
    Primitive unit cell      =        -315.17328096 eV
    Non-primitive unit cell  =        -945.51984289 eV
--------------------------------------------------------------------------------
Total lattice energy (in kJmol-1):
    Primitive unit cell      =          -30409.4037 kJ/(mole unit cells)
    Non-primitive unit cell  =          -91228.2112 kJ/(mole unit cells)
--------------------------------------------------------------------------------
Parameters
aiida_gulp.parsers.raw.parse_output_common.read_gulp_table(lines, lineno, field_names, field_conversions, star_to_none=True)[source]

Read tables of the format:

--------------------------------------------------------------------------------
    Configuration           Energy (eV)        Scale Factor
--------------------------------------------------------------------------------
            1                1.00000                 1.000
            2                1.00000                 1.000
            3                1.00000                 1.000
--------------------------------------------------------------------------------
Parameters
  • lines (list[str]) –

  • lineno (int) –

  • field_names (list[str]) –

  • field_conversions (list) – a list of functions for converting each expected field, e.g. [int, float, float]

  • star_to_none (bool) – See notes below, if a value has been replaced with *** then convert it to None

Returns

  • int (lineno)

  • values (dict)

Notes

Sometimes values can be output as *’s (presumably if they are too large)

    Observable no.  Type            Observable   Calculated    Residual  Error(%)
--------------------------------------------------------------------------------
            1        Energy        -90425.39915 ************ ************ -127.948
aiida_gulp.parsers.raw.parse_output_common.read_reaxff_econtribs(lines, lineno)[source]

read the ‘ReaxFF : Energy contributions: ‘ section of a GULP stdout file

E(bond)     =     -78.23660866 eV =    -1804.1674905 kcal
E(bpen)     =       0.00000000 eV =        0.0000000 kcal
E(lonepair) =       1.21399347 eV =       27.9951750 kcal
E(over)     =      12.78993990 eV =      294.9411301 kcal
E(under)    =       0.00000000 eV =        0.0000000 kcal
E(val)      =      16.66895737 eV =      384.3928245 kcal
E(pen)      =       0.00000000 eV =        0.0000000 kcal
E(coa)      =       0.00000000 eV =        0.0000000 kcal
E(tors)     =       2.35487488 eV =       54.3043568 kcal
E(conj)     =       0.00000000 eV =        0.0000000 kcal
E(hb)       =       0.00000000 eV =        0.0000000 kcal
E(vdw)      =       6.41369507 eV =      147.9023739 kcal
E(coulomb)  =      -3.34422152 eV =      -77.1190860 kcal
E(self)     =      -0.10608718 eV =       -2.4464129 kcal
Parameters
  • lines (list[str]) –

  • lineno (int) – should be the line below ‘ReaxFF : Energy contributions: ‘

aiida_gulp.parsers.raw.parse_output_fit module

aiida_gulp.parsers.raw.parse_output_fit.assess_species(value)[source]

some table finish with ‘Parameter Type’ ‘Species’, Species can be either:

  • 0 for ‘Energy shift’

  • blank (for global variables)

  • <i> <j> for species specific

aiida_gulp.parsers.raw.parse_output_fit.assign_exit_code(fit_succeeded, gulp_errors, parser_errors)[source]

given the error messages, assign an exit code

aiida_gulp.parsers.raw.parse_output_fit.parse_file(file_obj, parser_class=None)[source]

parse a file resulting from a GULP fit run

aiida_gulp.parsers.raw.parse_output_std module

parse the main.gout file of a GULP run and create the required output nodes

aiida_gulp.parsers.raw.parse_output_std.assign_exit_code(opt_succeeded, gulp_errors, parser_errors, single_point_only)[source]

given the error messages, assign an exit code

aiida_gulp.parsers.raw.parse_output_std.parse_file(file_obj, parser_class=None, single_point_only=False)[source]

parse a file resulting from a GULP single energy or optimise run, where one structure (configuration) has been supplied

aiida_gulp.parsers.raw.write_geometry module

aiida_gulp.parsers.raw.write_geometry.create_1d_geometry(lines, atoms)[source]

create 1D (polymer) geometry lines

aiida_gulp.parsers.raw.write_geometry.create_geometry_lines(structure_data, symmetry_data=None, name='main-geometry')[source]

Create list of lines for geometry section of .gin.

Parameters
  • structure_data (aiida.StructureData or dict or ase.Atoms) – dict with keys: ‘pbc’, ‘atomic_numbers’, ‘ccoords’, ‘lattice’, or ase.Atoms, or any object that has method structure_data.get_ase()

  • symmetry_data (dict or None) – keys; ‘operations’, ‘basis’, ‘crystal_type_name’/’hall_number’

  • name (str) – name to assign geometry

Returns

Return type

list[str]

aiida_gulp.parsers.raw.write_geometry.validate_1d_geometry(structure)[source]

validate a 1-d structure

aiida_gulp.parsers.raw.write_input module

class aiida_gulp.parsers.raw.write_input.InputCreationBase(outputs=None)[source]

Bases: object

a base class for creating a main.gin input file for GULP. Sub-classes can override the methods: validate_parameters, get_input_keywords, get_input_keywords

create a main.gin input file for GULP

Parameters

outputs (dict or None) – mapping of type of output to filename, e.g. {“cif”: “output.cif”}

create_content(structure, potential_lines, parameters=None, symmetry=None)[source]

create main input content for gulp.in

Parameters
Returns

file content

Return type

list[str]

get_content()[source]
get_content_hash()[source]

get md5 hex hash of content

get_content_lines()[source]
static get_geometry_lines(structure_data, symmetry_data=None)[source]

create list of lines for geometry section of .gin

Parameters
  • structure_data (aiida.StructureData or dict or ase.Atoms) – dict with keys: ‘pbc’, ‘atomic_numbers’, ‘ccoords’, ‘lattice’, or ase.Atoms, or any object that has method structure_data.get_ase()

  • symmetry_data (dict or None) – keys; ‘operations’, ‘basis’, ‘crystal_type_name’/’hall_number’

Returns

Return type

list[str]

get_input_keywords(parameters)[source]

return list of keywords for header, e.g.

‘verb’: verbose detail, including energy contributions ‘operators’: prints out symmetry operations ‘prop’: print properties, incl bulk/shear modulus, dielectric ‘linmin’: print details of minimisation ‘comp’: print intital/final geometry comparison

Parameters

parameters (dict) – the paramaters dict

Returns

list of keywords

Return type

list[str]

get_other_option_lines(parameters)[source]

get list of other option lines for .gin

Parameters

parameters (dict) – additional parameter data

Returns

Return type

list[str]

validate_parameters(parameters)[source]

validate the parameters dict, supplied to create_content

Parameters

parameters (dict) – the paramaters dict

Returns

True if validation is successful

Return type

bool

write_content(file_like)[source]

write the content to file_like object (path string or object with write method)

class aiida_gulp.parsers.raw.write_input.InputCreationOpt(outputs=None)[source]

Bases: aiida_gulp.parsers.raw.write_input.InputCreationBase

create a main.gin input file for GULP

Parameters

outputs (dict or None) – mapping of type of output to filename, e.g. {“cif”: “output.cif”}

get_input_keywords(parameters)[source]

return list of keywords for header, e.g.

‘verb’: verbose detail, including energy contributions ‘operators’: prints out symmetry operations ‘prop’: print properties, incl bulk/shear modulus, dielectric ‘linmin’: print details of minimisation ‘comp’: print intital/final geometry comparison

Parameters

parameters (dict) – the paramaters dict

Returns

list of keywords

Return type

list[str]

get_other_option_lines(parameters)[source]

get list of other option lines for .gin

Parameters

parameters (dict) – additional parameter data

Returns

Return type

list[str]

validate_parameters(parameters)[source]

validate the parameters dict, supplied to create_content

Parameters

parameters (dict) – the paramaters dict

Returns

True if validation is successful

Return type

bool

class aiida_gulp.parsers.raw.write_input.InputCreationSingle(outputs=None)[source]

Bases: aiida_gulp.parsers.raw.write_input.InputCreationBase

create a main.gin input file for GULP

Parameters

outputs (dict or None) – mapping of type of output to filename, e.g. {“cif”: “output.cif”}

aiida_gulp.parsers.raw.write_input_fitting module

aiida_gulp.parsers.raw.write_input_fitting.create_input_lines(potential, structures, observable_datas, observables, delta=None, dump_file='fitting.grs')[source]

create the input file for a potential fitting

Parameters
  • potential (aiida_gulp.data.potential.EmpiricalPotential) – must include fitting flags

  • structures (dict[str, aiida.StructureData]) – mapping of structure names to structures

  • observable_datas (dict[str, aiida.orm.Dict]) – mapping of structure names to observable data for the structure (must have same keys as structures)

  • observables (None or dict[str, callable]) – mapping of observable to a function that returns (value, weighting) from the observable_data.

  • delta (None or float) – differencing interval for gradients (default 0.00001 or 0.0001 for relax)

  • dump_file (str) – the name of the output dump file

Returns

  • list[str] – the input lines

  • list[str] – a list of the structure names, in the order they appear in the input

Module contents