pymatgen.analysis.chemenv.coordination_environments.chemenv_strategies module

class AbstractChemenvStrategy(structure_environments=None, symmetry_measure_type='csm_wcs_ctwcc')[source]

Bases: monty.json.MSONable

Class used to define a Chemenv strategy for the neighbors and coordination environment to be applied to a StructureEnvironments object

Abstract constructor for the all chemenv strategies. :param structure_environments: StructureEnvironments object containing all the information on the coordination of the sites in a structure

AC = <pymatgen.analysis.chemenv.utils.defs_utils.AdditionalConditions object>
DEFAULT_SYMMETRY_MEASURE_TYPE = 'csm_wcs_ctwcc'
STRATEGY_DESCRIPTION = None
STRATEGY_INFO_FIELDS = []
STRATEGY_OPTIONS = OrderedDict()
apply_strategy()[source]

Applies the strategy to the structure_environments object in order to define the coordination environments of the sites in the structure_environments object :param structure_environments: StructureEnvironments object containing all the information needed to define the coordination environment of the sites in the structure :return: The coordination environment(s) of the sites

as_dict()[source]

Bson-serializable dict representation of the SimplestChemenvStrategy object. :return: Bson-serializable dict representation of the SimplestChemenvStrategy object.

equivalent_site_index(psite)[source]
equivalent_site_index_and_transform(psite)[source]
classmethod from_dict(d)[source]

Reconstructs the SimpleAbundanceChemenvStrategy object from a dict representation of the SimpleAbundanceChemenvStrategy object created using the as_dict method. :param d: dict representation of the SimpleAbundanceChemenvStrategy object :return: StructureEnvironments object

get_site_ce_fractions_and_neighbors(site, full_ce_info=False, strategy_info=False)[source]

Applies the strategy to the structure_environments object in order to get coordination environments, their fraction, csm, geometry_info, and neighbors :param site: Site for which the above information is seeked :return: The list of neighbors of the site. For complex strategies, where one allows multiple solutions, this can return a list of list of neighbors

get_site_coordination_environment(site)[source]

Applies the strategy to the structure_environments object in order to define the coordination environment of a given site. :param site: Site for which the coordination environment is looked for :return: The coordination environment of the site. For complex strategies, where one allows multiple solutions, this can return a list of coordination environments for the site

get_site_coordination_environments(site)[source]

Applies the strategy to the structure_environments object in order to define the coordination environment of a given site. :param site: Site for which the coordination environment is looked for :return: The coordination environment of the site. For complex strategies, where one allows multiple solutions, this can return a list of coordination environments for the site

get_site_coordination_environments_fractions(site, isite=None, dequivsite=None, dthissite=None, mysym=None, ordered=True, min_fraction=0.0, return_maps=True, return_strategy_dict_info=False)[source]

Applies the strategy to the structure_environments object in order to define the coordination environment of a given site. :param site: Site for which the coordination environment is looked for :return: The coordination environment of the site. For complex strategies, where one allows multiple solutions, this can return a list of coordination environments for the site

get_site_neighbors(site)[source]

Applies the strategy to the structure_environments object in order to get the neighbors of a given site. :param site: Site for which the neighbors are looked for :param structure_environments: StructureEnvironments object containing all the information needed to get the neighbors of the site :return: The list of neighbors of the site. For complex strategies, where one allows multiple solutions, this can return a list of list of neighbors

prepare_symmetries()[source]
set_option(option_name, option_value)[source]
set_structure_environments(structure_environments)[source]
setup_options(all_options_dict)[source]
symmetry_measure_type
uniquely_determines_coordination_environments

Returns True if the strategy leads to a unique coordination environment, False otherwise. :return: True if the strategy leads to a unique coordination environment, False otherwise.

class AdditionalConditionInt[source]

Bases: int, pymatgen.analysis.chemenv.coordination_environments.chemenv_strategies.StrategyOption

