Capability

57 views
Skip to first unread message

EricS

unread,
Feb 9, 2023, 8:20:31 PM2/9/23
to kmcos-users
Hello Kmcos users,

I am in the process of studying the examples which may ultimately answer some of my questions but it might be more efficient to ask directly.

Can kmcos handle a hexagonal lattice?

Do all 2D simulations inherently have periodic boundary conditions in 2D?

I strongly assume this is possible but just to confirm: adding an immobile adsorbate to block / direct diffusion is possible, correct?

Best,
Eric

Aditya "Ashi" Savara

unread,
Feb 9, 2023, 8:53:50 PM2/9/23
to kmcos-users
 Kmcos can handle a hexagonal lattice, because all 2D periodic lattices can be mapped onto tetragonal lattice. Since sites in kmcos can go "outside" of the rectangular box of the unit cell, it is possible to have the sites located in a parallelogram shape that doesn't match the rectangle of the unit cell.  I don't know how the below particular example looks, or even it it works, but it is probably something worth looking at as a start.
If you do make a hexagonal lattice example, it would be good to add it to our examples.

If I am not mistaken the 2D simulations have periodic boundary conditions by default, but this can be turned off. The example at the first link seems to turn it off for the Z direction, though that is unnecessary for that example.

I actually could not remember how to turn the periodic boundary conditions on and off. If you do end up testing with some diffusion model by trying turn it off in one direction (like x only and leave y on) and see that the syntax in the above example works, do let us know. Then we can add it to the documentation and perhaps even add an example related to pbc.   I thought it was possible to turn it on and off after build/compilation, but the above example seems to suggest otherwise.

Yes, a diffusion can be "blocked" by something being in the way by simply requiring the recipient site to be empty when defining the diffusion the process, which is the typical way of doing things and how the diffusion example is written. 

Note: I see that intro2kmcos says some different things... including Task 8 saying something more like what I remembered, that there is a way to have periodic boundary conditions (or not) by modifying the kmc_settings.py file. But I don't seem to see that done in the solutions folder. So it seems like that solution is not quite complete.

EricS

unread,
Feb 10, 2023, 5:58:20 PM2/10/23
to kmcos-users
Hi Aditya and kmcos community,

Thanks for the guidance as I learn more about your software.

Looking over the two Pt111 files you linked above, I see that the kmc_model_lattice representation numbers for the cell and scaled_positions can, in certain cases, be obtained from helper functions available in ASE.  These files use the fcc111 function from the ase package.

Apparently, we can build a 2D hexagonal lattice with a two atom unit cell with non-orthogonal unit cell vectors.  Looking through the ASE docs, there is a helper function we can use the following:

# numbers / atoms inserted for carbon but this can be modified, 6 angstroms of space is given in the c direction
from ase.lattice.hexagonal import GrapheneFactory
g = GrapheneFactory()
graphene = g('C', latticeconstant={'a':2.46, 'c':6})

>>> print(graphene)
Lattice(symbols='C2', pbc=True, cell=[[2.46, 0.0, 0.0], [-1.2299999999999995, 2.130422493309719, 0.0], [0.0, 0.0, 6.0]])
>>> print(graphene.cell)
Cell([[2.46, 0.0, 0.0], [-1.2299999999999995, 2.130422493309719, 0.0], [0.0, 0.0, 6.0]])
>>> print(graphene.get_scaled_positions())
[[0.         0.         0.        ]
 [0.33333333 0.66666667 0.        ]]

In the plane that matters, the geometry is as follows with the first and second vectors in yellow and purple and the first and second scaled positions labeled as atoms 1 and 2:
HexLattice.png

As far as I understand, this specifies the lattice.  As far as I can reason, each unit cell would have 3 bridge site adsorbates in this cell at the midpoint of the three bonds that attach to atom "2".

Best,
Eric

Aditya "Ashi" Savara

unread,
Feb 10, 2023, 9:30:16 PM2/10/23
to kmcos-users
One thing to recognize is that you are looking at the representation. The sites for processes and their locations are defined by the user.  If you define your sites and build a simple adsorption like with CO, you can then do one step and show and another step and show. Then you can see how the site definition works relative to that lattice.  You can document what you wrote in this email and anything else you think a person should know, and the we can add it go intro2kmcos.  It is on the roadmap to gather a bunch of examples of typical lattice structures.

