Spin

class sisl.physics.Spin(kind='', dtype=<class 'numpy.float64'>)

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')
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

  • dtype (numpy.dtype, optional) – the data-type used for the spin-component.

Attributes

NONCOLINEAR

POLARIZED

SPINORBIT

UNPOLARIZED

X

Y

Z

__doc__

__hash__

__module__

__slots__

_dtype

_kind

_spins

dkind

Data-type kind

dtype

Data-type of the spin configuration

has_noncolinear

True if the configuration is non-collinear or spin-orbit

is_colinear

True if the configuration is polarized

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

spins

Number of spin-components

Methods

__delattr__

Implement delattr(self, name).

__dir__

Default dir() implementation.

__eq__(other)

Return self==value.

__format__

Default object formatter.

__ge__(other)

Return self>=value.

__getattribute__

Return getattr(self, name).

__getstate__()

__gt__(other)

Return self>value.

__init__([kind, dtype])

Initialize self.

__init_subclass__

This method is called when a class is subclassed.

__le__(other)

Return self<=value.

__len__()

__lt__(other)

Return self<value.

__ne__(other)

Return self!=value.

__new__

Create and return a new object.

__reduce__

Helper for pickle.

__reduce_ex__

Helper for pickle.

__repr__

Return repr(self).

__setattr__

Implement setattr(self, name, value).

__setstate__(state)

__sizeof__

Size of object in memory, in bytes.

__str__()

Return str(self).

__subclasshook__

Abstract classes can override this to customize issubclass().

copy()

Create a copy of the spin-object

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]])
copy()[source]

Create a copy of the spin-object

property dkind

Data-type kind

property dtype

Data-type of the spin configuration

property has_noncolinear

True if the configuration is non-collinear or spin-orbit

property is_colinear

True if the configuration is polarized

property is_noncolinear

True if the configuration non-collinear

property is_polarized

True if the configuration is polarized

property is_spinorbit

True if the configuration is spin-orbit

property is_unpolarized

True if the configuration is not polarized

property kind

A unique ID for the kind of spin configuration

property spins

Number of spin-components