Spglib is a library for finding and handling crystal symmetries written in C.

Spglib for python is found at Spglib for python.

Spglib-1.7.4.x. is the stable release.

Spglib-1.9.0 is the latest release. Updates and changes of API and definitions of variables can happen againt previous versions and they are written in the document.

Version history is summarized in ChangeLog.


Python module pyspglib is renamed to spglib in version 1.9.0.

In versions 1.8.x or before, the python wrapper (pyspglib) was considered as a special extention of spglib and separately maintained, but in version 1.9.x and later, it starts to be a part of spglib as a usual extension, and this python wrapper will be maintained to work following every update of c-spglib. The package name is changed from pyspglib to spglib. Following this change, the way to import python spglib module is changed and it is written in Spglib for python.


  • Find symmetry operations
  • Identify space-group type
  • Wyckoff position assignment
  • Refine crystal structure
  • Find a primitive cell
  • Search irreducible k-points
  • Liner tetrahedron method (the document is to be prepared.)


  • Space-group type finding algorithm: R. W. Grosse-Kunstleve, Acta Cryst., A55, 383-395 (1999)
  • Crystal refinement algorithm: R. W. Grosse-Kunstleve and P. D. Adams, Acta Cryst., A58, 60-65 (2002)


  1. Download spglib.

  2. Unzip, configure, and make:

    % tar xvfz spglib-1.7.4.tar.gz
    % cd spglib-1.7.4
    % ./configure
    % make
  3. Copy the libraries where you want using OpenMP. The libraries may be in src/.libs if you don’t make install,


Bottle neck of symmetry operation search may be eased using the OpenMP threading. In the case of gcc (> 4.2), set the following environment variables before running configure script:

% export LIBS='-lgomp'
% export CFLAGS='-fopenmp'

Overhead of threading is relatively large when the number of atoms is small. Therefore the threading is activated when the number of atoms >= 1000.


  1. Include spglib.h
  2. Link libsymspg.a or libsymspg.so
  3. A compilation example is shown in example/README.


A few examples are found in example directory.

Python extension

Python module is prepared in the python directory. See the details at Spglib for python.

Ruby extension

The ruby script symPoscar.rb in ruby directory reads a VASP POSCAR formatted file and finds the space-group type. The -l option refines a slightly distorted structure within tolerance spacified with the -s option. The -o option gives the symmetry operations of the input structure.

ruby symPoscar.rb POSCAR -s 0.1 -o -l

Some more options are shown with --help option:

ruby symPoscar.rb --help

The way to compile the ruby module is explained in ruby/README.

Fortran interface

Fortran interface spglib_f08.f90 is found in example directory. This fortran interface is the contribution from Dimitar Pashov. spglib_f.c is obsolete and is not recommended to use.

Mailing list

For questions, bug reports, and comments, please visit following mailing list:


For more information


Spglib project acknowledges Yusuke Seto for the Crystallographic database, Dimitar Pashov for the fortran interface, Paweł T. Jochym for python packages.