allowed_values = 'Integer amongst :\n - 0 for "No additional condition"\n - 1 for "Only anion-cation bonds"\n - 2 for "No element-element bonds (same elements)"\n - 3 for "Only anion-cation bonds and no element-element bonds (same elements)"\n - 4 for "Only element-oxygen bonds"\n'
as_dict()[source]
description = 'Only element-oxygen bonds'
classmethod from_dict(d)[source]
integer = 4
class AngleCutoffFloat[source]

Bases: float, pymatgen.analysis.chemenv.coordination_environments.chemenv_strategies.StrategyOption

allowed_values = 'Real number between 0.0 and 1.0'
as_dict()[source]
classmethod from_dict(d)[source]
class AngleNbSetWeight(aa=1.0)[source]

Bases: pymatgen.analysis.chemenv.coordination_environments.chemenv_strategies.NbSetWeight

angle_sum(nb_set)[source]
angle_sumn(nb_set)[source]
as_dict()[source]
classmethod from_dict(dd)[source]
weight(nb_set, structure_environments, cn_map=None, additional_info=None)[source]
class CNBiasNbSetWeight(cn_weights, initialization_options)[source]

Bases: pymatgen.analysis.chemenv.coordination_environments.chemenv_strategies.NbSetWeight

as_dict()[source]
classmethod explicit(cn_weights)[source]
classmethod from_description(dd)[source]
classmethod from_dict(dd)[source]
classmethod geometrically_equidistant(weight_cn1, weight_cn13)[source]
classmethod linearly_equidistant(weight_cn1, weight_cn13)[source]
weight(nb_set, structure_environments, cn_map=None, additional_info=None)[source]
class CSMFloat[source]

Bases: float, pymatgen.analysis.chemenv.coordination_environments.chemenv_strategies.StrategyOption

allowed_values = 'Real number between 0.0 and 100.0'
as_dict()[source]
classmethod from_dict(d)[source]
class DeltaCSMNbSetWeight(effective_csm_estimator={'function': 'power2_inverse_decreasing', 'options': {'max_csm': 8.0}}, weight_estimator={'function': 'smootherstep', 'options': {'delta_csm_min': 0.5, 'delta_csm_max': 3.0}}, delta_cn_weight_estimators=None, symmetry_measure_type='csm_wcs_ctwcc')[source]

Bases: pymatgen.analysis.chemenv.coordination_environments.chemenv_strategies.NbSetWeight

DEFAULT_EFFECTIVE_CSM_ESTIMATOR = {'function': 'power2_inverse_decreasing', 'options': {'max_csm': 8.0}}
DEFAULT_SYMMETRY_MEASURE_TYPE = 'csm_wcs_ctwcc'
DEFAULT_WEIGHT_ESTIMATOR = {'function': 'smootherstep', 'options': {'delta_csm_min': 0.5, 'delta_csm_max': 3.0}}
as_dict()[source]
classmethod delta_cn_specifics(delta_csm_mins=None, delta_csm_maxs=None, function='smootherstep', symmetry_measure_type='csm_wcs_ctwcc', effective_csm_estimator={'function': 'power2_inverse_decreasing', 'options': {'max_csm': 8.0}})[source]
classmethod from_dict(dd)[source]
weight(nb_set, structure_environments, cn_map=None, additional_info=None)[source]
class DistanceAngleAreaNbSetWeight(weight_type='has_intersection', surface_definition={'type': 'standard_elliptic', 'distance_bounds': {'lower': 1.2, 'upper': 1.8}, 'angle_bounds': {'lower': 0.1, 'upper': 0.8}}, nb_sets_from_hints='fallback_to_source', other_nb_sets='0_weight', additional_condition=1, smoothstep_distance=None, smoothstep_angle=None)[source]

Bases: pymatgen.analysis.chemenv.coordination_environments.chemenv_strategies.NbSetWeight

