tnpy.operators.SpinOperators
2.2. tnpy.operators.SpinOperators#
- class tnpy.operators.SpinOperators(spin=0.5)[source]#
Bases:
object
Constructor of spin operators.
\[ \begin{align}\begin{aligned}\begin{split}S^+ &= \frac{1}{2}\left( S^x + iS^y \right) \\ &= \frac{spin}{2} \times \begin{pmatrix} 0 & 1\\ 0 & 0 \end{pmatrix}\end{split}\\\begin{split}S^- &= \frac{1}{2}\left( S^x - iS^y \right) \\ &= \frac{spin}{2} \times \begin{pmatrix} 0 & 0\\ 1 & 0 \end{pmatrix}\end{split}\end{aligned}\end{align} \]- Parameters
spin (InitVar[float]) –
- Return type
None
- Sp#
Creation operator, 2 x 2 matrix.
- Type
np.ndarray
- Sm#
Annihilation operator, 2 x 2 matrix.
- Type
np.ndarray
- Sz#
Spin operator on z direction.
- Type
np.ndarray
- I2#
2 x 2 identity matrix.
- Type
np.ndarray
- O2#
2 x 2 zero matrix.
- Type
np.ndarray
Examples
>>> Sp, Sm, Sz, I2, O2 = SpinOperators(spin=0.5) >>> print(Sp) array([[0., 1.], [0., 0.]])
Warning
Unpacking ordering is important, and variable-unaware.
- __init__(spin=0.5)#
- Parameters
spin (InitVar[float]) –
- Return type
None
Methods
__init__
([spin])Attributes
- spin: InitVar[float] = 0.5#
- Sp: np.ndarray#
- Sm: np.ndarray#
- Sz: np.ndarray#
- I2: np.ndarray#
- O2: np.ndarray#
- __init__(spin=0.5)#
- Parameters
spin (InitVar[float]) –
- Return type
None