site_subs

Module to generate input files for substitutions

Functions

main()

main function

substitution(mpid, obj)

Substitute elements using the bsym package.

site_subs.substitution(mpid, obj)[source]

Substitute elements using the bsym package.

This function substitutes elements using the bsym package. It requires a ‘substitute’ key in the config.json file. Inside that, the user needs to define ‘mode’, ‘elm’, ‘sub’, and ‘new_sub’ as explained below:

Parameters: - mpid (str): Materials ID. - obj: Object of the MpConnect class.

‘substitute’ dictionary: - ‘mode’ (int): 1 for unique_structure_substitutions, 2 for substituting each key by its value pair. - ‘elm’ (str): Element to be substituted. - ‘sub’ (dict or tuple): Dictionary for single substitution or tuple for multiple substitutions. - ‘new_sub’ (dict): Dictionary for new substitutions.

If ‘mode’ is set to 1: - ‘sub’ (dict): Dictionary of elements to be substituted and their corresponding count.

If ‘mode’ is set to 2: - ‘new_sub’ (dict): Dictionary of substitutions.

Returns: None

site_subs.main()[source]

main function