AC = <pymatgen.analysis.chemenv.utils.defs_utils.AdditionalConditions object>
DEFAULT_SURFACE_DEFINITION = {'type': 'standard_elliptic', 'distance_bounds': {'lower': 1.2, 'upper': 1.8}, 'angle_bounds': {'lower': 0.1, 'upper': 0.8}}
as_dict()[source]
classmethod from_dict(dd)[source]
rectangle_crosses_area(d1, d2, a1, a2)[source]
w_area_has_intersection(nb_set, structure_environments, cn_map, additional_info)[source]
w_area_has_intersection_smoothstep(nb_set, structure_environments, cn_map, additional_info)[source]
w_area_intersection_nbsfh_fbs_onb0(nb_set, structure_environments, cn_map, additional_info)[source]
weight(nb_set, structure_environments, cn_map=None, additional_info=None)[source]
class DistanceCutoffFloat[source]

Bases: float, pymatgen.analysis.chemenv.coordination_environments.chemenv_strategies.StrategyOption

allowed_values = 'Real number between 1.0 and +infinity'
as_dict()[source]
classmethod from_dict(d)[source]
class MultiWeightsChemenvStrategy(structure_environments=None, additional_condition=1, symmetry_measure_type='csm_wcs_ctwcc', dist_ang_area_weight=None, self_csm_weight=None, delta_csm_weight=None, cn_bias_weight=None, angle_weight=None, normalized_angle_distance_weight=None, ce_estimator={'function': 'power2_inverse_power2_decreasing', 'options': {'max_csm': 8.0}})[source]

Bases: pymatgen.analysis.chemenv.coordination_environments.chemenv_strategies.AbstractChemenvStrategy

Constructor for the MultiWeightsChemenvStrategy. :param structure_environments: StructureEnvironments object containing all the information on the coordination of the sites in a structure

DEFAULT_CE_ESTIMATOR = {'function': 'power2_inverse_power2_decreasing', 'options': {'max_csm': 8.0}}
DEFAULT_DIST_ANG_AREA_WEIGHT = {}
STRATEGY_DESCRIPTION = ' Multi Weights ChemenvStrategy'
as_dict()[source]

Bson-serializable dict representation of the MultiWeightsChemenvStrategy object. :return: Bson-serializable dict representation of the MultiWeightsChemenvStrategy object.

classmethod from_dict(d)[source]

Reconstructs the MultiWeightsChemenvStrategy object from a dict representation of the MultipleAbundanceChemenvStrategy object created using the as_dict method. :param d: dict representation of the MultiWeightsChemenvStrategy object :return: MultiWeightsChemenvStrategy object

get_site_coordination_environment(site)[source]
get_site_coordination_environments(site, isite=None, dequivsite=None, dthissite=None, mysym=None, return_maps=False)[source]
get_site_coordination_environments_fractions(site, isite=None, dequivsite=None, dthissite=None, mysym=None, ordered=True, min_fraction=0.0, return_maps=True, return_strategy_dict_info=False, return_all=False)[source]
get_site_neighbors(site)[source]
classmethod stats_article_weights_parameters()[source]
uniquely_determines_coordination_environments
class NbSetWeight[source]

Bases: monty.json.MSONable

as_dict()[source]

A JSON serializable dict representation of this neighbors set weight.

weight(nb_set, structure_environments, cn_map=None, additional_info=None)[source]
class NormalizedAngleDistanceNbSetWeight(average_type, aa, bb)[source]

Bases: pymatgen.analysis.chemenv.coordination_environments.chemenv_strategies.NbSetWeight

ang(nb_set)[source]
anginvdist(nb_set)[source]
anginvndist(nb_set)[source]
angn(nb_set)[source]
angninvdist(nb_set)[source]
angninvndist(nb_set)[source]
as_dict()[source]
aweight(fda_list)[source]
classmethod from_dict(dd)[source]
gweight(fda_list)[source]
invdist(nb_set)[source]
invndist(nb_set)[source]
weight(nb_set, structure_environments, cn_map=None, additional_info=None)[source]
class SelfCSMNbSetWeight(effective_csm_estimator={'function': 'power2_inverse_decreasing', 'options': {'max_csm': 8.0}}, weight_estimator={'function': 'power2_decreasing_exp', 'options': {'max_csm': 8.0, 'alpha': 1.0}}, symmetry_measure_type='csm_wcs_ctwcc')[source]

Bases: pymatgen.analysis.chemenv.coordination_environments.chemenv_strategies.NbSetWeight

