sisl.physics.Spin

class sisl.physics.Spin

Bases: object

Spin class to determine configurations and spin components.

The basic class Spin implements a generic method to determine a spin configuration.

Its usage can be summarized in these few examples:

>>> Spin(Spin.UNPOLARIZED) == Spin("unpolarized") == Spin()
True
>>> Spin(Spin.POLARIZED) == Spin("polarized") == Spin("p")
True
>>> Spin(Spin.NONCOLINEAR, dtype=np.complex128) == Spin("non-collinear") == Spin("nc")
True
>>> Spin(Spin.SPINORBIT, dtype=np.complex128) == Spin("spin-orbit") == Spin("so") == Spin("soc")
True
>>> Spin(Spin.NAMBU) == Spin("nambu") == Spin("bdg")
True

Note that a data-type may be associated with a spin-object. This is not to say that the data-type is used in the configuration, but merely that it helps any sub-classed or classes who use the spin-object to determine the usage of the different spin-components.

Parameters:

kind (str or int, Spin, optional) – specify the spin kind

Methods

copy()

Create a copy of the spin-object

size(dtype)

Number of elements to describe the spin-components

Attributes

NAMBU

NONCOLINEAR

POLARIZED

SPINORBIT

UNPOLARIZED

X

Y

Z

is_colinear

True if the configuration is polarized

is_diagonal

Whether the spin-box is only using the diagonal components

is_nambu

True if the configuration is Nambu

is_noncolinear

True if the configuration non-collinear

is_polarized

True if the configuration is polarized

is_spinorbit

True if the configuration is spin-orbit

is_unpolarized

True if the configuration is not polarized

kind

A unique ID for the kind of spin configuration

spinor

Number of spinor components (1, 2 or 4)

copy()[source]

Create a copy of the spin-object

size(dtype)[source]

Number of elements to describe the spin-components

Parameters:

dtype (np.dtype) – data-type used to represent the spin-configuration

Return type:

int

NAMBU = 4
NONCOLINEAR = 2
POLARIZED = 1
SPINORBIT = 3
UNPOLARIZED = 0
X = array([[0.+0.j, 1.+0.j],        [1.+0.j, 0.+0.j]])
Y = array([[ 0.+0.j, -0.-1.j],        [ 0.+1.j,  0.+0.j]])
Z = array([[ 1.+0.j,  0.+0.j],        [ 0.+0.j, -1.+0.j]])
property is_colinear: bool

True if the configuration is polarized

property is_diagonal: bool

Whether the spin-box is only using the diagonal components

This will return true for non-polarized and polarized spin configurations. Otherwise false.

property is_nambu: bool

True if the configuration is Nambu

property is_noncolinear: bool

True if the configuration non-collinear

property is_polarized: bool

True if the configuration is polarized

property is_spinorbit: bool

True if the configuration is spin-orbit

property is_unpolarized: bool

True if the configuration is not polarized

property kind: int

A unique ID for the kind of spin configuration

property spinor: int

Number of spinor components (1, 2 or 4)