Developer’s API#

These APIs are for the internal usage and development of Spglib itself.

Python interface#

spglib.get_pointgroup(rotations)[source]#

Return point group in international table symbol and number.

The symbols are mapped to the numbers as follows: 1 “1 ” 2 “-1 ” 3 “2 ” 4 “m ” 5 “2/m ” 6 “222 ” 7 “mm2 ” 8 “mmm ” 9 “4 ” 10 “-4 ” 11 “4/m ” 12 “422 ” 13 “4mm ” 14 “-42m ” 15 “4/mmm” 16 “3 ” 17 “-3 ” 18 “32 ” 19 “3m ” 20 “-3m ” 21 “6 ” 22 “-6 ” 23 “6/m ” 24 “622 ” 25 “6mm ” 26 “-62m ” 27 “6/mmm” 28 “23 ” 29 “m-3 ” 30 “432 ” 31 “-43m ” 32 “m-3m “

spglib.get_layergroup(cell, aperiodic_dir=2, symprec=1e-05)[source]#

Return layer group in ….

If it fails, None is returned.

spglib.get_symmetry_layerdataset(cell, aperiodic_dir=2, symprec=1e-05)#

TODO: Add comments.

spglib.get_grid_point_from_address(grid_address, mesh)[source]#

Return grid point index by translating grid address.

spglib.get_stabilized_reciprocal_mesh(mesh, rotations, is_shift=None, is_time_reversal=True, qpoints=None, is_dense=False)[source]#

Return k-point map to the irreducible k-points and k-point grid points.

The symmetry is searched from the input rotation matrices in real space.

Parameters#

mesharray_like

Uniform sampling mesh numbers. dtype=’intc’, shape=(3,)

rotationsarray_like

Rotation matrices with respect to real space basis vectors. dtype=’intc’, shape=(rotations, 3)

is_shiftarray_like

[0, 0, 0] gives Gamma center mesh and value 1 gives half mesh shift. dtype=’intc’, shape=(3,)

is_time_reversalbool

Time reversal symmetry is included or not.

qpointsarray_like

q-points used as stabilizer(s) given in reciprocal space with respect to reciprocal basis vectors. dtype=’double’, shape=(qpoints ,3) or (3,)

is_densebool, optional

grid_mapping_table is returned with dtype=’uintp’ if True. Otherwise its dtype=’intc’. Default is False.

Returns#

grid_mapping_tablendarray

Grid point mapping table to ir-gird-points. dtype=’intc’, shape=(prod(mesh),)

grid_addressndarray

Address of all grid points. Each address is given by three unsigned integers. dtype=’intc’, shape=(prod(mesh), 3)

spglib.get_grid_points_by_rotations(address_orig, reciprocal_rotations, mesh, is_shift=None, is_dense=False)[source]#

Return grid points obtained after rotating input grid address.

Parameters#

address_origarray_like

Grid point address to be rotated. dtype=’intc’, shape=(3,)

reciprocal_rotationsarray_like

Rotation matrices {R} with respect to reciprocal basis vectors. Defined by q’=Rq. dtype=’intc’, shape=(rotations, 3, 3)

mesharray_like

dtype=’intc’, shape=(3,)

is_shiftarray_like, optional

With (1) or without (0) half grid shifts with respect to grid intervals sampled along reciprocal basis vectors. Default is None, which gives [0, 0, 0].

is_densebool, optional

rot_grid_points is returned with dtype=’uintp’ if True. Otherwise its dtype=’intc’. Default is False.

Returns#

rot_grid_pointsndarray

Grid points obtained after rotating input grid address dtype=’intc’ or ‘uintp’, shape=(rotations,)

spglib.get_BZ_grid_points_by_rotations(address_orig, reciprocal_rotations, mesh, bz_map, is_shift=None, is_dense=False)[source]#

Return grid points obtained after rotating input grid address.

Parameters#

address_origarray_like

Grid point address to be rotated. dtype=’intc’, shape=(3,)

reciprocal_rotationsarray_like

Rotation matrices {R} with respect to reciprocal basis vectors. Defined by q’=Rq. dtype=’intc’, shape=(rotations, 3, 3)

mesharray_like

dtype=’intc’, shape=(3,)

bz_maparray_like

TODO

is_shiftarray_like, optional

With (1) or without (0) half grid shifts with respect to grid intervals sampled along reciprocal basis vectors. Default is None, which gives [0, 0, 0].

is_densebool, optional

rot_grid_points is returned with dtype=’uintp’ if True. Otherwise its dtype=’intc’. Default is False.

Returns#

rot_grid_pointsndarray

Grid points obtained after rotating input grid address dtype=’intc’ or ‘uintp’, shape=(rotations,)

spglib.relocate_BZ_grid_address(grid_address, mesh, reciprocal_lattice, is_shift=None, is_dense=False)[source]#

Grid addresses are relocated to be inside first Brillouin zone.

Number of ir-grid-points inside Brillouin zone is returned. It is assumed that the following arrays have the shapes of

bz_grid_address : (num_grid_points_in_FBZ, 3) bz_map (prod(mesh * 2), )

Note that the shape of grid_address is (prod(mesh), 3) and the addresses in grid_address are arranged to be in parallelepiped made of reciprocal basis vectors. The addresses in bz_grid_address are inside the first Brillouin zone or on its surface. Each address in grid_address is mapped to one of those in bz_grid_address by a reciprocal lattice vector (including zero vector) with keeping element order. For those inside first Brillouin zone, the mapping is one-to-one. For those on the first Brillouin zone surface, more than one addresses in bz_grid_address that are equivalent by the reciprocal lattice translations are mapped to one address in grid_address. In this case, those grid points except for one of them are appended to the tail of this array, for which bz_grid_address has the following data storing:

|------------------array size of bz_grid_address-------------------------|
|--those equivalent to grid_address--|--those on surface except for one--|
|-----array size of grid_address-----|

Number of grid points stored in bz_grid_address is returned. bz_map is used to recover grid point index expanded to include BZ surface from grid address. The grid point indices are mapped to (mesh[0] * 2) x (mesh[1] * 2) x (mesh[2] * 2) space (bz_map).