DEFAULT_EFFECTIVE_CSM_ESTIMATOR = {'function': 'power2_inverse_decreasing', 'options': {'max_csm': 8.0}}
DEFAULT_SYMMETRY_MEASURE_TYPE = 'csm_wcs_ctwcc'
DEFAULT_WEIGHT_ESTIMATOR = {'function': 'power2_decreasing_exp', 'options': {'max_csm': 8.0, 'alpha': 1.0}}
as_dict()[source]
classmethod from_dict(dd)[source]
weight(nb_set, structure_environments, cn_map=None, additional_info=None)[source]
class SimpleAbundanceChemenvStrategy(structure_environments=None, additional_condition=1, symmetry_measure_type='csm_wcs_ctwcc')[source]

Bases: pymatgen.analysis.chemenv.coordination_environments.chemenv_strategies.AbstractChemenvStrategy

Simple ChemenvStrategy using the neighbors that are the most “abundant” in the grid of angle and distance parameters for the definition of neighbors in the Voronoi approach. The coordination environment is then given as the one with the lowest continuous symmetry measure

Constructor for the SimpleAbundanceChemenvStrategy. :param structure_environments: StructureEnvironments object containing all the information on the coordination of the sites in a structure

DEFAULT_ADDITIONAL_CONDITION = 1
DEFAULT_MAX_DIST = 2.0
STRATEGY_DESCRIPTION = ' Simple Abundance ChemenvStrategy using the most "abundant" neighbors map \n for the definition of neighbors in the Voronoi approach. \n The coordination environment is then given as the one with the \n lowest continuous symmetry measure.'
STRATEGY_OPTIONS = OrderedDict([('additional_condition', {'type': <class 'pymatgen.analysis.chemenv.coordination_environments.chemenv_strategies.AdditionalConditionInt'>, 'internal': '_additional_condition', 'default': 1}), ('surface_calculation_type', {})])
as_dict()[source]

Bson-serializable dict representation of the SimpleAbundanceChemenvStrategy object. :return: Bson-serializable dict representation of the SimpleAbundanceChemenvStrategy object.

classmethod from_dict(d)[source]

Reconstructs the SimpleAbundanceChemenvStrategy object from a dict representation of the SimpleAbundanceChemenvStrategy object created using the as_dict method. :param d: dict representation of the SimpleAbundanceChemenvStrategy object :return: StructureEnvironments object

get_site_coordination_environment(site, isite=None, dequivsite=None, dthissite=None, mysym=None, return_map=False)[source]
get_site_coordination_environments(site, isite=None, dequivsite=None, dthissite=None, mysym=None, return_maps=False)[source]
get_site_neighbors(site)[source]
uniquely_determines_coordination_environments
class SimplestChemenvStrategy(structure_environments=None, distance_cutoff=1.4, angle_cutoff=0.3, additional_condition=1, continuous_symmetry_measure_cutoff=10.0, symmetry_measure_type='csm_wcs_ctwcc')[source]

Bases: pymatgen.analysis.chemenv.coordination_environments.chemenv_strategies.AbstractChemenvStrategy

Simplest ChemenvStrategy using fixed angle and distance parameters for the definition of neighbors in the Voronoi approach. The coordination environment is then given as the one with the lowest continuous symmetry measure

Constructor for this SimplestChemenvStrategy. :param distance_cutoff: Distance cutoff used :param angle_cutoff: Angle cutoff used

