35 #include <bitcalc.hpp> 37 #include "diagonalcalc.hpp" 38 #include "mltplySpinCore.hpp" 39 #include "wrapperMPI.hpp" 65 std::complex<double> *tmp_v0,
66 std::complex<double> *tmp_v1
84 if (isite2 < isite1) {
103 is1_spin = X->
Def.
Tpow[2 * isite1 - 2 + isigma1];
104 is2_spin = X->
Def.
Tpow[2 * isite2 - 2 + isigma2];
106 ibit1_spin = (
long int)
myrank&is1_spin;
107 num1 += ibit1_spin / is1_spin;
109 ibit2_spin = (
long int)
myrank&is2_spin;
110 num2 += ibit2_spin / is2_spin;
116 is1_up = X->
Def.
Tpow[isite1 - 1];
117 is2_up = X->
Def.
Tpow[isite2 - 1];
134 if (num1 * num2 != 0) {
135 #pragma omp parallel for default(none) shared(tmp_v0, tmp_v1) \ 136 firstprivate(i_max, dtmp_V) private(j) 137 for (j = 1; j <= i_max; j++) {
138 tmp_v0[j] += dtmp_V * tmp_v1[j];
149 is1_spin = X->
Def.
Tpow[2 * isite1 - 2 + isigma1];
150 is2_spin = X->
Def.
Tpow[2 * isite2 - 2 + isigma2];
153 ibit2_spin = (
long int)
myrank&is2_spin;
154 num2 += ibit2_spin / is2_spin;
156 #pragma omp parallel for default(none) shared(tmp_v0, tmp_v1)\ 157 firstprivate(i_max, dtmp_V, is1_spin) private(num1, ibit1_spin, j) 158 for (j = 1; j <= i_max; j++) {
160 ibit1_spin = (j - 1) & is1_spin;
161 num1 += ibit1_spin / is1_spin;
162 tmp_v0[j] += dtmp_V * num1 * tmp_v1[j];
171 is1_spin = X->
Def.
Tpow[2 * isite1 - 2 + isigma1];
172 is2_spin = X->
Def.
Tpow[2 * isite2 - 2 + isigma2];
175 ibit2_spin = (
long int)
myrank&is2_spin;
176 num2 += ibit2_spin / is2_spin;
178 #pragma omp parallel for default(none) shared(tmp_v0, tmp_v1, list_1)\ 179 firstprivate(i_max, dtmp_V, is1_spin) private(num1, ibit1_spin, j) 180 for (j = 1; j <= i_max; j++) {
182 ibit1_spin =
list_1[j] & is1_spin;
183 num1 += ibit1_spin / is1_spin;
184 tmp_v0[j] += dtmp_V * num1*tmp_v1[j];
192 is1_up = X->
Def.
Tpow[isite1 - 1];
193 is2_up = X->
Def.
Tpow[isite2 - 1];
197 #pragma omp parallel for default(none) shared(tmp_v0, tmp_v1)\ 198 firstprivate(i_max, dtmp_V, is1_up, isigma1, X) private(num1, j) 199 for (j = 1; j <= i_max; j++) {
201 tmp_v0[j] += dtmp_V * num1 * tmp_v1[j];
209 #pragma omp parallel for default(none) shared(tmp_v0, tmp_v1) \ 210 firstprivate(i_max, dtmp_V, isite1, isigma1, X) private(j, num1) 211 for (j = 1; j <= i_max; j++) {
213 tmp_v0[j] += dtmp_V * num1 * tmp_v1[j];
223 is1_up = X->
Def.
Tpow[isite1 - 1];
224 is2_up = X->
Def.
Tpow[isite2 - 1];
228 #pragma omp parallel for default(none) shared(tmp_v0, tmp_v1) \ 229 firstprivate(i_max, dtmp_V, is1_up, isigma1, X, num2) private(j, num1) 230 for (j = 1; j <= i_max; j++) {
232 tmp_v0[j] += dtmp_V * num1 * tmp_v1[j];
240 #pragma omp parallel for default(none) shared(tmp_v0, tmp_v1, list_1)\ 241 firstprivate(i_max, dtmp_V, isite1, isigma1, X) private(j, num1) 242 for (j = 1; j <= i_max; j++) {
244 tmp_v0[j] += dtmp_V * num1 * tmp_v1[j];
261 is1_spin = X->
Def.
Tpow[2 * isite1 - 2 + isigma1];
262 is2_spin = X->
Def.
Tpow[2 * isite2 - 2 + isigma2];
263 #pragma omp parallel for default(none) \ 264 shared(tmp_v0, tmp_v1) firstprivate(i_max, dtmp_V, is1_spin, is2_spin) \ 265 private(num1, ibit1_spin, num2, ibit2_spin) 266 for (j = 1; j <= i_max; j++) {
269 ibit1_spin = (j - 1)&is1_spin;
270 num1 += ibit1_spin / is1_spin;
271 ibit2_spin = (j - 1)&is2_spin;
272 num2 += ibit2_spin / is2_spin;
273 tmp_v0[j] += dtmp_V * num1*num2*tmp_v1[j];
279 is1_spin = X->
Def.
Tpow[2 * isite1 - 2 + isigma1];
280 is2_spin = X->
Def.
Tpow[2 * isite2 - 2 + isigma2];
282 #pragma omp parallel for default(none) \ 283 shared(tmp_v0, tmp_v1, list_1) firstprivate(i_max, dtmp_V, is1_spin, is2_spin) \ 284 private(num1, ibit1_spin, num2, ibit2_spin) 285 for (j = 1; j <= i_max; j++) {
288 ibit1_spin =
list_1[j] & is1_spin;
289 num1 += ibit1_spin / is1_spin;
291 ibit2_spin =
list_1[j] & is2_spin;
292 num2 += ibit2_spin / is2_spin;
293 tmp_v0[j] += dtmp_V * num1*num2*tmp_v1[j];
299 is1_up = X->
Def.
Tpow[isite1 - 1];
300 is2_up = X->
Def.
Tpow[isite2 - 1];
301 #pragma omp parallel for default(none) \ 302 shared(tmp_v0, tmp_v1) firstprivate(i_max, dtmp_V, is1_up, is2_up, isigma1, isigma2, X) \ 303 private(j, num1, num2) 304 for (j = 1; j <= i_max; j++) {
307 tmp_v0[j] += dtmp_V * num1*num2*tmp_v1[j];
311 #pragma omp parallel for default(none) \ 312 shared(tmp_v0, tmp_v1, list_1) firstprivate(i_max, dtmp_V, isite1, isite2, isigma1, isigma2, X) \ 314 for (j = 1; j <= i_max; j++) {
318 tmp_v0[j] += dtmp_V * num1*tmp_v1[j];
327 is1_up = X->
Def.
Tpow[isite1 - 1];
328 is2_up = X->
Def.
Tpow[isite2 - 1];
329 #pragma omp parallel for default(none) \ 330 shared(tmp_v0, tmp_v1) firstprivate(i_max, dtmp_V, is1_up, is2_up, isigma1, isigma2, X) \ 331 private(j, num1, num2) 332 for (j = 1; j <= i_max; j++) {
335 tmp_v0[j] += dtmp_V * num1*num2*tmp_v1[j];
339 #pragma omp parallel for default(none) \ 340 shared(tmp_v0, tmp_v1) firstprivate(i_max, dtmp_V, isite1, isite2, isigma1, isigma2, X) \ 342 for (j = 1; j <= i_max; j++) {
346 tmp_v0[j] += dtmp_V * num1*tmp_v1[j];
380 std::complex<double> *tmp_v0,
381 std::complex<double> *tmp_v1
385 long int isigma1 = spin;
404 is1 = X->
Def.
Tpow[2 * isite1 - 2];
407 is1 = X->
Def.
Tpow[2 * isite1 - 1];
409 ibit1 = (
long int)
myrank & is1;
417 is1_up = X->
Def.
Tpow[isite1 - 1];
418 num1 = (((
long int)
myrank& is1_up) / is1_up) ^ (1 - spin);
432 #pragma omp parallel for default(none) shared(tmp_v0, tmp_v1) \ 433 firstprivate(i_max, dtmp_V) private(j) 434 for (j = 1; j <= i_max; j++) {
435 tmp_v0[j] += dtmp_V * tmp_v1[j];
445 is1 = X->
Def.
Tpow[2 * isite1 - 2];
448 is1 = X->
Def.
Tpow[2 * isite1 - 1];
451 #pragma omp parallel for default(none) \ 452 shared(tmp_v0, tmp_v1) firstprivate(i_max, dtmp_V, is1) private(num1, ibit1) 453 for (j = 1; j <= i_max; j++) {
456 tmp_v0[j] += dtmp_V * num1*tmp_v1[j];
463 is1 = X->
Def.
Tpow[2 * isite1 - 2];
466 is1 = X->
Def.
Tpow[2 * isite1 - 1];
469 #pragma omp parallel for default(none) \ 470 shared(list_1, tmp_v0, tmp_v1) firstprivate(i_max, dtmp_V, is1) private(num1, ibit1) 471 for (j = 1; j <= i_max; j++) {
474 tmp_v0[j] += dtmp_V * num1*tmp_v1[j];
480 is1_up = X->
Def.
Tpow[isite1 - 1];
481 #pragma omp parallel for default(none) \ 482 shared(list_1, tmp_v0, tmp_v1) firstprivate(i_max, dtmp_V, is1_up, spin) private(num1) 483 for (j = 1; j <= i_max; j++) {
484 num1 = (((j - 1)& is1_up) / is1_up) ^ (1 - spin);
485 tmp_v0[j] += dtmp_V * num1*tmp_v1[j];
489 #pragma omp parallel for default(none) \ 490 shared(tmp_v0, tmp_v1) firstprivate(i_max, dtmp_V, isite1, isigma1, X) private(j, num1) 491 for (j = 1; j <= i_max; j++) {
494 tmp_v0[j] += dtmp_V * tmp_v1[j];
502 is1_up = X->
Def.
Tpow[isite1 - 1];
503 #pragma omp parallel for default(none) \ 504 shared(list_1, tmp_v0, tmp_v1) firstprivate(i_max, dtmp_V, is1_up, spin) private(num1) 505 for (j = 1; j <= i_max; j++) {
506 num1 = ((
list_1[j] & is1_up) / is1_up) ^ (1 - spin);
507 tmp_v0[j] += dtmp_V * num1*tmp_v1[j];
511 #pragma omp parallel for default(none) \ 512 shared(tmp_v0, tmp_v1, list_1) firstprivate(i_max, dtmp_V, isite1, isigma1, X) private(j, num1) 513 for (j = 1; j <= i_max; j++) {
516 tmp_v0[j] += dtmp_V * tmp_v1[j];
550 std::complex<double> *tmp_v0,
551 std::complex<double> *tmp_v1
556 long int isigma1 = spin;
574 is1 = X->
Def.
Tpow[2 * isite1 - 2];
577 is1 = X->
Def.
Tpow[2 * isite1 - 1];
579 ibit1 = (
long int)
myrank & is1;
586 is1_up = X->
Def.
Tpow[isite1 - 1];
587 num1 = (((
long int)
myrank& is1_up) / is1_up) ^ (1 - spin);
602 #pragma omp parallel for default(none) shared(tmp_v0, tmp_v1)\ 603 firstprivate(i_max, dtmp_V) private(j) 604 for (j = 1; j <= i_max; j++) {
605 tmp_v0[j] += dtmp_V * tmp_v1[j];
613 is1 = X->
Def.
Tpow[2 * isite1 - 2];
616 is1 = X->
Def.
Tpow[2 * isite1 - 1];
618 #pragma omp parallel for default(none) shared(list_1, tmp_v0, tmp_v1) \ 619 firstprivate(i_max, dtmp_V, is1) private(num1, ibit1) 620 for (j = 1; j <= i_max; j++) {
621 ibit1 = (j - 1) & is1;
623 tmp_v0[j] += dtmp_V * num1*tmp_v1[j];
631 is1 = X->
Def.
Tpow[2 * isite1 - 2];
634 is1 = X->
Def.
Tpow[2 * isite1 - 1];
636 #pragma omp parallel for default(none) shared(list_1, tmp_v0, tmp_v1) \ 637 firstprivate(i_max, dtmp_V, is1) private(num1, ibit1) 638 for (j = 1; j <= i_max; j++) {
641 tmp_v0[j] += dtmp_V * num1*tmp_v1[j];
647 is1_up = X->
Def.
Tpow[isite1 - 1];
648 #pragma omp parallel for default(none) \ 649 shared(list_1, tmp_v0, tmp_v1) \ 650 firstprivate(i_max, dtmp_V, is1_up, spin) private(num1, ibit1_up) 651 for (j = 1; j <= i_max; j++) {
652 ibit1_up = (((j - 1) & is1_up) / is1_up) ^ (1 - spin);
653 tmp_v0[j] += dtmp_V * ibit1_up*tmp_v1[j];
657 #pragma omp parallel for default(none) shared(tmp_v0, tmp_v1) \ 658 firstprivate(i_max, dtmp_V, isite1, isigma1, X) private(j, num1) 659 for (j = 1; j <= i_max; j++) {
662 tmp_v0[j] += dtmp_V * tmp_v1[j];
670 is1_up = X->
Def.
Tpow[isite1 - 1];
671 #pragma omp parallel for default(none) shared(list_1, tmp_v0, tmp_v1)\ 672 firstprivate(i_max, dtmp_V, is1_up, spin) private(num1, ibit1_up) 673 for (j = 1; j <= i_max; j++) {
674 ibit1_up = ((
list_1[j] & is1_up) / is1_up) ^ (1 - spin);
675 tmp_v0[j] += dtmp_V * ibit1_up * tmp_v1[j];
679 #pragma omp parallel for default(none) shared(list_1, tmp_v0, tmp_v1)\ 680 firstprivate(i_max, dtmp_V, isite1, isigma1, X) private(j, num1) 681 for (j = 1; j <= i_max; j++) {
683 tmp_v0[j] += dtmp_V * num1 * tmp_v1[j];
706 std::complex<double> *tmp_v0,
707 std::complex<double> *tmp_v1
711 long int isite1, isite2;
712 long int A_spin, B_spin;
769 long int is1_up, is1_down;
786 is1_up = X->
Def.
Tpow[2 * isite1 - 2];
787 is1_down = X->
Def.
Tpow[2 * isite1 - 1];
788 is = is1_up + is1_down;
789 ibit = (
long int)
myrank & is;
791 #pragma omp parallel for default(none) shared(list_Diagonal) \ 792 firstprivate(i_max, dtmp_V) private(j) 818 is1_up = X->
Def.
Tpow[2 * isite1 - 2];
819 is1_down = X->
Def.
Tpow[2 * isite1 - 1];
820 is = is1_up + is1_down;
821 #pragma omp parallel for default(none) shared(list_Diagonal, list_1) firstprivate(i_max, is, dtmp_V) private(ibit) 822 for (j = 1; j <= i_max; j++) {
833 is1_up = X->
Def.
Tpow[2 * isite1 - 2];
834 is1_down = X->
Def.
Tpow[2 * isite1 - 1];
835 is = is1_up + is1_down;
836 #pragma omp parallel for default(none) shared(list_Diagonal, list_1) firstprivate(i_max, is, dtmp_V) private(ibit) 837 for (j = 1; j <= i_max; j++) {
880 long int isigma1 = spin;
899 is1 = X->
Def.
Tpow[2 * isite1 - 2];
902 is1 = X->
Def.
Tpow[2 * isite1 - 1];
904 ibit1 = (
long int)
myrank & is1;
906 #pragma omp parallel for default(none) shared(list_Diagonal) \ 907 firstprivate(i_max, dtmp_V, num1) private(j) 908 for (j = 1; j <= i_max; j++)
list_Diagonal[j] += num1 * dtmp_V;
916 is1_up = X->
Def.
Tpow[isite1 - 1];
917 ibit1_up = (((
long int)
myrank& is1_up) / is1_up) ^ (1 - spin);
918 #pragma omp parallel for default(none) shared(list_Diagonal) \ 919 firstprivate(i_max, dtmp_V, ibit1_up) private(j) 920 for (j = 1; j <= i_max; j++)
list_Diagonal[j] += dtmp_V * ibit1_up;
926 #pragma omp parallel for default(none) shared(list_Diagonal) \ 927 firstprivate(i_max, dtmp_V) private(j) 946 is1 = X->
Def.
Tpow[2 * isite1 - 2];
949 is1 = X->
Def.
Tpow[2 * isite1 - 1];
951 #pragma omp parallel for default(none) shared(list_1, list_Diagonal) firstprivate(i_max, dtmp_V, is1) private(num1, ibit1) 952 for (j = 1; j <= i_max; j++) {
965 is1 = X->
Def.
Tpow[2 * isite1 - 2];
968 is1 = X->
Def.
Tpow[2 * isite1 - 1];
971 #pragma omp parallel for default(none) shared(list_1, list_Diagonal) firstprivate(i_max, dtmp_V, is1) private(num1, ibit1) 972 for (j = 1; j <= i_max; j++) {
982 is1_up = X->
Def.
Tpow[isite1 - 1];
983 #pragma omp parallel for default(none) shared(list_1, list_Diagonal) firstprivate(i_max, dtmp_V, is1_up, spin) private(num1, ibit1_up) 984 for (j = 1; j <= i_max; j++) {
985 ibit1_up = (((j - 1)& is1_up) / is1_up) ^ (1 - spin);
990 #pragma omp parallel for default(none) shared(list_Diagonal) firstprivate(i_max, dtmp_V, isite1, isigma1, X) private(j, num1) 991 for (j = 1; j <= i_max; j++) {
1002 is1_up = X->
Def.
Tpow[isite1 - 1];
1003 #pragma omp parallel for default(none) shared(list_1, list_Diagonal) firstprivate(i_max, dtmp_V, is1_up, spin) private(num1, ibit1_up) 1004 for (j = 1; j <= i_max; j++) {
1005 ibit1_up = ((
list_1[j] & is1_up) / is1_up) ^ (1 - spin);
1010 #pragma omp parallel for default(none) shared(list_Diagonal, list_1) firstprivate(i_max, dtmp_V, isite1, isigma1, X) private(j, num1) 1011 for (j = 1; j <= i_max; j++) {
1047 long int is1_up, is1_down;
1048 long int ibit1_up, ibit1_down;
1050 long int is2_up, is2_down;
1051 long int ibit2_up, ibit2_down;
1060 if (isite2 < isite1) {
1077 is1_up = X->
Def.
Tpow[2 * isite1 - 2];
1078 is1_down = X->
Def.
Tpow[2 * isite1 - 1];
1079 is2_up = X->
Def.
Tpow[2 * isite2 - 2];
1080 is2_down = X->
Def.
Tpow[2 * isite2 - 1];
1085 ibit1_up = (
long int)
myrank&is1_up;
1086 num1 += ibit1_up / is1_up;
1087 ibit1_down = (
long int)
myrank&is1_down;
1088 num1 += ibit1_down / is1_down;
1090 ibit2_up = (
long int)
myrank&is2_up;
1091 num2 += ibit2_up / is2_up;
1092 ibit2_down = (
long int)
myrank&is2_down;
1093 num2 += ibit2_down / is2_down;
1095 #pragma omp parallel for default(none) shared(list_Diagonal) \ 1096 firstprivate(i_max, dtmp_V, num1, num2) private(j) 1097 for (j = 1; j <= i_max; j++)
list_Diagonal[j] += num1 * num2*dtmp_V;
1103 #pragma omp parallel for default(none) shared(list_Diagonal) firstprivate(i_max, dtmp_V) 1104 for (j = 1; j <= i_max; j++) {
1125 is1_up = X->
Def.
Tpow[2 * isite1 - 2];
1126 is1_down = X->
Def.
Tpow[2 * isite1 - 1];
1127 is2_up = X->
Def.
Tpow[2 * isite2 - 2];
1128 is2_down = X->
Def.
Tpow[2 * isite2 - 1];
1130 ibit2_up = (
long int)
myrank&is2_up;
1131 num2 += ibit2_up / is2_up;
1132 ibit2_down = (
long int)
myrank&is2_down;
1133 num2 += ibit2_down / is2_down;
1149 #pragma omp parallel for default(none) shared(list_Diagonal) \ 1150 firstprivate(i_max, dtmp_V, num2, is1_up, is1_down) \ 1151 private(num1, ibit1_up, ibit1_down, j) 1152 for (j = 1; j <= i_max; j++) {
1154 ibit1_up = (j - 1)&is1_up;
1155 num1 += ibit1_up / is1_up;
1156 ibit1_down = (j - 1)&is1_down;
1157 num1 += ibit1_down / is1_down;
1168 #pragma omp parallel for default(none) shared(list_1, list_Diagonal) \ 1169 firstprivate(i_max, dtmp_V, is1_up, is1_down, num2) \ 1170 private(num1, ibit1_up, ibit1_down, j) 1171 for (j = 1; j <= i_max; j++) {
1173 ibit1_up =
list_1[j] & is1_up;
1174 num1 += ibit1_up / is1_up;
1175 ibit1_down =
list_1[j] & is1_down;
1176 num1 += ibit1_down / is1_down;
1184 #pragma omp parallel for default(none) shared(list_Diagonal) firstprivate(i_max, dtmp_V) 1185 for (j = 1; j <= i_max; j++) {
1202 is1_up = X->
Def.
Tpow[2 * isite1 - 2];
1203 is1_down = X->
Def.
Tpow[2 * isite1 - 1];
1204 is2_up = X->
Def.
Tpow[2 * isite2 - 2];
1205 is2_down = X->
Def.
Tpow[2 * isite2 - 1];
1206 #pragma omp parallel for default(none) shared( list_Diagonal) firstprivate(i_max, dtmp_V, is1_up, is1_down, is2_up, is2_down) private(num1, ibit1_up, ibit1_down, num2, ibit2_up, ibit2_down) 1207 for (j = 1; j <= i_max; j++) {
1210 ibit1_up = (j - 1)&is1_up;
1211 num1 += ibit1_up / is1_up;
1212 ibit1_down = (j - 1)&is1_down;
1213 num1 += ibit1_down / is1_down;
1215 ibit2_up = (j - 1)&is2_up;
1216 num2 += ibit2_up / is2_up;
1217 ibit2_down = (j - 1)&is2_down;
1218 num2 += ibit2_down / is2_down;
1226 is1_up = X->
Def.
Tpow[2 * isite1 - 2];
1227 is1_down = X->
Def.
Tpow[2 * isite1 - 1];
1228 is2_up = X->
Def.
Tpow[2 * isite2 - 2];
1229 is2_down = X->
Def.
Tpow[2 * isite2 - 1];
1231 #pragma omp parallel for default(none) shared(list_1, list_Diagonal) firstprivate(i_max, dtmp_V, is1_up, is1_down, is2_up, is2_down) private(num1, ibit1_up, ibit1_down, num2, ibit2_up, ibit2_down) 1232 for (j = 1; j <= i_max; j++) {
1235 ibit1_up =
list_1[j] & is1_up;
1236 num1 += ibit1_up / is1_up;
1237 ibit1_down =
list_1[j] & is1_down;
1238 num1 += ibit1_down / is1_down;
1240 ibit2_up =
list_1[j] & is2_up;
1241 num2 += ibit2_up / is2_up;
1242 ibit2_down =
list_1[j] & is2_down;
1243 num2 += ibit2_down / is2_down;
1251 #pragma omp parallel for default(none) shared(list_Diagonal) firstprivate(i_max, dtmp_V) 1252 for (j = 1; j <= i_max; j++) {
1285 long int is1_up, is1_down;
1286 long int ibit1_up, ibit1_down;
1287 long int num1_up, num1_down;
1288 long int is2_up, is2_down;
1289 long int ibit2_up, ibit2_down;
1290 long int num2_up, num2_down;
1299 if (isite2 < isite1) {
1316 is1_up = X->
Def.
Tpow[2 * isite1 - 2];
1317 is1_down = X->
Def.
Tpow[2 * isite1 - 1];
1318 is2_up = X->
Def.
Tpow[2 * isite2 - 2];
1319 is2_down = X->
Def.
Tpow[2 * isite2 - 1];
1326 ibit1_up = (
long int)
myrank &is1_up;
1327 num1_up = ibit1_up / is1_up;
1328 ibit1_down = (
long int)
myrank &is1_down;
1329 num1_down = ibit1_down / is1_down;
1331 ibit2_up = (
long int)
myrank &is2_up;
1332 num2_up = ibit2_up / is2_up;
1333 ibit2_down = (
long int)
myrank &is2_down;
1334 num2_down = ibit2_down / is2_down;
1336 #pragma omp parallel for default(none) shared(list_Diagonal) \ 1337 firstprivate(i_max, dtmp_V, num1_up, num1_down, num2_up, num2_down) private(j) 1338 for (j = 1; j <= i_max; j++)
1339 list_Diagonal[j] += dtmp_V * (num1_up*num2_up + num1_down * num2_down);
1346 is1_up = X->
Def.
Tpow[isite1 - 1];
1347 is2_up = X->
Def.
Tpow[isite2 - 1];
1348 is_up = is1_up + is2_up;
1349 ibit = (
long int)
myrank & is_up;
1350 if (ibit == 0 || ibit == is_up) {
1351 #pragma omp parallel for default(none) shared(list_Diagonal) \ 1352 firstprivate(i_max, dtmp_V) private(j) 1371 is1_up = X->
Def.
Tpow[2 * isite1 - 2];
1372 is1_down = X->
Def.
Tpow[2 * isite1 - 1];
1373 is2_up = X->
Def.
Tpow[2 * isite2 - 2];
1374 is2_down = X->
Def.
Tpow[2 * isite2 - 1];
1379 ibit2_up = (
long int)
myrank &is2_up;
1380 num2_up = ibit2_up / is2_up;
1381 ibit2_down = (
long int)
myrank &is2_down;
1382 num2_down = ibit2_down / is2_down;
1384 #pragma omp parallel for default(none) shared( list_Diagonal) \ 1385 firstprivate(i_max, dtmp_V, num2_up, num2_down, is1_up, is1_down) \ 1386 private(num1_up, num1_down, ibit1_up, ibit1_down, j) 1387 for (j = 1; j <= i_max; j++) {
1391 ibit1_up = (j - 1)&is1_up;
1392 num1_up = ibit1_up / is1_up;
1393 ibit1_down = (j - 1)&is1_down;
1394 num1_down = ibit1_down / is1_down;
1396 list_Diagonal[j] += dtmp_V * (num1_up*num2_up + num1_down * num2_down);
1404 is1_up = X->
Def.
Tpow[2 * isite1 - 2];
1405 is1_down = X->
Def.
Tpow[2 * isite1 - 1];
1406 is2_up = X->
Def.
Tpow[2 * isite2 - 2];
1407 is2_down = X->
Def.
Tpow[2 * isite2 - 1];
1412 ibit2_up = (
long int)
myrank&is2_up;
1413 num2_up = ibit2_up / is2_up;
1414 ibit2_down = (
long int)
myrank&is2_down;
1415 num2_down = ibit2_down / is2_down;
1417 #pragma omp parallel for default(none) shared(list_1, list_Diagonal) \ 1418 firstprivate(i_max, dtmp_V, num2_up, num2_down, is1_up, is1_down) \ 1419 private(num1_up, num1_down, ibit1_up, ibit1_down, j) 1420 for (j = 1; j <= i_max; j++) {
1424 ibit1_up =
list_1[j] & is1_up;
1425 num1_up = ibit1_up / is1_up;
1426 ibit1_down =
list_1[j] & is1_down;
1427 num1_down = ibit1_down / is1_down;
1429 list_Diagonal[j] += dtmp_V * (num1_up*num2_up + num1_down * num2_down);
1434 is1_up = X->
Def.
Tpow[isite1 - 1];
1435 is2_up = X->
Def.
Tpow[isite2 - 1];
1436 ibit2_up = (
long int)
myrank & is2_up;
1438 if (ibit2_up == is2_up) {
1439 #pragma omp parallel for default(none) shared(list_Diagonal) \ 1440 firstprivate(i_max, dtmp_V, is1_up) private(j, ibit1_up) 1441 for (j = 1; j <= i_max; j++) {
1442 ibit1_up = (j - 1) & is1_up;
1443 if (ibit1_up == is1_up) {
1448 else if (ibit2_up == 0) {
1449 #pragma omp parallel for default(none) shared(list_Diagonal) \ 1450 firstprivate(i_max, dtmp_V, is1_up) private(j, ibit1_up) 1451 for (j = 1; j <= i_max; j++) {
1452 ibit1_up = (j - 1) & is1_up;
1453 if (ibit1_up == 0) {
1461 is1_up = X->
Def.
Tpow[isite1 - 1];
1462 is2_up = X->
Def.
Tpow[isite2 - 1];
1463 ibit2_up = (
long int)
myrank & is2_up;
1465 if (ibit2_up == is2_up) {
1466 #pragma omp parallel for default(none) shared(list_1, list_Diagonal) \ 1467 firstprivate(i_max, dtmp_V, is1_up) private(j, ibit1_up) 1468 for (j = 1; j <= i_max; j++) {
1469 ibit1_up =
list_1[j] & is1_up;
1470 if (ibit1_up == is1_up) {
1475 else if (ibit2_up == 0) {
1476 #pragma omp parallel for default(none) shared(list_1, list_Diagonal) \ 1477 firstprivate(i_max, dtmp_V, is1_up) private(j, ibit1_up) 1478 for (j = 1; j <= i_max; j++) {
1479 ibit1_up =
list_1[j] & is1_up;
1480 if (ibit1_up == 0) {
1499 is1_up = X->
Def.
Tpow[2 * isite1 - 2];
1500 is1_down = X->
Def.
Tpow[2 * isite1 - 1];
1501 is2_up = X->
Def.
Tpow[2 * isite2 - 2];
1502 is2_down = X->
Def.
Tpow[2 * isite2 - 1];
1504 #pragma omp parallel for default(none) shared( list_Diagonal) firstprivate(i_max, dtmp_V, is1_up, is1_down, is2_up, is2_down) private(num1_up, num1_down, num2_up, num2_down, ibit1_up, ibit1_down, ibit2_up, ibit2_down) 1505 for (j = 1; j <= i_max; j++) {
1511 ibit1_up = (j - 1)&is1_up;
1512 num1_up = ibit1_up / is1_up;
1513 ibit1_down = (j - 1)&is1_down;
1514 num1_down = ibit1_down / is1_down;
1516 ibit2_up = (j - 1)&is2_up;
1517 num2_up = ibit2_up / is2_up;
1518 ibit2_down = (j - 1)&is2_down;
1519 num2_down = ibit2_down / is2_down;
1521 list_Diagonal[j] += dtmp_V * (num1_up*num2_up + num1_down * num2_down);
1527 is1_up = X->
Def.
Tpow[2 * isite1 - 2];
1528 is1_down = X->
Def.
Tpow[2 * isite1 - 1];
1529 is2_up = X->
Def.
Tpow[2 * isite2 - 2];
1530 is2_down = X->
Def.
Tpow[2 * isite2 - 1];
1532 #pragma omp parallel for default(none) shared(list_1, list_Diagonal) firstprivate(i_max, dtmp_V, is1_up, is1_down, is2_up, is2_down) private(num1_up, num1_down, num2_up, num2_down, ibit1_up, ibit1_down, ibit2_up, ibit2_down) 1533 for (j = 1; j <= i_max; j++) {
1539 ibit1_up =
list_1[j] & is1_up;
1540 num1_up = ibit1_up / is1_up;
1541 ibit1_down =
list_1[j] & is1_down;
1542 num1_down = ibit1_down / is1_down;
1544 ibit2_up =
list_1[j] & is2_up;
1545 num2_up = ibit2_up / is2_up;
1546 ibit2_down =
list_1[j] & is2_down;
1547 num2_down = ibit2_down / is2_down;
1549 list_Diagonal[j] += dtmp_V * (num1_up*num2_up + num1_down * num2_down);
1554 is1_up = X->
Def.
Tpow[isite1 - 1];
1555 is2_up = X->
Def.
Tpow[isite2 - 1];
1556 is_up = is1_up + is2_up;
1557 #pragma omp parallel for default(none) shared(list_1, list_Diagonal) firstprivate(i_max, dtmp_V, is1_up, is2_up, is_up) private(j, ibit) 1558 for (j = 1; j <= i_max; j++) {
1559 ibit = (j - 1) & is_up;
1560 if (ibit == 0 || ibit == is_up) {
1567 is1_up = X->
Def.
Tpow[isite1 - 1];
1568 is2_up = X->
Def.
Tpow[isite2 - 1];
1569 is_up = is1_up + is2_up;
1570 #pragma omp parallel for default(none) shared(list_1, list_Diagonal) firstprivate(i_max, dtmp_V, is1_up, is2_up, is_up) private(j, ibit) 1571 for (j = 1; j <= i_max; j++) {
1572 ibit =
list_1[j] & is_up;
1573 if (ibit == 0 || ibit == is_up) {
1615 long int ibit1_spin;
1616 long int ibit2_spin;
1627 if (isite2 < isite1) {
1647 is1_spin = X->
Def.
Tpow[2 * isite1 - 2 + isigma1];
1648 is2_spin = X->
Def.
Tpow[2 * isite2 - 2 + isigma2];
1651 ibit1_spin = (
long int)
myrank&is1_spin;
1652 num1 += ibit1_spin / is1_spin;
1655 ibit2_spin = (
long int)
myrank&is2_spin;
1656 num2 += ibit2_spin / is2_spin;
1658 #pragma omp parallel for default(none) shared(list_Diagonal) \ 1659 firstprivate(i_max, dtmp_V, num2, num1) private(ibit1_spin, j) 1660 for (j = 1; j <= i_max; j++)
list_Diagonal[j] += num1 * num2*dtmp_V;
1668 is1_up = X->
Def.
Tpow[isite1 - 1];
1669 is2_up = X->
Def.
Tpow[isite2 - 1];
1673 #pragma omp parallel for default(none) shared(list_Diagonal) \ 1674 firstprivate(i_max, dtmp_V, is1_up, isigma1, X, num1, num2) private(j) 1675 for (j = 1; j <= i_max; j++) {
1684 if (num1 != 0 && num2 != 0) {
1685 #pragma omp parallel for default(none) shared(list_Diagonal) \ 1686 firstprivate(i_max, dtmp_V, num1, X) private(j) 1687 for (j = 1; j <= i_max; j++)
list_Diagonal[j] += dtmp_V * num1;
1708 is1_spin = X->
Def.
Tpow[2 * isite1 - 2 + isigma1];
1709 is2_spin = X->
Def.
Tpow[2 * isite2 - 2 + isigma2];
1712 ibit2_spin = (
long int)
myrank&is2_spin;
1713 num2 += ibit2_spin / is2_spin;
1715 #pragma omp parallel for default(none) shared(list_Diagonal) \ 1716 firstprivate(i_max, dtmp_V, is1_spin, num2) private(num1, ibit1_spin, j) 1717 for (j = 1; j <= i_max; j++) {
1719 ibit1_spin = (j - 1)&is1_spin;
1720 num1 += ibit1_spin / is1_spin;
1729 is1_spin = X->
Def.
Tpow[2 * isite1 - 2 + isigma1];
1730 is2_spin = X->
Def.
Tpow[2 * isite2 - 2 + isigma2];
1733 ibit2_spin = (
long int)
myrank&is2_spin;
1734 num2 += ibit2_spin / is2_spin;
1736 #pragma omp parallel for default(none) shared(list_Diagonal, list_1) \ 1737 firstprivate(i_max, dtmp_V, is1_spin, num2) private(num1, ibit1_spin, j) 1738 for (j = 1; j <= i_max; j++) {
1740 ibit1_spin =
list_1[j] & is1_spin;
1741 num1 += ibit1_spin / is1_spin;
1749 is1_up = X->
Def.
Tpow[isite1 - 1];
1750 is2_up = X->
Def.
Tpow[isite2 - 1];
1753 #pragma omp parallel for default(none) shared(list_Diagonal) \ 1754 firstprivate(i_max, dtmp_V, is1_up, isigma1, X, num2) private(j, num1) 1755 for (j = 1; j <= i_max; j++) {
1764 #pragma omp parallel for default(none) shared(list_Diagonal) \ 1765 firstprivate(i_max, dtmp_V, isite1, isigma1, X) private(j, num1) 1766 for (j = 1; j <= i_max; j++) {
1778 is1_up = X->
Def.
Tpow[isite1 - 1];
1779 is2_up = X->
Def.
Tpow[isite2 - 1];
1782 #pragma omp parallel for default(none) shared(list_Diagonal) \ 1783 firstprivate(i_max, dtmp_V, is1_up, isigma1, X, num2) private(j, num1) 1784 for (j = 1; j <= i_max; j++) {
1793 #pragma omp parallel for default(none) shared(list_Diagonal, list_1) \ 1794 firstprivate(i_max, dtmp_V, isite1, isigma1, X) private(j, num1) 1795 for (j = 1; j <= i_max; j++) {
1816 is1_spin = X->
Def.
Tpow[2 * isite1 - 2 + isigma1];
1817 is2_spin = X->
Def.
Tpow[2 * isite2 - 2 + isigma2];
1818 #pragma omp parallel for default(none) shared(list_Diagonal) firstprivate(i_max, dtmp_V, is1_spin, is2_spin) private(num1, ibit1_spin, num2, ibit2_spin) 1819 for (j = 1; j <= i_max; j++) {
1822 ibit1_spin = (j - 1)&is1_spin;
1823 num1 += ibit1_spin / is1_spin;
1824 ibit2_spin = (j - 1)&is2_spin;
1825 num2 += ibit2_spin / is2_spin;
1832 is1_spin = X->
Def.
Tpow[2 * isite1 - 2 + isigma1];
1833 is2_spin = X->
Def.
Tpow[2 * isite2 - 2 + isigma2];
1835 #pragma omp parallel for default(none) shared(list_Diagonal, list_1) firstprivate(i_max, dtmp_V, is1_spin, is2_spin) private(num1, ibit1_spin, num2, ibit2_spin) 1836 for (j = 1; j <= i_max; j++) {
1839 ibit1_spin =
list_1[j] & is1_spin;
1840 num1 += ibit1_spin / is1_spin;
1842 ibit2_spin =
list_1[j] & is2_spin;
1843 num2 += ibit2_spin / is2_spin;
1850 is1_up = X->
Def.
Tpow[isite1 - 1];
1851 is2_up = X->
Def.
Tpow[isite2 - 1];
1852 #pragma omp parallel for default(none) shared(list_Diagonal) firstprivate(i_max, dtmp_V, is1_up, is2_up, isigma1, isigma2, X) private(j, num1, num2) 1853 for (j = 1; j <= i_max; j++) {
1860 #pragma omp parallel for default(none) shared(list_Diagonal, list_1) firstprivate(i_max, dtmp_V, isite1, isite2, isigma1, isigma2, X) private(j, num1) 1861 for (j = 1; j <= i_max; j++) {
1874 is1_up = X->
Def.
Tpow[isite1 - 1];
1875 is2_up = X->
Def.
Tpow[isite2 - 1];
1876 #pragma omp parallel for default(none) shared(list_Diagonal) firstprivate(i_max, dtmp_V, is1_up, is2_up, isigma1, isigma2, X) private(j, num1, num2) 1877 for (j = 1; j <= i_max; j++) {
1884 #pragma omp parallel for default(none) shared(list_Diagonal) firstprivate(i_max, dtmp_V, isite1, isite2, isigma1, isigma2, X) private(j, num1) 1885 for (j = 1; j <= i_max; j++) {
1918 long int isite1, isite2;
1923 long int A_spin, B_spin;
1927 fprintf(
stdoutMPI,
"%s",
" Start: Calculate diagaonal components of Hamiltonian. \n");
1928 TimeKeeper(X,
"%s_TimeKeeper.dat",
"diagonal calculation starts: %s",
"a");
1930 #pragma omp parallel for default(none) private(j) shared(list_Diagonal) firstprivate(i_max) 1931 for (j = 1; j <= i_max; j++) {
1936 if (
childfopenMPI(
"CHECK_CoulombIntra.dat",
"w", &fp) != 0) {
1942 fprintf(fp,
"i=%ld isite1=%ld tmp_V=%lf \n", i, isite1, tmp_V);
1956 fprintf(fp,
"i=%ld spin=%ld isite1=%ld tmp_V=%lf \n", i, spin, isite1, tmp_V);
1972 fprintf(fp,
"i=%ld isite1=%ld isite2=%ld tmp_V=%lf \n", i, isite1, isite2, tmp_V);
1990 fprintf(fp,
"i=%ld isite1=%ld isite2=%ld tmp_V=%lf \n", i, isite1, isite2, tmp_V);
2005 fprintf(fp,
"i=%ld isite1=%ld A_spin=%ld isite2=%ld B_spin=%ld tmp_V=%lf \n", i, isite1, A_spin, isite2, B_spin, tmp_V);
2011 TimeKeeper(X,
"%s_TimeKeeper.dat",
"diagonal calculation finishes: %s",
"a");
2012 fprintf(
stdoutMPI,
"%s",
" End : Calculate diagaonal components of Hamiltonian. \n\n");
int * NTETransferDiagonal
struct DefineList Def
Definision of system (Hamiltonian) etc.
int SetDiagonalChemi(long int isite1, double dtmp_V, long int spin, struct BindStruct *X)
Calculate the components for the chemical potential .
FILE * stdoutMPI
File pointer to the standard output defined in InitializeMPI()
int NCoulombInter
Number of off-site Coulomb interaction.
int BitCheckGeneral(const long int org_bit, const int org_isite, const int target_ispin, const long int *SiteToBit, const long int *Tpow)
bit check function for general spin
int * EDSpinChemi
[DefineList::Nsite]
int X_Spin_CisAis(long int j, long int is1_spin, long int sigma1)
Compute the spin state with bit mask is1_spin.
double * ParaInterAll_Diagonal
[DefineList::NInterAll_Diagonal] Coupling constant of diagonal inter-all term. malloc in setmem_def()...
int *** TETransferDiagonal
int Nsite
Number of sites in the INTRA process region.
int X_SpinGC_CisAis(long int j, long int is1_spin, long int sigma1)
Compute the grandcanonical spin state with bit mask is1_spin.
int SetDiagonalInterAll(long int isite1, long int isite2, long int isigma1, long int isigma2, double dtmp_V, struct BindStruct *X)
Calculate the components for general two-body diagonal interaction, .
int EDNChemi
Number of on-site term.
int SetDiagonalTETransfer(long int isite1, double dtmp_V, long int spin, struct BindStruct *X, std::complex< double > *tmp_v0, std::complex< double > *tmp_v1)
Update the vector by the general one-body diagonal interaction, . (Using in Time Evolution mode)...
int diagonalcalc(struct BindStruct *X)
Calculate diagonal components and obtain the list, list_diagonal.
int NHundCoupling
Number of Hund coupling.
int ** InterAll_Diagonal
[DefineList::NinterAll_Diagonal][4] Interacted quartet
double ** ParaTETransferDiagonal
int SetDiagonalTEInterAll(long int isite1, long int isite2, long int isigma1, long int isigma2, double dtmp_V, struct BindStruct *X, std::complex< double > *tmp_v0, std::complex< double > *tmp_v1)
Update the vector by the general two-body diagonal interaction, . (Using in Time Evolution mode)...
int ** HundCoupling
[DefineList::NHundCoupling][2] Index of Hund coupling. malloc in setmem_def().
double * ParaCoulombInter
[DefineList::NCoulombInter]Coupling constant of off-site Coulomb interaction. malloc in setmem_def()...
int diagonalcalcForTE(const int _istep, struct BindStruct *X, std::complex< double > *tmp_v0, std::complex< double > *tmp_v1)
double * EDParaChemi
[DefineList::Nsite] On-site potential parameter. malloc in setmem_def().
int myrank
Process ID, defined in InitializeMPI()
int * NTEInterAllDiagonal
int NInterAll_Diagonal
Number of interall term (diagonal)
int iFlgGeneralSpin
Flag for the general (Sz/=1/2) spin.
int SetDiagonalCoulombIntra(long int isite1, double dtmp_V, struct BindStruct *X)
Calculate the components for Coulombintra interaction, .
long int * SiteToBit
[DefineList::NsiteMPI] Similar to DefineList::Tpow. For general spin.
long int * Tpow
[2 * DefineList::NsiteMPI] malloc in setmem_def().
double ** ParaTEInterAllDiagonal
double * ParaHundCoupling
[DefineList::NHundCoupling] Hund coupling constant. malloc in setmem_def().
int SetDiagonalTEChemi(long int isite1, long int spin, double dtmp_V, struct BindStruct *X, std::complex< double > *tmp_v0, std::complex< double > *tmp_v1)
Update the vector by the chemical potential generated by the commutation relation in terms of the g...
int TimeKeeper(struct BindStruct *X, const char *cFileName, const char *cTimeKeeper_Message, const char *cWriteType)
Functions for writing a time log.
int iCalcModel
Switch for model. 0:Hubbard, 1:Spin, 2:Kondo, 3:HubbardGC, 4:SpinGC, 5:KondoGC, 6:HubbardNConserved.
int SetDiagonalCoulombInter(long int isite1, long int isite2, double dtmp_V, struct BindStruct *X)
Calculate the components for Coulombinter interaction, .
double * ParaCoulombIntra
int *** TEInterAllDiagonal
int * EDChemi
[DefineList::Nsite] Chemical potential. malloc in setmem_def().
struct CheckList Check
Size of the Hilbert space.
int SetDiagonalHund(long int isite1, long int isite2, double dtmp_V, struct BindStruct *X)
Calculate the components for Hund interaction, .
long int idim_max
The dimension of the Hilbert space of this process.
int childfopenMPI(const char *_cPathChild, const char *_cmode, FILE **_fp)
Only the root process open file in output/ directory.