ChemEnv is a fast and robust tool to automatically identify coordination environments (e.g. tetrahedral, octahedral, icosahedral, ...) in a structure. The package is in pymatgen/analysis/chemenv and a script (get_environments.py) is provided in the pymatgen/scripts directory for simple usages. For more advanced usages, you should write your own script(s).
This example section consists of a small introduction describing the idea and the procedure for the identification of the environments. The simple "get_environments.py" script is then presented. Some more sophisticated examples of usage will be provided in a near future.
Describing materials and compounds in terms of the coordination environments of their constituent atoms is a common and useful practice amongst chemists, crystallographers and materials scientists. The ChemEnv package allows to identify the model coordination environment to which a given (slightly or highly distorted) local environment is the closest. Model coordination environments have been taken from the following two references that were published by the Internation Union of Crystallographers and the Internation Union of Pure and Applied Chemistry respectively :
Without entering into too many details, the identification procedure can be described as follows :
The real procedure is in fact more complicated but will be described in a forecoming paper.
The "get_environments.py" script is available in pymatgen/scripts. It should be installed automatically when you install pymatgen and should thus be available directly in a terminal. The script is self explanatory. Just run it by issuing "get_environment.py" in a terminal.
By default, the script will ask you the path to the CIF file of the structure you want to analyze. The script is also able to get a structure directly from the MaterialsProject database using the MaterialsProject id. In order to use this feature, you should setup the connection to the MaterialsProject by issuing "get_environment.py -s". Just follow the instructions of this setup option in order to setup the connection to the MaterialsProject. You can also specify other options (related to the procedure of identification of the coordination environments).
After having specified your structure (either from a CIF file or by MaterialsProject Id), the script will automatically identify the coordination environments. Be carefull that this can take some time for large and/or complex structures (structures with large coordination numbers typically take more time to process).
After the identification has been performed, the script asks you what you want to do :
If you have VTK installed, you can also visualize the structure directly.