1

Software like Diamond and VESTA allow users to build a supercell by extending the structure along the basis vectors of the latttice. However, I'd like to do something more general and build a supercell from an arbitrary integer matrix transformation. For instance, if I want to convert a primitive hexagonal unit cell into an orthorhombic supercell, I can use the transformation matrix $$M = \left[\begin{matrix} 1 & 1 & 0 \\ -1 & 1 & 0 \\ 0 & 0 & 1 \\ \end{matrix}\right]$$ and get the supercell basis $S$ from the original basis $B$ from the matrix multiplication $S = BM$. I'll note I've been considering this problem for arbitrary dimensions, not just 2 or 3.

The strategies I've thought of are:

  • Using an LU decomposition of $M$ to generate translation vectors along which atoms can be copied (from the diagonal of the U component), then moving the atoms into the supercell basis $S$ by truncating the integer portion of the fractional coordinate relative to the supercell. This works in most cases, but some particular transformations cause different atoms to move into the same position in the supercell, leaving some sites empty. I've worked around this by padding with more translation vectors, but it's a suboptimal solution.
  • Enumerating the lattice points inside the parallelotope generated by the transformation matrix, and generating copies of the atomic positions with the addition of the lattice points to the atomic coordinates (fractional with respect to the original basis). The coordinates can then be reduced with left division by $M$. The issue here is enumerating points within the parallelotope generated by the transformation matrix. I know there are $\det(M)$ points inside the parallelotope, but I'm not sure how to traverse them. This seems similar to rasterization problems in computer graphics, and I'm wondering if a generalized form of Bresenham's algorithm could work here.

I assume the solution to this problem may also be related to how k-points are generated from an arbitrary mesh. I know I might be trying too hard to optimize this process, but I'm doing so because I want to understand the structure of the problem.

  • 3
    Perhaps you could explain what a supercell is or otherwise mod your question for those without that chunk of background info? – Richard Oct 26 '22 at 21:48
  • 1
    You don't really say what you want the final output to be, a new list of atomic positions and the the new lattice vectors? Clarifying that (and the inputs) would help the question – Ian Bush Oct 27 '22 at 13:49

0 Answers0