Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adsorbate splits in example script #98

Open
LarsSchaaf opened this issue Apr 7, 2022 · 1 comment
Open

Adsorbate splits in example script #98

LarsSchaaf opened this issue Apr 7, 2022 · 1 comment

Comments

@LarsSchaaf
Copy link

LarsSchaaf commented Apr 7, 2022

Following the SI of the 2019 paper results in a split adsorbate (C3H5) as shown below

image

Following the code:

from catkit.gen.surface import SlabGenerator
from catkit.gen.adsorption import Builder
from ase.build import bulk
from ase.io import write
from ase.visualize import view
import numpy as np
from catkit.build import molecule
atoms = bulk('Pd', 'fcc', a=4, cubic=True)
atoms[3].symbol='Au'

gen = SlabGenerator(atoms, miller_index= [1,1,1], layers=6, layer_type='trim', vacuum=10)
slab = gen.get_slab()

exslab=slab.copy()
exslab*=(9,9,1)
exslab.set_cell(slab.cell)
exslab.translate(-4*np.sum(exslab.cell[:2], axis=0))

adsorbate=molecule('C3H5')[4]
builder=Builder(slab)


ads_slab = builder.add_adsorbate(adsorbate, bonds=[0, 2], index=-1)
for aslab in ads_slab:
    aslab = aslab.copy()
    surf_atoms = np.where(np.in1d(aslab.get_chemical_symbols(), ['Pd', 'Au']))
    del aslab[surf_atoms]
    aslab += exslab
    aslab.set_cell([0, 0, 0])
write('tutorial-1.xyz', ads_slab)
write('tutorial-2.xyz', aslab)

import catkit
catkit.__version__ # '0.5.4'
@srrohit7
Copy link

I have the same problem, did anyone find a fix around to this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants