API Reference#

Core APIs#

spinspg.get_spin_symmetry(lattice, positions, numbers, magmoms, symprec=1e-05, mag_symprec=None, angle_tolerance=-1.0, backend='spglib')[source]#

Return spin symmetry operations of a given spin arrangement.

See Spglib’s document for how to specify the spin arrangement by lattice, positions, numbers, and magmoms in details. With the returned spin symmetry operations, the i-th spin symmetry operation maps point coordinates x to rotations[i] @ x + translations[i] and magnetic moment m to spin_rotations[i] @ m.

Parameters:
  • lattice (array, (3, 3)) – lattice[i, :] is the i-th basis vector of a lattice

  • positions (array, (num_sites, 3)) – positions[i, :] is a fractional coordinates of the i-th site w.r.t. lattice.

  • numbers (array[int], (num_sites, )) – numbers[i] specifies a specie at the i-th site.

  • magmoms (array, (num_sites, 3)) – magmoms[i, :] is a magnetic moments at the i-th site in Cartesian coordinates.

  • symprec (float, default=1e-5) – See symprec.

  • mag_symprec (float | None) – See mag_symprec.

  • angle_tolerance (float, default=-1) – See angle_tolerance.

Returns:

  • spin_only_group (spin.SpinOnlyGroup) – Spin-only group, which preserve the given spin arrangement with identity spatial operation.

  • rotations (array[int], (num_sym, 3, 3)) – Rotation parts of spin symmetry operations w.r.t. lattice.

  • translations (array, (num_sym, 3)) – Translation parts of spin symmetry operations w.r.t. lattice.

  • spin_rotations (array, (num_sym, 3, 3)) – Spin rotation parts of spin symmetry operations in Cartesian coordinates.

Spin-only group#

enum spinspg.spin.SpinOnlyGroupType(value)[source]#

Type of spin only group.

Valid values are as follows:

NONMAGNETIC = <SpinOnlyGroupType.NONMAGNETIC: 1>#
COLLINEAR = <SpinOnlyGroupType.COLLINEAR: 2>#
COPLANAR = <SpinOnlyGroupType.COPLANAR: 3>#
NONCOPLANAR = <SpinOnlyGroupType.NONCOPLANAR: 4>#
class spinspg.spin.SpinOnlyGroup(spin_only_group_type, axis)[source]#

Spin only group.

This class represents one of nonmagnetic, collinear, coplanar, and non-coplanar spin-only groups.

Variables:
  • spin_only_group_type (spin.SpinOnlyGroupType) – Nonmagnetic, collinear, coplanar, or non-coplanar

  • axis (array or None, (3, )) – For collinear and coplanar, unit vector perpendicular to its rotation axis.

contain(linear, atol=1e-05)[source]#

Return if this spin only group contains linear.

classmethod nonmagnetic()[source]#

Instantiate nonmagnetic spin-only group.

classmethod collinear(axis)[source]#

Instantiate collinear spin-only group with the parallel axis.

classmethod coplanar(axis)[source]#

Instantiate coplanar spin-only group with the perpendicular axis.

classmethod noncoplanar()[source]#

Instantiate noncoplanar spin-only group.

Nontrivial spin point group#

spinspg.pointgroup.get_pointgroup_representative_from_symbol(symbol)[source]#

Return a representative of a given geometric crystal class.

Parameters:

symbol (symbol for geometric crystal class)

Returns:

group

Return type:

(order, 3, 3)

spinspg.pointgroup.get_pointgroup_representative(prim_rotations)[source]#

Return representative of crystallographic point group.

Parameters:

prim_rotations (array[int], (order, 3, 3)) – Integer rotation matrices

Returns:

  • symbol (str) – Point group type

  • P (array, (3, 3)) – transformation matrix. Let std_rotations be a representative of a crystallographic point group. The transformation P and mapping mapping satisfy np.linalg.inv(P) @ prim_rotations[mapping[i]] @ P == std_rotations[i]

  • mapping (list[int])