Aditya Ashi Savara

unread,
Feb 10, 2023, 9:47:52 PM2/10/23
to kmcos-users
That get scaled positions command is useful and helps a user figure out how to define their sites. I would certainly include that in an example.


On Saturday, February 11, 2023, Aditya "Ashi" Savara <adityasa...@u.northwestern.edu> wrote:
> One thing to recognize is that you are looking at the representation. The sites for processes and their locations are defined by the user.  If you define your sites and build a simple adsorption like with CO, you can then do one step and show and another step and show. Then you can see how the site definition works relative to that lattice.  You can document what you wrote in this email and anything else you think a person should know, and the we can add it go intro2kmcos.  It is on the roadmap to gather a bunch of examples of typical lattice structures.
>
> On Saturday, February 11, 2023 at 4:28:20 AM UTC+5:30 EricS wrote:
>>
>> Hi Aditya and kmcos community,
>>
>> Thanks for the guidance as I learn more about your software.
>> Looking over the two Pt111 files you linked above, I see that the kmc_model_lattice representation numbers for the cell and scaled_positions can, in certain cases, be obtained from helper functions available in ASE.  These files use the fcc111 function from the ase package.
>> Apparently, we can build a 2D hexagonal lattice with a two atom unit cell with non-orthogonal unit cell vectors.  Looking through the ASE docs, there is a helper function we can use the following:
>>
>> # numbers / atoms inserted for carbon but this can be modified, 6 angstroms of space is given in the c direction
>> from ase.lattice.hexagonal import GrapheneFactory
>> g = GrapheneFactory()
>> graphene = g('C', latticeconstant={'a':2.46, 'c':6})
>> >>> print(graphene)
>> Lattice(symbols='C2', pbc=True, cell=[[2.46, 0.0, 0.0], [-1.2299999999999995, 2.130422493309719, 0.0], [0.0, 0.0, 6.0]])
>> >>> print(graphene.cell)
>> Cell([[2.46, 0.0, 0.0], [-1.2299999999999995, 2.130422493309719, 0.0], [0.0, 0.0, 6.0]])
>> >>> print(graphene.get_scaled_positions())
>> [[0.         0.         0.        ]
>>  [0.33333333 0.66666667 0.        ]]
>> In the plane that matters, the geometry is as follows with the first and second vectors in yellow and purple and the first and second scaled positions labeled as atoms 1 and 2:
>> <https://ci6.googleusercontent.com/proxy/lNDYqJGoRhuiKIEsitfOVAUGAtIeulDb06eEtexyT94UH8CWSq2hi9dD57StFgweuVMrLuZaO0j9LB9SfI2GJeiM6rkQ0ZscW7uwfQhzKjVS5BZGid2G6fPlvNxEZgs4VUz07u6yrmmyZ-_8GQF1Kxv5=s0-d-e1-ft#https://groups.google.com/group/kmcos-users/attach/293dada3c6cd9/HexLattice.png?part=0.1&view=1>

