sgeom

The sgeom executable is a tool for reading and transforming general coordinate formats to other formats, or alter them.

For a short help description of the possible uses do:

sgeom --help

Here we list a few of the most frequent used commands.

Conversion

The simplest usage is transforming from one format to another format. sgeom takes at least two mandatory arguments, the first being the input file format, and the second (and any third + argumets) the output file formats

sgeom <in> <out> [<out2>] [[<out3>] ...]

Hence to convert from an fdf SIESTA input file to an xyz file for plotting in a GUI program one can do this:

sgeom RUN.fdf RUN.xyz

and the RUN.xyz file will be created.

Remark that the input file must be the first argument of sgeom.

Available formats

The currently available formats are:

  • xyz, standard coordinate format Note that the the xyz file format does not per see contain the cell size. The XYZSile writes the cell information in the xyz file comment section (2nd line). Hence if the file was written with sisl you retain the cell information.
  • gout, reads geometries from GULP output
  • nc, reads/writes NetCDF4 files created by SIESTA
  • TBT.nc/PHT.nc, reads NetCDF4 files created by TBtrans/PHtrans
  • tb, intrinsic file format for geometry/tight-binding models
  • fdf, SIESTA native format
  • XV, SIESTA coordinate format with velocities
  • POSCAR/CONTCAR, VASP coordinate format, does not contain species, i.e. returns Hydrogen geometry.
  • ASCII, BigDFT coordinate format
  • win, Wannier90 input file
  • xsf, XCrySDen coordinate format

Advanced Features

More advanced features are represented here.

The sgeom utility enables highly advanced creation of several geometry structures by invocing the arguments in order.

I.e. if one performs:

sgeom <in> --repeat x 3 repx3.xyz --repeat y 3 repx3_repy3.xyz

will read <in>, repeat the geometry 3 times along the first unit-cell vector, store the resulting geometry in repx3.xyz. Subsequently it will repeat the already repeated structure 3 times along the second unit-cell vector and store the now 3x3 repeated structure as repx3_repy3.xyz.

Repeating/Tiling structures

One may use periodicity to create larger structures from a simpler structure. This is useful for creating larger bulk structures. To repeat a structure do

sgeom <in> --repeat [ax|yb|zc] <int> <out>

which repeats the structure one atom at a time, <int> times, in the corresponding direction. Note that x and a correspond to the same cell direction (the first).

To repeat the structure in chunks one can use the --tile option:

sgeom <in> --tile [ax|yb|zc] <int> <out>

which results in the same structure as --repeat however with different atomic ordering.

Both tiling and repeating have the shorter variants:

sgeom <in> -t[xyz] <int> -r[xyz] <int>

to ease the commands.

To repeat a structure 4 times along the x cell direction:

sgeom RUN.fdf --repeat x 4 RUN4x.fdf
sgeom RUN.fdf --repeat-x 4 RUN4x.fdf
sgeom RUN.fdf --tile x 4 RUN4x.fdf
sgeom RUN.fdf --tile-x 4 RUN4x.fdf

where all the above yields the same structure, albeit with different orderings.

Rotating structure

To rotate the structure around certain cell directions one can do:

sgeom <in> --rotate [ax|yb|zc] <angle> <out>

which rotates the structure around the origo with a normal vector along the specified cell direction. The input angle is in degrees and not in radians. If one wish to use radians append an r in the angle specification.

Again there are shorthand commands:

sgeom <in> -R[xyz] <angle>

Combining command line arguments

All command line options may be used together. However, one should be aware that the order of the command lines determine the order of operations.

If one starts by repeating the structure, then rotate it, then shift the structure, it will be different from, shift the structure, then rotate, then repeat.

Be also aware that outputting structures are done at the time in the command line order. This means one can store the intermediate steps while performing the entire operation.