Low dimensionality atom group finder, which analyses a bulk crystal and returns groups of atoms which are held together by weak (van der Waals) forces as separate structures.
git clone https://github.com/psi-lms/lowdimfinder.git
cd lowdimfinder
pip install -e .from ase import Atoms
from ase.io import read
from lowdimfinder import LowDimFinder
from ase.build import mx2
# Change this to load your own structure
structure = mx2(
'MoS2', kind='2H', a=3.16, thickness=3.13, size=(3, 3, 1), vacuum=5.0
)
# Analyze the structure for low-dimensional groups
finder = LowDimFinder(
aiida_structure=structure,
vacuum_space=40.0,
radii_offset=-0.7,
bond_margin=0.0,
max_supercell=3,
min_supercell=3,
rotation=True,
full_periodicity=False,
radii_source="alvarez",
orthogonal_axis_2D=True,
)
# Get results
results = finder.get_group_data()
# Check dimensionality of found groups
print("Dimensionalities:", results["dimensionality"])
print("Chemical formulas:", results["chemical_formula"])
# Check if the structure contains 2D layers
if 2 in results["dimensionality"]:
print("Layered material detected!")
# Extract layer structures
for i, dim in enumerate(results["dimensionality"]):
if dim == 2:
layer = Atoms(
symbols=results["chemical_symbols"][i],
positions=results["positions"][i],
cell=results["cell"][i],
tags=results["tags"][i],
)
print(f"Layer {i}: {layer.get_chemical_formula()}")# print(results)
# The output contains information for all the individual sub-structures.
# In this case, the structure is purely 2D. However, the lists could contain multiple
# entries, each of them corresponding to a sub-structure with a potentially different
# dimensionality. E.g., [3, 0, 3, 0, ...] corresponds to a 3D bulk
# structure with additional molecular components (0D).
{'dimensionality': [2],
'chemical_formula': ['Mo9S18'],
'positions': [[[0.0, 0.0, 21.564999999999998],
[-1.5799999999999998, -0.9122134253196084, 20.0],
[-1.5799999999999998, -0.9122134253196084, 23.13],
[-1.5799999999999996, 2.736640275958826, 21.564999999999998],
[-3.159999999999999, 1.824426850639218, 20.0],
[-3.159999999999999, 1.824426850639218, 23.13],
[-3.1599999999999993, 5.473280551917652, 21.564999999999998],
[-4.74, 4.5610671265980445, 20.0],
[-4.74, 4.5610671265980445, 23.13],
[-1.5800000000000005, -2.736640275958826, 21.564999999999998],
[-3.16, -3.6488537012784343, 20.0],
[-3.16, -3.6488537012784343, 23.13],
[-3.16, 0.0, 21.564999999999998],
[-4.74, -0.9122134253196084, 20.0],
[-4.74, -0.9122134253196084, 23.13],
[-4.739999999999999, 2.736640275958826, 21.564999999999998],
[-6.32, 1.8244268506392187, 20.0],
[-6.32, 1.8244268506392187, 23.13],
[-3.160000000000001, -5.473280551917652, 21.564999999999998],
[-4.74, -6.38549397723726, 20.0],
[-4.74, -6.38549397723726, 23.13],
[-4.74, -2.736640275958825, 21.564999999999998],
[-6.32, -3.6488537012784334, 20.0],
[-6.32, -3.6488537012784334, 23.13],
[-6.32, 0.0, 21.564999999999998],
[-7.9, -0.912213425319607, 20.0],
[-7.9, -0.9122134253196061, 23.13]]],
'chemical_symbols': [
[
'Mo', 'S', 'S', 'Mo', 'S', 'S', 'Mo', 'S', 'S', 'Mo', 'S', 'S', 'Mo',
'S', 'S', 'Mo', 'S', 'S', 'Mo', 'S', 'S', 'Mo', 'S', 'S', 'Mo', 'S', 'S'
]
],
'cell': [
[
[-4.739999999999998, 8.209920827876479, 0.0],
[-4.740000000000001, -8.209920827876479, 0.0],
[0.0, 0.0, 43.129999999999995]
]
],
'tags': [
[
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0
]
]
}The following example shows how LowDimFinder is used in the Materials Cloud Layer Finder Tool to detect layered materials:
from ase import Atoms
from lowdimfinder import (
LowDimFinder,
)
# Try different radii offsets
for radii_offset in [-0.75, -0.7, -0.65, -0.6, -0.55]:
finder = LowDimFinder(
aiida_structure=structure,
vacuum_space=40.0,
radii_offset=radii_offset,
bond_margin=0.0,
max_supercell=3,
min_supercell=3,
rotation=True,
full_periodicity=False,
radii_source="alvarez",
orthogonal_axis_2D=True,
)
results = finder.get_group_data()
if 2 in results["dimensionality"]:
is_layered = True
layer_structures = []
layer_indices = []
for i in range(len(results["dimensionality"])):
if results["dimensionality"][i] == 2:
layer = Atoms(
symbols=results["chemical_symbols"][i],
positions=results["positions"][i],
cell=results["cell"][i],
tags=results["tags"][i],
)
layer_structures.append(layer)
layer_indices.append(finder._get_unit_cell_groups()[i])
rotated_cell = finder._rotated_structures[i]
break
if radii_offset == -0.55:
is_layered = False
print("Is layered material:", is_layered)
print("Radii offset used:", radii_offset)- cordero: Covalent radii from Cordero et al., Dalton Trans. 2008
- pyykko: Covalent radii from Pyykkö & Atsumi, Chem. Eur. J. 2009
- vdw: Van der Waals radii from
S. S. Batsanov. “Van der Waals radii of elements”. In: Inorganic Materials 37.9 (2001), pp. 871–885. ISSN: 00201685. - alvarez: Van der Waals radii from Alvarez, Dalton Trans. 2013
If you use LowDimFinder in your research, please consider citing the relevant papers:
@article{Mounet2018,
title = {Two-dimensional materials from high-throughput computational exfoliation of experimentally known compounds},
volume = {13},
ISSN = {1748-3395},
url = {http://dx.doi.org/10.1038/s41565-017-0035-5},
DOI = {10.1038/s41565-017-0035-5},
number = {3},
journal = {Nature Nanotechnology},
publisher = {Springer Science and Business Media LLC},
author = {Mounet, Nicolas and Gibertini, Marco and Schwaller, Philippe and Campi, Davide and Merkys, Andrius and Marrazzo, Antimo and Sohier, Thibault and Castelli, Ivano Eligio and Cepellotti, Andrea and Pizzi, Giovanni and Marzari, Nicola},
year = {2018},
month = feb,
pages = {246–252}
}
@article{TohidiVahdat2022,
title = {Machine-learning accelerated identification of exfoliable two-dimensional materials},
volume = {3},
ISSN = {2632-2153},
url = {http://dx.doi.org/10.1088/2632-2153/ac9bca},
DOI = {10.1088/2632-2153/ac9bca},
number = {4},
journal = {Machine Learning: Science and Technology},
publisher = {IOP Publishing},
author = {Tohidi Vahdat, Mohammad and Varoon Agrawal, Kumar and Pizzi, Giovanni},
year = {2022},
month = nov,
pages = {045014}
}LowDimFinder was developed at the Laboratory of Theory and Simulation of Materials (THEOS) at EPFL, for the publication underlying MC2D (Mounet, N., Gibertini, M., Schwaller, P. et al. Nature Nanotech 13, 246–252 (2018)).
This package is now maintained by the Laboratory for Materials Simulations (LMS) at Paul Scherrer Institute (PSI).
We acknowledge funding from the MARVEL National Centre of Competence in Research of the Swiss National Science Foundation (SNSF).
This project is licensed under the MIT License - see the LICENSE file for details.