pymatgen.analysis.chemenv.coordination_environments.voronoi module

This module contains the object used to describe the possible bonded atoms based on a Voronoi analysis.

class DetailedVoronoiContainer(structure=None, voronoi_list2=None, voronoi_cutoff=10.0, isites=None, normalized_distance_tolerance=1e-05, normalized_angle_tolerance=0.001, additional_conditions=None, valences=None, maximum_distance_factor=None, minimum_angle_factor=None)[source]

Bases: MSONable

Class used to store the full Voronoi of a given structure.

Constructor for the VoronoiContainer object. Either a structure is given, in which case the Voronoi is computed, or the different components of the VoronoiContainer are given (used in the from_dict method).

Parameters:
  • structure – Structure for which the Voronoi is computed.

  • voronoi_list2 – List of voronoi polyhedrons for each site.

  • voronoi_cutoff – cutoff used for the voronoi.

  • isites – indices of sites for which the Voronoi has to be computed.

  • normalized_distance_tolerance – Tolerance for two normalized distances to be considered equal.

  • normalized_angle_tolerance – Tolerance for two normalized angles to be considered equal.

  • additional_conditions – Additional conditions to be used.

  • valences – Valences of all the sites in the structure (used when additional conditions require it).

  • maximum_distance_factor – The maximum distance factor to be considered.

  • minimum_angle_factor – The minimum angle factor to be considered.

Raises:

RuntimeError if the Voronoi cannot be constructed.

AC = <pymatgen.analysis.chemenv.utils.defs_utils.AdditionalConditions object>[source]
as_dict()[source]

Bson-serializable dict representation of the VoronoiContainer.

Returns:

dictionary that is BSON-encodable.

default_normalized_angle_tolerance = 0.001[source]
default_normalized_distance_tolerance = 1e-05[source]
default_voronoi_cutoff = 10.0[source]
classmethod from_dict(d)[source]

Reconstructs the VoronoiContainer object from a dict representation of the VoronoiContainer created using the as_dict method.

Parameters:

d – dict representation of the VoronoiContainer object.

Returns:

VoronoiContainer object.

get_rdf_figure(isite, normalized=True, figsize=None, step_function=None)[source]

Get the Radial Distribution Figure for a given site.

Parameters:
  • isite – Index of the site.

  • normalized – Whether to normalize distances.

  • figsize – Size of the figure.

  • step_function – Type of step function to be used for the RDF.

Returns:

Matplotlib figure.

get_sadf_figure(isite, normalized=True, figsize=None, step_function=None)[source]

Get the Solid Angle Distribution Figure for a given site.

Parameters:
  • isite – Index of the site.

  • normalized – Whether to normalize angles.

  • figsize – Size of the figure.

  • step_function – Type of step function to be used for the SADF.

Returns:

Matplotlib figure.

is_close_to(other, rtol=0.0, atol=1e-08) bool[source]

Whether two DetailedVoronoiContainer objects are close to each other.

Parameters:
  • other – Another DetailedVoronoiContainer to be compared with.

  • rtol – Relative tolerance to compare values.

  • atol – Absolute tolerance to compare values.

Returns:

True if the two DetailedVoronoiContainer are close to each other.

maps_and_surfaces(isite, surface_calculation_type=None, max_dist=2.0, additional_conditions=None)[source]

Get the different surfaces and their cn_map corresponding to the different distance-angle cutoffs for a given site.

Parameters:
  • isite – Index of the site

  • surface_calculation_type – How to compute the surface.

  • max_dist – The maximum distance factor to be considered.

  • additional_conditions – If additional conditions have to be considered.

Returns:

Surfaces and cn_map’s for each distance-angle cutoff.

maps_and_surfaces_bounded(isite, surface_calculation_options=None, additional_conditions=None)[source]

Get the different surfaces (using boundaries) and their cn_map corresponding to the different distance-angle cutoffs for a given site.

Parameters:
  • isite – Index of the site

  • surface_calculation_options – Options for the boundaries.

  • additional_conditions – If additional conditions have to be considered.

Returns:

Surfaces and cn_map’s for each distance-angle cutoff.

neighbors(isite, distfactor, angfactor, additional_condition=None)[source]

Get the neighbors of a given site corresponding to a given distance and angle factor.

Parameters:
  • isite – Index of the site.

  • distfactor – Distance factor.

  • angfactor – Angle factor.

  • additional_condition – Additional condition to be used (currently not implemented).

Returns:

List of neighbors of the given site for the given distance and angle factors.

neighbors_surfaces(isite, surface_calculation_type=None, max_dist=2.0)[source]

Get the different surfaces corresponding to the different distance-angle cutoffs for a given site.

Parameters:
  • isite – Index of the site

  • surface_calculation_type – How to compute the surface.

  • max_dist – The maximum distance factor to be considered.

Returns:

Surfaces for each distance-angle cutoff.

neighbors_surfaces_bounded(isite, surface_calculation_options=None)[source]

Get the different surfaces (using boundaries) corresponding to the different distance-angle cutoffs for a given site.

Parameters:
  • isite – Index of the site.

  • surface_calculation_options – Options for the boundaries.

Returns:

Surfaces for each distance-angle cutoff.

setup_neighbors_distances_and_angles(indices)[source]

Initializes the angle and distance separations.

Parameters:

indices – Indices of the sites for which the Voronoi is needed.

setup_voronoi_list(indices, voronoi_cutoff)[source]

Set up of the voronoi list of neighbors by calling qhull.

Parameters:
  • indices – indices of the sites for which the Voronoi is needed.

  • voronoi_cutoff – Voronoi cutoff for the search of neighbors.

Raises:

RuntimeError – If an infinite vertex is found in the voronoi construction.

to_bson_voronoi_list2()[source]

Transforms the voronoi_list into a vlist + bson_nb_voro_list, that are BSON-encodable.

Returns:

[vlist, bson_nb_voro_list], to be used in the as_dict method.

voronoi_parameters_bounds_and_limits(isite, plot_type, max_dist)[source]

Get the different boundaries and limits of the distance and angle factors for the given site.

Parameters:
  • isite – Index of the site.

  • plot_type – Types of distance/angle parameters to get.

  • max_dist – Maximum distance factor.

Returns:

Distance and angle bounds and limits.

from_bson_voronoi_list2(bson_nb_voro_list2, structure)[source]

Returns the voronoi_list needed for the VoronoiContainer object from a bson-encoded voronoi_list.

Parameters:
  • bson_nb_voro_list2 – List of periodic sites involved in the Voronoi.

  • structure – Structure object.

Returns:

The voronoi_list needed for the VoronoiContainer (with PeriodicSites as keys of the dictionary - not allowed in the BSON format).