4
$\begingroup$

My surface is a monolayer graphene. I want to add a layer of water as adsorbate and the parameters are height = 3.31 Angstroms on top of the slab; Coverage = 24/72; The orientation is: The hydrogen atoms are facing down towards the surface.

When i try to use acat, i am getting an error 'IndexError: list index out of range'. My goal is to get the structure as in the following figure:

enter image description here

Here one can see the orientation of the H2O molecule on top of the surface (the legs are facing down)

enter image description here

And this is how i want the layer distribution of H2O on the surface. For every 3 carbon there is one H2O

Could anyone please help?

This is the code i wrote:

import ase.io
import ase.build
from ase.visualize import view
from acat.build.adlayer import max_dist_coverage_pattern as mdcp
from acat.settings import site_heights
slab = ase.build.graphene(formula = 'C2',a=2.46,size=(6,6,1))
slab.center(vacuum=21,axis=2)
heights = {k: v+3.31 for k, v in site_heights.items()}
system = mdcp(slab,adsorbate_species='H2O',coverage = 24/72, surface = 'ontop', heights= heights)
$\endgroup$
4
  • $\begingroup$ Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. $\endgroup$
    – Community Bot
    Dec 30, 2023 at 11:41
  • $\begingroup$ I have now updated(edited) the question in the topic. I have added the code that i wrote. Is this better understandable? $\endgroup$ Dec 30, 2023 at 11:44
  • $\begingroup$ I am not familiar with acat, but The error "IndexError: list index out of range" typically occurs when you try to access an element at an index that is outside the valid range of indices for a list or array. In your case, the error is likely caused by accessing an element beyond the range of the site_heights list or array. you should check the site_heights list and ensure that it has enough elements to accommodate the indices you're trying to access. You can print the site_heights list to see its content and length with print(site_heights) and print(len(site_heights)) $\endgroup$ Dec 30, 2023 at 12:22
  • $\begingroup$ ACAT dev here. The error is due to the fact that ACAT doesn't support monolayer surface. It requires at least a 3-layer slab to identify surface adsorption sites. $\endgroup$
    – Shaun Han
    Jan 3 at 11:15

2 Answers 2

2
$\begingroup$

I was able to find a workaround for the problem that I had. It goes like this:

import ase.io
import ase.build
from ase.visualize import view
from ase.build import add_adsorbate
slab = ase.build.graphene(formula=‘C2’,a=2.46,size=(6,6,1))
slab.center(vacuum=21,axis=2)
water = ase.build.molecule(‘H2O’)
h = 3.31
x = 0
y = 0
add_adorbate(slab, adsorbate=water,height=h,position(x,y),offset=None,mol_index=0)
view(slab)

In the above code, the position of the adsorbate over the surface is controlled by the parameter position(x,y) where x and y values are in Angstroms. The x and y values of an atom in the surface can be seen through:

slab.get_positions()

The parameter mol_index is the atom in the molecule used for positioning. The Index starts with 0,1,2….

water.get_chemical_symbols()

In my case it’s O,H,H=(0,1,2)

Overall it is a bit tedious work as I need to place one molecule at a time but it works for now.

Thank you

$\endgroup$
0
$\begingroup$

Tried this approach. From the first row three atoms are selected and then for each of these, atoms on the opposite are selected along the column

import numpy as np
import ase.io
import ase.build
from ase.visualize import view
from ase.build import add_adsorbate
from ase import Atoms

slab = ase.build.graphene(formula='C2',a=2.46,size=(6,6,1))
slab.center()
water = ase.build.molecule('H2O')

h = 3.31


a=slab.positions[:,1].min()
index=[]
for i in range(len(slab)):
    if slab[i].position[1]==a:
        index.append(i)

start_index=index[::2]

for i in start_index:
    x = (slab[i].position[0])
    y = (slab[i].position[1])
    add_adsorbate(slab, adsorbate=water, height=h, position=(x,y), offset=None, mol_index=0)
    
    for j in range(i,len(slab.positions)):
        dist=((slab[j].position[0]-slab[i].position[0])**2+(slab[j].position[1]-slab[i].position[1])**2)**0.5
        if 2.84<dist<2.842:
            x = (slab[j].position[0])
            y = (slab[j].position[1])
            add_adsorbate(slab, adsorbate=water, height=h, position=(x,y), offset=None, mol_index=0)
            i=j
        continue
        
        

view(slab)
$\endgroup$
2
  • 1
    $\begingroup$ As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center. $\endgroup$
    – Community Bot
    Jan 30 at 20:21
  • $\begingroup$ Can you please use sentences instead of sentence fragments? $\endgroup$ Jan 31 at 11:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .