Utility Functions/Classes¶
Custom Datatypes¶
This module defines subclasses of UserDict and UserList to be able to prevent unintended modifications
- masci_tools.util.lockable_containers.LockContainer(lock_object: Union[masci_tools.util.lockable_containers.LockableList, masci_tools.util.lockable_containers.LockableDict]) → Generator[source]¶
Contextmanager for temporarily locking a lockable object. Object is unfrozen when exiting with block
- Parameters
lock_object – lockable container (not yet frzen)
- class masci_tools.util.lockable_containers.LockableDict(*args: Mapping[Any, Any], recursive: bool = True, **kwargs: object)[source]¶
Subclass of UserDict, which can prevent modifications to itself. Raises RuntimeError if modification is attempted.
Use
LockableDict.freeze()
to enforce.LockableDict.get_unlocked()
returns a copy of the locked object with builtin lists and dicts- Parameters
recursive – bool if True (default) all subitems (lists or dicts) are converted into their lockable counterparts
All other args or kwargs will be passed on to initialize the UserDict
- IMPORTANT NOTE:
This is not a direct subclass of dict. So isinstance(a, dict) will be False if a is an LockableDict
- class masci_tools.util.lockable_containers.LockableList(*args: Iterable[Any], recursive: bool = True, **kwargs: Iterable[Any])[source]¶
Subclass of UserList, which can prevent modifications to itself. Raises RuntimeError if modification is attempted.
Use
LockableList.freeze()
to enforce.LockableList.get_unlocked()
returns a copy of the locked object with builtin lists and dicts- Parameters
recursive – bool if True (default) all subitems (lists or dicts) are converted into their lockable counterparts
All other args or kwargs will be passed on to initialize the UserList
- IMPORTANT NOTE:
This is not a direct subclass of list. So isinstance(a, list) will be False if a is an LockableList
- extend(other: Iterable[object]) → None[source]¶
S.extend(iterable) – extend sequence by appending elements from the iterable
- pop(i: int = - 1) → object[source]¶
return the value at index i (default last) and remove it from list
This module defines a small helper class to make case insensitive dictionary lookups available naturally
- class masci_tools.util.case_insensitive_dict.CaseInsensitiveDict(*args: Mapping[Any, Any], upper: bool = False, **kwargs: Union[bool, object])[source]¶
Dict with case insensitive lookup. Used in Schema dicts to make finding paths for tags and attributes easier. Does not preserve the case of the inserted key. Does not support case insensitive lookups in nested dicts Subclass of
masci_tools.util.lockable_containers.LockableDict
. So can be frozen via the`freeze()` method- Parameters
upper – bool if True the method upper() will be used instead of lower() to normalize keys
All other args or kwargs will be passed on to initialize the UserDict
- IMPORTANT NOTE:
This is not a direct subcalss of dict. So isinstance(a, dict) will be False if a is an CaseInsensitiveDict
- class masci_tools.util.case_insensitive_dict.CaseInsensitiveFrozenSet(iterable: Optional[Iterable[Any]] = None, upper: bool = False)[source]¶
Frozenset (i.e. immutable set) with case insensitive membership tests. Used in Schema dicts in tag_info entries to make flexible classification easy Preserves the case of the entered keys (original_case() returns the case of the first encounter)
- Parameters
iterable – iterable only containing str
- Note:
There might be subtle differences to expected behaviour with the methods __radd__, __ror__, and so on
- difference(*others: Iterable[Any]) → masci_tools.util.case_insensitive_dict.CaseInsensitiveFrozenSet[source]¶
Return the difference of two or more sets as a new set.
(i.e. all elements that are in this set but not the others.)
- intersection(*others: Iterable[Any]) → masci_tools.util.case_insensitive_dict.CaseInsensitiveFrozenSet[source]¶
Return the intersection of two sets as a new set.
(i.e. all elements that are in both sets.)
- symmetric_difference(other: Iterable[Any]) → masci_tools.util.case_insensitive_dict.CaseInsensitiveFrozenSet[source]¶
Return the symmetric difference of two sets as a new set.
(i.e. all elements that are in exactly one of the sets.)
- union(*others: Iterable[Any]) → masci_tools.util.case_insensitive_dict.CaseInsensitiveFrozenSet[source]¶
Return the union of sets as a new set.
(i.e. all elements that are in either set.)
Common XML utility¶
Common functions for parsing input/output files or XMLschemas from FLEUR
- masci_tools.util.xml.common_functions.abs_to_rel_xpath(xpath, new_root)[source]¶
Convert a given xpath to be relative from a tag appearing in the original xpath.
- Parameters
xpath – str of the xpath to convert
new_root – str of the tag from which the new xpath should be relative
- Returns
str of the relative xpath
- masci_tools.util.xml.common_functions.check_complex_xpath(node, base_xpath, complex_xpath)[source]¶
Check that the given complex xpath produces a subset of the results for the simple xpath
- Parameters
node – root node of an etree
base_xpath – str of the xpath without complex syntax
complex_xpath – str of the xpath to check
- Raises
ValueError – If the complex_xpath does not produce a subset of the results of the base_xpath
- masci_tools.util.xml.common_functions.clear_xml(tree)[source]¶
Removes comments and executes xinclude tags of an xml tree.
- Parameters
tree – an xml-tree which will be processed
- Returns
cleared_tree, an xmltree without comments and with replaced xinclude tags
- masci_tools.util.xml.common_functions.eval_xpath(node, xpath, logger=None, list_return=False, namespaces=None)[source]¶
Tries to evaluate an xpath expression. If it fails it logs it. If a absolute path is given (starting with ‘/’) and the tag of the node does not match the root. It will try to find the tag in the path and convert it into a relative path
- Parameters
node – root node of an etree
xpath – xpath expression (relative, or absolute)
logger – logger object for logging warnings, errors, if not provided all errors will be raised
list_return – if True, the returned quantity is always a list even if only one element is in it
namespaces – dict, passed to namespaces argument in xpath call
- Returns
text, attribute or a node list
- masci_tools.util.xml.common_functions.get_xml_attribute(node, attributename, logger=None)[source]¶
Get an attribute value from a node.
- Parameters
node – a node from etree
attributename – a string with the attribute name.
logger – logger object for logging warnings, errors, if not provided all errors will be raised
- Returns
either attributevalue, or None
- masci_tools.util.xml.common_functions.reverse_xinclude(xmltree, schema_dict, included_tags, **kwargs)[source]¶
Split the xmltree back up according to the given included tags. The original xmltree will be returned with the corresponding xinclude tags and the included trees are returned in a dict mapping the inserted filename to the extracted tree
Tags for which no known filename is known are returned under unknown-1.xml, … The following tags have known filenames:
relaxation:
relax.xml
kPointLists:
kpts.xml
symmetryOperations:
sym.xml
atomSpecies:
species.xml
atomGroups:
atoms.xml
Additional mappings can be given in the keyword arguments
- Parameters
xmltree – an xml-tree which will be processed
schema_dict – Schema dictionary containing all the necessary information
included_tags – Iterable of str, containing the names of the tags to be excluded
- Returns
xmltree with the inseerted xinclude tags and a dict mapping the filenames to the excluded trees
- Raises
ValueError – if the tag can not be found in teh given xmltree
- masci_tools.util.xml.common_functions.split_off_attrib(xpath)[source]¶
Splits off attribute of the given xpath (part after @)
- Parameters
xpath – str of the xpath to split up
- masci_tools.util.xml.common_functions.split_off_tag(xpath)[source]¶
Splits off the last part of the given xpath
- Parameters
xpath – str of the xpath to split up
- masci_tools.util.xml.common_functions.validate_xml(xmltree, schema, error_header='File does not validate')[source]¶
Checks a given xmltree against a schema and produces a nice error message with all the validation errors collected
- Parameters
xmltree – xmltree of the file to validate
schema – etree.XMLSchema to validate against
error_header – str to lead a evtl error message with
- Raises
etree.DocumentInvalid if the schema does not validate
Common functions for converting types to and from XML files
- masci_tools.util.xml.converters.convert_attribute_to_xml(attributevalue, possible_types, logger=None, float_format='.10', list_return=False)[source]¶
Tries to converts a given attributevalue to a string for a xml file according to the types given in possible_types. First succeeded conversion will be returned
- Parameters
attributevalue – value to convert.
possible_types – list of str What types it will try to convert from
logger – logger object for logging warnings if given the errors are logged and the list is returned with the unconverted values otherwise a error is raised, when the first conversion fails
list_return – if True, the returned quantity is always a list even if only one element is in it
- Returns
The converted str of the value of the first succesful conversion
- masci_tools.util.xml.converters.convert_fleur_lo(loelements)[source]¶
Converts lo xml elements from the inp.xml file into a lo string for the inpgen
- masci_tools.util.xml.converters.convert_from_fortran_bool(stringbool)[source]¶
Converts a string in this case (‘T’, ‘F’, or ‘t’, ‘f’) to True or False
- Parameters
stringbool – a string (‘t’, ‘f’, ‘F’, ‘T’)
- Returns
boolean (either True or False)
- masci_tools.util.xml.converters.convert_str_version_number(version_str)[source]¶
Convert the version number as a integer for easy comparisons
- Parameters
version_str – str of the version number, e.g. ‘0.33’
- Returns
tuple of ints representing the version str
- masci_tools.util.xml.converters.convert_text_to_xml(textvalue, possible_definitions, logger=None, float_format='16.13', list_return=False)[source]¶
Tries to convert a given list of values to str for a xml file based on the definitions (length and type). First succeeded conversion will be returned
- Parameters
textvalue – value to convert
possible_definitions – list of dicts What types it will try to convert to
logger – logger object for logging warnings if given the errors are logged and the list is returned with the unconverted values otherwise a error is raised, when the first conversion fails
list_return – if True, the returned quantity is always a list even if only one element is in it
- Returns
The converted value of the first succesful conversion
- masci_tools.util.xml.converters.convert_to_fortran_bool(boolean)[source]¶
Converts a Boolean as string to the format defined in the input
- Parameters
boolean – either a boolean or a string (‘True’, ‘False’, ‘F’, ‘T’)
- Returns
a string (either ‘t’ or ‘f’)
- masci_tools.util.xml.converters.convert_xml_attribute(stringattribute, possible_types, constants=None, logger=None, list_return=False)[source]¶
Tries to converts a given string attribute to the types given in possible_types. First succeeded conversion will be returned
If no logger is given and a attribute cannot be converted an error is raised
- Parameters
stringattribute – str, Attribute to convert.
possible_types – list of str What types it will try to convert to
constants – dict, of constants defined in fleur input
logger – logger object for logging warnings if given the errors are logged and the list is returned with the unconverted values otherwise a error is raised, when the first conversion fails
list_return – if True, the returned quantity is always a list even if only one element is in it
- Returns
The converted value of the first successful conversion
- masci_tools.util.xml.converters.convert_xml_text(tagtext, possible_definitions, constants=None, logger=None, list_return=False)[source]¶
Tries to converts a given string text based on the definitions (length and type). First succeeded conversion will be returned
- Parameters
tagtext – str, text to convert.
possible_defintions – list of dicts What types it will try to convert to
constants – dict, of constants defined in fleur input
logger – logger object for logging warnings if given the errors are logged and the list is returned with the unconverted values otherwise a error is raised, when the first conversion fails
list_return – if True, the returned quantity is always a list even if only one element is in it
- Returns
The converted value of the first succesful conversion
XML Setter functions¶
Functions for modifying the xml input file of Fleur utilizing the schema dict and as little knowledge of the concrete xpaths as possible
- masci_tools.util.xml.xml_setters_names.add_number_to_attrib(xmltree, schema_dict, attributename, add_number, complex_xpath=None, mode='abs', occurrences=None, **kwargs)[source]¶
Adds a given number to the attribute value in a xmltree specified by the name of the attribute and optional further specification If there are no nodes under the specified xpath an error is raised
- Parameters
xmltree – an xmltree that represents inp.xml
schema_dict – InputSchemaDict containing all information about the structure of the input
attributename – the attribute name to change
add_number – number to add/multiply with the old attribute value
complex_xpath – an optional xpath to use instead of the simple xpath for the evaluation
mode – str (either rel or abs). rel multiplies the old value with add_number abs adds the old value and add_number
occurrences – int or list of int. Which occurence of the node to set. By default all are set.
- Kwargs:
- param tag_name
str, name of the tag where the attribute should be parsed
- param contains
str, this string has to be in the final path
- param not_contains
str, this string has to NOT be in the final path
- param exclude
list of str, here specific types of attributes can be excluded valid values are: settable, settable_contains, other
- Returns
xmltree with shifted attribute
- masci_tools.util.xml.xml_setters_names.add_number_to_first_attrib(xmltree, schema_dict, attributename, add_number, complex_xpath=None, mode='abs', **kwargs)[source]¶
Adds a given number to the first occurrence of an attribute value in a xmltree specified by the name of the attribute and optional further specification If there are no nodes under the specified xpath an error is raised
- Parameters
xmltree – an xmltree that represents inp.xml
schema_dict – InputSchemaDict containing all information about the structure of the input
attributename – the attribute name to change
add_number – number to add/multiply with the old attribute value
complex_xpath – an optional xpath to use instead of the simple xpath for the evaluation
mode – str (either rel or abs). rel multiplies the old value with add_number abs adds the old value and add_number
- Kwargs:
- param tag_name
str, name of the tag where the attribute should be parsed
- param contains
str, this string has to be in the final path
- param not_contains
str, this string has to NOT be in the final path
- param exclude
list of str, here specific types of attributes can be excluded valid values are: settable, settable_contains, other
- Returns
xmltree with shifted attribute
- masci_tools.util.xml.xml_setters_names.create_tag(xmltree, schema_dict, tag, complex_xpath=None, create_parents=False, occurrences=None, **kwargs)[source]¶
This method creates a tag with a uniquely identified xpath under the nodes of its parent. If there are no nodes evaluated the subtags can be created with create_parents=True
The tag is always inserted in the correct place if a order is enforced by the schema
- Parameters
xmltree – an xmltree that represents inp.xml
schema_dict – InputSchemaDict containing all information about the structure of the input
tag – str of the tag to create or etree Element with the same name to insert
complex_xpath – an optional xpath to use instead of the simple xpath for the evaluation
create_parents – bool optional (default False), if True and the given xpath has no results the the parent tags are created recursively
occurrences – int or list of int. Which occurence of the parent nodes to create a tag. By default all nodes are used.
- Kwargs:
- param contains
str, this string has to be in the final path
- param not_contains
str, this string has to NOT be in the final path
- Returns
xmltree with created tags
- masci_tools.util.xml.xml_setters_names.delete_att(xmltree, schema_dict, attrib_name, complex_xpath=None, occurrences=None, **kwargs)[source]¶
This method deletes a attribute with a uniquely identified xpath.
- Parameters
xmltree – an xmltree that represents inp.xml
schema_dict – InputSchemaDict containing all information about the structure of the input
tag – str of the attribute to delete
complex_xpath – an optional xpath to use instead of the simple xpath for the evaluation
occurrences – int or list of int. Which occurence of the parent nodes to delete a attribute. By default all nodes are used.
- Kwargs:
- param tag_name
str, name of the tag where the attribute should be parsed
- param contains
str, this string has to be in the final path
- param not_contains
str, this string has to NOT be in the final path
- param exclude
list of str, here specific types of attributes can be excluded valid values are: settable, settable_contains, other
- Returns
xmltree with deleted attributes
- masci_tools.util.xml.xml_setters_names.delete_tag(xmltree, schema_dict, tag_name, complex_xpath=None, occurrences=None, **kwargs)[source]¶
This method deletes a tag with a uniquely identified xpath.
- Parameters
xmltree – an xmltree that represents inp.xml
schema_dict – InputSchemaDict containing all information about the structure of the input
tag – str of the tag to delete
complex_xpath – an optional xpath to use instead of the simple xpath for the evaluation
occurrences – int or list of int. Which occurence of the parent nodes to delete a tag. By default all nodes are used.
- Kwargs:
- param contains
str, this string has to be in the final path
- param not_contains
str, this string has to NOT be in the final path
- Returns
xmltree with deleted tags
- masci_tools.util.xml.xml_setters_names.replace_tag(xmltree, schema_dict, tag_name, newelement, complex_xpath=None, occurrences=None, **kwargs)[source]¶
This method deletes a tag with a uniquely identified xpath.
- Parameters
xmltree – an xmltree that represents inp.xml
schema_dict – InputSchemaDict containing all information about the structure of the input
tag – str of the tag to replace
newelement – etree Element to replace the tag
complex_xpath – an optional xpath to use instead of the simple xpath for the evaluation
occurrences – int or list of int. Which occurence of the parent nodes to replace a tag. By default all nodes are used.
- Kwargs:
- param contains
str, this string has to be in the final path
- param not_contains
str, this string has to NOT be in the final path
- Returns
xmltree with replaced tags
- masci_tools.util.xml.xml_setters_names.set_atomgroup(xmltree, schema_dict, attributedict, position=None, species=None, create=False)[source]¶
Method to set parameters of an atom group of the fleur inp.xml file.
- Parameters
xmltree – xml etree of the inp.xml
schema_dict – InputSchemaDict containing all information about the structure of the input
attributedict – a python dict specifying what you want to change.
position – position of an atom group to be changed. If equals to ‘all’, all species will be changed
species – atom groups, corresponding to the given species will be changed
create – bool, if species does not exist create it and all subtags?
- Returns
xml etree of the new inp.xml
attributedict is a python dictionary containing dictionaries that specify attributes to be set inside the certain specie. For example, if one wants to set a beta noco parameter it can be done via:
'attributedict': {'nocoParams': {'beta': val}}
- masci_tools.util.xml.xml_setters_names.set_atomgroup_label(xmltree, schema_dict, atom_label, attributedict, create=False)[source]¶
This method calls
set_atomgroup()
method for a certain atom species that corresponds to an atom with a given label.- Parameters
xmltree – xml etree of the inp.xml
schema_dict – InputSchemaDict containing all information about the structure of the input
atom_label – string, a label of the atom which specie will be changed. ‘all’ to change all the species
attributedict – a python dict specifying what you want to change.
create – bool, if species does not exist create it and all subtags?
- Returns
xml etree of the new inp.xml
attributedict is a python dictionary containing dictionaries that specify attributes to be set inside the certain specie. For example, if one wants to set a beta noco parameter it can be done via:
'attributedict': {'nocoParams': {'beta': val}}
- masci_tools.util.xml.xml_setters_names.set_attrib_value(xmltree, schema_dict, attributename, attribv, complex_xpath=None, occurrences=None, create=False, **kwargs)[source]¶
Sets an attribute in a xmltree to a given value, specified by its name and further specifications. If there are no nodes under the specified xpath a tag can be created with create=True. The attribute values are converted automatically according to the types of the attribute with
convert_attribute_to_xml()
if they are not str already.- Parameters
xmltree – an xmltree that represents inp.xml
schema_dict – InputSchemaDict containing all information about the structure of the input
attributename – the attribute name to set
attribv – value or list of values to set
complex_xpath – an optional xpath to use instead of the simple xpath for the evaluation
occurrences – int or list of int. Which occurence of the node to set. By default all are set.
create – bool optional (default False), if True the tag is created if is missing
- Kwargs:
- param tag_name
str, name of the tag where the attribute should be parsed
- param contains
str, this string has to be in the final path
- param not_contains
str, this string has to NOT be in the final path
- param exclude
list of str, here specific types of attributes can be excluded valid values are: settable, settable_contains, other
- Returns
xmltree with set attribute
- masci_tools.util.xml.xml_setters_names.set_complex_tag(xmltree, schema_dict, tag_name, changes, complex_xpath=None, create=False, **kwargs)[source]¶
Function to correctly set tags/attributes for a given tag. Goes through the attributedict and decides based on the schema_dict, how the corresponding key has to be handled. The tag is specified via its name and evtl. further specification
Supports:
attributes
tags with text only
simple tags, i.e. only attributes (can be optional single/multiple)
complex tags, will recursively create/modify them
- Parameters
xmltree – an xmltree that represents inp.xml
schema_dict – InputSchemaDict containing all information about the structure of the input
tag_name – name of the tag to set
attributedict – Keys in the dictionary correspond to names of tags and the values are the modifications to do on this tag (attributename, subdict with changes to the subtag, …)
complex_xpath – an optional xpath to use instead of the simple xpath for the evaluation
create – bool optional (default False), if True and the path, where the complex tag is set does not exist it is created
- Kwargs:
- param contains
str, this string has to be in the final path
- param not_contains
str, this string has to NOT be in the final path
- Returns
xmltree with changes to the complex tag
- masci_tools.util.xml.xml_setters_names.set_first_attrib_value(xmltree, schema_dict, attributename, attribv, complex_xpath=None, create=False, **kwargs)[source]¶
Sets the first occurrence of an attribute in a xmltree to a given value, specified by its name and further specifications. If there are no nodes under the specified xpath a tag can be created with create=True. The attribute values are converted automatically according to the types of the attribute with
convert_attribute_to_xml()
if they are not str already.- Parameters
xmltree – an xmltree that represents inp.xml
schema_dict – InputSchemaDict containing all information about the structure of the input
attributename – the attribute name to set
attribv – value or list of values to set
complex_xpath – an optional xpath to use instead of the simple xpath for the evaluation
create – bool optional (default False), if True the tag is created if is missing
- Kwargs:
- param tag_name
str, name of the tag where the attribute should be parsed
- param contains
str, this string has to be in the final path
- param not_contains
str, this string has to NOT be in the final path
- param exclude
list of str, here specific types of attributes can be excluded valid values are: settable, settable_contains, other
- Returns
xmltree with set attribute
- masci_tools.util.xml.xml_setters_names.set_first_text(xmltree, schema_dict, attributename, attribv, complex_xpath=None, create=False, **kwargs)[source]¶
Sets the text the first occurrence of a tag in a xmltree to a given value, specified by the name of the tag and further specifications. By default the text will be set on all nodes returned for the specified xpath. If there are no nodes under the specified xpath a tag can be created with create=True. The text values are converted automatically according to the types with
convert_text_to_xml()
if they are not str already.- Parameters
xmltree – an xmltree that represents inp.xml
schema_dict – InputSchemaDict containing all information about the structure of the input
tag_name – str name of the tag, where the text should be set
text – value or list of values to set
complex_xpath – an optional xpath to use instead of the simple xpath for the evaluation
create – bool optional (default False), if True the tag is created if is missing
- Kwargs:
- param contains
str, this string has to be in the final path
- param not_contains
str, this string has to NOT be in the final path
- Returns
xmltree with set text
- masci_tools.util.xml.xml_setters_names.set_inpchanges(xmltree, schema_dict, change_dict, path_spec=None)[source]¶
This method sets all the attribute and texts provided in the change_dict.
The first occurrence of the attribute/tag is set
- Parameters
xmltree – xml tree that represents inp.xml
schema_dict – InputSchemaDict containing all information about the structure of the input
path_spec – dict, with ggf. necessary further specifications for the path of the attribute
- Params change_dict
dictionary {attrib_name : value} with all the wanted changes.
An example of change_dict:
change_dict = {'itmax' : 1, 'l_noco': True, 'ctail': False, 'l_ss': True}
- Returns
an xmltree of the inp.xml file with changes.
- masci_tools.util.xml.xml_setters_names.set_kpath(xmltree, schema_dict, kpath, count, gamma=False)[source]¶
Sets a k-path directly into inp.xml as a alternative kpoint set with purpose ‘bands’
Warning
This method is only supported for input versions before the Max5 release
- Parameters
xmltree – xml tree that represents inp.xml
schema_dict – InputSchemaDict containing all information about the structure of the input
kpath – a dictionary with kpoint name as key and k point coordinate as value
count – number of k-points
gamma – bool that controls if the gamma-point should be included in the k-point mesh
- Returns
an xmltree of the inp.xml file with changes.
- masci_tools.util.xml.xml_setters_names.set_kpath_max4(xmltree, schema_dict, kpath, count, gamma=False)[source]¶
Sets a k-path directly into inp.xml as a alternative kpoint set with purpose ‘bands’
- Parameters
xmltree – xml tree that represents inp.xml
schema_dict – InputSchemaDict containing all information about the structure of the input
kpath – a dictionary with kpoint name as key and k point coordinate as value
count – number of k-points
gamma – bool that controls if the gamma-point should be included in the k-point mesh
- Returns
an xmltree of the inp.xml file with changes.
- masci_tools.util.xml.xml_setters_names.set_kpointlist(xmltree, schema_dict, kpoints, weights, name=None, kpoint_type='path', special_labels=None, switch=False, overwrite=False)[source]¶
Explicitely create a kPointList from the given kpoints and weights. This routine will add the specified kPointList with the given name.
Warning
For input versions Max4 and older all keyword arguments are not valid (name, kpoint_type, special_labels, switch and overwrite)
- Parameters
xmltree – xml tree that represents inp.xml
schema_dict – InputSchemaDict containing all information about the structure of the input
kpoints – list or array containing the relative coordinates of the kpoints
weights – list or array containing the weights of the kpoints
name – str for the name of the list, if not given a default name is generated
kpoint_type – str specifying the type of the kPointList (‘path’, ‘mesh’, ‘spex’, ‘tria’, …)
special_labels – dict mapping indices to labels. The labels will be inserted for the kpoints corresponding to the given index
switch – bool, if True the kPointlist will be used by Fleur when starting the next calculation
overwrite – bool, if True and a kPointlist with the given name already exists it will be overwritten
- Returns
an xmltree of the inp.xml file with changes.
- masci_tools.util.xml.xml_setters_names.set_kpointlist_max4(xmltree, schema_dict, kpoints, weights)[source]¶
Explicitely create a kPointList from the given kpoints and weights. This routine is specific to input versions Max4 and before and will replace any existing kPointCount, kPointMesh, … with the specified kPointList
- Parameters
xmltree – xml tree that represents inp.xml
schema_dict – InputSchemaDict containing all information about the structure of the input
kpoints – list or array containing the relative coordinates of the kpoints
weights – list or array containing the weights of the kpoints
- Returns
an xmltree of the inp.xml file with changes.
- masci_tools.util.xml.xml_setters_names.set_nkpts(xmltree, schema_dict, count, gamma=False)[source]¶
Sets a k-point mesh directly into inp.xml
Warning
This method is only supported for input versions before the Max5 release
- Parameters
xmltree – xml tree that represents inp.xml
schema_dict – InputSchemaDict containing all information about the structure of the input
count – number of k-points
gamma – bool that controls if the gamma-point should be included in the k-point mesh
- Returns
an xmltree of the inp.xml file with changes.
- masci_tools.util.xml.xml_setters_names.set_nkpts_max4(xmltree, schema_dict, count, gamma=False)[source]¶
Sets a k-point mesh directly into inp.xml specific for inputs of version Max4
- Parameters
xmltree – xml tree that represents inp.xml
schema_dict – InputSchemaDict containing all information about the structure of the input
count – number of k-points
gamma – bool that controls if the gamma-point should be included in the k-point mesh
- Returns
an xmltree of the inp.xml file with changes.
- masci_tools.util.xml.xml_setters_names.set_simple_tag(xmltree, schema_dict, tag_name, changes, complex_xpath=None, create_parents=False, **kwargs)[source]¶
Sets one or multiple simple tag(s) in an xmltree. A simple tag can only hold attributes and has no subtags. The tag is specified by its name and further specification If the tag can occur multiple times all existing tags are DELETED and new ones are written. If the tag only occurs once it will automatically be created if its missing.
- Parameters
xmltree – an xmltree that represents inp.xml
schema_dict – InputSchemaDict containing all information about the structure of the input
tag_name – str name of the tag to modify/set
changes – list of dicts or dict with the changes. Elements in list describe multiple tags. Keys in the dictionary correspond to {‘attributename’: attributevalue}
complex_xpath – an optional xpath to use instead of the simple xpath for the evaluation
create_parents – bool optional (default False), if True and the path, where the simple tags are set does not exist it is created
- Kwargs:
- param contains
str, this string has to be in the final path
- param not_contains
str, this string has to NOT be in the final path
- Returns
xmltree with set simple tags
- masci_tools.util.xml.xml_setters_names.set_species(xmltree, schema_dict, species_name, attributedict, create=False)[source]¶
Method to set parameters of a species tag of the fleur inp.xml file.
- Parameters
xmltree – xml etree of the inp.xml
schema_dict – InputSchemaDict containing all information about the structure of the input
species_name – string, name of the specie you want to change Can be name of the species, ‘all’ or ‘all-<string>’ (sets species with the string in the species name)
attributedict – a python dict specifying what you want to change.
create – bool, if species does not exist create it and all subtags?
- Raises
ValueError – if species name is non existent in inp.xml and should not be created. also if other given tags are garbage. (errors from eval_xpath() methods)
- Return xmltree
xml etree of the new inp.xml
attributedict is a python dictionary containing dictionaries that specify attributes to be set inside the certain specie. For example, if one wants to set a MT radius it can be done via:
attributedict = {'mtSphere' : {'radius' : 2.2}}
Another example:
'attributedict': {'special': {'socscale': 0.0}}
that switches SOC terms on a sertain specie.
mtSphere
,atomicCutoffs
,energyParameters
,lo
,electronConfig
,nocoParams
,ldaU
andspecial
keys are supported. To find possible keys of the inner dictionary please refer to the FLEUR documentation flapw.de
- masci_tools.util.xml.xml_setters_names.set_species_label(xmltree, schema_dict, atom_label, attributedict, create=False)[source]¶
This method calls
set_species()
method for a certain atom species that corresponds to an atom with a given label- Parameters
xmltree – xml etree of the inp.xml
schema_dict – InputSchemaDict containing all information about the structure of the input
atom_label – string, a label of the atom which specie will be changed. ‘all’ to change all the species
attributedict – a python dict specifying what you want to change.
create – bool, if species does not exist create it and all subtags?
- Returns
xml etree of the new inp.xml
- masci_tools.util.xml.xml_setters_names.set_text(xmltree, schema_dict, tag_name, text, complex_xpath=None, occurrences=None, create=False, **kwargs)[source]¶
Sets the text on tags in a xmltree to a given value, specified by the name of the tag and further specifications. By default the text will be set on all nodes returned for the specified xpath. If there are no nodes under the specified xpath a tag can be created with create=True. The text values are converted automatically according to the types with
convert_text_to_xml()
if they are not str already.- Parameters
xmltree – an xmltree that represents inp.xml
schema_dict – InputSchemaDict containing all information about the structure of the input
tag_name – str name of the tag, where the text should be set
text – value or list of values to set
complex_xpath – an optional xpath to use instead of the simple xpath for the evaluation
occurrences – int or list of int. Which occurence of the node to set. By default all are set.
create – bool optional (default False), if True the tag is created if is missing
- Kwargs:
- param contains
str, this string has to be in the final path
- param not_contains
str, this string has to NOT be in the final path
- Returns
xmltree with set text
- masci_tools.util.xml.xml_setters_names.shift_value(xmltree, schema_dict, change_dict, mode='abs', path_spec=None)[source]¶
Shifts numerical values of attributes directly in the inp.xml file.
The first occurrence of the attribute is shifted
- Parameters
xmltree – xml tree that represents inp.xml
schema_dict – InputSchemaDict containing all information about the structure of the input
change_dict – a python dictionary with the keys to shift and the shift values.
mode – ‘abs’ if change given is absolute, ‘rel’ if relative
path_spec – dict, with ggf. necessary further specifications for the path of the attribute
- Returns
a xml tree with shifted values
An example of change_dict:
change_dict = {'itmax' : 1, 'dVac': -0.123}
- masci_tools.util.xml.xml_setters_names.shift_value_species_label(xmltree, schema_dict, atom_label, attributename, value_given, mode='abs', **kwargs)[source]¶
Shifts the value of an attribute on a species by label if atom_label contains ‘all’ then applies to all species
- Parameters
xmltree – xml etree of the inp.xml
schema_dict – InputSchemaDict containing all information about the structure of the input
atom_label – string, a label of the atom which specie will be changed. ‘all’ if set up all species
attributename – name of the attribute to change
value_given – value to add or to multiply by
mode – ‘rel’ for multiplication or ‘abs’ for addition
- Kwargs if the attributename does not correspond to a unique path:
- param contains
str, this string has to be in the final path
- param not_contains
str, this string has to NOT be in the final path
- Returns
xml etree of the new inp.xml
- masci_tools.util.xml.xml_setters_names.switch_kpointset(xmltree, schema_dict, list_name)[source]¶
Switch the used k-point set
Warning
This method is only supported for input versions after the Max5 release
- Parameters
xmltree – xml tree that represents inp.xml
schema_dict – InputSchemaDict containing all information about the structure of the input
list_name – name of the kPoint set to use
- Returns
an xmltree of the inp.xml file with changes.
- masci_tools.util.xml.xml_setters_names.switch_kpointset_max4(xmltree, schema_dict, list_name)[source]¶
Sets a k-point mesh directly into inp.xml specific for inputs of version Max4
Warning
This method is only supported for input versions after the Max5 release
- Parameters
xmltree – xml tree that represents inp.xml
schema_dict – InputSchemaDict containing all information about the structure of the input
list_name – name of the kPoint set to use
- Returns
an xmltree of the inp.xml file with changes.
This module contains useful methods for initializing or modifying a n_mmp_mat file for LDA+U
- masci_tools.util.xml.xml_setters_nmmpmat.rotate_nmmpmat(xmltree, nmmplines, schema_dict, species_name, orbital, phi, theta)[source]¶
Rotate the density matrix with the given angles phi and theta
- Parameters
xmltree – an xmltree that represents inp.xml
nmmplines – list of lines in the n_mmp_mat file
schema_dict – InputSchemaDict containing all information about the structure of the input
species_name – string, name of the species you want to change
orbital – integer, orbital quantum number of the LDA+U procedure to be modified
phi – float, angle (radian), by which to rotate the density matrix
theta – float, angle (radian), by which to rotate the density matrix
- Raises
ValueError – If something in the input is wrong
KeyError – If no LDA+U procedure is found on a species
- Returns
list with modified nmmplines
- masci_tools.util.xml.xml_setters_nmmpmat.set_nmmpmat(xmltree, nmmplines, schema_dict, species_name, orbital, spin, state_occupations=None, orbital_occupations=None, denmat=None, phi=None, theta=None)[source]¶
Routine sets the block in the n_mmp_mat file specified by species_name, orbital and spin to the desired density matrix
- Parameters
xmltree – an xmltree that represents inp.xml
nmmplines – list of lines in the n_mmp_mat file
schema_dict – InputSchemaDict containing all information about the structure of the input
species_name – string, name of the species you want to change
orbital – integer, orbital quantum number of the LDA+U procedure to be modified
spin – integer, specifies which spin block should be modified
state_occupations – list, sets the diagonal elements of the density matrix and everything else to zero
denmat – matrix, specify the density matrix explicitely
phi – float, optional angle (radian), by which to rotate the density matrix before writing it
theta – float, optional angle (radian), by which to rotate the density matrix before writing it
- Raises
ValueError – If something in the input is wrong
KeyError – If no LDA+U procedure is found on a species
- Returns
list with modified nmmplines
- masci_tools.util.xml.xml_setters_nmmpmat.validate_nmmpmat(xmltree, nmmplines, schema_dict)[source]¶
Checks that the given nmmp_lines is valid with the given xmltree
Checks that the number of blocks is as expected from the inp.xml and each block does not contain non-zero elements outside their size given by the orbital quantum number in the inp.xml. Additionally the occupations, i.e. diagonal elements are checked that they are in between 0 and the maximum possible occupation
- Parameters
xmltree – an xmltree that represents inp.xml
nmmplines – list of lines in the n_mmp_mat file
- Raises
ValueError – if any of the above checks are violated.
Functions for modifying the xml input file of Fleur with explicit xpath arguments These can still use the schema dict for finding information about the xpath
- masci_tools.util.xml.xml_setters_xpaths.eval_xpath_create(xmltree, schema_dict, xpath, base_xpath, create_parents=False, occurrences=None, list_return=False)[source]¶
Evaluates and xpath and creates tag if the result is empty
- Parameters
xmltree – an xmltree that represents inp.xml
schema_dict – InputSchemaDict containing all information about the structure of the input
xpath – a path where to place a new tag
base_xpath – path where to place a new tag without complex syntax ([] conditions and so on)
create_parents – bool optional (default False), if True also the parents of the tag are created if they are missing
occurrences – int or list of int. Which occurence of the parent nodes to create a tag if the tag is missing. By default all nodes are used.
list_return – if True, the returned quantity is always a list even if only one element is in it
- Returns
list of nodes from the result of the xpath expression
- masci_tools.util.xml.xml_setters_xpaths.xml_add_number_to_attrib(xmltree, schema_dict, xpath, base_xpath, attributename, add_number, mode='abs', occurrences=None)[source]¶
Adds a given number to the attribute value in a xmltree. By default the attribute will be shifted on all nodes returned for the specified xpath. If there are no nodes under the specified xpath an error is raised
- Parameters
xmltree – an xmltree that represents inp.xml
schema_dict – InputSchemaDict containing all information about the structure of the input
xpath – a path where to set the attributes
base_xpath – path where to place a new tag without complex syntax ([] conditions and so on)
attributename – the attribute name to change
add_number – number to add/multiply with the old attribute value
mode – str (either rel or abs). rel multiplies the old value with add_number abs adds the old value and add_number
occurrences – int or list of int. Which occurence of the node to set. By default all are set.
- Raises
ValueError – If the attribute is unknown or cannot be float or int
ValueError – If the evaluation of the old values failed
ValueError – If a float result is written to a integer attribute
- Returns
xmltree with shifted attribute
- masci_tools.util.xml.xml_setters_xpaths.xml_add_number_to_first_attrib(xmltree, schema_dict, xpath, base_xpath, attributename, add_number, mode='abs')[source]¶
Adds a given number to the first occurrence of a attribute value in a xmltree. If there are no nodes under the specified xpath an error is raised
- Parameters
xmltree – an xmltree that represents inp.xml
schema_dict – InputSchemaDict containing all information about the structure of the input
xpath – a path where to set the attributes
base_xpath – path where to place a new tag without complex syntax ([] conditions and so on)
attributename – the attribute name to change
add_number – number to add/multiply with the old attribute value
mode – str (either rel or abs). rel multiplies the old value with add_number abs adds the old value and add_number
- Raises
ValueError – If the attribute is unknown or cannot be float or int
ValueError – If the evaluation of the old values failed
ValueError – If a float result is written to a integer attribute
- Returns
xmltree with shifted attribute
- masci_tools.util.xml.xml_setters_xpaths.xml_create_tag_schema_dict(xmltree, schema_dict, xpath, base_xpath, element, create_parents=False, occurrences=None)[source]¶
This method evaluates an xpath expression and creates a tag in a xmltree under the returned nodes. If there are no nodes evaluated the subtags can be created with create_parents=True
The tag is always inserted in the correct place if a order is enforced by the schema
- Parameters
xmltree – an xmltree that represents inp.xml
schema_dict – InputSchemaDict containing all information about the structure of the input
xpath – a path where to place a new tag
base_xpath – path where to place a new tag without complex syntax ([] conditions and so on)
element – a tag name or etree Element to be created
create_parents – bool optional (default False), if True and the given xpath has no results the the parent tags are created recursively
occurrences – int or list of int. Which occurence of the parent nodes to create a tag. By default all nodes are used.
- Raises
ValueError – If the nodes are missing and create_parents=False
- Returns
xmltree with created tags
- masci_tools.util.xml.xml_setters_xpaths.xml_set_attrib_value(xmltree, schema_dict, xpath, base_xpath, attributename, attribv, occurrences=None, create=False)[source]¶
Sets an attribute in a xmltree to a given value. By default the attribute will be set on all nodes returned for the specified xpath. If there are no nodes under the specified xpath a tag can be created with create=True. The attribute values are converted automatically according to the types of the attribute with
convert_attribute_to_xml()
if they are not str already.- Parameters
xmltree – an xmltree that represents inp.xml
schema_dict – InputSchemaDict containing all information about the structure of the input
xpath – a path where to set the attributes
base_xpath – path where to place a new tag without complex syntax ([] conditions and so on)
attributename – the attribute name to set
attribv – value or list of values to set
occurrences – int or list of int. Which occurence of the node to set. By default all are set.
create – bool optional (default False), if True the tag is created if is missing
- Raises
ValueError – If the conversion to string failed
ValueError – If the tag is missing and create=False
ValueError – If the attributename is not allowed on the base_xpath
- Returns
xmltree with set attribute
- masci_tools.util.xml.xml_setters_xpaths.xml_set_complex_tag(xmltree, schema_dict, xpath, base_xpath, attributedict, create=False)[source]¶
Recursive Function to correctly set tags/attributes for a given tag. Goes through the attributedict and decides based on the schema_dict, how the corresponding key has to be handled.
Supports:
attributes
tags with text only
simple tags, i.e. only attributes (can be optional single/multiple)
complex tags, will recursively create/modify them
- Parameters
xmltree – an xmltree that represents inp.xml
schema_dict – InputSchemaDict containing all information about the structure of the input
xpath – a path where to set the attributes
base_xpath – path where to place a new tag without complex syntax ([] conditions and so on)
tag_name – name of the tag to set
attributedict – Keys in the dictionary correspond to names of tags and the values are the modifications to do on this tag (attributename, subdict with changes to the subtag, …)
create – bool optional (default False), if True and the path, where the complex tag is set does not exist it is created
- Returns
xmltree with changes to the complex tag
- masci_tools.util.xml.xml_setters_xpaths.xml_set_first_attrib_value(xmltree, schema_dict, xpath, base_xpath, attributename, attribv, create=False)[source]¶
Sets the first occurrence attribute in a xmltree to a given value. If there are no nodes under the specified xpath a tag can be created with create=True. The attribute values are converted automatically according to the types of the attribute with
convert_attribute_to_xml()
if they are not str already.- Parameters
xmltree – an xmltree that represents inp.xml
schema_dict – InputSchemaDict containing all information about the structure of the input
xpath – a path where to set the attribute
base_xpath – path where to place a new tag without complex syntax ([] conditions and so on)
attributename – the attribute name to set
attribv – value or list of values to set
create – bool optional (default False), if True the tag is created if is missing
- Raises
ValueError – If the conversion to string failed
ValueError – If the tag is missing and create=False
ValueError – If the attributename is not allowed on the base_xpath
- Returns
xmltree with set attribute
- masci_tools.util.xml.xml_setters_xpaths.xml_set_first_text(xmltree, schema_dict, xpath, base_xpath, text, create=False)[source]¶
Sets the text on the first occurrence of a tag in a xmltree to a given value. If there are no nodes under the specified xpath a tag can be created with create=True. The text values are converted automatically according to the types with
convert_text_to_xml()
if they are not str already.- Parameters
xmltree – an xmltree that represents inp.xml
schema_dict – InputSchemaDict containing all information about the structure of the input
xpath – a path where to set the text
base_xpath – path where to place a new tag without complex syntax ([] conditions and so on)
text – value or list of values to set
create – bool optional (default False), if True the tag is created if is missing
- Raises
ValueError – If the conversion to string failed
ValueError – If the tag is missing and create=False
- Returns
xmltree with set text
- masci_tools.util.xml.xml_setters_xpaths.xml_set_simple_tag(xmltree, schema_dict, xpath, base_xpath, tag_name, changes, create_parents=False)[source]¶
Sets one or multiple simple tag(s) in an xmltree. A simple tag can only hold attributes and has no subtags. If the tag can occur multiple times all existing tags are DELETED and new ones are written. If the tag only occurs once it will automatically be created if its missing.
- Parameters
xmltree – an xmltree that represents inp.xml
schema_dict – InputSchemaDict containing all information about the structure of the input
xpath – a path where to set the attributes
base_xpath – path where to place a new tag without complex syntax ([] conditions and so on)
tag_name – name of the tag to set
changes – list of dicts or dict with the changes. Elements in list describe multiple tags. Keys in the dictionary correspond to {‘attributename’: attributevalue}
create_parents – bool optional (default False), if True and the path, where the simple tags are set does not exist it is created
- Returns
xmltree with set simple tags
- masci_tools.util.xml.xml_setters_xpaths.xml_set_text(xmltree, schema_dict, xpath, base_xpath, text, occurrences=None, create=False)[source]¶
Sets the text on tags in a xmltree to a given value. By default the text will be set on all nodes returned for the specified xpath. If there are no nodes under the specified xpath a tag can be created with create=True. The text values are converted automatically according to the types with
convert_text_to_xml()
if they are not str already.- Parameters
xmltree – an xmltree that represents inp.xml
schema_dict – InputSchemaDict containing all information about the structure of the input
xpath – a path where to set the text
base_xpath – path where to place a new tag without complex syntax ([] conditions and so on)
text – value or list of values to set
occurrences – int or list of int. Which occurence of the node to set. By default all are set.
create – bool optional (default False), if True the tag is created if is missing
- Raises
ValueError – If the conversion to string failed
ValueError – If the tag is missing and create=False
- Returns
xmltree with set text
Basic functions for modifying the xml input file of Fleur. These functions DO NOT
have the ability to create missing tags on the fly. This functionality is added on top
in xml_setters_xpaths
since we need the schema dictionary
to do these operations robustly
- masci_tools.util.xml.xml_setters_basic.xml_create_tag(xmltree, xpath, element, place_index=None, tag_order=None, occurrences=None, correct_order=True, several=True)[source]¶
This method evaluates an xpath expression and creates a tag in a xmltree under the returned nodes. If there are no nodes under the specified xpath an error is raised.
The tag is appended by default, but can be inserted at a certain index (place_index) or can be inserted according to a given order of tags
- Parameters
xmltree – an xmltree that represents inp.xml
xpath – a path where to place a new tag
element – a tag name or etree Element to be created
place_index – defines the place where to put a created tag
tag_order – defines a tag order
occurrences – int or list of int. Which occurence of the parent nodes to create a tag. By default all nodes are used.
correct_order – bool, if True (default) and a tag_order is given, that does not correspond to the given order in the xmltree (only order wrong no unknown tags) it will be corrected and a warning is given This is necessary for some edge cases of the xml schemas of fleur
several – bool, if True multiple tags od the given name are allowed
- Raises
ValueError – If the insertion failed in any way (tag_order does not match, failed to insert, …)
- Returns
xmltree with created tags
- masci_tools.util.xml.xml_setters_basic.xml_delete_att(xmltree, xpath, attrib, occurrences=None)[source]¶
Deletes an xml attribute in an xmletree.
- Parameters
xmltree – an xmltree that represents inp.xml
xpath – a path to the attribute to be deleted
attrib – the name of an attribute
occurrences – int or list of int. Which occurence of the parent nodes to create a tag. By default all nodes are used.
- Returns
xmltree with deleted attribute
- masci_tools.util.xml.xml_setters_basic.xml_delete_tag(xmltree, xpath, occurrences=None)[source]¶
Deletes a xml tag in an xmletree.
- Parameters
xmltree – an xmltree that represents inp.xml
xpath – a path to the tag to be deleted
occurrences – int or list of int. Which occurence of the parent nodes to create a tag. By default all nodes are used.
- Returns
xmltree with deleted tag
- masci_tools.util.xml.xml_setters_basic.xml_replace_tag(xmltree, xpath, newelement, occurrences=None)[source]¶
replaces xml tags by another tag on an xmletree in place
- Parameters
xmltree – an xmltree that represents inp.xml
xpath – a path to the tag to be replaced
newelement – a new tag
occurrences – int or list of int. Which occurence of the parent nodes to create a tag. By default all nodes are used.
- Returns
xmltree with replaced tag
- masci_tools.util.xml.xml_setters_basic.xml_set_attrib_value_no_create(xmltree, xpath, attributename, attribv, occurrences=None)[source]¶
Sets an attribute in a xmltree to a given value. By default the attribute will be set on all nodes returned for the specified xpath.
- Parameters
xmltree – an xmltree that represents inp.xml
xpath – a path where to set the attributes
attributename – the attribute name to set
attribv – value or list of values to set (if not str they will be converted with str(value))
occurrences – int or list of int. Which occurence of the node to set. By default all are set.
- Raises
ValueError – If the lengths of attribv or occurrences do not match number of nodes
- Returns
xmltree with set attribute
- masci_tools.util.xml.xml_setters_basic.xml_set_text_no_create(xmltree, xpath, text, occurrences=None)[source]¶
Sets the text of a tag in a xmltree to a given value. By default the text will be set on all nodes returned for the specified xpath.
- Parameters
xmltree – an xmltree that represents inp.xml
xpath – a path where to set the text
text – value or list of values to set (if not str they will be converted with str(value))
occurrences – int or list of int. Which occurrence of the node to set. By default all are set.
- Raises
ValueError – If the lengths of text or occurrences do not match number of nodes
- Returns
xmltree with set text
XML Getter functions¶
This module provides functions to extract distinct parts of the fleur xml files for easy versioning and reuse
- masci_tools.util.xml.xml_getters.get_cell(xmltree, schema_dict, logger=None)[source]¶
Get the Bravais matrix from the given fleur xml file. In addition a list determining in, which directions there are periodic boundary conditions in the system.
Warning
Only the explicit definition of the Bravais matrix is supported. Old inputs containing the latnam definitions are not supported
- Parameters
xmltree – etree representing the fleur xml file
schema_dict – schema dictionary corresponding to the file version of the xmltree
logger – logger object for logging warnings, errors
- Returns
numpy array of the bravais matrix and list of boolean values for periodic boundary conditions
- masci_tools.util.xml.xml_getters.get_fleur_modes(xmltree, schema_dict, logger=None)[source]¶
Determine the calculation modes of fleur for the given xml file. Calculation modes are things that change the produced files or output in the out.xml files
- Parameters
xmltree – etree representing the fleur xml file
schema_dict – schema dictionary corresponding to the file version of the xmltree
logger – logger object for logging warnings, errors
- Returns
dictionary with all the extracted calculation modes
The following modes are inspected:
jspin: How many spins are considered in the calculation
noco: Is the calculation non-collinear?
soc: Is spin-orbit coupling included?
relax: Is the calculation a structure relaxation?
gw: Special mode for GW/Spex calculations
force_theorem: Is a Force theorem calculation performed?
film: Is the structure a film system
ldau: Is LDA+U included?
dos: Is it a density of states calculation?
band: Is it a bandstructure calculation?
bz_integration: How is the integration over the Brillouin-Zone performed?
- masci_tools.util.xml.xml_getters.get_kpoints_data(xmltree, schema_dict, name=None, index=None, logger=None)[source]¶
Get the kpoint sets defined in the given fleur xml file.
Warning
For file versions before Max5 the name argument is not valid
- Parameters
xmltree – etree representing the fleur xml file
schema_dict – schema dictionary corresponding to the file version of the xmltree
name – str, optional, if given only the kpoint set with the given name is returned
index – int, optional, if given only the kpoint set with the given index is returned
logger – logger object for logging warnings, errors
- Returns
tuple containing the kpoint information
The tuple contains the following entries:
- kpoints
dict or list (list if there is only one kpoint set), containing the coordinates of the kpoints
- weights
dict or list (list if there is only one kpoint set), containing the weights of the kpoints
- cell
numpy array, bravais matrix of the given system
- pbc
list of booleans, determines in which directions periodic boundary conditions are applicable
- masci_tools.util.xml.xml_getters.get_kpoints_data_max4(xmltree, schema_dict, logger=None)[source]¶
Get the kpoint sets defined in the given fleur xml file.
Note
This function is specific to file version before and including the Max4 release of fleur
- Parameters
xmltree – etree representing the fleur xml file
schema_dict – schema dictionary corresponding to the file version of the xmltree
logger – logger object for logging warnings, errors
- Returns
tuple containing the kpoint information
The tuple contains the following entries:
- kpoints
list containing the coordinates of the kpoints
- weights
list containing the weights of the kpoints
- cell
numpy array, bravais matrix of the given system
- pbc
list of booleans, determines in which directions periodic boundary conditions are applicable
- masci_tools.util.xml.xml_getters.get_nkpts(xmltree, schema_dict, logger=None)[source]¶
Get the number of kpoints that will be used in the calculation specified in the given fleur XMl file.
Warning
For file versions before Max5 only kPointList or kPointCount tags will work. However, for kPointCount there is no real guarantee that for every occasion it will correspond to the number of kpoints. So a warning is written out
- Parameters
xmltree – etree representing the fleur xml file
schema_dict – schema dictionary corresponding to the file version of the xmltree
logger – logger object for logging warnings, errors
- Returns
int with the number of kpoints
- masci_tools.util.xml.xml_getters.get_nkpts_max4(xmltree, schema_dict, logger=None)[source]¶
Get the number of kpoints that will be used in the calculation specified in the given fleur XMl file. Version specific for Max4 versions or older
Warning
For file versions before Max5 only kPointList or kPointCount tags will work. However, for kPointCount there is no real guarantee that for every occasion it will correspond to the number of kpoints. So a warning is written out
- Parameters
xmltree – etree representing the fleur xml file
schema_dict – schema dictionary corresponding to the file version of the xmltree
logger – logger object for logging warnings, errors
- Returns
int with the number of kpoints
- masci_tools.util.xml.xml_getters.get_parameter_data(xmltree, schema_dict, inpgen_ready=True, write_ids=True, logger=None)[source]¶
This routine returns an python dictionary produced from the inp.xml file, which contains all the parameters needed to setup a new inp.xml from a inpgen input file to produce the same input (for parameters that the inpgen can control)
- Parameters
xmltree – etree representing the fleur xml file
schema_dict – schema dictionary corresponding to the file version of the xmltree
inpgen_ready – Bool, return a dict which can be inputed into inpgen while setting atoms
write_ids – Bool, if True the atom ids are added to the atom namelists
logger – logger object for logging warnings, errors
- Returns
dict, which will lead to the same inp.xml (in case if other defaults, which can not be controlled by input for inpgen, were changed)
- masci_tools.util.xml.xml_getters.get_relaxation_information(xmltree, schema_dict, logger=None)[source]¶
Get the relaxation information from the given fleur XML file. This includes the current displacements, energy and posforce evolution
- Parameters
xmltree – etree representing the fleur xml file
schema_dict – schema dictionary corresponding to the file version of the xmltree
logger – logger object for logging warnings, errors
- Returns
dict with the relaxation information
- Raises
ValueError – If no relaxation section is included in the xml tree
- masci_tools.util.xml.xml_getters.get_relaxation_information_pre029(xmltree, schema_dict, logger=None)[source]¶
Get the relaxation information from the given fleur XML file. This includes the current displacements, energy and posforce evolution
- Parameters
xmltree – etree representing the fleur xml file
schema_dict – schema dictionary corresponding to the file version of the xmltree
logger – logger object for logging warnings, errors
- Returns
dict with the relaxation information
- Raises
ValueError – If no relaxation section is included in the xml tree
- masci_tools.util.xml.xml_getters.get_structure_data(xmltree, schema_dict, logger=None)[source]¶
Get the structure defined in the given fleur xml file.
Warning
Only the explicit definition of the Bravais matrix is supported. Old inputs containing the latnam definitions are not supported
- Parameters
xmltree – etree representing the fleur xml file
schema_dict – schema dictionary corresponding to the file version of the xmltree
logger – logger object for logging warnings, errors
- Returns
tuple containing the structure information
The tuple contains the following entries:
- atom_data
list of tuples containing the absolute positions and symbols of the atoms
- cell
numpy array, bravais matrix of the given system
- pbc
list of booleans, determines in which directions periodic boundary conditions are applicable
Basic IO helper functions¶
Here commonly used functions that do not need aiida-stuff (i.e. can be tested without a database) are collected.
- masci_tools.io.common_functions.abs_to_rel(vector, cell)[source]¶
Converts a position vector in absolute coordinates to relative coordinates.
- Parameters
vector – list or np.array of length 3, vector to be converted
cell – Bravais matrix of a crystal 3x3 Array, List of list or np.array
- Returns
list of length 3 of scaled vector, or False if vector was not length 3
- masci_tools.io.common_functions.abs_to_rel_f(vector, cell, pbc)[source]¶
Converts a position vector in absolute coordinates to relative coordinates for a film system.
- Parameters
vector – list or np.array of length 3, vector to be converted
cell – Bravais matrix of a crystal 3x3 Array, List of list or np.array
pbc – Boundary conditions, List or Tuple of 3 Boolean
- Returns
list of length 3 of scaled vector, or False if vector was not length 3
- masci_tools.io.common_functions.angles_to_vec(magnitude, theta, phi)[source]¶
convert (magnitude, theta, phi) to (x,y,z)
theta/phi need to be in radians!
Input can be single number, list of numpy.ndarray data Returns x,y,z vector
- masci_tools.io.common_functions.camel_to_snake(name)[source]¶
Converts camelCase to snake_case variable names Used in the Fleur parser to convert attribute names from the xml files
- masci_tools.io.common_functions.convert_to_fortran(val, quote_strings=True)[source]¶
- Parameters
val – the value to be read and converted to a Fortran-friendly string.
- masci_tools.io.common_functions.convert_to_fortran_string(string)[source]¶
converts some parameter strings to the format for the inpgen :param string: some string :returns: string in right format (extra “”)
- masci_tools.io.common_functions.convert_to_pystd(value)[source]¶
Recursively convert numpy datatypes to standard python, needed by aiida-core.
- Usage:
converted = convert_to_pystd(to_convert)
where to_convert can be a dict, array, list, or single valued variable
- masci_tools.io.common_functions.filter_out_empty_dict_entries(dict_to_filter)[source]¶
Filter out entries in a given dict that correspond to empty values. At the moment this is empty lists, dicts and None
- Parameters
dict_to_filter – dict to filter
- Returns
dict without empty entries
- masci_tools.io.common_functions.get_corestates_from_potential(potfile='potential')[source]¶
Read core states from potential file
- masci_tools.io.common_functions.get_ef_from_potfile(potfile)[source]¶
extract fermi energy from potfile
- masci_tools.io.common_functions.get_highest_core_state(nstates, energies, lmoments)[source]¶
Find highest lying core state from list of core states, needed to find and check energy contour
- masci_tools.io.common_functions.get_wigner_matrix(l, phi, theta)[source]¶
Produces the wigner rotation matrix for the density matrix
- Parameters
l – int, orbital quantum number
phi – float, angle (radian) corresponds to euler angle alpha
theta – float, angle (radian) corresponds to euler angle beta
- masci_tools.io.common_functions.interpolate_dos(dosfile, return_original=False)[source]¶
interpolation function copied from complexdos3 fortran code
Principle of DOS here: Two-point contour integration for DOS in the middle of the two points. The input DOS and energy must be complex. Parameter deltae should be of the order of magnitude of eim:
<-2*deltae-> _ /\ | DOS=(n(1)+n(2))/2 + (n(1)-n(2))*eim/deltae / \ | (1) (2) 2*i*eim=2*i*pi*Kb*Tk / \ | / \ | ------------------------ (Real E axis)
- Parameters
input – either absolute path of ‘complex.dos’ file or file handle to it
- Returns
E_Fermi, numpy array of interpolated dos
- Note
output units are in Ry!
- masci_tools.io.common_functions.open_general(filename_or_handle, iomode=None)[source]¶
Open a file directly from a path or use a file handle if that is given. Also take care of closed files by reopenning them. This is intended to be used like this:
f = open_general(outfile) with f: # make sure the file is properly closed txt = f.readlines()
- masci_tools.io.common_functions.rel_to_abs(vector, cell)[source]¶
Converts a position vector in internal coordinates to absolute coordinates in Angstrom.
- Parameters
vector – list or np.array of length 3, vector to be converted
cell – Bravais matrix of a crystal 3x3 Array, List of list or np.array
- Returns
list of legth 3 of scaled vector, or False if vector was not lenth 3
- masci_tools.io.common_functions.rel_to_abs_f(vector, cell)[source]¶
Converts a position vector in internal coordinates to absolute coordinates in Angstrom for a film structure (2D).
- masci_tools.io.common_functions.skipHeader(seq, n)[source]¶
Iterate over a sequence skipping the first n elements
- Args:
seq (iterable): Iterable sequence n (int): Number of Elements to skip in the beginning of the sequence
- Yields:
item: Elements in seq after the first n elements
- masci_tools.io.common_functions.vec_to_angles(vec)[source]¶
converts vector (x,y,z) to (magnitude, theta, phi)
Small utility functions for inspecting hdf files and converting the complete file structure into a python dictionary
- masci_tools.io.hdf5_util.h5dump(file, group='/')[source]¶
Shows the overall filestructure of an hdf file Goes through all groups and subgroups and prints the attributes or the shape and datatype of the datasets
- Parameters
filepath – path to the hdf file
- masci_tools.io.hdf5_util.hdfList(name, obj)[source]¶
Print the name of the current object (indented to create a nice tree structure)
Also prints attribute values and dataset shapes and datatypes
- masci_tools.io.hdf5_util.read_groups(hdfdata, flatten=False)[source]¶
Recursive function to read a hdf datastructure and extract the datasets and attributes
- Parameters
hdfdata – current hdf group to process
flatten – bool, if True the dictionary will be flattened (does not check for lost information)
- Returns
two dictionaries, one with the datasets the other with the attributes in the file
- masci_tools.io.hdf5_util.read_hdf_simple(file, flatten=False)[source]¶
Reads in an hdf file and returns its context in a nested dictionary
- Parameters
filepath – path or filehandle to the hdf file
flatten – bool, if True the dictionary will be flattened (does not check for lost information)
- Returns
two dictionaries, one with the datasets the other with the attributes in the file
Non unique group attribute or dataset names will be overwritten in the return dict
Logging Utility¶
This module defines useful utility for logging related functionality
- class masci_tools.util.logging_util.DictHandler(log_dict, ignore_unknown_levels=False, **kwargs)[source]¶
Custom Handler for the logging module inserting logging messages into a given dictionary.
Messages are grouped into list under the names of the error categories. Keyword arguments can be used to modify the keys for the different levels
- class masci_tools.util.logging_util.OutParserLogAdapter(logger, extra)[source]¶
This adapter expects the passed in dict-like object to have a ‘iteration’ key, whose value is prepended as [Iteration i] to the message
- process(msg, kwargs)[source]¶
Process the logging message and keyword arguments passed in to a logging call to insert contextual information. You can either manipulate the message itself, the keyword args or both. Return the message and kwargs modified (or not) to suit your needs.
Normally, you’ll only need to override this one method in a LoggerAdapter subclass for your specific needs.
Fleur parser utility¶
This module contains helper functions for extracting information easily from the schema_dicts defined for the Fleur input/output
Also provides convienient functions to use just a attribute name for extracting the attribute from the right place in the given etree
- masci_tools.util.schema_dict_util.attrib_exists(node, schema_dict, name, logger=None, **kwargs)[source]¶
Evaluates whether the attribute exists in the xmltree based on the given name and additional further specifications with the available type information
- Parameters
node – etree Element, on which to execute the xpath evaluations
schema_dict – dict, containing all the path information and more
name – str, name of the tag
logger – logger object for logging warnings, errors, if not provided all errors will be raised
- Kwargs:
- param tag_name
str, name of the tag where the attribute should be parsed
- param contains
str, this string has to be in the final path
- param not_contains
str, this string has to NOT be in the final path
- param exclude
list of str, here specific types of attributes can be excluded valid values are: settable, settable_contains, other
- Returns
bool, True if any tag with the attribute exists
- masci_tools.util.schema_dict_util.eval_simple_xpath(node, schema_dict, name, logger=None, **kwargs)[source]¶
Evaluates a simple xpath expression of the tag in the xmltree based on the given name and additional further specifications with the available type information
- Parameters
node – etree Element, on which to execute the xpath evaluations
schema_dict – dict, containing all the path information and more
name – str, name of the tag
logger – logger object for logging warnings, errors, if not provided all errors will be raised
- Kwargs:
- param contains
str, this string has to be in the final path
- param not_contains
str, this string has to NOT be in the final path
- param list_return
bool, if True a list is always returned
- Returns
etree Elements obtained via the simple xpath expression
- masci_tools.util.schema_dict_util.evaluate_attribute(node, schema_dict, name, constants=None, logger=None, **kwargs)[source]¶
Evaluates the value of the attribute based on the given name and additional further specifications with the available type information
- Parameters
node – etree Element, on which to execute the xpath evaluations
schema_dict – dict, containing all the path information and more
name – str, name of the attribute
constants – dict, contains the defined constants
logger – logger object for logging warnings, errors, if not provided all errors will be raised
- Kwargs:
- param tag_name
str, name of the tag where the attribute should be parsed
- param contains
str, this string has to be in the final path
- param not_contains
str, this string has to NOT be in the final path
- param exclude
list of str, here specific types of attributes can be excluded valid values are: settable, settable_contains, other
- param list_return
if True, the returned quantity is always a list even if only one element is in it
- param optional
bool, if True and no logger given none or an empty list is returned
- Returns
list or single value, converted in convert_xml_attribute
- masci_tools.util.schema_dict_util.evaluate_parent_tag(node, schema_dict, name, constants=None, logger=None, **kwargs)[source]¶
Evaluates all attributes of the parent tag based on the given name and additional further specifications with the available type information
- Parameters
node – etree Element, on which to execute the xpath evaluations
schema_dict – dict, containing all the path information and more
name – str, name of the tag
constants – dict, contains the defined constants
logger – logger object for logging warnings, errors, if not provided all errors will be raised
- Kwargs:
- param contains
str, this string has to be in the final path
- param not_contains
str, this string has to NOT be in the final path
- param only_required
bool (optional, default False), if True only required attributes are parsed
- param ignore
list of str (optional), attributes not to parse
- param list_return
if True, the returned quantity is always a list even if only one element is in it
- param strict_missing_error
if True, and no logger is given an error is raised if any attribute is not found
- Returns
dict, with attribute values converted via convert_xml_attribute
- masci_tools.util.schema_dict_util.evaluate_single_value_tag(node, schema_dict, name, constants=None, logger=None, **kwargs)[source]¶
Evaluates the value and unit attribute of the tag based on the given name and additional further specifications with the available type information
- Parameters
node – etree Element, on which to execute the xpath evaluations
schema_dict – dict, containing all the path information and more
name – str, name of the tag
constants – dict, contains the defined constants
logger – logger object for logging warnings, errors, if not provided all errors will be raised
- Kwargs:
- param contains
str, this string has to be in the final path
- param not_contains
str, this string has to NOT be in the final path
- param only_required
bool (optional, default False), if True only required attributes are parsed
- param ignore
list of str (optional), attributes not to parse
- param list_return
if True, the returned quantity is always a list even if only one element is in it
- param strict_missing_error
if True, and no logger is given an error is raised if any attribute is not found
- Returns
value and unit, both converted in convert_xml_attribute
- masci_tools.util.schema_dict_util.evaluate_tag(node, schema_dict, name, constants=None, logger=None, **kwargs)[source]¶
Evaluates all attributes of the tag based on the given name and additional further specifications with the available type information
- Parameters
node – etree Element, on which to execute the xpath evaluations
schema_dict – dict, containing all the path information and more
name – str, name of the tag
constants – dict, contains the defined constants
logger – logger object for logging warnings, errors, if not provided all errors will be raised
- Kwargs:
- param contains
str, this string has to be in the final path
- param not_contains
str, this string has to NOT be in the final path
- param only_required
bool (optional, default False), if True only required attributes are parsed
- param ignore
list of str (optional), attributes not to parse
- param list_return
if True, the returned quantity is always a list even if only one element is in it
- param strict_missing_error
if True, and no logger is given an error is raised if any attribute is not found
- Returns
dict, with attribute values converted via convert_xml_attribute
- masci_tools.util.schema_dict_util.evaluate_text(node, schema_dict, name, constants, logger=None, **kwargs)[source]¶
Evaluates the text of the tag based on the given name and additional further specifications with the available type information
- Parameters
node – etree Element, on which to execute the xpath evaluations
schema_dict – dict, containing all the path information and more
name – str, name of the tag
constants – dict, contains the defined constants
logger – logger object for logging warnings, errors, if not provided all errors will be raised
- Kwargs:
- param contains
str, this string has to be in the final path
- param not_contains
str, this string has to NOT be in the final path
- param list_return
if True, the returned quantity is always a list even if only one element is in it
- param optional
bool, if True and no logger given none or an empty list is returned
- Returns
list or single value, converted in convert_xml_text
- masci_tools.util.schema_dict_util.get_attrib_xpath(schema_dict, name, contains=None, not_contains=None, exclude=None, tag_name=None)[source]¶
Tries to find a unique path from the schema_dict based on the given name of the attribute and additional further specifications
- Parameters
schema_dict – dict, containing all the path information and more
name – str, name of the attribute
root_tag – str, name of the tag from which the path should be relative
contains – str or list of str, this string has to be in the final path
not_contains – str or list of str, this string has to NOT be in the final path
exclude – list of str, here specific types of attributes can be excluded valid values are: settable, settable_contains, other
tag_name – str, if given this name will be used to find a path to a tag with the same name in
get_tag_xpath()
- Returns
str, xpath to the tag with the given attribute
- Raises
ValueError – If no unique path could be found
- masci_tools.util.schema_dict_util.get_number_of_nodes(node, schema_dict, name, logger=None, **kwargs)[source]¶
Evaluates the number of occurences of the tag in the xmltree based on the given name and additional further specifications with the available type information
- Parameters
node – etree Element, on which to execute the xpath evaluations
schema_dict – dict, containing all the path information and more
name – str, name of the tag
logger – logger object for logging warnings, errors, if not provided all errors will be raised
- Kwargs:
- param contains
str, this string has to be in the final path
- param not_contains
str, this string has to NOT be in the final path
- Returns
bool, True if any nodes with the path exist
- masci_tools.util.schema_dict_util.get_relative_attrib_xpath(schema_dict, name, root_tag, contains=None, not_contains=None, exclude=None, tag_name=None)[source]¶
Tries to find a unique relative path from the schema_dict based on the given name of the attribute name of the root, from which the path should be relative and additional further specifications
- Parameters
schema_dict – dict, containing all the path information and more
name – str, name of the attribute
contains – str or list of str, this string has to be in the final path
not_contains – str or list of str, this string has to NOT be in the final path
exclude – list of str, here specific types of attributes can be excluded valid values are: settable, settable_contains, other
tag_name – str, if given this name will be used to find a path to a tag with the same name in
get_relative_tag_xpath()
- Returns
str, xpath for the given tag
- Raises
ValueError – If no unique path could be found
- masci_tools.util.schema_dict_util.get_relative_tag_xpath(schema_dict, name, root_tag, contains=None, not_contains=None)[source]¶
Tries to find a unique relative path from the schema_dict based on the given name of the tag name of the root, from which the path should be relative and additional further specifications
- Parameters
schema_dict – dict, containing all the path information and more
name – str, name of the tag
root_tag – str, name of the tag from which the path should be relative
contains – str or list of str, this string has to be in the final path
not_contains – str or list of str, this string has to NOT be in the final path
- Returns
str, xpath for the given tag
- Raises
ValueError – If no unique path could be found
- masci_tools.util.schema_dict_util.get_tag_info(schema_dict, name, contains=None, not_contains=None, path_return=True, convert_to_builtin=False, multiple_paths=False, parent=False)[source]¶
Tries to find a unique path from the schema_dict based on the given name of the tag and additional further specifications and returns the tag_info entry for this tag
- Parameters
schema_dict – dict, containing all the path information and more
name – str, name of the tag
contains – str or list of str, this string has to be in the final path
not_contains – str or list of str, this string has to NOT be in the final path
path_return – bool, if True the found path will be returned alongside the tag_info
convert_to_builtin – bool, if True the CaseInsensitiveFrozenSets are converetd to normal sets with the rigth case of the attributes
multiple_paths – bool, if True mulitple paths are allowed to match as long as they have the same tag_info
parent – bool, if True the tag_info for the parent of the tag is returned
- Returns
dict, tag_info for the found xpath
- Returns
str, xpath to the tag if path_return=True
- masci_tools.util.schema_dict_util.get_tag_xpath(schema_dict, name, contains=None, not_contains=None)[source]¶
Tries to find a unique path from the schema_dict based on the given name of the tag and additional further specifications
- Parameters
schema_dict – dict, containing all the path information and more
name – str, name of the tag
contains – str or list of str, this string has to be in the final path
not_contains – str or list of str, this string has to NOT be in the final path
- Returns
str, xpath for the given tag
- Raises
ValueError – If no unique path could be found
- masci_tools.util.schema_dict_util.read_constants(root, schema_dict, logger=None)[source]¶
Reads in the constants defined in the inp.xml and returns them combined with the predefined constants from fleur as a dictionary
- Parameters
root – root of the etree of the inp.xml file
schema_dict – schema_dictionary of the version of the file to read (inp.xml or out.xml)
logger – logger object for logging warnings, errors
- Returns
a python dictionary with all defined constants
- masci_tools.util.schema_dict_util.tag_exists(node, schema_dict, name, logger=None, **kwargs)[source]¶
Evaluates whether the tag exists in the xmltree based on the given name and additional further specifications with the available type information
- Parameters
node – etree Element, on which to execute the xpath evaluations
schema_dict – dict, containing all the path information and more
name – str, name of the tag
logger – logger object for logging warnings, errors, if not provided all errors will be raised
- Kwargs:
- param contains
str, this string has to be in the final path
- param not_contains
str, this string has to NOT be in the final path
- Returns
bool, True if any nodes with the path exist
This module contains the functions necessary to parse mathematical expressions with predefined constants given in the inp.xml file of Fleur
- masci_tools.util.fleur_calculate_expression.calculate_expression(expression, constants, prevCommand=None, exp_return=False)[source]¶
Recursively evaluates the given expression string with the given defined constants
- Parameters
expression – str containing the expression to be parsed
constants – dict with all defined constants (predefined in the Fleur code or defined in the inp.xml)
prevCommand – str, which gives the command before the beginning of the current block if it is given the calculation is stopped, when a command is encountered, which should be exectuted after prevCommand (order of operations)
exp_return – bool, determines whether to return the remaining string of the expression
- Returns
float value of the given expression string
- masci_tools.util.fleur_calculate_expression.evaluate_bracket(expression, constants)[source]¶
Evaluates the bracket opened at the start of the expression
- Parameters
expression – expression to be parsed
constants – dict with defined constants
- Returns
value of the expression inside the brackets and remaining string of the expression after the corresponding closed bracket
- masci_tools.util.fleur_calculate_expression.get_first_number(expression)[source]¶
Reads the number in the beginning of the expression string. This number can begin with a sign +-, a number or the decimal point
- Parameters
expression – str of the expression
- Returns
float value of the number in the beginning and the string of the remaining expression
- masci_tools.util.fleur_calculate_expression.get_first_string(expression)[source]¶
Reads the letter string in the beginning of the expression string.
- Parameters
expression – str of the expression
- Returns
letter string in the beginning and the string of the remaining expression
This module contains a class which organizes the known parsing tasks for outxml files and provides fuctionality for adding custom tasks easily
- class masci_tools.util.parse_tasks.ParseTasks(version, task_file=None, validate_defaults=False)[source]¶
Representation of all known parsing tasks for the out.xml file
When set up it will initialize the known default tasks and check if they work for the given output version
Accesing definition of task example
from masci_tools.io.parsers.fleur import ParseTasks p = ParseTasks('0.33') totE_definition = p.tasks['total_energy']
- add_task(task_name, task_definition, **kwargs)[source]¶
Add a new task definition to the tasks dictionary
Will first check if the definition has all the required keys
- Parameters
task_name – str, key in the tasks dict
task_definition – dict with the defined tasks
overwrite – bool (optional), if True and the key is present in the dictionary it will be overwritten with the new definition
append – bool (optional), if True and the key is present in the dictionary the new defintions will be inserted into this dictionary (inner keys WILL BE OVERWRITTEN). Additionally if an inner key is overwritten with an empty dict the inner key will be removed
- The following keys are expected in each entry of the task_definition dictionary:
- param parse_type
str, defines which methods to use when extracting the information
- param path_spec
dict with all the arguments that should be passed to get_tag_xpath or get_attrib_xpath to get the correct path
- param subdict
str, if present the parsed values are put into this key in the output dictionary
- param overwrite_last
bool, if True no list is inserted and each entry overwrites the last
- For the allAttribs parse_type there are more keys that can appear:
- param base_value
str, optional. If given the attribute with this name will be inserted into the key from the task_definition all other keys are formatted as {task_key}_{attribute_name}
- param ignore
list of str, these attributes will be ignored
- param overwrite
list of str, these attributes will not create a list and overwrite any value that might be there
- param flat
bool, if False the dict parsed from the tag is inserted as a dict into the correspondin key if True the values will be extracted and put into the output dictionary with the format {task_key}_{attribute_name}
- determine_tasks(fleurmodes, minimal=False)[source]¶
Determine, which tasks to perform based on the fleur_modes
- Parameters
fleurmodes – dict with the calculation modes
minimal – bool, whether to only perform minimal tasks
- property general_tasks¶
Tasks to perform for the root node
- property iteration_tasks¶
Tasks to perform for each iteration
- perform_task(task_name, node, out_dict, schema_dict, constants, logger=None, use_lists=True)[source]¶
Evaluates the task given in the tasks_definition dict
- Parameters
task_name – str, specifies the task to perform
node – etree.Element, the xpath expressions are evaluated from this node
out_dict – dict, output will be put in this dictionary
schema_dict – dict, here all paths and attributes are stored according to the outputschema
constants – dict with all the defined mathematical constants
logger – logger object for logging warnings, errors
root_tag – str, this string will be appended in front of any xpath before it is evaluated
use_lists – bool, if True lists are created for each key if not otherwise specified
- masci_tools.util.parse_tasks.find_migration(start, target, migrations)[source]¶
Tries to find a migration path from the start to the target version via the defined migration functions
- Parameters
start – str of the starting version
target – str of the target version
migrations – dict of funcs registered via the register_migration_function decorator
- Returns
list of migration functions to be called to go from start to target
This module defines decorators for the ParseTasks class to make extending/modifying the parser more convenient
- Up till now 3 decorators are defined:
`register_migration`
marks a function of making backwards incompatible changes to the parsing tasks`register_parsing_function`
gives a mappimg between available parsing functions and the keywords in the parsing tasks`conversion_function`
makes the decorated function available to be called easily after a certain parsing task has occured
- masci_tools.util.parse_tasks_decorators.conversion_function(func)[source]¶
Marks a function as a conversion function, which can be called after performing a parsing task. The function can be specified via the _conversions control key in the task definitions.
- A conversion function has to have the following arguments:
- param out_dict
dict with the previously parsed information
- param parser_info_out
dict, with warnings, info, errors, …
and return only the modified output dict
- masci_tools.util.parse_tasks_decorators.register_migration(base_version, target_version)[source]¶
Decorator to add migration for task definition dictionary to the ParseTasks class The function should only take the dict of task definitions as an argument
- Parameters
base_version – str of the version, from which the migration starts
target_version – str or list of str with the versions that work after the migration has been performed
- masci_tools.util.parse_tasks_decorators.register_parsing_function(parse_type_name, all_attribs_keys=False)[source]¶
Decorator to add parse type for task definition dictionary.
- Parameters
parse_type_name – str, the function can be selected in task defintions via this string
all_attribs_keys – bool, if True the arguments for parsing multiple attributes are valid
- The decorated function has to have the following arguments:
- param node
etree Element, on which to execute the xpath evaluations
- param schema_dict
dict, containing all the path information and more
- param name
str, name of the tag/attribute
- param parser_info_out
dict, with warnings, info, errors, …
- param kwargs
here all other keyword arguments are collected
This module contains custom conversion functions for the outxml_parser, which cannot be handled by the standard parsing framework
- masci_tools.io.parsers.fleur.outxml_conversions.calculate_total_magnetic_moment(out_dict, logger)[source]¶
Calculate the the total magnetic moment per cell
- Parameters
out_dict – dict with the already parsed information
- masci_tools.io.parsers.fleur.outxml_conversions.calculate_walltime(out_dict, logger)[source]¶
Calculate the walltime from start and end time
- Parameters
out_dict – dict with the already parsed information
logger – logger object for logging warnings, errors, if not provided all errors will be raised
- masci_tools.io.parsers.fleur.outxml_conversions.convert_forces(out_dict, logger)[source]¶
Convert the parsed forces from a iteration
- Parameters
out_dict – dict with the already parsed information
- masci_tools.io.parsers.fleur.outxml_conversions.convert_ldau_definitions(out_dict, logger)[source]¶
Convert the parsed information from LDA+U into a more readable dict
ldau_info has keys for each species with LDA+U ({species_name}/{atom_number}) and this in turn contains a dict with the LDA+U definition for the given orbital (spdf)
- Parameters
out_dict – dict with the already parsed information
Basic Fleur Schema parser functions¶
Load all fleur schema related functions
- class masci_tools.io.parsers.fleur.fleur_schema.InputSchemaDict(*args, xmlschema=None, **kwargs)[source]¶
This class contains information parsed from the FleurInputSchema.xsd
The keys contain the following information:
- inp_version
Version string of the input schema represented in this object
- tag_paths
simple xpath expressions to all valid tag names Multiple paths or ambiguous tag names are parsed as a list
- _basic_types
Parsed definitions of all simple Types with their respective base type (int, float, …) and evtl. length restrictions (Only used in the schema construction itself)
- attrib_types
All possible base types for all valid attributes. If multiple are possible a list, with ‘string’ always last (if possible)
- simple_elements
All elements with simple types and their type definition with the additional attributes
- unique_attribs
All attributes and their paths, which occur only once and have a unique path
- unique_path_attribs
All attributes and their paths, which have a unique path but occur in multiple places
- other_attribs
All attributes and their paths, which are not in ‘unique_attribs’ or ‘unique_path_attribs’
- omitt_contained_tags
All tags, which only contain a list of one other tag
- tag_info
For each tag (path), the valid attributes and tags (optional, several, order, simple, text)
- classmethod fromPath(path)[source]¶
load the FleurInputSchema dict for the specified FleurInputSchema file
- Parameters
path – path to the input schema file
- Returns
InputSchemaDict object with the information for the provided file
- classmethod fromVersion(version, logger=None, no_cache=False)[source]¶
load the FleurInputSchema dict for the specified version
- Parameters
version – str with the desired version, e.g. ‘0.33’
logger – logger object for warnings, errors and information, …
- Returns
InputSchemaDict object with the information for the provided version
- property inp_version¶
Returns the input version as an integer for comparisons (> or <)
- class masci_tools.io.parsers.fleur.fleur_schema.OutputSchemaDict(*args, xmlschema=None, **kwargs)[source]¶
This object contains information parsed from the FleurOutputSchema.xsd
The keys contain the following information:
- out_version
Version string of the output schema represented in this class
- input_tag
Name of the element containing the fleur input
- tag_paths
simple xpath expressions to all valid tag names not in an iteration Multiple paths or ambiguous tag names are parsed as a list
- iteration_tag_paths
simple relative xpath expressions to all valid tag names inside an iteration. Multiple paths or ambiguous tag names are parsed as a list
- _basic_types
Parsed definitions of all simple Types with their respective base type (int, float, …) and evtl. length restrictions (Only used in the schema construction itself)
- _input_basic_types
Part of the parsed definitions of all simple Types with their respective base type (int, float, …) and evtl. length restrictions from the input schema (Only used in the schema construction itself)
- attrib_types
All possible base types for all valid attributes. If multiple are possible a list, with ‘string’ always last (if possible)
- simple_elements
All elements with simple types and their type definition with the additional attributes
- unique_attribs
All attributes and their paths, which occur only once and have a unique path outside of an iteration
- unique_path_attribs
All attributes and their paths, which have a unique path but occur in multiple places outside of an iteration
- other_attribs
All attributes and their paths, which are not in ‘unique_attribs’ or ‘unique_path_attribs’ outside of an iteration
- iteration_unique_attribs
All attributes and their relative paths, which occur only once and have a unique path inside of an iteration
- iteration_unique_path_attribs
All attributes and their relative paths, which have a unique path but occur in multiple places inside of an iteration
- iteration_other_attribs
All attributes and their relative paths, which are not in ‘unique_attribs’ or ‘unique_path_attribs’ inside of an iteration
- omitt_contained_tags
All tags, which only contain a list of one other tag
- tag_info
For each tag outside of an iteration (path), the valid attributes and tags (optional, several, order, simple, text)
- iteration_tag_info
For each tag inside of an iteration (relative path), the valid attributes and tags (optional, several, order, simple, text)
- classmethod fromPath(path, inp_path=None, inpschema_dict=None)[source]¶
load the FleurOutputSchema dict for the specified paths
- Parameters
path – str path to the FleurOutputSchema file
inp_path – str path to the FleurInputSchema file (defaults to same folder as path)
- Returns
OutputSchemaDict object with the information for the provided files
- classmethod fromVersion(version, inp_version=None, logger=None, no_cache=False)[source]¶
load the FleurOutputSchema dict for the specified version
- Parameters
version – str with the desired version, e.g. ‘0.33’
inp_version – str with the desired input version, e.g. ‘0.33’ (defaults to version)
logger – logger object for warnings, errors and information, …
- Returns
OutputSchemaDict object with the information for the provided versions
- property inp_version¶
Returns the input version as an integer for comparisons (> or <)
- property out_version¶
Returns the output version as an integer for comparisons (> or <)
- masci_tools.io.parsers.fleur.fleur_schema.add_fleur_schema(path, overwrite=False)[source]¶
Adds the FleurInput/OutputSchema from the specified path (folder containing the Schemas) to the folder with the correct version number and creates the schema_dicts
- Parameters
path – path to the folder containing the schema files
overwrite – bool, if True and the schema with the same version exists it will be overwritten. Otherwise an error is raised
- masci_tools.io.parsers.fleur.fleur_schema.create_inpschema_dict(path, apply_patches=True)[source]¶
Creates dictionary with information about the FleurInputSchema.xsd. The functions, whose results are added to the schema_dict and the corresponding keys are defined in schema_actions
- Parameters
path – str path to the folder containing the FleurInputSchema.xsd file
apply_patches – bool if True (default) the registered patching functions are applied after creation
- masci_tools.io.parsers.fleur.fleur_schema.create_outschema_dict(path, inpschema_dict)[source]¶
Creates dictionary with information about the FleurOutputSchema.xsd. The functions, whose results are added to the schema_dict and the corresponding keys are defined in schema_actions
- Parameters
path – str path to the folder containing the FleurOutputSchema.xsd file
inp_path – str path to the FleurInputSchema.xsd file (defaults to the same folder as path)
- masci_tools.io.parsers.fleur.fleur_schema.schema_dict_version_dispatch(output_schema=False)[source]¶
Decorator for creating variations of functions based on the inp/out version of the schema_dict. All functions here need to have the signature:
def f(node, schema_dict, *args, **kwargs): pass
So schema_dict is the second positional argument
Inspired by singledispatch in the functools module
functions to extract information about the fleur schema input or output
- masci_tools.io.parsers.fleur.fleur_schema.fleur_schema_parser_functions.extract_attribute_types(xmlschema, namespaces, **kwargs)[source]¶
Determine the required type of all attributes
- Parameters
xmlschema – xmltree representing the schema
namespaces – dictionary with the defined namespaces
- Returns
possible types of the attributes in a dictionary, if multiple types are possible a list is inserted for the tag
- masci_tools.io.parsers.fleur.fleur_schema.fleur_schema_parser_functions.get_basic_elements(xmlschema, namespaces, **kwargs)[source]¶
find all elements, whose type can be directly trace back to a basic_type
- Parameters
xmlschema – xmltree representing the schema
namespaces – dictionary with the defined namespaces
- Returns
dictionary with tags and their corresponding type_definition meaning a dicationary with possible base types and evtl. length restriction
- masci_tools.io.parsers.fleur.fleur_schema.fleur_schema_parser_functions.get_basic_types(xmlschema, namespaces, **kwargs)[source]¶
find all types, which can be traced back directly to a base_type
- Parameters
xmlschema – xmltree representing the schema
namespaces – dictionary with the defined namespaces
- Returns
dictionary with type names and their corresponding type_definition meaning a dicationary with possible base types and evtl. length restriction
- masci_tools.io.parsers.fleur.fleur_schema.fleur_schema_parser_functions.get_input_tag(xmlschema, namespaces, **kwargs)[source]¶
Returns the tag for the input type element of the outxmlschema
- Parameters
xmlschema – xmltree representing the schema
namespaces – dictionary with the defined namespaces
- Returns
name of the element with the type ‘FleurInputType’
- masci_tools.io.parsers.fleur.fleur_schema.fleur_schema_parser_functions.get_omittable_tags(xmlschema, namespaces, **kwargs)[source]¶
find tags with no attributes and, which are only used to mask a list of one other possible tag (e.g. atomSpecies)
- Parameters
xmlschema – xmltree representing the schema
namespaces – dictionary with the defined namespaces
- Returns
list of tags, containing only a sequence of one allowed tag
- masci_tools.io.parsers.fleur.fleur_schema.fleur_schema_parser_functions.get_other_attribs(xmlschema, namespaces, **kwargs)[source]¶
Determine all other attributes not contained in settable or settable_contains
- Parameters
xmlschema – xmltree representing the schema
namespaces – dictionary with the defined namespaces
- Returns
dictionary with all attributes and the corresponding list of paths to the tag
- masci_tools.io.parsers.fleur.fleur_schema.fleur_schema_parser_functions.get_root_tag(xmlschema, namespaces, **kwargs)[source]¶
Returns the tag for the root element of the xmlschema
- Parameters
xmlschema – xmltree representing the schema
namespaces – dictionary with the defined namespaces
- Returns
name of the single element defined in the first level of the schema
- masci_tools.io.parsers.fleur.fleur_schema.fleur_schema_parser_functions.get_tag_info(xmlschema, namespaces, **kwargs)[source]¶
- Get all important information about the tags
allowed attributes
contained tags (simple (only attributes), optional (with default values), several, order, text tags)
- Parameters
xmlschema – xmltree representing the schema
namespaces – dictionary with the defined namespaces
- Returns
dictionary with the tag information
- masci_tools.io.parsers.fleur.fleur_schema.fleur_schema_parser_functions.get_tag_paths(xmlschema, namespaces, **kwargs)[source]¶
Determine simple xpaths to all possible tags
- Parameters
xmlschema – xmltree representing the schema
namespaces – dictionary with the defined namespaces
- Returns
possible paths of all tags in a dictionary, if multiple paths are possible a list is inserted for the tag
- masci_tools.io.parsers.fleur.fleur_schema.fleur_schema_parser_functions.get_unique_attribs(xmlschema, namespaces, **kwargs)[source]¶
Determine all attributes, which can be set through set_inpchanges in aiida_fleur Meaning ONE possible path and no tags in the path with maxOccurs!=1
- Parameters
xmlschema – xmltree representing the schema
namespaces – dictionary with the defined namespaces
- Returns
dictionary with all settable attributes and the corresponding path to the tag
- masci_tools.io.parsers.fleur.fleur_schema.fleur_schema_parser_functions.get_unique_path_attribs(xmlschema, namespaces, **kwargs)[source]¶
Determine all attributes, with multiple possible path that do have at least one path with all contained tags maxOccurs!=1
- Parameters
xmlschema – xmltree representing the schema
namespaces – dictionary with the defined namespaces
- Returns
dictionary with all attributes and the corresponding list of paths to the tag
Defined constants¶
Here we collect physical constants which are used throughout the code that way we ensure consistency
Note
For masci-tools versions after 0.4.6
the constants used in the KKR functions are replaced
by the NIST values by default. If you still want to use the old values
you can set the environment variable MASCI_TOOLS_USE_OLD_CONSTANTS to True
1import numpy as np
2import os
3
4# NIST https://physics.nist.gov/cgi-bin/cuu/Value?hrev
5HTR_TO_EV = 27.211386245988 #(53)
6RY_TO_EV = 13.605693122994 #(26)
7BOHR_A = 0.5291772108
8HTR_TO_KELVIN = 315_775.02480407
9#Scipy bohr 5.29177210903e-11 m
10#Scipy htr 27.211386245988 eV
11# NIST BOHR 0.529177210903 #(80)
12#https://physics.nist.gov/cgi-bin/cuu/Value?bohrrada0
13
14#KKR constants
15if os.environ.get('MASCI_TOOLS_USE_OLD_CONSTANTS', False) == 'True':
16 ANG_BOHR_KKR = 1.8897261254578281
17 RY_TO_EV_KKR = 13.605693009
18else:
19 #Set the constants to the NIST values
20 RY_TO_EV_KKR = RY_TO_EV
21 ANG_BOHR_KKR = 1.8897261246257702
22
23#Fleur
24#htr_eV = 27.21138602
25#bohr=0.5291772108
26#bohrtocm=0.529177e-8
27#pymatgen uses scipy.constants
28#ase: Bohr 0.5291772105638411
29#Hartree 27.211386024367243
30#Rydberg 13.605693012183622
31#1/Bohr
32#1.8897261258369282
33#aiida-core units:
34#bohr_to_ang = 0.52917720859
35
36#Predefined constants in the Fleur Code (These are accepted in the inp.xml)
37FLEUR_DEFINED_CONSTANTS = {
38 'Pi': np.pi,
39 'Deg': 2 * np.pi / 360.0,
40 'Ang': 1.8897261247728981,
41 'nm': 18.897261247728981,
42 'pm': 0.018897261247728981,
43 'Bohr': 1.0,
44 'Htr': 1.0,
45 'eV': 1.0 / HTR_TO_EV,
46 'Ry': 0.5
47}
48
49PERIODIC_TABLE_ELEMENTS = {
50 0: { # This is for empty spheres etc.
51 'mass': 1.00000,
52 'name': 'Unknown',
53 'symbol': 'X'
54 },
55 1: {
56 'mass': 1.00794,
57 'name': 'Hydrogen',
58 'symbol': 'H',
59 'econfig': '1s1',
60 'fleur_default_econfig': '| 1s1',
61 'lo': '',
62 'rmt': 0.65,
63 'lmax': '',
64 'jri': 981,
65 'soc': False,
66 'mag': False
67 },
68 2: {
69 'mass': 4.002602,
70 'name': 'Helium',
71 'symbol': 'He',
72 'econfig': '1s2',
73 'fleur_default_econfig': '| 1s2',
74 'lo': '',
75 'rmt': 1.2,
76 'lmax': '',
77 'jri': 981
78 },
79 3: {
80 'mass': 6.941,
81 'name': 'Lithium',
82 'symbol': 'Li',
83 'econfig': '1s2 | 2s1',
84 'fleur_default_econfig': '1s2 | 2s1',
85 'lo': '',
86 'rmt': 2.13,
87 'lmax': '',
88 'jri': 981
89 },
90 4: {
91 'mass': 9.012182,
92 'name': 'Beryllium',
93 'symbol': 'Be',
94 'econfig': '1s2 | 2s2',
95 'fleur_default_econfig': '1s2 | 2s2',
96 'lo': '',
97 'rmt': 1.87,
98 'lmax': '',
99 'jri': 981
100 },
101 5: {
102 'mass': 10.811,
103 'name': 'Boron',
104 'symbol': 'B',
105 'econfig': '1s2 | 2s2 2p1',
106 'fleur_default_econfig': '1s2 | 2s2 2p1',
107 'lo': '',
108 'rmt': 1.4,
109 'lmax': '',
110 'jri': 981
111 },
112 6: {
113 'mass': 12.0107,
114 'name': 'Carbon',
115 'symbol': 'C',
116 'econfig': '[He] 2s2 | 2p2',
117 'fleur_default_econfig': '[He] 2s2 | 2p2',
118 'lo': '',
119 'rmt': 1.2,
120 'lmax': '',
121 'jri': 981
122 },
123 7: {
124 'mass': 14.0067,
125 'name': 'Nitrogen',
126 'symbol': 'N',
127 'econfig': '[He] 2s2 | 2p3',
128 'fleur_default_econfig': '[He] 2s2 | 2p3',
129 'lo': '',
130 'rmt': 1.0,
131 'lmax': '',
132 'jri': 981
133 },
134 8: {
135 'mass': 15.9994,
136 'name': 'Oxygen',
137 'symbol': 'O',
138 'econfig': '[He] 2s2 | 2p4',
139 'fleur_default_econfig': '[He] 2s2 | 2p4',
140 'lo': '',
141 'rmt': 1.1,
142 'lmax': '',
143 'jri': 981
144 },
145 9: {
146 'mass': 18.9984032,
147 'name': 'Fluorine',
148 'symbol': 'F',
149 'econfig': '[He] 2s2 | 2p5',
150 'fleur_default_econfig': '[He] 2s2 | 2p5',
151 'lo': '',
152 'rmt': 1.2,
153 'lmax': '',
154 'jri': 981
155 },
156 10: {
157 'mass': 20.1797,
158 'name': 'Neon',
159 'symbol': 'Ne',
160 'econfig': '[He] 2s2 | 2p6',
161 'fleur_default_econfig': '[He] 2s2 | 2p6',
162 'lo': '',
163 'rmt': 2.1,
164 'lmax': '',
165 'jri': 981
166 },
167 11: {
168 'mass': 22.98977,
169 'name': 'Sodium',
170 'symbol': 'Na',
171 'econfig': '[He] 2s2 | 2p6 3s1',
172 'fleur_default_econfig': '[He] | 2s2 2p6 3s1',
173 'lo': '2s 2p',
174 'rmt': 2.1,
175 'lmax': '',
176 'jri': 981
177 },
178 12: {
179 'mass': 24.305,
180 'name': 'Magnesium',
181 'symbol': 'Mg',
182 'econfig': '[He] 2s2 | 2p6 3s2',
183 'fleur_default_econfig': '[He] 2s2 | 2p6 3s2',
184 'lo': '2p',
185 'rmt': 2.3,
186 'lmax': '',
187 'jri': 981
188 },
189 13: {
190 'mass': 26.981538,
191 'name': 'Aluminium',
192 'symbol': 'Al',
193 'econfig': '[He] 2s2 2p6 | 3s2 3p1',
194 'fleur_default_econfig': '[He] 2s2 2p6 | 3s2 3p1',
195 'lo': '',
196 'rmt': 2.1,
197 'lmax': '',
198 'jri': 981
199 },
200 14: {
201 'mass': 28.0855,
202 'name': 'Silicon',
203 'symbol': 'Si',
204 'econfig': '[He] 2s2 2p6 | 3s2 3p2',
205 'fleur_default_econfig': '[He] 2s2 2p6 | 3s2 3p2',
206 'lo': '',
207 'rmt': 2.0,
208 'lmax': '',
209 'jri': 981
210 },
211 15: {
212 'mass': 30.973761,
213 'name': 'Phosphorus',
214 'symbol': 'P',
215 'econfig': '[He] 2s2 2p6 | 3s2 3p3',
216 'fleur_default_econfig': '[He] 2s2 2p6 | 3s2 3p3',
217 'lo': '',
218 'rmt': 1.9,
219 'lmax': '',
220 'jri': 981
221 },
222 16: {
223 'mass': 32.065,
224 'name': 'Sulfur',
225 'symbol': 'S',
226 'econfig': '[He] 2s2 2p6 | 3s2 3p4',
227 'fleur_default_econfig': '[He] 2s2 2p6 | 3s2 3p4',
228 'lo': '',
229 'rmt': 1.7,
230 'lmax': '',
231 'jri': 981
232 },
233 17: {
234 'mass': 35.453,
235 'name': 'Chlorine',
236 'symbol': 'Cl',
237 'econfig': '[He] 2s2 2p6 | 3s2 3p5',
238 'fleur_default_econfig': '[He] 2s2 2p6 | 3s2 3p5',
239 'lo': '',
240 'rmt': 1.7,
241 'lmax': '',
242 'jri': 981
243 },
244 18: {
245 'mass': 39.948,
246 'name': 'Argon',
247 'symbol': 'Ar',
248 'econfig': '[He] 2s2 2p6 | 3s2 3p6',
249 'fleur_default_econfig': '[He] 2s2 2p6 | 3s2 3p6',
250 'lo': '',
251 'rmt': 1.8,
252 'lmax': '',
253 'jri': 981
254 },
255 19: {
256 'mass': 39.0983,
257 'name': 'Potassium',
258 'symbol': 'K',
259 'econfig': '[Ne] 3s2 | 3p6 4s1',
260 'fleur_default_econfig': '[Ne] | 3s2 3p6 4s1',
261 'lo': '3s 3p',
262 'rmt': 2.0,
263 'lmax': '',
264 'jri': 981
265 },
266 20: {
267 'mass': 40.078,
268 'name': 'Calcium',
269 'symbol': 'Ca',
270 'econfig': '[Ne] 3s2 | 3p6 4s2',
271 'fleur_default_econfig': '[Ne] | 3s2 3p6 4s2',
272 'lo': '3s 3p',
273 'rmt': 2.3,
274 'lmax': '',
275 'jri': 981
276 },
277 21: {
278 'mass': 44.955912,
279 'name': 'Scandium',
280 'symbol': 'Sc',
281 'econfig': '[Ne] 3s2 3p6 | 4s2 3d1',
282 'fleur_default_econfig': '[Ne] | 3s2 3p6 4s2 3d1',
283 'lo': '3s 3p',
284 'rmt': 2.2,
285 'lmax': '',
286 'jri': 981
287 },
288 22: {
289 'mass': 47.867,
290 'name': 'Titanium',
291 'symbol': 'Ti',
292 'econfig': '[Ne] | 3s2 3p6 4s2 3d2',
293 'fleur_default_econfig': '[Ne] | 3s2 3p6 4s2 3d2',
294 'lo': '3s 3p',
295 'rmt': 2.1,
296 'lmax': '',
297 'jri': 981
298 },
299 23: {
300 'mass': 50.9415,
301 'name': 'Vanadium',
302 'symbol': 'V',
303 'econfig': '[Ne] 3s2 3p6 | 4s2 3d3',
304 'fleur_default_econfig': '[Ne] | 3s2 3p6 4s2 3d3',
305 'lo': '3s 3p',
306 'rmt': 1.9,
307 'lmax': '',
308 'jri': 981
309 },
310 24: {
311 'mass': 51.9961,
312 'name': 'Chromium',
313 'symbol': 'Cr',
314 'econfig': '[Ne] 3s2 3p6 | 4s1 3d5',
315 'fleur_default_econfig': '[Ne] | 3s2 3p6 4s1 3d5',
316 'lo': '3s 3p',
317 'rmt': 1.8,
318 'lmax': '',
319 'jri': 981
320 },
321 25: {
322 'mass': 54.938045,
323 'name': 'Manganese',
324 'symbol': 'Mn',
325 'econfig': '[Ne] 3s2 3p6 | 4s2 3d5',
326 'fleur_default_econfig': '[Ne] | 3s2 3p6 4s2 3d5',
327 'lo': '3s 3p',
328 'rmt': 2.0,
329 'lmax': '',
330 'jri': 981
331 },
332 26: {
333 'mass': 55.845,
334 'name': 'Iron',
335 'symbol': 'Fe',
336 'econfig': '[Ne] 3s2 3p6 | 4s2 3d6',
337 'fleur_default_econfig': '[Ne] | 3s2 3p6 4s2 3d6',
338 'lo': '3s 3p',
339 'rmt': 2.00,
340 'lmax': '',
341 'jri': 981
342 },
343 27: {
344 'mass': 58.933195,
345 'name': 'Cobalt',
346 'symbol': 'Co',
347 'econfig': '[Ne] 3s2 3p6 | 4s2 3d7',
348 'fleur_default_econfig': '[Ne] 3s2 | 3p6 4s2 3d7',
349 'lo': '3p',
350 'rmt': 1.9,
351 'lmax': '',
352 'jri': 981
353 },
354 28: {
355 'mass': 58.6934,
356 'name': 'Nickel',
357 'symbol': 'Ni',
358 'econfig': '[Ne] 3s2 3p6 | 4s2 3d8',
359 'fleur_default_econfig': '[Ne] 3s2 | 3p6 4s2 3d8',
360 'lo': '3p',
361 'rmt': 1.9,
362 'lmax': '',
363 'jri': 981
364 },
365 29: {
366 'mass': 63.546,
367 'name': 'Copper',
368 'symbol': 'Cu',
369 'econfig': '[Ne] 3s2 3p6 |4s1 3d10',
370 'fleur_default_econfig': '[Ne] 3s2 | 3p6 4s1 3d10',
371 'lo': '3p',
372 'rmt': 2.1,
373 'lmax': '',
374 'jri': 981
375 },
376 30: {
377 'mass': 65.38,
378 'name': 'Zinc',
379 'symbol': 'Zn',
380 'econfig': '[Ne] 3s2 3p6 | 3d10 4s2',
381 'fleur_default_econfig': '[Ne] 3s2 3p6 | 3d10 4s2',
382 'lo': '3d',
383 'rmt': 2.2,
384 'lmax': '',
385 'jri': 981
386 },
387 31: {
388 'mass': 69.723,
389 'name': 'Gallium',
390 'symbol': 'Ga',
391 'econfig': '[Ne] 3s2 3p6 | 3d10 4s2 4p1',
392 'fleur_default_econfig': '[Ne] 3s2 3p6 | 3d10 4s2 4p1',
393 'lo': '3d',
394 'rmt': 2.1,
395 'lmax': '',
396 'jri': 981
397 },
398 32: {
399 'mass': 72.64,
400 'name': 'Germanium',
401 'symbol': 'Ge',
402 'econfig': '[Ne] 3s2 3p6 | 3d10 4s2 4p2',
403 'fleur_default_econfig': '[Ne] 3s2 3p6 | 3d10 4s2 4p2',
404 'lo': '3d',
405 'rmt': 2.1,
406 'lmax': '',
407 'jri': 981
408 },
409 33: {
410 'mass': 74.9216,
411 'name': 'Arsenic',
412 'symbol': 'As',
413 'econfig': '[Ne] 3s2 3p6 | 3d10 4s2 4p3',
414 'fleur_default_econfig': '[Ne] 3s2 3p6 | 3d10 4s2 4p3',
415 'lo': '3d',
416 'rmt': 2.0,
417 'lmax': '',
418 'jri': 981
419 },
420 34: {
421 'mass': 78.96,
422 'name': 'Selenium',
423 'symbol': 'Se',
424 'econfig': '[Ne] 3s2 3p6 | 3d10 4s2 4p4',
425 'fleur_default_econfig': '[Ne] 3s2 3p6 | 3d10 4s2 4p4',
426 'lo': '3d',
427 'rmt': 2.0,
428 'lmax': '',
429 'jri': 981
430 },
431 35: {
432 'mass': 79.904,
433 'name': 'Bromine',
434 'symbol': 'Br',
435 'econfig': '[Ne] 3s2 3p6 | 3d10 4s2 4p5',
436 'fleur_default_econfig': '[Ne] 3s2 3p6 | 3d10 4s2 4p5',
437 'lo': '3d',
438 'rmt': 2.1,
439 'lmax': '',
440 'jri': 981
441 },
442 36: {
443 'mass': 83.798,
444 'name': 'Krypton',
445 'symbol': 'Kr',
446 'econfig': '[Ne] 3s2 3p6 | 3d10 4s2 4p6',
447 'fleur_default_econfig': '[Ne] 3s2 3p6 | 3d10 4s2 4p6',
448 'lo': '3d',
449 'rmt': 2.2,
450 'lmax': '',
451 'jri': 981
452 },
453 37: {
454 'mass': 85.4678,
455 'name': 'Rubidium',
456 'symbol': 'Rb',
457 'econfig': '[Ar] 3d10 4s2 | 4p6 5s1',
458 'fleur_default_econfig': '[Ar] 3d10 | 4s2 4p6 5s1',
459 'lo': '4s 4p',
460 'rmt': 2.4,
461 'lmax': '',
462 'jri': 981
463 },
464 38: {
465 'mass': 87.62,
466 'name': 'Strontium',
467 'symbol': 'Sr',
468 'econfig': '[Ar] 3d10 4s2 | 4p6 5s2',
469 'fleur_default_econfig': '[Ar] 3d10 | 4s2 4p6 5s2',
470 'lo': '4s 4p',
471 'rmt': 2.4,
472 'lmax': '',
473 'jri': 981
474 },
475 39: {
476 'mass': 88.90585,
477 'name': 'Yttrium',
478 'symbol': 'Y',
479 'econfig': '[Ar] 4s2 3d10 4p6 | 5s2 4d1',
480 'fleur_default_econfig': '[Ar] 3d10 | 4s2 4p6 5s2 4d1',
481 'lo': '4s 4p',
482 'rmt': 2.4,
483 'lmax': '',
484 'jri': 981
485 },
486 40: {
487 'mass': 91.224,
488 'name': 'Zirconium',
489 'symbol': 'Zr',
490 'econfig': '[Ar] 4s2 3d10 4p6 | 5s2 4d2',
491 'fleur_default_econfig': '[Ar] 3d10 | 4s2 4p6 5s2 4d2',
492 'lo': '4s 4p',
493 'rmt': 2.3,
494 'lmax': '',
495 'jri': 981
496 },
497 41: {
498 'mass': 92.90638,
499 'name': 'Niobium',
500 'symbol': 'Nb',
501 'econfig': '[Ar] 4s2 3d10 4p6 | 5s1 4d4',
502 'fleur_default_econfig': '[Ar] 3d10 | 4s2 4p6 5s1 4d4',
503 'lo': '4s 4p',
504 'rmt': 2.1,
505 'lmax': '',
506 'jri': 981
507 },
508 42: {
509 'mass': 95.96,
510 'name': 'Molybdenum',
511 'symbol': 'Mo',
512 'econfig': '[Ar] 4s2 3d10 4p6 | 5s1 4d5',
513 'fleur_default_econfig': '[Ar] 3d10 | 4s2 4p6 5s1 4d5',
514 'lo': '4s 4p',
515 'rmt': 2.0,
516 'lmax': '',
517 'jri': 981
518 },
519 43: {
520 'mass': 98.0,
521 'name': 'Technetium',
522 'symbol': 'Tc',
523 'econfig': '[Ar] 4s2 3d10 4p6 | 5s2 4d5',
524 'fleur_default_econfig': '[Ar] 3d10 | 4s2 4p6 5s2 4d5',
525 'lo': '4s 4p',
526 'rmt': 2.1,
527 'lmax': '',
528 'jri': 981
529 },
530 44: {
531 'mass': 101.07,
532 'name': 'Ruthenium',
533 'symbol': 'Ru',
534 'econfig': '[Ar] 4s2 3d10 4p6 | 5s1 4d7',
535 'fleur_default_econfig': '[Ar] 4s2 3d10 | 4p6 5s1 4d7',
536 'lo': '4p',
537 'rmt': 2.1,
538 'lmax': '',
539 'jri': 981
540 },
541 45: {
542 'mass': 102.9055,
543 'name': 'Rhodium',
544 'symbol': 'Rh',
545 'econfig': '[Ar] 4s2 3d10 4p6 | 5s1 4d8',
546 'fleur_default_econfig': '[Ar] 4s2 3d10 | 4p6 5s1 4d8',
547 'lo': '4p',
548 'rmt': 2.1,
549 'lmax': '',
550 'jri': 981
551 },
552 46: {
553 'mass': 106.42,
554 'name': 'Palladium',
555 'symbol': 'Pd',
556 'econfig': '[Ar] 4s2 3d10 4p6 | 4d10',
557 'fleur_default_econfig': '[Ar] 4s2 3d10 | 4p6 4d10',
558 'lo': '4p',
559 'rmt': 2.1,
560 'lmax': '',
561 'jri': 981
562 },
563 47: {
564 'mass': 107.8682,
565 'name': 'Silver',
566 'symbol': 'Ag',
567 'econfig': '[Ar] 4s2 3d10 4p6 | 5s1 4d10',
568 'fleur_default_econfig': '[Ar] 3d10 | 4s2 4p6 5s1 4d10',
569 'lo': '4s 4p',
570 'rmt': 2.3,
571 'lmax': '',
572 'jri': 981
573 },
574 48: {
575 'mass': 112.411,
576 'name': 'Cadmium',
577 'symbol': 'Cd',
578 'econfig': '[Ar] 4s2 3d10 4p6 | 4d10 5s2',
579 'fleur_default_econfig': '[Ar] 4s2 3d10 4p6 | 4d10 5s2',
580 'lo': '4d',
581 'rmt': 2.4,
582 'lmax': '',
583 'jri': 981
584 },
585 49: {
586 'mass': 114.818,
587 'name': 'Indium',
588 'symbol': 'In',
589 'econfig': '[Ar] 4s2 3d10 4p6 | 4d10 5s2 5p1',
590 'fleur_default_econfig': '[Ar] 4s2 3d10 4p6 | 4d10 5s2 5p1',
591 'lo': '4d',
592 'rmt': 2.2,
593 'lmax': '',
594 'jri': 981
595 },
596 50: {
597 'mass': 118.71,
598 'name': 'Tin',
599 'symbol': 'Sn',
600 'econfig': '[Kr] 4d10 | 5s2 5p2',
601 'fleur_default_econfig': '[Kr] | 4d10 5s2 5p2',
602 'lo': '4d',
603 'rmt': 2.3,
604 'lmax': '',
605 'jri': 981
606 },
607 51: {
608 'mass': 121.76,
609 'name': 'Antimony',
610 'symbol': 'Sb',
611 'econfig': '[Kr] 4d10 | 5s2 5p3',
612 'fleur_default_econfig': '[Kr] | 4d10 5s2 5p3',
613 'lo': '4d',
614 'rmt': 2.3,
615 'lmax': '',
616 'jri': 981
617 },
618 52: {
619 'mass': 127.6,
620 'name': 'Tellurium',
621 'symbol': 'Te',
622 'econfig': '[Kr] 4d10 | 5s2 5p4',
623 'fleur_default_econfig': '[Kr] | 4d10 5s2 5p4',
624 'lo': '4d',
625 'rmt': 2.3,
626 'lmax': '',
627 'jri': 981
628 },
629 53: {
630 'mass': 126.90447,
631 'name': 'Iodine',
632 'symbol': 'I',
633 'econfig': '[Kr] 4d10 | 5s2 5p5',
634 'fleur_default_econfig': '[Kr] | 4d10 5s2 5p5',
635 'lo': '4d',
636 'rmt': 2.2,
637 'lmax': '',
638 'jri': 981
639 },
640 54: {
641 'mass': 131.293,
642 'name': 'Xenon',
643 'symbol': 'Xe',
644 'econfig': '[Kr] 4d10 | 5s2 5p6',
645 'fleur_default_econfig': '[Kr] | 4d10 5s2 5p6',
646 'lo': '4d',
647 'rmt': 2.2,
648 'lmax': '',
649 'jri': 981
650 },
651 55: {
652 'mass': 132.9054519,
653 'name': 'Caesium',
654 'symbol': 'Cs',
655 'econfig': '[Kr] 4d10 5s2 | 5p6 6s1',
656 'fleur_default_econfig': '[Kr] 4d10 | 5s2 5p6 6s1',
657 'lo': '5s 5p',
658 'rmt': 2.4,
659 'lmax': '',
660 'jri': 981
661 },
662 56: {
663 'mass': 137.327,
664 'name': 'Barium',
665 'symbol': 'Ba',
666 'econfig': '[Kr] 4d10 5s2 | 5p6 6s2',
667 'fleur_default_econfig': '[Kr] 4d10 | 5s2 5p6 6s2',
668 'lo': '5s 5p',
669 'rmt': 2.4,
670 'lmax': '',
671 'jri': 981
672 },
673 57: {
674 'mass': 138.90547,
675 'name': 'Lanthanum',
676 'symbol': 'La',
677 'econfig': '[Kr] 4d10 5s2 | 5p6 6s2 5d1',
678 'fleur_default_econfig': '[Kr] 4d10 | 5s2 5p6 6s2 5d1',
679 'lo': '5s 5p',
680 'rmt': 2.2,
681 'lmax': '',
682 'jri': 981
683 },
684 58: {
685 'mass': 140.116,
686 'name': 'Cerium',
687 'symbol': 'Ce',
688 'econfig': '[Kr] 4d10 5s2 5p6 | 6s2 4f1 5d1',
689 'fleur_default_econfig': '[Kr] 4d10 | 5s2 5p6 6s2 4f1 5d1',
690 'lo': '5s 5p',
691 'rmt': 2.2,
692 'lmax': '',
693 'jri': 981
694 },
695 59: {
696 'mass': 140.90765,
697 'name': 'Praseodymium',
698 'symbol': 'Pr',
699 'econfig': '[Kr] 4d10 5s2 5p6 | 6s2 4f3',
700 'fleur_default_econfig': '[Kr] 4d10 | 5s2 5p6 6s2 4f3',
701 'lo': '5s 5p',
702 'rmt': 2.4,
703 'lmax': '',
704 'jri': 981
705 },
706 60: {
707 'mass': 144.242,
708 'name': 'Neodymium',
709 'symbol': 'Nd',
710 'econfig': '[Kr] 4d10 5s2 5p6 | 6s2 4f4',
711 'fleur_default_econfig': '[Kr] 4d10 | 5s2 5p6 6s2 4f4',
712 'lo': '5s 5p',
713 'rmt': 2.1,
714 'lmax': '',
715 'jri': 981
716 },
717 61: {
718 'mass': 145.0,
719 'name': 'Promethium',
720 'symbol': 'Pm',
721 'econfig': '[Kr] 4d10 5s2 5p6 | 6s2 4f5',
722 'fleur_default_econfig': '[Kr] 4d10 | 5s2 5p6 6s2 4f5',
723 'lo': '5s 5p',
724 'rmt': 2.4,
725 'lmax': '',
726 'jri': 981
727 },
728 62: {
729 'mass': 150.36,
730 'name': 'Samarium',
731 'symbol': 'Sm',
732 'econfig': '[Kr] 4d10 5s2 5p6 | 6s2 4f6',
733 'fleur_default_econfig': '[Kr] 4d10 | 5s2 5p6 6s2 4f6',
734 'lo': '5s 5p',
735 'rmt': 2.1,
736 'lmax': '',
737 'jri': 981
738 },
739 63: {
740 'mass': 151.964,
741 'name': 'Europium',
742 'symbol': 'Eu',
743 'econfig': '[Kr] 4d10 | 4f7 5s2 5p6 6s2',
744 'fleur_default_econfig': '[Kr] 4d10 | 5s2 5p6 4f7 6s2',
745 'lo': '5s 5p',
746 'rmt': 2.4,
747 'lmax': '',
748 'jri': 981
749 },
750 64: {
751 'mass': 157.25,
752 'name': 'Gadolinium',
753 'symbol': 'Gd',
754 'econfig': '[Kr] 4d10 5s2 5p6 | 6s2 4f7 5d1',
755 'fleur_default_econfig': '[Kr] 4d10 | 5s2 5p6 6s2 4f7 5d1',
756 'lo': '5s 5p',
757 'rmt': 2.2,
758 'lmax': '',
759 'jri': 981
760 },
761 65: {
762 'mass': 158.92535,
763 'name': 'Terbium',
764 'symbol': 'Tb',
765 'econfig': '[Kr] 4d10 5s2 5p6 | 6s2 4f9',
766 'fleur_default_econfig': '[Kr] 4d10 | 5s2 5p6 6s2 4f8 5d1',
767 'lo': '5s 5p',
768 'rmt': 2.1,
769 'lmax': '',
770 'jri': 981
771 },
772 66: {
773 'mass': 162.5,
774 'name': 'Dysprosium',
775 'symbol': 'Dy',
776 'econfig': '[Kr] 4d10 5s2 5p6 | 6s2 4f10',
777 'fleur_default_econfig': '[Kr] 4d10 | 5s2 5p6 6s2 4f9 5d1',
778 'lo': '5s 5p',
779 'rmt': 2.4,
780 'lmax': '',
781 'jri': 981
782 },
783 67: {
784 'mass': 164.93032,
785 'name': 'Holmium',
786 'symbol': 'Ho',
787 'econfig': '[Kr] 4d10 5s2 5p6 | 6s2 4f11',
788 'fleur_default_econfig': '[Kr] 4d10 | 5s2 5p6 6s2 4f10 5d1',
789 'lo': '5s 5p',
790 'rmt': 2.4,
791 'lmax': '',
792 'jri': 981
793 },
794 68: {
795 'mass': 167.259,
796 'name': 'Erbium',
797 'symbol': 'Er',
798 'econfig': '[Kr] 4d10 5s2 5p6 | 6s2 4f12',
799 'fleur_default_econfig': '[Kr] 4d10 | 5s2 5p6 6s2 4f11 5d1',
800 'lo': '5s 5p',
801 'rmt': 2.5,
802 'lmax': '',
803 'jri': 981
804 },
805 69: {
806 'mass': 168.93421,
807 'name': 'Thulium',
808 'symbol': 'Tm',
809 'econfig': '[Kr] 4d10 5s2 5p6 | 6s2 4f13',
810 'fleur_default_econfig': '[Kr] 4d10 | 5s2 5p6 6s2 4f12 5d1',
811 'lo': '5s 5p',
812 'rmt': 2.4,
813 'lmax': '',
814 'jri': 981
815 },
816 70: {
817 'mass': 173.054,
818 'name': 'Ytterbium',
819 'symbol': 'Yb',
820 'econfig': '[Kr] 4d10 5s2 5p6 | 6s2 4f14',
821 'fleur_default_econfig': '[Kr] 4d10 | 5s2 5p6 6s2 4f13 5d1',
822 'lo': '5s 5p',
823 'rmt': 2.6,
824 'lmax': '',
825 'jri': 981
826 },
827 71: {
828 'mass': 174.9668,
829 'name': 'Lutetium',
830 'symbol': 'Lu',
831 'econfig': '[Kr] 4d10 | 4f14 5s2 5p6 5d1 6s2',
832 'fleur_default_econfig': '[Kr] 4d10 | 5s2 5p6 4f14 6s2 5d1',
833 'lo': '5s 5p',
834 'rmt': 2.5,
835 'lmax': '',
836 'jri': 981
837 },
838 72: {
839 'mass': 178.49,
840 'name': 'Hafnium',
841 'symbol': 'Hf',
842 'econfig': '[Kr] 4d10 | 4f14 5s2 5p6 5d2 6s2',
843 'fleur_default_econfig': '[Kr] 4d10 4f14 | 5s2 5p6 6s2 5d2',
844 'lo': '5s 5p',
845 'rmt': 2.3,
846 'lmax': '',
847 'jri': 981
848 },
849 73: {
850 'mass': 180.94788,
851 'name': 'Tantalum',
852 'symbol': 'Ta',
853 'econfig': '[Kr] 4d10 4f14 | 5s2 5p6 5d3 6s2',
854 'fleur_default_econfig': '[Kr] 4d10 4f14 | 5s2 5p6 6s2 5d3',
855 'lo': '5s 5p',
856 'rmt': 2.2,
857 'lmax': '',
858 'jri': 981
859 },
860 74: {
861 'mass': 183.84,
862 'name': 'Tungsten',
863 'symbol': 'W',
864 'econfig': '[Kr] 5s2 4d10 4f14 | 5p6 6s2 5d4',
865 'fleur_default_econfig': '[Kr] 4d10 4f14 | 5s2 5p6 6s2 5d4',
866 'lo': '5s 5p',
867 'rmt': 2.1,
868 'lmax': '',
869 'jri': 981
870 },
871 75: {
872 'mass': 186.207,
873 'name': 'Rhenium',
874 'symbol': 'Re',
875 'econfig': '[Kr] 4d10 4f14 5p6 | 5s2 6s2 5d5',
876 'fleur_default_econfig': '[Kr] 4d10 4f14 | 5s2 5p6 6s2 5d5',
877 'lo': '5s 5p',
878 'rmt': 2.1,
879 'lmax': '',
880 'jri': 981
881 },
882 76: {
883 'mass': 190.23,
884 'name': 'Osmium',
885 'symbol': 'Os',
886 'econfig': '[Kr] 4d10 4f14 5p6 | 5s2 6s2 5d6',
887 'fleur_default_econfig': '[Kr] 5s2 4d10 4f14 | 5p6 6s2 5d6',
888 'lo': '5p',
889 'rmt': 2.1,
890 'lmax': '',
891 'jri': 981
892 },
893 77: {
894 'mass': 192.217,
895 'name': 'Iridium',
896 'symbol': 'Ir',
897 'econfig': '[Kr] 4d10 4f14 5p6 | 5s2 6s2 5d7',
898 'fleur_default_econfig': '[Kr] 5s2 4d10 4f14 | 5p6 6s2 5d7',
899 'lo': '5p',
900 'rmt': 2.1,
901 'lmax': '',
902 'jri': 981
903 },
904 78: {
905 'mass': 195.084,
906 'name': 'Platinum',
907 'symbol': 'Pt',
908 'econfig': '[Kr] 4d10 4f14 5p6 | 5s2 6s2 5d8',
909 'fleur_default_econfig': '[Kr] 5s2 4d10 4f14 | 5p6 6s2 5d8',
910 'lo': '5p',
911 'rmt': 2.1,
912 'lmax': '',
913 'jri': 981
914 },
915 79: {
916 'mass': 196.966569,
917 'name': 'Gold',
918 'symbol': 'Au',
919 'econfig': '[Kr] 4d10 4f14 5p6 | 5s2 6s2 5d9',
920 'fleur_default_econfig': '[Kr] 4d10 4f14 | 5s2 5p6 6s2 5d9',
921 'lo': '5s 5p',
922 'rmt': 2.2,
923 'lmax': '',
924 'jri': 981
925 },
926 80: {
927 'mass': 200.59,
928 'name': 'Mercury',
929 'symbol': 'Hg',
930 'econfig': '[Kr] 5s2 4d10 4f14 | 5p6 5d10 6s2',
931 'fleur_default_econfig': '[Kr] 5s2 4d10 4f14 5p6 | 5d10 6s2',
932 'lo': '5d',
933 'rmt': 2.4,
934 'lmax': '',
935 'jri': 981
936 },
937 81: {
938 'mass': 204.3833,
939 'name': 'Thallium',
940 'symbol': 'Tl',
941 'econfig': '[Xe] 4f14 | 5d10 6s2 6p1',
942 'fleur_default_econfig': '[Xe] 4f14 | 5d10 6s2 6p1',
943 'lo': '5d',
944 'rmt': 2.4,
945 'lmax': '',
946 'jri': 981
947 },
948 82: {
949 'mass': 207.2,
950 'name': 'Lead',
951 'symbol': 'Pb',
952 'econfig': '[Xe] 4f14 | 5d10 6s2 6p2',
953 'fleur_default_econfig': '[Xe] 4f14 | 5d10 6s2 6p2',
954 'lo': '5d',
955 'rmt': 2.4,
956 'lmax': '',
957 'jri': 981
958 },
959 83: {
960 'mass': 208.9804,
961 'name': 'Bismuth',
962 'symbol': 'Bi',
963 'econfig': '[Xe] 4f14 | 5d10 6s2 6p3',
964 'fleur_default_econfig': '[Xe] 4f14 | 5d10 6s2 6p3',
965 'lo': '5d',
966 'rmt': 2.4,
967 'lmax': '',
968 'jri': 981
969 },
970 84: {
971 'mass': 209.0,
972 'name': 'Polonium',
973 'symbol': 'Po',
974 'econfig': '[Xe] 4f14 | 5d10 6s2 6p4',
975 'fleur_default_econfig': '[Xe] 4f14 | 5d10 6s2 6p4',
976 'lo': '5d',
977 'rmt': 2.2,
978 'lmax': '',
979 'jri': 981
980 },
981 85: {
982 'mass': 210.0,
983 'name': 'Astatine',
984 'symbol': 'At',
985 'econfig': '[Xe] 4f14 | 5d10 6s2 6p5',
986 'fleur_default_econfig': '[Xe] 4f14 | 5d10 6s2 6p5',
987 'lo': '5d',
988 'rmt': 2.2,
989 'lmax': '',
990 'jri': 981
991 },
992 86: {
993 'mass': 222.0,
994 'name': 'Radon',
995 'symbol': 'Rn',
996 'econfig': '[Xe] 4f14 | 5d10 6s2 6p6',
997 'fleur_default_econfig': '[Xe] 4f14 | 5d10 6s2 6p6',
998 'lo': '5d',
999 'rmt': 2.2,
1000 'lmax': '',
1001 'jri': 981
1002 }, # TODO: after wards not rigth
1003 87: {
1004 'mass': 223.0,
1005 'name': 'Francium',
1006 'symbol': 'Fr',
1007 'econfig': '[Xe] 4f14 5d10 6s2 | 6p6 7s1',
1008 'fleur_default_econfig': '[Xe] 4f14 5d10 | 6s2 6p6 7s1',
1009 'lo': '6s 6p',
1010 'rmt': 2.2,
1011 'lmax': '',
1012 'jri': 981
1013 },
1014 88: {
1015 'mass': 226.0,
1016 'name': 'Radium',
1017 'symbol': 'Ra',
1018 'econfig': '[Xe] 4f14 5d10 6s2 | 6p6 7s2',
1019 'fleur_default_econfig': '[Xe] 4f14 5d10 | 6s2 6p6 7s2',
1020 'lo': '6s 6p',
1021 'rmt': 2.2,
1022 'lmax': '',
1023 'jri': 981
1024 },
1025 89: {
1026 'mass': 227.0,
1027 'name': 'Actinium',
1028 'symbol': 'Ac',
1029 'econfig': '[Xe] 4f14 5d10 6s2 | 6p6 7s2 6d1',
1030 'fleur_default_econfig': '[Xe] 4f14 5d10 | 6s2 6p6 7s2 6d1',
1031 'lo': '6s 6p',
1032 'rmt': 2.2,
1033 'lmax': '',
1034 'jri': 981
1035 },
1036 90: {
1037 'mass': 232.03806,
1038 'name': 'Thorium',
1039 'symbol': 'Th',
1040 'econfig': '[Xe] 4f14 5d10 6s2 | 6p6 7s2 6d1 5f1',
1041 'fleur_default_econfig': '[Xe] 4f14 5d10 | 6s2 6p6 7s2 6d1 5f1',
1042 'lo': '6s 6p',
1043 'rmt': 2.2,
1044 'lmax': '',
1045 'jri': 981
1046 },
1047 91: {
1048 'mass': 231.03588,
1049 'name': 'Protactinium',
1050 'symbol': 'Pa',
1051 'econfig': '[Xe] 4f14 5d10 6s2 | 6p6 7s2 6d1 5f2',
1052 'fleur_default_econfig': '[Xe] 4f14 5d10 | 6s2 6p6 7s2 6d1 5f2',
1053 'lo': '6s 6p',
1054 'rmt': 2.2,
1055 'lmax': '',
1056 'jri': 981
1057 },
1058 92: {
1059 'mass': 238.02891,
1060 'name': 'Uranium',
1061 'symbol': 'U',
1062 'econfig': '[Xe] 4f14 5d10 6s2 6p6| 7s2 5f4',
1063 'fleur_default_econfig': '[Xe] 4f14 5d10 | 6s2 6p6 7s2 5f4',
1064 'lo': '6s 6p',
1065 'rmt': 2.3,
1066 'lmax': '',
1067 'jri': 981
1068 },
1069 93: {
1070 'mass': 237.0,
1071 'name': 'Neptunium',
1072 'symbol': 'Np',
1073 'econfig': '[Xe] 4f14 5d10 6s2 6p6 | 7s2 5f5',
1074 'fleur_default_econfig': '[Xe] 4f14 5d10 | 6s2 6p6 7s2 5f5',
1075 'lo': '6s 6p',
1076 'rmt': 2.1,
1077 'lmax': '',
1078 'jri': 981
1079 },
1080 94: {
1081 'mass': 244.0,
1082 'name': 'Plutonium',
1083 'symbol': 'Pu',
1084 'econfig': '[Xe] 4f14 5d10 6s2 6p6 | 7s2 5f6',
1085 'fleur_default_econfig': '[Xe] 4f14 5d10 | 6s2 6p6 7s2 5f6',
1086 'lo': '6s 6p',
1087 'rmt': 2.2,
1088 'lmax': '',
1089 'jri': 981
1090 },
1091 95: {
1092 'mass': 243.0,
1093 'name': 'Americium',
1094 'symbol': 'Am',
1095 'econfig': '[Xe] 4f14 5d10 6s2 6p6 | 7s2 5f7',
1096 'fleur_default_econfig': '[Xe] 4f14 5d10 | 6s2 6p6 7s2 5f7',
1097 'lo': '6s 6p',
1098 'rmt': 2.4,
1099 'lmax': '',
1100 'jri': 981
1101 },
1102 96: {
1103 'mass': 247.0,
1104 'name': 'Curium',
1105 'symbol': 'Cm',
1106 'econfig': '[Xe] 4f14 5d10 6s2 6p6 | 7s2 5f8',
1107 'fleur_default_econfig': '[Xe] 4f14 5d10 | 6s2 6p6 7s2 5f8',
1108 'lo': '6s 6p',
1109 'rmt': 2.4,
1110 'lmax': '',
1111 'jri': 981
1112 },
1113 97: {
1114 'mass': 247.0,
1115 'name': 'Berkelium',
1116 'symbol': 'Bk',
1117 'econfig': '[Xe] 4f14 5d10 6s2 6p6 | 7s2 5f9',
1118 'fleur_default_econfig': '[Xe] 4f14 5d10 | 6s2 6p6 7s2 5f9',
1119 'lo': '6s 6p',
1120 'rmt': 2.4,
1121 'lmax': '',
1122 'jri': 981
1123 },
1124 98: {
1125 'mass': 251.0,
1126 'name': 'Californium',
1127 'symbol': 'Cf',
1128 'econfig': '[Xe] 4f14 5d10 6s2 6p6 | 7s2 5f10',
1129 'fleur_default_econfig': '[Xe] 4f14 5d10 | 6s2 6p6 7s2 5f10',
1130 'lo': '6s 6p',
1131 'rmt': 2.4,
1132 'lmax': '',
1133 'jri': 981
1134 },
1135 99: {
1136 'mass': 252.0,
1137 'name': 'Einsteinium',
1138 'symbol': 'Es',
1139 'econfig': '[Xe] 4f14 5d10 6s2 6p6 | 7s2 5f11',
1140 'fleur_default_econfig': '[Xe] 4f14 5d10 | 6s2 6p6 7s2 5f11',
1141 'lo': '6s 6p',
1142 'rmt': 2.4,
1143 'lmax': '',
1144 'jri': 981
1145 },
1146 100: {
1147 'mass': 257.0,
1148 'name': 'Fermium',
1149 'symbol': 'Fm',
1150 'econfig': '[Xe] 4f14 5d10 6s2 6p6 | 7s2 5f12',
1151 'fleur_default_econfig': '[Xe] 4f14 5d10 | 6s2 6p6 7s2 5f12',
1152 'lo': '6s 6p',
1153 'rmt': 2.4,
1154 'lmax': '',
1155 'jri': 981
1156 },
1157 101: {
1158 'mass': 258.0,
1159 'name': 'Mendelevium',
1160 'symbol': 'Md',
1161 'econfig': '[Xe] 4f14 5d10 6s2 6p6 | 7s2 5f13',
1162 'fleur_default_econfig': '[Xe] 4f14 5d10 | 6s2 6p6 7s2 5f13',
1163 'lo': '6s 6p',
1164 'rmt': 2.4,
1165 'lmax': '',
1166 'jri': 981
1167 },
1168 102: {
1169 'mass': 259.0,
1170 'name': 'Nobelium',
1171 'symbol': 'No',
1172 'econfig': '[Xe] 4f14 5d10 6s2 6p6 | 7s2 5f14',
1173 'fleur_default_econfig': '[Xe] 4f14 5d10 | 6s2 6p6 7s2 5f14',
1174 'lo': '6s 6p',
1175 'rmt': 2.4,
1176 'lmax': '',
1177 'jri': 981
1178 },
1179 103: {
1180 'mass': 262.0,
1181 'name': 'Lawrencium',
1182 'symbol': 'Lr',
1183 'econfig': '[Xe] 4f14 5d10 6s2 6p6 | 7s2 5f14 6d1',
1184 'fleur_default_econfig': '[Xe] 4f14 5d10 | 6s2 6p6 7s2 5f14 6d1',
1185 'lo': '6s 6p 5f',
1186 'rmt': 2.4,
1187 'lmax': '',
1188 'jri': 981
1189 },
1190 104: {
1191 'mass': 267.0,
1192 'name': 'Rutherfordium',
1193 'symbol': 'Rf',
1194 'econfig': '[Xe] 4f14 5d10 6s2 6p6 | 7s2 5f14 6d2',
1195 'fleur_default_econfig': '[Xe] 4f14 5d10 6s2 6p6 | 7s2 5f14 6d2',
1196 'lo': '6p 5f',
1197 'rmt': 2.4,
1198 'lmax': '',
1199 'jri': 981
1200 },
1201 105: {
1202 'mass': 268.0,
1203 'name': 'Dubnium',
1204 'symbol': 'Db',
1205 'econfig': '[Xe] 4f14 5d10 6s2 6p6 | 7s2 5f14 6d3',
1206 'fleur_default_econfig': '[Xe] 4f14 5d10 6s2 | 6p6 7s2 5f14 6d3',
1207 'lo': '6p 5f',
1208 'rmt': 2.4,
1209 'lmax': '',
1210 'jri': 981
1211 },
1212 106: {
1213 'mass': 271.0,
1214 'name': 'Seaborgium',
1215 'symbol': 'Sg',
1216 'econfig': '[Xe] 4f14 5d10 6s2 6p6 | 7s2 5f14 6d4',
1217 'fleur_default_econfig': '[Xe] 4f14 5d10 6s2 | 6p6 7s2 5f14 6d4',
1218 'lo': '6p 5f',
1219 'rmt': 2.4,
1220 'lmax': '',
1221 'jri': 981
1222 },
1223 107: {
1224 'mass': 272.0,
1225 'name': 'Bohrium',
1226 'symbol': 'Bh',
1227 'econfig': '[Rn] 7s2 5f14 | 6d5',
1228 'fleur_default_econfig': '[Xe] 4f14 5d10 6s2 6p6 5f14 | 7s2 6d5',
1229 'lo': '',
1230 'rmt': 2.4,
1231 'lmax': '',
1232 'jri': 981
1233 },
1234 108: {
1235 'mass': 270.0,
1236 'name': 'Hassium',
1237 'symbol': 'Hs',
1238 'econfig': '[Rn] 7s2 5f14 | 6d6',
1239 'fleur_default_econfig': '[Rn] 5f14 | 7s2 6d6',
1240 'lo': '',
1241 'rmt': 2.4,
1242 'lmax': '',
1243 'jri': 981
1244 },
1245 109: {
1246 'mass': 276.0,
1247 'name': 'Meitnerium',
1248 'symbol': 'Mt',
1249 'econfig': '[Rn] 7s2 5f14 | 6d7',
1250 'fleur_default_econfig': '[Rn] 5f14 | 7s2 6d7',
1251 'lo': '',
1252 'rmt': 2.4,
1253 'lmax': '',
1254 'jri': 981
1255 },
1256 110: {
1257 'mass': 281.0,
1258 'name': 'Darmstadtium',
1259 'symbol': 'Ds',
1260 'econfig': '[Rn] 7s2 5f14 | 6d8',
1261 'fleur_default_econfig': '[Rn] 5f14 | 7s2 6d8',
1262 'lo': '',
1263 'rmt': 2.4,
1264 'lmax': '',
1265 'jri': 981
1266 },
1267 111: {
1268 'mass': 280.0,
1269 'name': 'Roentgenium',
1270 'symbol': 'Rg',
1271 'econfig': '[Rn] 7s2 5f14 | 6d9',
1272 'fleur_default_econfig': '[Rn] 5f14 | 7s2 6d9',
1273 'lo': '',
1274 'rmt': 2.4,
1275 'lmax': '',
1276 'jri': 981
1277 },
1278 112: {
1279 'mass': 285.0,
1280 'name': 'Copernicium',
1281 'symbol': 'Cn',
1282 'econfig': '[Rn] 7s2 5f14 | 6d10',
1283 'fleur_default_econfig': '[Rn] 5f14 | 7s2 6d10',
1284 'lo': '6d',
1285 'rmt': 2.4,
1286 'lmax': '',
1287 'jri': 981
1288 },
1289 113: {
1290 'mass': 285.0,
1291 'name': 'Nihomium',
1292 'symbol': 'Nh',
1293 'econfig': '[Rn] 7s2 5f14 | 6d10 7p1',
1294 'fleur_default_econfig': '[Rn] 7s2 5f14 | 6d10 7p1',
1295 'lo': '6d',
1296 'rmt': 2.4,
1297 'lmax': '',
1298 'jri': 981
1299 },
1300 114: {
1301 'mass': 289.0,
1302 'name': 'Flerovium',
1303 'symbol': 'Fl',
1304 'econfig': '[Rn] 7s2 5f14 | 6d10 7p2',
1305 'fleur_default_econfig': '[Rn] 7s2 5f14 | 6d10 7p2',
1306 'lo': '6d',
1307 'rmt': 2.4,
1308 'lmax': '',
1309 'jri': 981
1310 },
1311 115: {
1312 'mass': 0.0,
1313 'name': 'Mascovium',
1314 'symbol': 'Mc',
1315 'econfig': '[Rn] 7s2 5f14 | 6d10 7p3',
1316 'fleur_default_econfig': '[Rn] 7s2 5f14 | 6d10 7p3',
1317 'lo': '6d',
1318 'rmt': 2.4,
1319 'lmax': '',
1320 'jri': 981
1321 },
1322 116: {
1323 'mass': 293.0,
1324 'name': 'Livermorium',
1325 'symbol': 'Lv',
1326 'econfig': '[Rn] 7s2 5f14 | 6d10 7p4',
1327 'fleur_default_econfig': '[Rn] 7s2 5f14 | 6d10 7p4',
1328 'lo': '6d',
1329 'rmt': 2.4,
1330 'lmax': '',
1331 'jri': 981
1332 },
1333 117: {
1334 'mass': 0.0,
1335 'name': 'Tennessine',
1336 'symbol': 'Ts',
1337 'econfig': '[Rn] 7s2 5f14 | 6d10 7p5',
1338 'fleur_default_econfig': '[Rn] 7s2 5f14 | 6d10 7p5',
1339 'lo': '6d',
1340 'rmt': 2.4,
1341 'lmax': '',
1342 'jri': 981
1343 },
1344 118: {
1345 'mass': 0.0,
1346 'name': 'Oganesson',
1347 'symbol': 'Og',
1348 'econfig': '[Rn] 7s2 5f14 | 6d10 7p6',
1349 'fleur_default_econfig': '[Rn] 7s2 5f14 | 6d10 7p6',
1350 'lo': '6d',
1351 'rmt': 2.4,
1352 'lmax': '',
1353 'jri': 981
1354 }
1355}