Questaal Home

The supercell and superlattice maker lmscell

lmscell is a supercell or superlattice maker that reads standard input files, constructs supercells or superlattices, and writes supercell information to site files.


lmscell has two modes:

  • supercell maker (default mode)
    In the default mode an existing structure is enlarged into a supercell. It is up to the user to to modify the site file resulting from lmscell. This style is useful for building supercells with point defects, and the command options below apply to the default mode only.

  • superlattice maker
    In this mode, different site files are stacked together to assemble a superlattice. This mode is useful for constructing superlattices along a particular dimension. To use this mode invoke lmscell with --stack[~options]. lmscell starts a superlattice editor, which can be run interactively or in batch mode.

In either case, to get started you need a standard setup that works either for the full-potential code lmf for an ASA program such as lm.

Supercell maker

The only input you must supply in addition to a standard setup are the superlattice vectors. lmscell reads them from standard input (alternatively you can supply them in the ctrl file with tag STRUC_SLAT).

lmscell will prompt you for 9 numbers:

Enter lattice vectors of supercell, or ? for help:

Enter either:

  • 9 floating point numbers, corresponding to the first, second, and third lattice vectors of the supercell.
    Here you supply the lattice vectors directly in Cartesian coordinates. This method is useful, if you know what supercell you want at the outset. Be advised that lmscell will not work properly unless the vectors you specify can be constructed as integer multiples of the original lattice vectors.
  • m or p followed by 9 integers.
    Now the lattice vectors are given as as integer multiples of the lattice vectors of the original lattice. By construction this is always an exact supercell of the original lattice.

lmscell will generate a supercell. To create a site file, use  --wsite  or  --wsitex.  lmscell has numerous other command line options.

Superlattice maker

In this mode, lmscell starts up a superlattice editor. Unit cells are taken from site files you specify and stacked up to build a superlattice. You can build the superlattice interactively, or in batch mode. Once completed you can save the superlattice structure in a site file (by default this file is named sites.ext).

Interactive mode
To operate lmscell in interactive mode, invoke
$ lmscell --stack

You should see:

 Welcome to the superlattice editor.  Enter '?' to see options.

 Option :

The editor operates interactively. It reads a command from standard input, executes the command, and returns to the  Option prompt waiting for another instruction. The editor will print a short summary of instructions if you type   ? <RET> .

Batch mode
You can also run the editor in batch mode by stringing instructions together separated by a delimiter, e.g.
$ lmscell -vz=11.5/11.43 ctrl.inas '--stack~size~site site.inas'

The delimiter ( ~  in this case), is the first character following --stack. lmscell will parse through all the commands sequentially until it encounters q “quit” instruction ( ~q ) which causes it to exit. If no such instruction is encountered, lmscell returns to the interactive mode.

Superlattice editor instructions

This sections documents the instruction set of the dynamical self-energy editor. Codes that can generate the input for this editor are spectral and lmfdmft.

Most instructions have optional arguments. They separated by a delimiter, taken is the first character, e.g. you can use a space. In the description below it is assumed to be  @ .
Note: if you are operating the editor in batch mode, be sure to distinguish this delimiter from the batch mode delimiter.

  • ?
    prints out a brief summary of editor’s instructions

  • file sitefn [options]
    reads site file sitefn and inserts basis vectors into the existing lattice.
    Call  P ,  Pi , and  Ps  the lattice vectors of the existing, insertion, and super lattices, respectively.

    1. No extension is added to sitefn; supply the full file name.
    2. The first two lattice vectors  Pi(1)  and  Pi(2)  (specifying the basal plane of the superlattice) must match the existing structure,  P(1)  and  P(2) .
    3. The superlattice  Ps  is constructed from  P(3) + Pi(3) .
    4. By default, the bottom plane of inserted lattice is offset to coincide with the top plane of the existing lattice.
      • @scale=#      scale the lattice constant of the insertion lattice by  # .
      • @stretch=#     stretch P(3) of the insertion lattice by #. Basis vectors are kept as fixed multiples of P(3).
      • @dpos=#1,#2,#3   rigidly shift the basis vectors of the insertion lattice by (#1,#2,#3), expressed in Cartesian coordinates
      • @dup=#       repeat insertion  #  times.
      • @pad=#       not documented
      • @shft=#       not documented
  • sort@expr1[@expr2][@expr3]
    Uses algrebraic expressions of site data to order sites positions.
    Variables that can be used in expressions:
    • is,ib,z    site and species index, and species atomic number
    • x1,x2,x3  site positions, Cartesian coordinates
    • p1,p2,p3  site positions, projections onto lattice vectors (p1,p2,p3)
    • h1,h2,h3  site positions, projections onto reciprocal lattice vectors
    • Example : order sites by distance from the plane normal to p1×p2:   sort h3
  • scale@#
    Scales lattice constant by  #

  • stretch@#
    Stretches third lattice vector p3 by  #. Basis vectors are kept as fixed multiples of P(3).

  • show[@options]
    shows information about the current structure
    • @all :    show all of the information below (does the same no options given)
    • @size :     show size of the structure
    • @pos :   show positions of basis atoms in the structure
    • @plane :   project positions onto axis normal to basal plane
  • wsite [options]  |  wsitex [options]
    writes to disk a site file corresponding to the current structure
    wsitex writes positions as as fractional multiples of lattice vectors
    • @fn=file :   names the file (default name is sites.ext)
    • @short :   write file in short format
    • @quad1 :   translate basis to first quadrant before writing
  • q
    quit editor and stop

Other resources

Edit This Page