I am currently learning DFTB+ using the tutorials on the official website :

  1. Carbon Nanoribbons : https://dftbplus-recipes.readthedocs.io/en/latest/defect/carbon2d-elec.html#zigzag-nanoribbon

  2. Molecular Junctions : https://dftbplus-recipes.readthedocs.io/en/latest/transport/molecule-junction.html

How do I go about creating the geometry files for the systems used in these tutorials?

So far, I have been using Avogadro for creating xyz files but I haven't created "planar periodic" structures as illustrated in the tutorials.

  • 2
    $\begingroup$ +1 Welcome to our new community and thank you so much for contributing your question here! We hope to see much more of you in the future !!! $\endgroup$ Commented May 11, 2021 at 6:16
  • 1
    $\begingroup$ Question on Chem SE. Posting a question on multiple sites is generally discouraged. You should delete the Chem SE one or include a link to the other version in each question. This helps other users see if/where a question has been answered and avoids multiple users answering a question without being aware of existing answers. $\endgroup$
    – Tyberius
    Commented May 11, 2021 at 11:41

1 Answer 1


Since you know how to use Avogadro to create XYZ files, a very simple solution to your problem is to simply create the XYZ file then use an xyz2gen script to convert fron XYZ format to the GEN format you seek. This is an example of a script that converts from XYZ to DFTB+ format.

The beauty of the GEN format of DFTB+ is that with only a few lines, you can "generate" the entire structure based on the periodicity of the system, which is specified by Cartesian lattice vectors. An excellent exercise to help you learn how this works is given at the top of the first page you gave us in your question. Start at the origin and add atoms based on the vectors given: you'll find it quite cool how a 2D hexagonal lattice begins to emerge!


You must log in to answer this question.

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