Generating Slabs / Surfaces

One of the frequently requested solid-state features in generating slabs. You know – someone wants to do a simulation of a Pt (111) surface with an adsorbed molecule. Or better yet, a Pt (211) “miscut” or defect surface.

I have some code that purports to allow rotations to arbitrary Miller planes, and it seems to work for the camera. But anytime I tried to modify the coordinates of the actual atoms, weird things happened. Since I’ve never had much time to debug this, it sat on the shelf.

Today, the solution hit me. It’s REALLY easy to do:

  1. By the definition of a Miller Plane (say 111), you can find the normal vector to the plane. So for (111), the normal vector is [111].
  2. To generate a slab, what we want to do is to rotate this normal vector [111] to the z-axis. This means atoms in the Miller plane will end up in the xy plane.
  3. The normal vector is actually in fractional coordinates, so you need to convert it to Cartesian real-space.
  4. Use the same rotation code currently in the aligntool.

The result will orient the crystal atoms, such that the Miller plane is parallel to the xy plane. You now need to translate in the z-direction and cleave as needed. To ensure you have a big enough slab, generate a big supercell beforehand and delete atoms as needed.

If anyone wants to give this a try, I’d be glad to help them. Otherwise, someone here at Pitt will work on this over the summer.

Cheers,
-Geoff

Hi Geoff,

On May 19, 2011, at 4:17 PM, David C. Lonie wrote:

I started work on this very problem shortly after writing the
crystallography extension, but life got busy before I could finish
it.

It looks like Pitt will be getting a small grant for enhancements to Avogadro, including this feature and a materials builder (e.g., a library of basic crystal structures allowing users to pick “rock salt but with K and I instead of NaCl”). So if you could put any code you have, I’ll make sure it gets done. (For example, push that branch to GitHub or send me a patch.)

We’ll probably also port the existing unit cell display and supercell extensions to the crystallography extension.

BTW, will you post any summary of your Google Summer of Code plans?

-Geoff

Hi again,

On Thu, May 19, 2011 at 4:17 PM, David C. Lonie loniedavid@gmail.com wrote:

From: Geoffrey Hutchison geoff.hutchison@gmail.com
Subject: Generating Slabs / Surfaces
Date: Thu, 19 May 2011 15:57:43 -0400

One of the frequently requested solid-state features in generating
slabs. You know – someone wants to do a simulation of a Pt (111)
surface with an adsorbed molecule. Or better yet, a Pt (211)
“miscut” or defect surface.

I started work on this very problem shortly after writing the
crystallography extension, but life got busy before I could finish
it. I believe I took a similar approach to the one you
describe. Unfortunately time is very tight for me right now, and will
continue to be through the end of summer. I will happily put my code
up somewhere public later today in case someone would like to pick
this up – There are several people who have asked about this, and I
think it would be an excellent feature for Avogadro to have.

I checked on this code last night, and your approach is actually much
simpler than what I was trying to do :slight_smile: I think I’ll just try to wrap
this feature up myself since it’s mostly finished now. I can also
reuse some of the unit cell clipping code for a nice visual preview…

Dave

On Fri, May 20, 2011 at 11:28 AM, Geoffrey Hutchison geoff.hutchison@gmail.com wrote:

It looks like Pitt will be getting a small grant for enhancements to Avogadro, including this feature and a materials builder (e.g., a library of basic crystal structures allowing users to pick “rock salt but with K and I instead of NaCl”). So if you could put any code you have, I’ll make sure it gets done. (For example, push that branch to GitHub or send me a patch.)

Very cool – I like these ideas, but haven’t had the opportunity to
get to work on them.

We’ll probably also port the existing unit cell display and supercell extensions to the crystallography extension.

This would be a huge help – thanks for doing this.

BTW, will you post any summary of your Google Summer of Code plans?

Sure :slight_smile: I don’t think I’ve mentioned it on the list yet, but I will
be working with Marcus this summer on adding native chemistry
visualization functionality to VTK through a Google Summer of Code
project. The project description and proposal can be found here:
http://xtalopt.openmolecules.net/VTK-chem.pdf

