-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwp_shrink.c
146 lines (133 loc) · 5.44 KB
/
wp_shrink.c
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
/************* wp_shrink.c (in su3.a) **************************/
/*
Compute the "Wilson projection" of a Wilson fermion vector.
(1 +- gamma_j) is a projection operator, and we want to isolate
the components of the vector that it keeps. In other words, keep
the components of the vector along the eigenvectors of 1+-gamma_j
with eigenvalue 2, and throw away those with eigenvalue 0.
usage: wp_shrink( wilson_vector *src, half_wilson_vector *dest,
int dir, int sign )
If dir is one of XUP,YUP,ZUP or TUP, take the projections
along the eigenvectors with eigenvalue +1, which survive
multiplication by (1+gamma[dir]).
If dir is one of XDOWN,YDOWN,ZDOWN or TDOWN, take the projections
along the eigenvectors with eigenvalue -1, which survive
multiplication by (1-gamma[OPP_DIR(dir)]).
If sign=MINUS, switch the roles of +1 and -1 (ie use -gamma_dir
instead of gamma_dir )
Here my eigenvectors are normalized to 2, so for XYZT directions
I won't explicitely multiply by 2. In other words, the matrix of
eigenvectors is sqrt(2) times a unitary matrix, and in reexpanding
the vector I will multiply by the adjoint of this matrix.
For UP directions, hvec.h[0] and hvec.h[2] contain the projections
along the first and second eigenvectors respectively.
For DOWN directions, hvec.h[0] and hvec.h[2] contain the projections
along the third and fourth eigenvectors respectively. This results
in down directions differing from up directions only in the sign of
the addition.
Note: wp_shrink( +-dir) followed by wp_grow( +-dir) amounts to multiplication
by 1+-gamma_dir
gamma(XUP) eigenvectors eigenvalue
0 0 0 i ( 1, 0, 0,-i) +1
0 0 i 0 ( 0, 1,-i, 0) +1
0 -i 0 0 ( 0, 1, 0,+i) -1
-i 0 0 0 ( 1, 0,+i, 0) -1
gamma(YUP) eigenvectors eigenvalue
0 0 0 -1 ( 1, 0, 0,-1) +1
0 0 1 0 ( 0, 1, 1, 0) +1
0 1 0 0 ( 1, 0, 0, 1) -1
-1 0 0 0 ( 0, 1,-1, 0) -1
gamma(ZUP) eigenvectors eigenvalue
0 0 i 0 ( 1, 0,-i, 0) +1
0 0 0 -i ( 0, 1, 0,+i) +1
-i 0 0 0 ( 1, 0,+i, 0) -1
0 i 0 0 ( 0, 1, 0,-i) -1
gamma(TUP) eigenvectors eigenvalue
0 0 1 0 ( 1, 0, 1, 0) +1
0 0 0 1 ( 0, 1, 0, 1) +1
1 0 0 0 ( 1, 0,-1, 0) -1
0 1 0 0 ( 0, 1, 0,-1) -1
gamma(FIVE) eigenvectors eigenvalue
1 0 0 0
0 1 0 0
0 0 -1 0
0 0 0 -1
*/
#include <stdio.h>
#include "../include/config.h"
#include "../include/complex.h"
#include "../include/su3.h"
#include "../include/dirs.h"
void wp_shrink( wilson_vector *src, half_wilson_vector *dest,
int dir, int sign ){
register int i; /*color*/
if(sign==MINUS)dir=OPP_DIR(dir); /* two ways to get -gamma_dir ! */
switch(dir){
case XUP:
for(i=0;i<3;i++){
dest->h[0].c[i].real = src->d[0].c[i].real - src->d[3].c[i].imag;
dest->h[0].c[i].imag = src->d[0].c[i].imag + src->d[3].c[i].real;
dest->h[1].c[i].real = src->d[1].c[i].real - src->d[2].c[i].imag;
dest->h[1].c[i].imag = src->d[1].c[i].imag + src->d[2].c[i].real;
}
break;
case XDOWN:
for(i=0;i<3;i++){
dest->h[0].c[i].real = src->d[0].c[i].real + src->d[3].c[i].imag;
dest->h[0].c[i].imag = src->d[0].c[i].imag - src->d[3].c[i].real;
dest->h[1].c[i].real = src->d[1].c[i].real + src->d[2].c[i].imag;
dest->h[1].c[i].imag = src->d[1].c[i].imag - src->d[2].c[i].real;
}
break;
case YUP:
for(i=0;i<3;i++){
dest->h[0].c[i].real = src->d[0].c[i].real - src->d[3].c[i].real;
dest->h[0].c[i].imag = src->d[0].c[i].imag - src->d[3].c[i].imag;
dest->h[1].c[i].real = src->d[1].c[i].real + src->d[2].c[i].real;
dest->h[1].c[i].imag = src->d[1].c[i].imag + src->d[2].c[i].imag;
}
break;
case YDOWN:
for(i=0;i<3;i++){
dest->h[0].c[i].real = src->d[0].c[i].real + src->d[3].c[i].real;
dest->h[0].c[i].imag = src->d[0].c[i].imag + src->d[3].c[i].imag;
dest->h[1].c[i].real = src->d[1].c[i].real - src->d[2].c[i].real;
dest->h[1].c[i].imag = src->d[1].c[i].imag - src->d[2].c[i].imag;
}
break;
case ZUP:
for(i=0;i<3;i++){
dest->h[0].c[i].real = src->d[0].c[i].real - src->d[2].c[i].imag;
dest->h[0].c[i].imag = src->d[0].c[i].imag + src->d[2].c[i].real;
dest->h[1].c[i].real = src->d[1].c[i].real + src->d[3].c[i].imag;
dest->h[1].c[i].imag = src->d[1].c[i].imag - src->d[3].c[i].real;
}
break;
case ZDOWN:
for(i=0;i<3;i++){
dest->h[0].c[i].real = src->d[0].c[i].real + src->d[2].c[i].imag;
dest->h[0].c[i].imag = src->d[0].c[i].imag - src->d[2].c[i].real;
dest->h[1].c[i].real = src->d[1].c[i].real - src->d[3].c[i].imag;
dest->h[1].c[i].imag = src->d[1].c[i].imag + src->d[3].c[i].real;
}
break;
case TUP:
for(i=0;i<3;i++){
dest->h[0].c[i].real = src->d[0].c[i].real + src->d[2].c[i].real;
dest->h[0].c[i].imag = src->d[0].c[i].imag + src->d[2].c[i].imag;
dest->h[1].c[i].real = src->d[1].c[i].real + src->d[3].c[i].real;
dest->h[1].c[i].imag = src->d[1].c[i].imag + src->d[3].c[i].imag;
}
break;
case TDOWN:
for(i=0;i<3;i++){
dest->h[0].c[i].real = src->d[0].c[i].real - src->d[2].c[i].real;
dest->h[0].c[i].imag = src->d[0].c[i].imag - src->d[2].c[i].imag;
dest->h[1].c[i].real = src->d[1].c[i].real - src->d[3].c[i].real;
dest->h[1].c[i].imag = src->d[1].c[i].imag - src->d[3].c[i].imag;
}
break;
default:
printf("BAD CALL TO WP_SHRINK()\n");
}
}