I am trying to write a special hexagonal lattice generator, with several kinds of boundary conditions, such as helical BC, periodic BC, and I find it hard to verify whether it works correctly. I tried to draw them using 2-dimensional network drawing (using networkx) and as I expected, it was a total mess. Right now I have to work out the adjacency matrix beforehand and verify the generated network with the calculated adjacency matrix. It's fine with the regular lattice, but if I introduce some random perturbation on the lattice, this approach is very tiresome. It would be a lot easier if I could see the network drawn correctly.

Is it possible to correctly visualize (probably in 3D?) lattice with various boundary conditions? Or in other software tools? Is there a convenient way to test this kind of network generator?


  • $\begingroup$ Hexagonal or hexahedral? $\endgroup$ – Bill Barth Jan 3 '13 at 13:08
  • $\begingroup$ I would say honeycomb lattice to avoid ambiguity. $\endgroup$ – wdg Jan 4 '13 at 13:43
  • $\begingroup$ Maybe a picture of what you're trying to do would be helpful. I can't tell from your description if you're talking about a 2D or 3D lattice. If you're only interested in a flat, 2D hexagonal lattice, then color-coding the nodes on the boundaries with the same boundary conditions might be the easiest way to see what's going on. E.g. interior lattice points are black, and boundary points which are identified through the same periodic boundary condition are red. Etc. Etc. You could draw the lattice with graphviz or something similar. $\endgroup$ – Bill Barth Jan 6 '13 at 17:00

Creating lattice (and other periodic) structures is a major issue in molecular simulations. Therefore, if you can translate your points into something that can be parsed by a viewer such as VMD or PyMol, you should be able to generate a view that can tell you if everything is working as expected. (This assumes, of course, that you build more than one periodic "cell" of your lattice.)


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.