Substrate Analyzer -- CIF generation


Hi all,

I am currently writing a script to generate slab-heterostructure CIF files from the matches found by SubstrateAnalyzer. After running the module, I have successfully made slabs of the film & substrate materials for each match – as well as shifted the slabs so that they’ll form an interface when combined. But I now need make supercells from the given slabs in order to get the correct match and combine structures. Here, is where I am stuck. How would I take the surface vectors from the match to generate the correct supercell?

The documentation and source code (here) is unclear on the output values “film_vecs” vs. “film_sl_vecs”. I presume “sl” refers to the superlattice, but I’m unsure how to use these vectors to make a supercell. Do these vectors refer to the superlattice directly or are they transformation vectors? Further, would the .make_supercell() function be used here to convert from slab (or base structure?) into the correct supercell? (output vectors are also 2x3 surface matrix instead of 3x3 bulk matrix, which complicates transformation as well)

Any help would be appreciated! Or if there’s an easier route to generate the SubstrateAnalyzer interfaces as CIFs, let me know. I can send my current script if needed – the only current issue is specification of these vectors. I just need clarification on their meaning & how to apply them for supercell generation.


Hi Jack,

You can use the film_vecs and film_sl_vecs to compute a transformation matrix. To do this you need to do the following:

1.) Compute an orthogonal surface vector for each set of surface vectors and make them unit vectors. This ensures you don’t get any c-direction dialation.
2.) Then you can compute the transformation matrix from film_vecs to film_sl_vecs using simple linear algebra.

This matrix has two components to it:
a.) A super-lattice scaling component
b.) A rotation

You should be able to use linear algebra here to decompose these as well. Then you’d apply the super-lattice scaling matrix, then the rotation and it should put the two slabs in the correct orientation to join together.


Thanks for the response! This clears up my question perfectly. I really appreciate it!