# Software for generating a lattice from a unit cell for molecular crystals?

I am looking for a software package which can take a unit cell (and lattice parameters, etc.) and from that generate a crystal lattice. Ideally it will have functionality for orthorhombic, hexagonal, and other types of unit cells which are slightly less trivial than a cubic lattice.

Finally, it should work for molecular crystals.

I have seen the ASE lattice class (https://wiki.fysik.dtu.dk/ase/ase/lattice.html), but it isn't so clear to me how to define a lattice for a system when the unit cell is quite large.

As an example, I have a unit cell for a clathrate hydrate which contains 68 water molecules and I want to generate a lattice from this unit cell. How would one usually go about doing this?

My guess is that one way around this is to use some kind of MD package and just give the unit cell along with the lattice parameters and the type of lattice. Then, after applying periodic boundary conditions, somehow get the package to print out the coordinates of atoms beyond just the original unit cell. This feels a bit hacky to me, but if this is normal and someone knows a relatively simple way to do this, then let me know. Answers involving either open-source or purchasable software are acceptable, although open-source is always preferred :)

As an aside, it seems to me that it may not be too hard to just write code to do this for my specific cases, so if anyone has a good reference for generating the lattice given the type of unit cell, lattice parameters, and a set of Cartesian coordinates, that would also be helpful.

• Simply work out the lattice vectors, and then any integer multiple of them when added to a atomic position will be the position of the an equivalent atom. Forget cell angles and symmetry of the cell, for this all you need is the lattice vectors. chemistry.stackexchange.com/questions/94400/… might be of help as well Nov 10 '19 at 22:03
• If I understand the question correctly, VESTA (Free, available for Windows, Linux, macOS) does that. You can create a new structure from scratch by applying the crystallographic system and space group to the set of atomic coordinates, and then "grow" obtained unit cell as much as you want, and finally export to, say, XYZ format. I barely touched this workflow in one of my answers. Nov 10 '19 at 22:03
• @IanBush I could be wrong, but I don't think this is true. The lattice constants are basis vectors for the unit cell and a different transformation matrix is required depending on what symmetry the unit cell is meant to have (e.g. cubic, orthorhombic, hexagonal, etc.). If you are aware of a reference where someone has posted the appropriate transformation matrix for each type of unit cell, then that would be very useful. Maybe these are matrices easy to derive, but I want a reference just to be confident I do this right. Nov 10 '19 at 23:10
• Yes it is true, as long as you pick the appropriate unit cell. 3 non-coplanar vectors span a 3 dimensional space. Crystal unit cells span a 3 dimensional space. Make the lattice vectors the edge of the unit cell and you are sorted. Hexagonal might be the only confusing case, en.wikipedia.org/wiki/Hexagonal_crystal_family has a picture to show how it can be done. Nov 11 '19 at 9:54

## 2 Answers

In addition to the presentations about CCDC Mercury and Vesta by @andselisk here and later mine about Avogadro could be extended. As described earlier, Avogadro's capability to read .cif files about crystallographic models allows you to extend these via the slab builder to any extent you need (GUI entry Crystallography -> Build -> Slab) and to export them either as normal .xyz file, or (via the extension tab, template assisted) in one of multiple formats recognized by quantum chemical programs (e.g., Gaussian, GAMESS-UK, MOPAC).

It equally is possible to start from scratch with a cubic unit cell of 3 Å. Subsequently, you would alter the lattice parameters ($$a, b, c; \alpha, \beta, \gamma$$) and enter atoms one, after the other, either in cartesian coordinates (either Angstrom, Bohr, nm or pm), or in fractional atomic coordinates as typically in .cif files. You may wrap the atoms into the cell, and of course impose one of the space group symmetries to fill your cell, too. You may symmetrize your constructed unit cell and reset (within tolerances you determine) into a standard setting, too. Equally than just reading a .cif,.pdb, or .xyz, these constructed unit cells may be extended with the slab builder, and equally may be exported in one of the computer chemistry formats mentioned earlier, too.

• I ended up downloading Avogadro, and it is extremely easy to duplicate the unit cell as needed. This can be done through the build tab as well. Slab seems to do something similar. I will accept this answer after a little bit. Nov 11 '19 at 0:41

You might also look into Force Field X 'Crystal' module (https://ffx.biochem.uiowa.edu/modules/crystal/index.html), unit conventions can be found here (https://ffx.biochem.uiowa.edu/properties-spacegroup.html).

Also, I feel it's important to mention that the code is open source and freely available, useful if you're interested in exactly how the calculations are performed: the procedure outlined by https://chemistry.stackexchange.com/users/1782/buttonwood is very similar, if not identical, to the implementation, IIRC.

Cheers!

• Briefly, I thought about the OP's question to be a little related to how powder-XRD models may be solved, and the shake-and-bake approach for single crystal specimen (secure.hwi.buffalo.edu/SnB) seen to describe larger molecules, too. Since the program you point to seems to grow among crystallographers for biophysics (e.g., DNA, proteïns), and the concept of SnB entered, for example ShelxD, do you know if there is a similar cell / structure optimization present / planned in Force Field X Crystal, too? Nov 13 '19 at 23:08
• There exists a really useful tool, already implemented, to optimize crystal structures, specifically proteins: ffx.biochem.uiowa.edu/commands/realspace.ManyBody.html The publication can be found here: cell.com/biophysj/fulltext/S0006-3495(15)00676-1 There also exists a module to further refine structures (including the above-mentioned rotamer optimization): ffx.biochem.uiowa.edu/commands-realspace.html Hope this answers your question, at least to some degree. Nov 15 '19 at 14:41