Coding officially starts next week, and I will post a new message to
the list asking for input. Basic nuclear and electronic structure
visualization will be the first priority, and once that’s finished we
can start considering community-requested features.

Dave

On May 20, 2011, at 11:36 AM, David Lonie wrote:

project. The project description and proposal can be found here:
http://xtalopt.openmolecules.net/VTK-chem.pdf

Coding officially starts next week, and I will post a new message to
the list asking for input. Basic nuclear and electronic structure
visualization will be the first priority, and once that’s finished we
can start considering community-requested features.

I think I’d consider the project a success if it offers alpha/beta orbitals and calculation of spin density from unrestricted calculations. :slight_smile:

Cheers,
-Geoff


Prof. Geoffrey Hutchison
Department of Chemistry
University of Pittsburgh
tel: (412) 648-0492
email: geoff.hutchison@gmail.com
web: http://hutchison.chem.pitt.edu/

On May 20, 2011, at 11:29 AM, David Lonie wrote:

I checked on this code last night, and your approach is actually much
simpler than what I was trying to do :slight_smile: I think I’ll just try to wrap
this feature up myself since it’s mostly finished now. I can also
reuse some of the unit cell clipping code for a nice visual preview…

As I said last week, I have a staff member here at Pitt who’s chomping at the bit to get started. We’d be happy to take a “not quite ready for prime-time” version and finish it off. I suspect you’re pretty busy right now.

-Geoff

Hi Geoff,

On Thu, May 26, 2011 at 1:00 PM, Geoffrey Hutchison geoff.hutchison@gmail.com wrote:

As I said last week, I have a staff member here at Pitt who’s chomping at the bit to get started. We’d be happy to take a “not quite ready for prime-time” version and finish it off. I suspect you’re pretty busy right now.

Your suspicions are correct :slight_smile: If someone is eager to start this,
then I will happily let them take this project over. I’ve pushed my
draft to the slabbuilder branch on my github fork:

https://github.com/dlonie/avogadro/tree/slabbuilder

It consists of a module in the crystallography extension and an
additional engine. The extension module launches a dockwidget (this
GUI will need to be redone, a lot of it is leftover from a
sandboxing-stage), takes input from the widget and passes it to the
engine through the molecule’s QObject dynamic properties.

Much of the code isn’t close to finished yet, but here was my vision:

The engine then renders a cell that should map out the periodic slab
and fills it with atoms appropriately, or simply renders a translucent
plane where the slice would be made (this was the source of my
question about drawShadedQuadrilateral from a few days ago). The user
would inspect the slice before it is made, optionally offsetting the
slice plane along it’s normal.

When the slice is made, a periodic slab would be generated with the
slice plane in the x,y plane. The user could then expand the cell with
the supercell builder and trim to fit their needs.

Like I said above, the code is far from finished, but the basics
should be there for whoever picks it up.

Feel free to let me know if there are any questions!

Dave

The engine then renders a cell that should map out the periodic slab
and fills it with atoms appropriately, or simply renders a translucent
plane where the slice would be made (this was the source of my
question about drawShadedQuadrilateral from a few days ago).

Yes, I guessed about the shaded quadrilateral. We’ll probably adapt the engine a bit – it seems like a more general “Miller Plane” engine would be useful, since someone may just want to display a particular Miller Plane.

I’ll pass this along to German and we can take it from here.

-Geoff

Hi Geoff,

On Thu, May 26, 2011 at 1:45 PM, Geoffrey Hutchison geoff.hutchison@gmail.com wrote:

I’ll pass this along to German and we can take it from here.

I just realized that I had pushed an out-of-date branch to github
earlier – I had some more local changes here that defined the miller
plane, etc here. I’ve rebased the slabbuilder branch on github to
contain the new code, so you may need to do a:

git checkout local-slabbuilder-branch
git remote update
git reset --hard github-remote-name/slabbuilder

to update (Note that reset --hard will reset any local changes to the
source tree, so ‘git stash’ any changes or make a backup of the
current branch if new work has been done). Or just browse the new code
on github and see if any of it is useful.

Dave