DEFAULT_ADDITIONAL_CONDITION = 1
DEFAULT_ANGLE_CUTOFF = 0.3
DEFAULT_CONTINUOUS_SYMMETRY_MEASURE_CUTOFF = 10.0
DEFAULT_DISTANCE_CUTOFF = 1.4
STRATEGY_DESCRIPTION = ' Simplest ChemenvStrategy using fixed angle and distance parameters \n for the definition of neighbors in the Voronoi approach. \n The coordination environment is then given as the one with the \n lowest continuous symmetry measure.'
STRATEGY_OPTIONS = OrderedDict([('distance_cutoff', {'type': <class 'pymatgen.analysis.chemenv.coordination_environments.chemenv_strategies.DistanceCutoffFloat'>, 'internal': '_distance_cutoff', 'default': 1.4}), ('angle_cutoff', {'type': <class 'pymatgen.analysis.chemenv.coordination_environments.chemenv_strategies.AngleCutoffFloat'>, 'internal': '_angle_cutoff', 'default': 0.3}), ('additional_condition', {'type': <class 'pymatgen.analysis.chemenv.coordination_environments.chemenv_strategies.AdditionalConditionInt'>, 'internal': '_additional_condition', 'default': 1}), ('continuous_symmetry_measure_cutoff', {'type': <class 'pymatgen.analysis.chemenv.coordination_environments.chemenv_strategies.CSMFloat'>, 'internal': '_continuous_symmetry_measure_cutoff', 'default': 10.0})])
add_strategy_visualization_to_subplot(subplot, visualization_options=None, plot_type=None)[source]
additional_condition
angle_cutoff
apply_strategy()[source]
as_dict()[source]

Bson-serializable dict representation of the SimplestChemenvStrategy object. :return: Bson-serializable dict representation of the SimplestChemenvStrategy object.

continuous_symmetry_measure_cutoff
distance_cutoff
classmethod from_dict(d)[source]

Reconstructs the SimplestChemenvStrategy object from a dict representation of the SimplestChemenvStrategy object created using the as_dict method. :param d: dict representation of the SimplestChemenvStrategy object :return: StructureEnvironments object

get_site_coordination_environment(site, isite=None, dequivsite=None, dthissite=None, mysym=None, return_map=False)[source]
get_site_coordination_environments(site, isite=None, dequivsite=None, dthissite=None, mysym=None, return_maps=False)[source]
get_site_coordination_environments_fractions(site, isite=None, dequivsite=None, dthissite=None, mysym=None, ordered=True, min_fraction=0.0, return_maps=True, return_strategy_dict_info=False)[source]
get_site_neighbors(site, isite=None, dequivsite=None, dthissite=None, mysym=None)[source]
uniquely_determines_coordination_environments
class StrategyOption[source]

Bases: monty.json.MSONable

allowed_values = None
as_dict()[source]

A JSON serializable dict representation of this strategy option.

class TargettedPenaltiedAbundanceChemenvStrategy(structure_environments=None, truncate_dist_ang=True, additional_condition=1, max_nabundant=5, target_environments=['O:6'], target_penalty_type='max_csm', max_csm=5.0, symmetry_measure_type='csm_wcs_ctwcc')[source]

Bases: pymatgen.analysis.chemenv.coordination_environments.chemenv_strategies.SimpleAbundanceChemenvStrategy

Simple ChemenvStrategy using the neighbors that are the most “abundant” in the grid of angle and distance parameters for the definition of neighbors in the Voronoi approach, with a bias for a given list of target environments. This can be useful in the case of, e.g. connectivity search of some given environment. The coordination environment is then given as the one with the lowest continuous symmetry measure

DEFAULT_TARGET_ENVIRONMENTS = ['O:6']
as_dict()[source]

Bson-serializable dict representation of the TargettedPenaltiedAbundanceChemenvStrategy object. :return: Bson-serializable dict representation of the TargettedPenaltiedAbundanceChemenvStrategy object.

classmethod from_dict(d)[source]

Reconstructs the TargettedPenaltiedAbundanceChemenvStrategy object from a dict representation of the TargettedPenaltiedAbundanceChemenvStrategy object created using the as_dict method. :param d: dict representation of the TargettedPenaltiedAbundanceChemenvStrategy object :return: TargettedPenaltiedAbundanceChemenvStrategy object

get_site_coordination_environment(site, isite=None, dequivsite=None, dthissite=None, mysym=None, return_map=False)[source]
uniquely_determines_coordination_environments
get_effective_csm(nb_set, cn_map, structure_environments, additional_info, symmetry_measure_type, max_effective_csm, effective_csm_estimator_ratio_function)[source]
set_info(additional_info, field, isite, cn_map, value)[source]