pyiron_contrib.atomistics.atomicrex.structure_list module

class pyiron_contrib.atomistics.atomicrex.structure_list.ARStructureContainer(num_atoms=0, num_structures=0)[source]

Bases: object

add_predefined_structure(identifier, lattice, lattice_parameter, atom_type_A, ca_ratio=None, atom_type_B=None, fit=True, relative_weight=1, clamp=True)[source]
add_scalar_fit_property(prop='atomic-energy', target_val=nan, fit=True, relax=False, relative_weight=1, residual_style=0, output=True, tolerance=nan, min_val=nan, max_val=nan)[source]
add_structure(structure, identifier, fit=True, relative_weight=1, clamp=True)[source]
add_training_data(container: TrainingContainer) None[source]
add_vector_fit_property(prop='atomic-forces', target_val=None, fit=True, relax=False, relative_weight=1, residual_style=0, tolerance=nan, output=True)[source]
from_hdf(hdf, group_name='structures')[source]
get_predicted_data() FlattenedStorage[source]
get_scalar_property(prop, identifier, final=True)[source]

Returns final or target value of a scalar property based on the identifier used when adding a structure If identifier is an array of identifiers the return value is an array of values.

Parameters
  • prop (str) – property string as used when adding the property

  • identifier (str or array(str)) – identifier as used when adding the structure

  • final (bool, optional) – Whether to return the final or target value. Defaults to True.

Returns

[description]

Return type

[type]

get_training_data() TrainingStorage[source]
get_vector_property(prop, identifier, final=True)[source]

Returns final or target value of a vector property based on the identifier used when adding a structure. Currently only allows to return a vector property for a single structure, not for multiple ones like the get_scalar_property function.

Parameters
  • prop (str) – property string as used when adding the property

  • identifier (str) – identifier as used when adding the structure

  • final (bool, optional) – Whether to return the final or target value. Defaults to True.

Returns

[description]

Return type

[type]

property plot

plotting interface

Type

TrainingPlots

property predicted_data
prepare_plotting(final_values=False)[source]
to_hdf(hdf, group_name='structures')[source]
property training_data
write_xml_file(directory, name='structures.xml')[source]

Internal helper function that writes an atomicrex style xml file containg all structures.

Parameters
  • directory (string) – Working directory.

  • name (str, optional) – . Defaults to “structures.xml”.

pyiron_contrib.atomistics.atomicrex.structure_list.get_sort_array(structure)[source]
pyiron_contrib.atomistics.atomicrex.structure_list.predefined_structure_xml(identifier, lattice, lattice_param, ca_ratio, atom_type_A, atom_type_B, relative_weight, clamp, fit_properties, fit)[source]

Internal function. Creates xml element for predefined structure. :param identifier: Unique identifier. :type identifier: str :param relative_weight: weight in objective function :type relative_weight: float :param clamp: clamp the structure (no relaxation) :type clamp: bool :param fit: whether to fit the structure :type fit: bool

Returns

atomicrex predefined structure xml element.

Return type

[ElementTree xml element]

pyiron_contrib.atomistics.atomicrex.structure_list.sort_structure(structure, forces=None)[source]
pyiron_contrib.atomistics.atomicrex.structure_list.structure_meta_xml(identifier, relative_weight, clamp, fit_properties, struct_file_path, fit, mod_poscar=True)[source]

Internal function. Creates xml element with scalar properties, weight and reference to POSCAR containg structure and forces.

Parameters
  • identifier (str) – Unique identifier.

  • relative_weight (float) – weight in objective function

  • clamp (bool) – clamp the structure (no relaxation)

  • mod_poscar (bool, optional) – Combine with poscar file. Defaults to True.

  • struct_file_path (string) – path to POSCAR file

Raises
  • NotImplementedError – mod_poscar has to be True, because forces can’t

  • be provided in xml format in atomicrex yet.

Returns

atomicrex structure xml element.

Return type

[ElementTree xml element]

pyiron_contrib.atomistics.atomicrex.structure_list.user_structure_to_xml_element(structure)[source]

Converts an ase/pyiron atoms object to an atomicrex xml element Right now forces can’t be passed in the xml file, so this is not really helpful. :param structure: ase or pyiron Atoms :type structure: Atoms

Returns

atomicrex structure xml

Return type

(ET.Element, ET.Element)

pyiron_contrib.atomistics.atomicrex.structure_list.write_modified_poscar(identifier, forces, directory, structure=None, positions=None, cell=None, symbols=None)[source]

Internal function. Writes a pyiron structure and corresponding forces in a modified POSCAR file. Either provide a structure instance or positions and symbols. :param identifier: Unique identifier used for the filename. :type identifier: str :param structure: ase or pyiron atoms object. :type structure: Atoms :param positions: atomic positions :type positions: np.array :param symbols: chemical symbols :type symbols: np.array :param forces: atomic forces. Must be in same order as positions. :type forces: array or list[list] :param directory: Working directory. :type directory: str