TCM
UoC crest

Cellsym

Cellsym is a simple C front-end for the excellent spglib symmetry finding code. Its author has nothing to do with spglib, but is responsible for check2xsf.

Cellsym borrows much of its code from an early version of check2xsf. Its functionality will be rolled into the yet-to-be-released check2xsf2. However, this page remains to show a smaller, lighter wrapper for spglib than check2xsf2 will be. N.B. This version ignores spin.

Spglib is a useful package for finding crystallographic symmetry, including the primitive cell, individual symmetry operations, and the international space group symbol. It can also snap atoms and axes to the exact positions implied by the symmetry operations which are nearly present.

Cellsym can read and write CASTEP .cell files, PDB files, and (a subset of) SHELX97 .res files. These it can then pass to spglib. Currently cellsym does not handle k-points, but does provide access to most of the rest of spglib's functionality. When writing .cell files, it can include the symmetry operations found by spglib.

$ cellsym -h
Usage: cellsym [-vV] [-e=eps] [--FORMAT] --OPERATION infile [outfile]

-e=eps       set tolerance for finding symmetries. Default=0.0001
-v           be verbose (may be repeated)
-V           print version number and exit

OPERATION is one of:
   primitive      call spg_find_primitive()
   refine         call spg_refine_cell()
   int            call spg_get_international()
   schoen         call spg_get_schoenflies()
   symmetry       call spg_get_symmetry()
   list           call spg_get_symmetry() and list results
   point          call spg_get_symmetry() followed by spg_get_pointgroup()

FORMAT is one of: cell      CASTEP .cell, cartesian and fractional
                  cell_abc                abc and fractional
                  cell_abs                cartesian and absolute
                  cell_abc_abs            abc and absolute
                  pdb       PDB
                  pdbn      PDB with atoms numbered
                  shelx     SHELX97
                  airss     not SHELX97

Multiple operations may be specified. The order in which they will
be applied is the order in which they are listed above, not the
order on the command line.

cellsym version 0.15 (c) 2012, 2013 MJR, symmetry information from libspg.
$ cellsym --int --list -v -e=2e-3 beryl.cell 
International symmetry is P622      
12 symmetry operations found.
 1  axis along ( 0.000, 0.000, 1.000) through (0,0,0)
 2  axis along ( 1.000, 0.000, 0.000) through (0.000000,0.000000,0.249956)
 2  axis along ( 1.000, 1.000, 0.000) through (-0.000012,0.000014,0.249956)
 3  axis along ( 0.000, 0.000, 1.000) through (0,0,0)
 2  axis along ( 0.000, 0.000, 1.000) through (0,0,0)
 2  axis along ( 1.000, 2.000, 0.000) through (-0.000043,0.000000,0.249956)
 2  axis along ( 1.000,-1.000, 0.000) through (0.000017,0.000017,0.249956)
 6  axis along ( 0.000, 0.000, 1.000) through (0,0,0)
 6  axis along ( 0.000, 0.000, 1.000) through (0,0,0)
 2  axis along ( 2.000, 1.000, 0.000) through (0.000000,0.000039,0.249956)
 3  axis along ( 0.000, 0.000, 1.000) through (0,0,0)
 2  axis along ( 0.000,-1.000, 0.000) through (-0.000018,-0.000008,0.249956)
$ cellsym --int --list -v -e=2e-4 SiC_2H.cell 
International symmetry is P6_3mc    
12 symmetry operations found.
 1  axis along ( 0.000, 0.000, 1.000) through (0,0,0)
-2  axis along ( 1.000, 1.000, 0.000) through (0.166667,0.166667,-0.250000)
-2  axis along ( 2.000,-1.000, 0.000) through (0.166667,0.166667,-0.250000)
 3  axis along ( 0.000, 0.000, 1.000) through (0,0,0)
2_1 axis along ( 0.000, 0.000, 1.000) through (0.166667,0.166667,0.000000)
-2  axis along ( 1.000,-1.000, 0.000) through (0,0,0)
-2  axis along ( 0.000,-1.000, 0.000) through (0,0,0)
6_3 axis along ( 0.000, 0.000, 1.000) through (-0.333333,0.666667,0.000000)
6_3 axis along ( 0.000, 0.000, 1.000) through (0.666667,-0.333333,0.000000)
-2  axis along ( 1.000, 0.000, 0.000) through (0,0,0)
 3  axis along ( 0.000, 0.000, 1.000) through (0,0,0)
-2  axis along ( 1.000,-2.000, 0.000) through (0.166667,0.166667,-0.250000)

The above output does not explicitly state that -2 axes are mirror or glide planes.

Cellsym is still very much beta quality, but its source is available here (0.16a). It requires version 1.3 or later of spglib, which, for convenience, is also available here. (Also successfully tested with 1.9.4.) Cellsym is released under the GPL version 2, and there is no claim that it is fit for any purpose whatsoever. If you deem it useful to you, that is your judgement.