allomorph.constants

Attributes

LMP_DATA_DIR

MNP_DIR

BNP_DIR

TNP_DIR

CS_DIR

GOLDEN_RATIO

VACUUM_THICKNESS

RANDOM_DISTRIB_NO

ELE_DICT

DIAMETER_LIST

SHAPE_LIST

BNP_DISTRIB_LIST

TNP_DISTRIB_LIST

RATIO_LIST

CUSTOM_SHAPES

Functions

update_constants(config)

Update global constants from a dictionary.

load_config(path)

Load configuration from a JSON, YAML, or TOML file.

validate_ele_dict(ele_dict)

Validate a user-supplied element dictionary.

load_ele_dict_from_file(path)

Load an element dictionary from a JSON file.

dist_1d(coord1, coord2, dim)

Compute distance between 2 points in one of their real space coordinates.

dist_3d(coord1, coord2)

Compute real space distance between 2 points.

calc_rcs_prob(obj, shape)

Compute the core-shell probability for each atom in obj.

parse_ele_comb(ele_comb[, ele_dict])

Parse a concatenated element combination string into individual symbols.

Module Contents

allomorph.constants.LMP_DATA_DIR = '.'[source]
allomorph.constants.MNP_DIR = 'MNP'[source]
allomorph.constants.BNP_DIR = 'BNP'[source]
allomorph.constants.TNP_DIR = 'TNP'[source]
allomorph.constants.CS_DIR = 'CS'[source]
allomorph.constants.GOLDEN_RATIO[source]
allomorph.constants.VACUUM_THICKNESS = 40.0[source]
allomorph.constants.RANDOM_DISTRIB_NO = 3[source]
allomorph.constants.ELE_DICT[source]
allomorph.constants.DIAMETER_LIST = [10, 15, 20][source]
allomorph.constants.SHAPE_LIST = ['OT', 'SP', 'IC', 'CU', 'DH', 'TH', 'RD', 'TO', 'CO'][source]
allomorph.constants.BNP_DISTRIB_LIST = ['L10', 'RAL', 'RCS'][source]
allomorph.constants.TNP_DISTRIB_LIST = ['L10R', 'CS', 'CL10S', 'CRALS', 'RRAL', 'CSRAL', 'CSL10', 'CRSR', 'LL10'][source]
allomorph.constants.RATIO_LIST = [20, 40][source]
allomorph.constants.CUSTOM_SHAPES[source]
allomorph.constants.update_constants(config)[source]

Update global constants from a dictionary.

Parameters:

config – Dictionary containing constant names and their new values.

allomorph.constants.load_config(path)[source]

Load configuration from a JSON, YAML, or TOML file.

Parameters:

path – Path to the configuration file.

Returns:

The loaded configuration dictionary.

allomorph.constants.validate_ele_dict(ele_dict)[source]

Validate a user-supplied element dictionary.

Parameters:

ele_dict – Dictionary mapping element symbols to property dicts.

Returns:

The validated dictionary.

Raises:

ValueError – If required keys are missing or invalid.

allomorph.constants.load_ele_dict_from_file(path)[source]

Load an element dictionary from a JSON file.

Parameters:

path – Path to a JSON file containing the element dictionary.

Returns:

Validated element dictionary.

allomorph.constants.dist_1d(coord1, coord2, dim)[source]

Compute distance between 2 points in one of their real space coordinates.

allomorph.constants.dist_3d(coord1, coord2)[source]

Compute real space distance between 2 points.

allomorph.constants.calc_rcs_prob(obj, shape)[source]

Compute the core-shell probability for each atom in obj.

Returns a list where higher values correspond to surface-like positions.

Parameters:
  • obj – ASE Atoms object.

  • shape – Nanoparticle shape string (e.g. ‘IC’, ‘DH’, ‘OT’).

Returns:

List of probabilities, one per atom.

allomorph.constants.parse_ele_comb(ele_comb, ele_dict=None)[source]

Parse a concatenated element combination string into individual symbols.

Parameters:
  • ele_comb – String like ‘AuPtPd’ or ‘CuAgAu’.

  • ele_dict – Optional element dictionary to use for matching. If None, the built-in ELE_DICT is used.

Returns:

List of element symbols, e.g. [‘Au’, ‘Pt’, ‘Pd’].

Raises:

ValueError – If the string cannot be parsed.