spglib.msg module#

MagneticSpaceGroup operations.

class spglib.msg.MagneticSpaceGroupType(uni_number, litvin_number, bns_number, og_number, number, type)[source]#

Bases: DictInterface

Magnetic space group type information.

Added in version 2.5.0.

_abc_impl = <_abc._abc_data object>#
bns_number: str#

BNS number e.g. ‘151.32’

litvin_number: int#

Serial number in Litvin’s [Magnetic group tables](https://www.iucr.org/publ/978-0-9553602-2-0)

number: int#

ITA’s serial number of space group for reference setting

og_number: str#

OG number e.g. ‘153.4.1270’

type: int#

Type of MSG from 1 to 4

uni_number: int#

Serial number of UNI (or BNS) symbols

spglib.msg.MsgCell#

Magnetic crystal structure represented by a tuple of (spglib.utils.Lattice, spglib.utils.Positions, spglib.utils.Numbers, spglib.utils.Magmoms).

alias of tuple[Sequence[Sequence[float]], Sequence[Sequence[float]], Sequence[int], Sequence[float] | Sequence[Sequence[float]]]

class spglib.msg.SpglibMagneticDataset(uni_number, msg_type, hall_number, tensor_rank, n_operations, rotations, translations, time_reversals, n_atoms, equivalent_atoms, transformation_matrix, origin_shift, n_std_atoms, std_lattice, std_types, std_positions, std_tensors, std_rotation_matrix, primitive_lattice)[source]#

Bases: DictInterface

Spglib magnetic dataset information.

See Magnetic Spglib dataset (Experimental) in detail.

Added in version 2.5.0.

_abc_impl = <_abc._abc_data object>#
equivalent_atoms: ndarray[tuple[Any, ...], dtype[int32]]#

Symmetrically equivalent atoms, where ‘symmetrically’ means found symmetry operations.

hall_number: int#

For type-I, II, III, Hall number of FSG; for type-IV, that of XSG

msg_type: int#

Magnetic space groups (MSG) is classified by its family space group (FSG) and maximal space subgroup (XSG).

FSG is a non-magnetic space group obtained by ignoring time-reversal term in MSG. XSG is a space group obtained by picking out non time-reversal operations in MSG.

  • msg_type==1 (type-I):

    MSG, XSG, FSG are all isomorphic.

  • msg_type==2 (type-II):

    XSG and FSG are isomorphic, and MSG is generated from XSG and pure time reversal operations.

  • msg_type==3 (type-III):

    XSG is a proper subgroup of MSG with isomorphic translational subgroups.

  • msg_type==4 (type-IV):

    XSG is a proper subgroup of MSG with isomorphic point group.

n_atoms: int#

Number of atoms in the input cell

n_operations: int#

Number of magnetic symmetry operations

n_std_atoms: int#

Number of atoms in standardized unit cell

origin_shift: ndarray[tuple[Any, ...], dtype[float64]]#

Origin shift from standardized to input origin

shape: (3, )

primitive_lattice: ndarray[tuple[Any, ...], dtype[float64]]#

Basis vectors of primitive lattice.

shape: (3, 3)

rotations: ndarray[tuple[Any, ...], dtype[int32]]#

Rotation (matrix) parts of symmetry operations

shape: (n_operations, 3, 3)

std_lattice: ndarray[tuple[Any, ...], dtype[float64]]#

Row-wise lattice vectors of the standardized unit cell

shape: (3, 3)

std_positions: ndarray[tuple[Any, ...], dtype[float64]]#

Fractional coordinates of atoms in the standardized unit cell

shape: (n_std_atoms, 3)

std_rotation_matrix: ndarray[tuple[Any, ...], dtype[float64]]#

Rigid rotation matrix to rotate from standardized basis vectors to idealized standardized basis vectors

std_tensors: ndarray[tuple[Any, ...], dtype[float64]]#
shape:

(n_std_atoms, ) for collinear magnetic moments. (n_std_atoms, 3) for vector non-collinear magnetic moments.

std_types: ndarray[tuple[Any, ...], dtype[int32]]#

Identity numbers of atoms in the standardized unit cell

shape: (n_std_atoms, )

tensor_rank: int#

Rank of magmoms.

time_reversals: ndarray[tuple[Any, ...], dtype[int32]]#

Time reversal part of magnetic symmetry operations.

True indicates time reversal operation, and False indicates an ordinary operation.

shape: (n_operations, )

transformation_matrix: ndarray[tuple[Any, ...], dtype[int32]]#

Transformation matrix from input lattice to standardized

shape: (3, 3)

translations: ndarray[tuple[Any, ...], dtype[float64]]#

Translation (vector) parts of symmetry operations

shape: (n_operations, 3)

uni_number: int#

UNI number between 1 to 1651

spglib.msg.get_magnetic_spacegroup_type(uni_number)[source]#

Translate UNI number to magnetic space group type information.

If fails, return None.

Return type:

MagneticSpaceGroupType | None

Parameters#

uni_numberint

UNI number between 1 to 1651

Returns#

magnetic_spacegroup_type: MagneticSpaceGroupType | None

Notes#

Added in version 2.0.

spglib.msg.get_magnetic_spacegroup_type_from_symmetry(rotations, translations, time_reversals, lattice=None, symprec=1e-05)[source]#

Return magnetic space-group type information from symmetry operations.

Parameters#

rotations, translations, time_reversals:

See returns of get_magnetic_symmetry().

lattice(Optional) array_like (3, 3)

Basis vectors a, b, c given in row vectors. This is used as the measure of distance. Default is None, which gives unit matrix.

symprec: float

See get_symmetry().

Returns#

magnetic_spacegroup_type: MagneticSpaceGroupType | None

spglib.msg.get_magnetic_symmetry(cell, symprec=1e-05, angle_tolerance=-1.0, mag_symprec=-1.0, is_axial=None, with_time_reversal=True, _throw=False)[source]#

Find magnetic symmetry operations from a crystal structure and site tensors.

Return type:

dict[str, Any] | None

Parameters#

celltuple

Crystal structure given either in tuple. In the case given by a tuple, it has to follow the form below,

(basis vectors, atomic points, types in integer numbers, …)

  • basis vectorsarray_like

    shape=(3, 3), order=’C’, dtype=’double’

    [[a_x, a_y, a_z],
    [b_x, b_y, b_z],
    [c_x, c_y, c_z]]
    
  • atomic pointsarray_like

    shape=(num_atom, 3), order=’C’, dtype=’double’

    Atomic position vectors with respect to basis vectors, i.e., given in fractional coordinates.

  • typesarray_like

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

    Integer numbers to distinguish species.

  • magmoms:
    case-I: Scalar

    shape=(num_atom, ), dtype=’double’

    Each atomic site has a scalar value. With is_magnetic=True, values are included in the symmetry search in a way of collinear magnetic moments.

    case-II: Vectors

    shape=(num_atom, 3), order=’C’, dtype=’double’

    Each atomic site has a vector. With is_magnetic=True, vectors are included in the symmetry search in a way of non-collinear magnetic moments.

symprecfloat

Symmetry search tolerance in the unit of length.

angle_tolerancefloat

Symmetry search tolerance in the unit of angle deg. Normally it is not recommended to use this argument. See a bit more detail at angle_tolerance. If the value is negative, an internally optimized routine is used to judge symmetry.

mag_symprecfloat

Tolerance for magnetic symmetry search in the unit of magnetic moments. If not specified, use the same value as symprec.

is_axial: None or bool

Set is_axial=True if magmoms does not change their sign by improper rotations. If not specified, set is_axial=False when magmoms.shape==(num_atoms, ), and set is_axial=True when magmoms.shape==(num_atoms, 3). These default settings correspond to collinear and non-collinear spins.

with_time_reversal: bool

Set with_time_reversal=True if magmoms change their sign by time-reversal operations. Default is True.

Returns#

symmetry: dict or None

Rotation parts and translation parts of symmetry operations represented with respect to basis vectors and atom index mapping by symmetry operations.

  • ‘rotations’ndarray

    shape=(num_operations, 3, 3), order=’C’, dtype=’intc’

    Rotation (matrix) parts of symmetry operations

  • ‘translations’ndarray

    shape=(num_operations, 3), dtype=’double’

    Translation (vector) parts of symmetry operations

  • ‘time_reversals’: ndarray

    shape=(num_operations, ), dtype=’bool_’

    Time reversal part of magnetic symmetry operations. True indicates time reversal operation, and False indicates an ordinary operation.

  • ‘equivalent_atoms’ndarray

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

  • ‘primitive_lattice’: ndarray

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

Notes#

Added in version 2.0.

spglib.msg.get_magnetic_symmetry_dataset(cell, is_axial=None, symprec=1e-05, angle_tolerance=-1.0, mag_symprec=-1.0)[source]#

Search magnetic symmetry dataset from an input cell. If it fails, return None.

Return type:

SpglibMagneticDataset | None

Parameters#

cell, is_axial, symprec, angle_tolerance, mag_symprec:

See get_magnetic_symmetry().

Returns#

dataset : SpglibMagneticDataset or None

Notes#

Added in version 2.0.

spglib.msg.get_magnetic_symmetry_from_database(uni_number, hall_number=0)[source]#

Return magnetic symmetry operations from UNI number between 1 and 1651.

If fails, return None.

Optionally alternative settings can be specified with Hall number.

Return type:

dict[str, Any] | None

Parameters#

uni_numberint

UNI number between 1 and 1651.

hall_numberint, optional

The Hall symbol is given by the serial number in between 1 and 530.

Returns#

symmetrydict
  • ‘rotations’

  • ‘translations’

  • ‘time_reversals’

    0 and 1 indicate ordinary and anti-time-reversal operations, respectively.

Notes#

Added in version 2.0.