>>
>> As far as I understand, this specifies the lattice.  As far as I can reason, each unit cell would have 3 bridge site adsorbates in this cell at the midpoint of the three bonds that attach to atom "2".
>>
>> Best,
>> Eric
>> On Thursday, February 9, 2023 at 5:53:50 PM UTC-8 Aditya "Ashi" Savara wrote:
>>>
>>>  Kmcos can handle a hexagonal lattice, because all 2D periodic lattices can be mapped onto tetragonal lattice. Since sites in kmcos can go "outside" of the rectangular box of the unit cell, it is possible to have the sites located in a parallelogram shape that doesn't match the rectangle of the unit cell.  I don't know how the below particular example looks, or even it it works, but it is probably something worth looking at as a start.
>>> https://github.com/kmcos/kmcos/blob/master/examples/Pt_111__build.py
>>> https://github.com/kmcos/kmcos/blob/master/examples/model_Pt111_surface__build.py
>>> If you do make a hexagonal lattice example, it would be good to add it to our examples.
>>> If I am not mistaken the 2D simulations have periodic boundary conditions by default, but this can be turned off. The example at the first link seems to turn it off for the Z direction, though that is unnecessary for that example.
>>> I actually could not remember how to turn the periodic boundary conditions on and off. If you do end up testing with some diffusion model by trying turn it off in one direction (like x only and leave y on) and see that the syntax in the above example works, do let us know. Then we can add it to the documentation and perhaps even add an example related to pbc.   I thought it was possible to turn it on and off after build/compilation, but the above example seems to suggest otherwise.
>>> Yes, a diffusion can be "blocked" by something being in the way by simply requiring the recipient site to be empty when defining the diffusion the process, which is the typical way of doing things and how the diffusion example is written. 
>>> Note: I see that intro2kmcos says some different things... including Task 8 saying something more like what I remembered, that there is a way to have periodic boundary conditions (or not) by modifying the kmc_settings.py file. But I don't seem to see that done in the solutions folder. So it seems like that solution is not quite complete.
>>>
>>> On Thursday, February 9, 2023 at 8:20:31 PM UTC-5 EricS wrote:
>>>>
>>>> Hello Kmcos users,
>>>> I am in the process of studying the examples which may ultimately answer some of my questions but it might be more efficient to ask directly.
>>>> Can kmcos handle a hexagonal lattice?
>>>> Do all 2D simulations inherently have periodic boundary conditions in 2D?
>>>> I strongly assume this is possible but just to confirm: adding an immobile adsorbate to block / direct diffusion is possible, correct?
>>>> Best,
>>>> Eric
>
> --
> You received this message because you are subscribed to a topic in the Google Groups "kmcos-users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/kmcos-users/8ZuL06LTZ6Y/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to kmcos-users...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/kmcos-users/b656bf2b-46e8-4273-8663-263e800c8d42n%40googlegroups.com.
>

EricS

unread,
Feb 13, 2023, 9:03:32 AM2/13/23
to kmcos-users
Greping through the example directory, it seems like the species list is set by default to empty (kmc_model.species_list.default_species = 'empty') or initialized to a full monolayer:
layer.sites.append(Site(name='coord1', pos='.5 .5 .5', default_species='CO'))

How can I control the exact initial adsorbate distribution?  For example, to have exactly one adsorbate in the entire simulation or perhaps to specify a specific spatial distribution of adsorbates?

Best,
Eric

Aditya Ashi Savara

unread,
Feb 13, 2023, 9:29:24 AM2/13/23
to EricS, kmcos-users
The build file is essentially about building the structure and the processes. What you're describing is basically about trying to change the species present at the beginning of a trajectory.
that would be accomplished using the model.put command, which is at the below link.  



EricS

unread,
Feb 14, 2023, 1:02:44 PM2/14/23
to kmcos-users
Thank you for the clarification and the guidance!  I will look into it as I continue to prepare a simulation on a hexagonal lattice.

I noticed that parameters have conversion factors that kmcos will parse and expand (e.g., 'angstrom').  Where is the full set of available conversion factors defined?  These conversion factors appear to work for the value field of a parameter but not for the min/max fields of the parameters.

Best,
Eric

EricS

unread,
Feb 14, 2023, 3:59:26 PM2/14/23
to kmcos-users
Your diffusion example only tracks occupation.  I would like to prepare a second example file that can be used to demonstrate the temperature dependence of the diffusion coefficient.  I can imagine many ways of doing this.  For example, when a diffusion process is triggered, a vector associated with that coordinate is added to a running total displacement vector.  Can such a thing be included with the process action?  If not, is there a better way to accomplish what I am suggesting?

Best,
Eric

EricS

unread,
Feb 14, 2023, 4:17:30 PM2/14/23
to kmcos-users
Ah, a workflow for tracking diffusion distance might be included in the MyFirst*Displacement* example.  I will look it over and report back.

Aditya Ashi Savara

unread,
Feb 14, 2023, 8:38:41 PM2/14/23
to kmcos-users
These are very different topics, it would be better to make a separate thread next time there is a totally new topic, so that others can look at the users group email logs for guidance.

You may or may not have found this already, but the acf module is used for that example, and the functions are here:

The word "ion" seems to appear in the module, but presumably that really works for any species, even though the first case example may have been for ions.

Reply all
Reply to author
Forward
0 new messages