Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Gen = SlabGenerator(
atoms,
miller_index=[1, 1, 1],
layers=3,
fixed=1,
vacuum=8)
terminations = Gen.get_unique_terminations()
# Loop over unique surface terminations.
images = []
for i, t in enumerate(terminations):
# Get the slab.
slab = Gen.get_slab(iterm=i)
slab.center(axis=2, vacuum=5)
# Add an adsorbate to each slab.
radii = np.average([get_radius(a.number) for a in slab])
height = radii + covalent_radii[6]
add_adsorbate(slab, ads, height, position=slab.get_positions()[-1, :2])
# Usually, the chemical formula (Hill) is available for the adsorbate.
# It will be used by AtoML if attached like so:
slab.info['key_value_pairs'] = {}
slab.info['key_value_pairs']['species'] = ads
# If the adsorbate consist of the same elements that the slab does,
# it is preferable to specify the atomic indices belonging to the adsorbate.
slab.info['ads_atoms'] = [12]
# Append them to a list.
images.append(slab)
# If you import from an ase.db, it is recommended to make use of
# atoml.api.ase_atoms_api.database_to_list
# Some information is expected to be attached to atoms objects.