forked from JamesdeLisle/2D-Chern-Number
-
Notifications
You must be signed in to change notification settings - Fork 0
/
paulifunc.cpp
42 lines (37 loc) · 817 Bytes
/
paulifunc.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include "twodwind.h"
#include <complex>
#include <eigen3/Eigen/Dense>
pauli::pauli( int pauli_type_ )
{
std::complex<double> zero(0.0,0.0);
std::complex<double> one(1.0,0.0);
std::complex<double> I(0.0,1.0);
if ( pauli_type_ == 1 )
{
emptyp(0,0) = zero;
emptyp(0,1) = one;
emptyp(1,0) = one;
emptyp(1,1) = zero;
}
else if ( pauli_type_ == 2 )
{
emptyp(0,0) = zero;
emptyp(0,1) = -I;
emptyp(1,0) = I;
emptyp(1,1) = zero;
}
else if ( pauli_type_ == 3 )
{
emptyp(0,0) = one;
emptyp(0,1) = zero;
emptyp(1,0) = zero;
emptyp(1,1) = -one;
}
else
{
emptyp(0,0) = one;
emptyp(0,1) = zero;
emptyp(1,0) = zero;
emptyp(1,1) = one;
}
}