# What's a general algorithm to build a supercell from a primitive cell?

Tags:
1. Sep 14, 2014

Basically, I've written some code that take as inputs 1)Basis vectors 2)lattice translation vectors
and computes the structure factor of the basis, producing a diffraction pattern.

I'd like to begin incorporating subtle differences between atoms, so I want to compute the structure factor of a supercell instead of a primitive cell. So for instance, let's say I'm dealing with graphene. That lattice has a 2-atom basis, so a supercell would be built of maybe 4 or 6 atoms. The thing is, I'm not sure what algorithm determines the new lattice translation vectors. If these aren't chosen correctly, it messes up the reciprocal space and diffraction condition.

Ideally there should be some general, bravais-lattice-independent method of building the supercell so that the supercell lattice vectors are just multiples of the primitive lattice vectors, but I don't know which basis atoms to include to avoid overlap upon translation. Any tips or references would be greatly appreciated.

2. Sep 17, 2014

### M Quack

There are many many possible supercells that can be found in surface science, magnetism, crystallographic phase transitions etc. I don't think that there is a single defined algorithm for designing "the" supercell.