I've installed and can run LAMMPS on macOS as desdribed in Okay, I've installed LAMMPS I: My first try of an example gives different & incorrect output and I'm looking forward to my first Xene experience! I've found https://lammpstutorials.github.io/tutorials/04-Graphene.html which begins:

Graphene sheet - First, a graphene sheet will be generated using VMD-topotool. The sheet will be deformed using applied displacement.

and that section begins:

Generation of the system The initial configuration (atoms positions, bonds, angles, etc.) is generated using VMD. Open VMD, and go to Extensions, Modeling, Nanotube Builder. A window named Carbon Nanostructures opens, and from this window it is possible to generate a sheet of graphene or BN, as well as a nanotube. For now tutorial, we are going to generate a 4 nm per 4 nm sheet of graphene. Simply change the values of "Edge length along x" and "Edge length along y" to 4, and click on "Generate Sheet(s)". You shoud see this:

enter image description here

However, at least from where I live I can not even get the following links to work:

and in any event I'll be building my own honeycomb structure to include buckling and defects. So I'd like to ask:

Question: I'd like to make a small graphene flake for a LAMMPS simulation using my Python script (not someone else's program), but how?

I was hoping on reverse-engineering the output file from the VMD-toptool and generating a new one from my python script but now I have nothing to go on. I'm assuming it's a text file with atomic positions on a honeycomb lattice but not sure what else needs to be in it.

update 1: this tutorial looks promising


update 2: potentially very helpful!


1 Answer 1


ASE has a build-in method that can produce what you want:

ase.build.graphene_nanoribbon(n, m, type='zigzag',
          saturated=False, C_H=1.09, C_C=1.42, vacuum=None,
          magnetic=False, initial_mag=1.12, sheet=False, 
          main_element='C', saturate_element='H')

You can then write it to a LAMMPS file using ASE directly, or to another format and convert it to LAMMPS with Atomsk.

  • $\begingroup$ excellent! I have this so far: pastebin.com/KatCRaNG I'll now try to import it with LAMMPS and see if I can make it do something. $\endgroup$
    – uhoh
    Commented May 15, 2022 at 13:06
  • $\begingroup$ I am not sure of what you want to achieve here, if you just want a picture of your graphene sheet, you can just write to .xyz file (simple format), open the file with VMD and use the Tachyon raytracer to produce an amazing image (much better than matplotlib at least). Good luck! $\endgroup$
    – Okano
    Commented May 15, 2022 at 21:32
  • $\begingroup$ "am not sure of what you want to achieve here" My plot just confirms that I have a honeycomb and if I displace every other atom positions[::2, 1] += height I can have a buckled honeycomb (most Xene's besides graphene) and now that I understand how they're ordered I can now figure out how to add defects (e.g. vacancies, adatoms or Stone-Wales-like bond rotations) With that confidence I can proceed as mentioned in the question "I'll be building my own honeycomb structure to include buckling and defects." $\endgroup$
    – uhoh
    Commented May 15, 2022 at 22:36
  • $\begingroup$ My pastebin script also shows I've figured out how to identify the bonds which may further help me with inserting defects. I can now have a "graphene flake for a LAMMPS simulation" and I'm "looking forward to my first Xene experience" meaning that "I'll now try to import it with LAMMPS and see if I can make it do something." All is well as far as I can tell! $\endgroup$
    – uhoh
    Commented May 15, 2022 at 22:43
  • 1
    $\begingroup$ I am glad that you got what you wanted, I know Atomsk can also create graphene sheet, and add/remove atoms if you care. $\endgroup$
    – Okano
    Commented May 16, 2022 at 13:24

You must log in to answer this question.

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