69 #include "mltplyCommon.h" 70 #include "mltplySpinCore.h" 71 #include "mltplyMPISpinCore.h" 73 #include "wrapperMPI.h" 80 unsigned long int i_int ,
82 double complex *tmp_v0 ,
83 double complex *tmp_v1 )
86 double complex dam_pr;
88 X->Def.InterAll_OffDiagonal[i_int][0],
X->Def.InterAll_OffDiagonal[i_int][1],
89 X->Def.InterAll_OffDiagonal[i_int][3],
X->Def.InterAll_OffDiagonal[i_int][4],
90 X->Def.InterAll_OffDiagonal[i_int][5],
X->Def.InterAll_OffDiagonal[i_int][7],
91 X->Def.ParaInterAll_OffDiagonal[i_int],
X, tmp_v0, tmp_v1);
92 X->Large.prdct += dam_pr;
110 double complex tmp_J,
112 double complex *tmp_v0,
113 double complex *tmp_v1
116 int mask1, mask2, state1, state2, ierr, origin;
117 unsigned long int idim_max_buf, j;
118 MPI_Status statusMPI;
119 double complex Jint, dmv, dam_pr;
121 mask1 = (int)
X->Def.Tpow[org_isite1];
122 mask2 = (
int)
X->Def.Tpow[org_isite3];
123 if (org_isite1 != org_isite3) {
124 origin =
myrank ^ (mask1 + mask2);
127 if (org_ispin1 == org_ispin4 && org_ispin2 == org_ispin3) {
136 state1 = (origin & mask1) / mask1;
137 state2 = (origin & mask2) / mask2;
139 if (state1 == org_ispin2 && state2 == org_ispin4) {
142 else if (state1 == org_ispin1 && state2 == org_ispin3) {
144 if (
X->Large.mode == M_CORR ||
X->Large.mode == M_CALCSPEC) {
152 ierr = MPI_Sendrecv(&
X->Check.idim_max, 1, MPI_UNSIGNED_LONG, origin, 0,
153 &idim_max_buf, 1, MPI_UNSIGNED_LONG, origin, 0,
154 MPI_COMM_WORLD, &statusMPI);
156 ierr = MPI_Sendrecv(tmp_v1,
X->Check.idim_max + 1, MPI_DOUBLE_COMPLEX, origin, 0,
157 v1buf, idim_max_buf + 1, MPI_DOUBLE_COMPLEX, origin, 0,
158 MPI_COMM_WORLD, &statusMPI);
162 #pragma omp parallel default(none) reduction(+:dam_pr) private(j, dmv) \ 163 firstprivate(idim_max_buf, Jint, X) shared(v1buf, tmp_v1, tmp_v0) 165 if (
X->Large.mode == M_MLTPLY ||
X->Large.mode == M_CALCSPEC) {
167 for (j = 1; j <= idim_max_buf; j++) {
168 dmv = Jint *
v1buf[j];
170 dam_pr += conj(tmp_v1[j]) * dmv;
175 for (j = 1; j <= idim_max_buf; j++) {
176 dmv = Jint *
v1buf[j];
177 dam_pr += conj(tmp_v1[j]) * dmv;
192 unsigned long int i_int ,
194 double complex *tmp_v0 ,
195 double complex *tmp_v1
198 double complex dam_pr;
200 X->Def.InterAll_OffDiagonal[i_int][0],
X->Def.InterAll_OffDiagonal[i_int][1],
201 X->Def.InterAll_OffDiagonal[i_int][4],
X->Def.InterAll_OffDiagonal[i_int][5],
202 X->Def.InterAll_OffDiagonal[i_int][7],
X->Def.ParaInterAll_OffDiagonal[i_int],
X, tmp_v0, tmp_v1);
203 X->Large.prdct += dam_pr;
218 double complex tmp_J,
220 double complex *tmp_v0,
221 double complex *tmp_v1
224 int mask1, mask2, state2, ierr;
225 long int origin, num1;
226 unsigned long int idim_max_buf, j;
227 MPI_Status statusMPI;
228 double complex Jint, dmv, dam_pr;
230 if (org_isite1 == org_isite3 && org_ispin1 == org_ispin4) {
234 mask1 = (int)
X->Def.Tpow[org_isite1];
235 mask2 = (
int)
X->Def.Tpow[org_isite3];
237 state2 = (origin & mask2) / mask2;
239 if (num1 != 0 && state2 == org_ispin4) {
244 if (
X->Large.mode == M_CORR ||
X->Large.mode == M_CALCSPEC) Jint = 0;
250 ierr = MPI_Sendrecv(&
X->Check.idim_max, 1, MPI_UNSIGNED_LONG, origin, 0,
251 &idim_max_buf, 1, MPI_UNSIGNED_LONG, origin, 0,
252 MPI_COMM_WORLD, &statusMPI);
254 ierr = MPI_Sendrecv(tmp_v1,
X->Check.idim_max + 1, MPI_DOUBLE_COMPLEX, origin, 0,
255 v1buf, idim_max_buf + 1, MPI_DOUBLE_COMPLEX, origin, 0,
256 MPI_COMM_WORLD, &statusMPI);
260 if (
X->Large.mode == M_MLTPLY ||
X->Large.mode == M_CALCSPEC) {
261 #pragma omp parallel for default(none) reduction(+:dam_pr) private(j, dmv) \ 262 firstprivate(idim_max_buf, Jint, X) shared(v1buf, tmp_v1, tmp_v0) 263 for (j = 1; j <= idim_max_buf; j++) {
264 dmv = Jint *
v1buf[j];
266 dam_pr += conj(tmp_v1[j]) * dmv;
270 #pragma omp parallel for default(none) reduction(+:dam_pr) private(j, dmv) \ 271 firstprivate(idim_max_buf, Jint, X) shared(v1buf, tmp_v1, tmp_v0) 272 for (j = 1; j <= idim_max_buf; j++) {
273 dmv = Jint *
v1buf[j];
274 dam_pr += conj(tmp_v1[j]) * dmv;
288 unsigned long int i_int,
290 double complex *tmp_v0,
291 double complex *tmp_v1
295 double complex dam_pr;
297 X->Def.InterAll_OffDiagonal[i_int][0],
X->Def.InterAll_OffDiagonal[i_int][1],
298 X->Def.InterAll_OffDiagonal[i_int][3],
X->Def.InterAll_OffDiagonal[i_int][4],
299 X->Def.InterAll_OffDiagonal[i_int][5],
X->Def.ParaInterAll_OffDiagonal[i_int],
X, tmp_v0, tmp_v1);
300 X->Large.prdct += dam_pr;
315 double complex tmp_J,
317 double complex *tmp_v0,
318 double complex *tmp_v1
321 int mask1, mask2, state1, ierr, num1;
323 unsigned long int idim_max_buf, j;
324 MPI_Status statusMPI;
325 double complex Jint, dmv, dam_pr;
327 if (org_isite1 == org_isite3 && org_ispin1 == org_ispin3) {
331 mask1 = (int)
X->Def.Tpow[org_isite1];
333 state1 = (origin & mask1) / mask1;
334 mask2 = (int)
X->Def.Tpow[org_isite3];
336 if (state1 == org_ispin2) {
348 if (
X->Large.mode == M_CORR ||
X->Large.mode == M_CALCSPEC) {
357 ierr = MPI_Sendrecv(&
X->Check.idim_max, 1, MPI_UNSIGNED_LONG, origin, 0,
358 &idim_max_buf, 1, MPI_UNSIGNED_LONG, origin, 0,
359 MPI_COMM_WORLD, &statusMPI);
361 ierr = MPI_Sendrecv(tmp_v1,
X->Check.idim_max + 1, MPI_DOUBLE_COMPLEX, origin, 0,
362 v1buf, idim_max_buf + 1, MPI_DOUBLE_COMPLEX, origin, 0,
363 MPI_COMM_WORLD, &statusMPI);
367 #pragma omp parallel default(none) reduction(+:dam_pr) private(j, dmv) \ 368 firstprivate(idim_max_buf, Jint, X) shared(v1buf, tmp_v1, tmp_v0) 370 if (
X->Large.mode == M_MLTPLY ||
X->Large.mode == M_CALCSPEC) {
372 for (j = 1; j <= idim_max_buf; j++) {
373 dmv = Jint *
v1buf[j];
375 dam_pr += conj(tmp_v1[j]) * dmv;
380 for (j = 1; j <= idim_max_buf; j++) {
381 dmv = Jint *
v1buf[j];
382 dam_pr += conj(tmp_v1[j]) * dmv;
402 double complex tmp_J,
404 double complex *tmp_v0,
405 double complex *tmp_v1
408 long unsigned int mask1, mask2, num1,num2;
411 double complex dmv, dam_pr;
412 mask1 = (int)
X->Def.Tpow[org_isite1];
413 mask2 = (
int)
X->Def.Tpow[org_isite3];
418 #pragma omp parallel default(none) reduction(+:dam_pr) private(j, dmv) \ 419 firstprivate(tmp_J, X, num1, num2) shared(tmp_v1, tmp_v0) 421 if (
X->Large.mode == M_MLTPLY ||
X->Large.mode == M_CALCSPEC) {
423 for (j = 1; j <=
X->Check.idim_max; j++) {
424 dmv = num1*num2*tmp_v1[j] * tmp_J;
426 dam_pr += conj(tmp_v1[j]) * dmv;
431 for (j = 1; j <=
X->Check.idim_max; j++) {
432 dmv = num1 * num2 * tmp_v1[j] * tmp_J;
433 dam_pr += conj(tmp_v1[j]) * dmv;
453 double complex tmp_J,
455 double complex *tmp_v0,
456 double complex *tmp_v1
459 long unsigned int mask1, mask2, num1, num2;
462 double complex Jint, dmv, dam_pr;
464 mask1 = (int)
X->Def.Tpow[org_isite1];
465 mask2 = (
int)
X->Def.Tpow[org_isite3];
469 #pragma omp parallel default(none) reduction(+:dam_pr) private(j, dmv, num1) \ 470 firstprivate(Jint, X, num2, mask1, org_ispin1) shared(tmp_v1, tmp_v0) 472 if (
X->Large.mode == M_MLTPLY ||
X->Large.mode == M_CALCSPEC) {
474 for (j = 1; j <=
X->Check.idim_max; j++) {
476 dmv = Jint * num1 * num2 * tmp_v1[j];
478 dam_pr += conj(tmp_v1[j]) * dmv;
483 for (j = 1; j <=
X->Check.idim_max; j++) {
485 dmv = Jint * num1 * num2 * tmp_v1[j];
486 dam_pr += conj(tmp_v1[j]) * dmv;
501 unsigned long int i_int,
503 double complex *tmp_v0,
504 double complex *tmp_v1
507 double complex dam_pr;
509 X->Def.InterAll_OffDiagonal[i_int][0],
X->Def.InterAll_OffDiagonal[i_int][1],
510 X->Def.InterAll_OffDiagonal[i_int][3],
X->Def.InterAll_OffDiagonal[i_int][4],
511 X->Def.InterAll_OffDiagonal[i_int][5],
X->Def.InterAll_OffDiagonal[i_int][7],
512 X->Def.ParaInterAll_OffDiagonal[i_int],
X, tmp_v0, tmp_v1);
513 X->Large.prdct += dam_pr;
529 double complex tmp_J,
531 double complex *tmp_v0,
532 double complex *tmp_v1
535 int mask2, state2, ierr, origin;
536 unsigned long int mask1, idim_max_buf, j, ioff, state1, state1check;
537 MPI_Status statusMPI;
538 double complex Jint, dmv, dam_pr;
542 mask2 = (int)
X->Def.Tpow[org_isite3];
544 state2 = (origin & mask2) / mask2;
546 if (state2 == org_ispin4) {
547 state1check = (
unsigned long int) org_ispin2;
550 else if (state2 == org_ispin3) {
551 state1check = (
unsigned long int) org_ispin1;
553 if (
X->Large.mode == M_CORR ||
X->Large.mode == M_CALCSPEC) {
559 ierr = MPI_Sendrecv(&
X->Check.idim_max, 1, MPI_UNSIGNED_LONG, origin, 0,
560 &idim_max_buf, 1, MPI_UNSIGNED_LONG, origin, 0,
561 MPI_COMM_WORLD, &statusMPI);
563 ierr = MPI_Sendrecv(tmp_v1,
X->Check.idim_max + 1, MPI_DOUBLE_COMPLEX, origin, 0,
564 v1buf, idim_max_buf + 1, MPI_DOUBLE_COMPLEX, origin, 0,
565 MPI_COMM_WORLD, &statusMPI);
570 mask1 =
X->Def.Tpow[org_isite1];
573 #pragma omp parallel default(none) reduction(+:dam_pr) private(j, dmv, state1, ioff) \ 574 firstprivate(idim_max_buf, Jint, X, state1check, mask1) shared(v1buf, tmp_v1, tmp_v0) 576 if (
X->Large.mode == M_MLTPLY ||
X->Large.mode == M_CALCSPEC) {
578 for (j = 0; j < idim_max_buf; j++) {
581 dmv = Jint *
v1buf[j + 1];
582 tmp_v0[ioff + 1] += dmv;
583 dam_pr += conj(tmp_v1[ioff + 1]) * dmv;
589 for (j = 0; j < idim_max_buf; j++) {
592 dmv = Jint *
v1buf[j + 1];
593 dam_pr += conj(tmp_v1[ioff + 1]) * dmv;
609 unsigned long int i_int,
611 double complex *tmp_v0,
612 double complex *tmp_v1
615 double complex dam_pr;
617 X->Def.InterAll_OffDiagonal[i_int][0],
X->Def.InterAll_OffDiagonal[i_int][1],
618 X->Def.InterAll_OffDiagonal[i_int][4],
X->Def.InterAll_OffDiagonal[i_int][5],
619 X->Def.InterAll_OffDiagonal[i_int][7],
X->Def.ParaInterAll_OffDiagonal[i_int],
X, tmp_v0, tmp_v1);
620 X->Large.prdct += dam_pr;
635 double complex tmp_J,
637 double complex *tmp_v0,
638 double complex *tmp_v1
641 int mask2, state2, ierr, origin;
642 unsigned long int mask1, idim_max_buf, j, state1, state1check;
643 MPI_Status statusMPI;
644 double complex Jint, dmv, dam_pr;
648 mask2 = (int)
X->Def.Tpow[org_isite3];
650 state2 = (origin & mask2) / mask2;
651 if (state2 == org_ispin4) {
652 state1check = (
unsigned long int) org_ispin1;
655 else if (state2 == org_ispin3) {
656 state1check = (
unsigned long int) org_ispin1;
658 if (
X->Large.mode == M_CORR ||
X->Large.mode == M_CALCSPEC) {
664 ierr = MPI_Sendrecv(&
X->Check.idim_max, 1, MPI_UNSIGNED_LONG, origin, 0,
665 &idim_max_buf, 1, MPI_UNSIGNED_LONG, origin, 0,
666 MPI_COMM_WORLD, &statusMPI);
668 ierr = MPI_Sendrecv(tmp_v1,
X->Check.idim_max + 1, MPI_DOUBLE_COMPLEX, origin, 0,
669 v1buf, idim_max_buf + 1, MPI_DOUBLE_COMPLEX, origin, 0,
670 MPI_COMM_WORLD, &statusMPI);
675 mask1 =
X->Def.Tpow[org_isite1];
678 #pragma omp parallel default(none) reduction(+:dam_pr) private(j, dmv, state1) \ 679 firstprivate(idim_max_buf, Jint, X, state1check, mask1) shared(v1buf, tmp_v1, tmp_v0) 681 if (
X->Large.mode == M_MLTPLY ||
X->Large.mode == M_CALCSPEC) {
682 for (j = 0; j < idim_max_buf; j++) {
683 state1 = (j & mask1) / mask1;
684 if (state1 == state1check) {
685 dmv = Jint *
v1buf[j + 1];
686 tmp_v0[j + 1] += dmv;
687 dam_pr += conj(tmp_v1[j + 1]) * dmv;
692 for (j = 0; j < idim_max_buf; j++) {
693 state1 = (j & mask1) / mask1;
694 if (state1 == state1check) {
695 dmv = Jint *
v1buf[j + 1];
696 dam_pr += conj(tmp_v1[j + 1]) * dmv;
712 unsigned long int i_int,
714 double complex *tmp_v0,
715 double complex *tmp_v1
718 double complex dam_pr;
720 X->Def.InterAll_OffDiagonal[i_int][0],
X->Def.InterAll_OffDiagonal[i_int][1],
721 X->Def.InterAll_OffDiagonal[i_int][3],
X->Def.InterAll_OffDiagonal[i_int][4],
722 X->Def.InterAll_OffDiagonal[i_int][5],
X->Def.ParaInterAll_OffDiagonal[i_int],
X, tmp_v0, tmp_v1);
723 X->Large.prdct += dam_pr;
738 double complex tmp_J,
740 double complex *tmp_v0,
741 double complex *tmp_v1
745 unsigned long int mask1, j, ioff, state1, state1check;
747 double complex Jint, dmv, dam_pr;
751 mask2 = (int)
X->Def.Tpow[org_isite3];
752 state2 = (
myrank & mask2) / mask2;
754 if (state2 == org_ispin3) {
755 state1check = org_ispin2;
762 mask1 = (int)
X->Def.Tpow[org_isite1];
765 #pragma omp parallel
default(none) reduction(+:dam_pr)
private(j, dmv, state1, ioff) \
766 firstprivate(Jint,
X, state1check, mask1) shared(tmp_v1, tmp_v0)
768 if (
X->Large.mode == M_MLTPLY ||
X->Large.mode == M_CALCSPEC) {
770 for (j = 0; j <
X->Check.idim_max; j++) {
772 state1 = (j & mask1) / mask1;
774 if (state1 == state1check) {
775 dmv = Jint * tmp_v1[j + 1];
778 dmv = conj(Jint) * tmp_v1[j + 1];
780 tmp_v0[ioff + 1] += dmv;
781 dam_pr += conj(tmp_v1[ioff + 1]) * dmv;
784 else if (
X->Large.mode == M_CORR) {
786 for (j = 0; j <
X->Check.idim_max; j++) {
788 state1 = (j & mask1) / mask1;
790 if (state1 == state1check) {
791 dmv = Jint * tmp_v1[j + 1];
796 dam_pr += conj(tmp_v1[ioff + 1]) * dmv;
801 for (j = 0; j <
X->Check.idim_max; j++) {
802 state1 = (j & mask1) / mask1;
804 if (state1 == state1check) {
805 dmv = Jint * tmp_v1[j + 1];
808 dmv = conj(Jint) * tmp_v1[j + 1];
810 dam_pr += conj(tmp_v1[ioff + 1]) * dmv;
830 double complex tmp_J,
832 double complex *tmp_v0,
833 double complex *tmp_v1
836 unsigned long int off, j;
838 double complex tmp_V, dmv, dam_pr;
839 MPI_Status statusMPI;
841 if (org_isite1 == org_isite3 && org_ispin1 == org_ispin4) {
846 &off,
X->Def.SiteToBit,
X->Def.Tpow) ==
TRUE) {
858 if (ihermite ==
FALSE) {
862 X->Def.SiteToBit,
X->Def.Tpow) ==
TRUE) {
864 if (
X->Large.mode == M_CORR ||
X->Large.mode == M_CALCSPEC) tmp_V = 0.0;
871 ierr = MPI_Sendrecv(tmp_v1,
X->Check.idim_max + 1, MPI_DOUBLE_COMPLEX, origin, 0,
872 v1buf,
X->Check.idim_max + 1, MPI_DOUBLE_COMPLEX, origin, 0,
873 MPI_COMM_WORLD, &statusMPI);
877 #pragma omp parallel default(none) reduction(+:dam_pr) firstprivate(X, tmp_V) \ 878 private(j, dmv) shared (tmp_v0, tmp_v1, v1buf) 880 if (
X->Large.mode == M_MLTPLY ||
X->Large.mode == M_CALCSPEC) {
882 for (j = 1; j <=
X->Check.idim_max; j++) {
883 dmv =
v1buf[j] * tmp_V;
885 dam_pr += conj(tmp_v1[j]) * dmv;
890 for (j = 1; j <=
X->Check.idim_max; j++) {
891 dmv =
v1buf[j] * tmp_V;
892 dam_pr += conj(tmp_v1[j]) * dmv;
912 double complex tmp_J,
914 double complex *tmp_v0,
915 double complex *tmp_v1
918 unsigned long int j, off;
920 double complex tmp_V, dmv, dam_pr;
921 MPI_Status statusMPI;
923 if (org_isite1 == org_isite3 && org_ispin1 == org_ispin3) {
929 &off,
X->Def.SiteToBit,
X->Def.Tpow) ==
TRUE) {
933 X->Def.SiteToBit,
X->Def.Tpow) ==
TRUE) {
936 if (
X->Large.mode == M_CORR ||
X->Large.mode == M_CALCSPEC) tmp_V = 0.0;
944 ierr = MPI_Sendrecv(tmp_v1,
X->Check.idim_max + 1, MPI_DOUBLE_COMPLEX, origin, 0,
945 v1buf,
X->Check.idim_max + 1, MPI_DOUBLE_COMPLEX, origin, 0,
946 MPI_COMM_WORLD, &statusMPI);
950 #pragma omp parallel default(none) reduction(+:dam_pr) firstprivate(X, tmp_V) private(j, dmv) \ 951 shared (tmp_v0, tmp_v1, v1buf) 953 if (
X->Large.mode == M_MLTPLY ||
X->Large.mode == M_CALCSPEC) {
955 for (j = 1; j <=
X->Check.idim_max; j++) {
956 dmv =
v1buf[j] * tmp_V;
958 dam_pr += conj(tmp_v1[j]) * dmv;
963 for (j = 1; j <=
X->Check.idim_max; j++) {
964 dmv =
v1buf[j] * tmp_V;
965 dam_pr += conj(tmp_v1[j]) * dmv;
986 double complex tmp_J,
988 double complex *tmp_v0,
989 double complex *tmp_v1
992 unsigned long int tmp_off, off, j;
993 int origin, ierr, ihermite;
994 double complex tmp_V, dmv, dam_pr;
995 MPI_Status statusMPI;
999 if (org_isite1 == org_isite3 && org_ispin1 == org_ispin4 &&
1000 org_ispin2 == org_ispin3) {
1006 &tmp_off,
X->Def.SiteToBit,
X->Def.Tpow) ==
TRUE) {
1009 &off,
X->Def.SiteToBit,
X->Def.Tpow) ==
TRUE) {
1013 else ihermite =
FALSE;
1019 if (ihermite ==
FALSE) {
1021 X->Def.SiteToBit,
X->Def.Tpow) ==
TRUE) {
1024 X->Def.Tpow) ==
TRUE) {
1025 tmp_V = conj(tmp_J);
1026 if (
X->Large.mode == M_CORR ||
X->Large.mode == M_CALCSPEC) tmp_V = 0.0;
1035 ierr = MPI_Sendrecv(tmp_v1,
X->Check.idim_max + 1, MPI_DOUBLE_COMPLEX, origin, 0,
1036 v1buf,
X->Check.idim_max + 1, MPI_DOUBLE_COMPLEX, origin, 0,
1037 MPI_COMM_WORLD, &statusMPI);
1041 #pragma omp parallel default(none) reduction(+:dam_pr) firstprivate(X, tmp_V) private(j, dmv) \ 1042 shared (tmp_v0, tmp_v1, v1buf) 1044 if (
X->Large.mode == M_MLTPLY ||
X->Large.mode == M_CALCSPEC) {
1046 for (j = 1; j <=
X->Check.idim_max; j++) {
1047 dmv =
v1buf[j] * tmp_V;
1049 dam_pr += conj(tmp_v1[j]) * dmv;
1054 for (j = 1; j <=
X->Check.idim_max; j++) {
1055 dmv =
v1buf[j] * tmp_V;
1056 dam_pr += conj(tmp_v1[j]) * dmv;
1075 double complex tmp_J,
1077 double complex *tmp_v0,
1078 double complex *tmp_v1
1081 unsigned long int j, num1;
1082 double complex tmp_V, dmv, dam_pr;
1085 num1 =
BitCheckGeneral((
unsigned long int)
myrank, org_isite1 + 1, org_ispin1,
X->Def.SiteToBit,
X->Def.Tpow);
1088 num1 =
BitCheckGeneral((
unsigned long int)
myrank, org_isite3 + 1, org_ispin3,
X->Def.SiteToBit,
X->Def.Tpow);
1097 #pragma omp parallel default(none) reduction(+:dam_pr) firstprivate(X, tmp_V) private(j, dmv) \ 1098 shared (tmp_v0, tmp_v1) 1100 if (
X->Large.mode == M_MLTPLY ||
X->Large.mode == M_CALCSPEC) {
1102 for (j = 1; j <=
X->Check.idim_max; j++) {
1103 dmv = tmp_v1[j] * tmp_V;
1105 dam_pr += conj(tmp_v1[j]) * dmv;
1110 for (j = 1; j <=
X->Check.idim_max; j++) {
1111 dmv = tmp_v1[j] * tmp_V;
1112 dam_pr += conj(tmp_v1[j]) * dmv;
1130 double complex tmp_trans,
1132 double complex *tmp_v0,
1133 double complex *tmp_v1
1136 unsigned long int off, j;
1138 double complex tmp_V, dmv, dam_pr;
1139 MPI_Status statusMPI;
1142 &off,
X->Def.SiteToBit,
X->Def.Tpow) ==
TRUE) {
1146 org_isite1 + 1, org_ispin2, org_ispin1, &off,
1147 X->Def.SiteToBit,
X->Def.Tpow) ==
TRUE) {
1148 tmp_V = conj(tmp_trans);
1149 if (
X->Large.mode == M_CORR ||
X->Large.mode == M_CALCSPEC) tmp_V = 0.0;
1155 ierr = MPI_Sendrecv(tmp_v1,
X->Check.idim_max + 1, MPI_DOUBLE_COMPLEX, origin, 0,
1156 v1buf,
X->Check.idim_max + 1, MPI_DOUBLE_COMPLEX, origin, 0,
1157 MPI_COMM_WORLD, &statusMPI);
1161 #pragma omp parallel default(none) reduction(+:dam_pr) firstprivate(X, tmp_V) private(j, dmv) \ 1162 shared (tmp_v0, tmp_v1, v1buf) 1164 if (
X->Large.mode == M_MLTPLY ||
X->Large.mode == M_CALCSPEC) {
1166 for (j = 1; j <=
X->Check.idim_max; j++) {
1167 dmv =
v1buf[j] * tmp_V;
1169 dam_pr += conj(tmp_v1[j]) * dmv;
1174 for (j = 1; j <=
X->Check.idim_max; j++) {
1175 dmv =
v1buf[j] * tmp_V;
1176 dam_pr += conj(tmp_v1[j]) * dmv;
1193 double complex tmp_trans,
1195 double complex *tmp_v0,
1196 double complex *tmp_v1
1199 unsigned long int j, num1;
1200 double complex tmp_V, dmv, dam_pr;
1204 org_isite1 + 1, org_ispin1,
X->Def.SiteToBit,
X->Def.Tpow);
1211 #pragma omp parallel default(none) reduction(+:dam_pr) firstprivate(X, tmp_V) private(j, dmv) \ 1212 shared (tmp_v0, tmp_v1) 1214 if (
X->Large.mode == M_MLTPLY ||
X->Large.mode == M_CALCSPEC) {
1216 for (j = 1; j <=
X->Check.idim_max; j++) {
1217 dmv = tmp_v1[j] * tmp_V;
1219 dam_pr += conj(tmp_v1[j]) * dmv;
1224 for (j = 1; j <=
X->Check.idim_max; j++) {
1225 dmv = tmp_v1[j] * tmp_V;
1226 dam_pr += conj(tmp_v1[j]) * dmv;
1243 double complex tmp_trans,
1245 double complex *tmp_v0,
1246 double complex *tmp_v1
1249 unsigned long int j, num1;
1250 double complex tmp_V, dmv, dam_pr;
1254 org_isite1 + 1, org_ispin1,
X->Def.SiteToBit,
X->Def.Tpow);
1261 #pragma omp parallel default(none) reduction(+:dam_pr) firstprivate(X, tmp_V) private(j, dmv) \ 1262 shared (tmp_v0, tmp_v1) 1264 if (
X->Large.mode == M_MLTPLY ||
X->Large.mode == M_CALCSPEC) {
1266 for (j = 1; j <=
X->Check.idim_max; j++) {
1267 dmv = tmp_v1[j] * tmp_V;
1269 dam_pr += conj(tmp_v1[j]) * dmv;
1274 for (j = 1; j <=
X->Check.idim_max; j++) {
1275 dmv = tmp_v1[j] * tmp_V;
1276 dam_pr += conj(tmp_v1[j]) * dmv;
1294 double complex tmp_trans,
1296 double complex *tmp_v0,
1297 double complex *tmp_v1,
1298 double complex *tmp_v1buf,
1299 unsigned long int idim_max,
1302 long unsigned int _ihfbit
1306 unsigned long int off, j, tmp_off,idim_max_buf;
1308 double complex tmp_V, dmv;
1309 MPI_Status statusMPI;
1312 &off,
X->Def.SiteToBit,
X->Def.Tpow) ==
TRUE) {
1316 org_isite1 + 1, org_ispin2, org_ispin1, &off,
1317 X->Def.SiteToBit,
X->Def.Tpow) ==
TRUE) {
1318 tmp_V = conj(tmp_trans);
1319 if (
X->Large.mode == M_CORR ||
X->Large.mode ==M_CALCSPEC) tmp_V = 0.0;
1325 ierr = MPI_Sendrecv(&idim_max, 1, MPI_UNSIGNED_LONG, origin, 0,
1326 &idim_max_buf, 1, MPI_UNSIGNED_LONG, origin, 0,
1327 MPI_COMM_WORLD, &statusMPI);
1330 ierr = MPI_Sendrecv(
list_1_org, idim_max + 1, MPI_UNSIGNED_LONG, origin, 0,
1331 list_1buf_org, idim_max_buf + 1, MPI_UNSIGNED_LONG, origin, 0,
1332 MPI_COMM_WORLD, &statusMPI);
1335 ierr = MPI_Sendrecv(tmp_v1, idim_max + 1, MPI_DOUBLE_COMPLEX, origin, 0,
1336 v1buf, idim_max_buf + 1, MPI_DOUBLE_COMPLEX, origin, 0,
1337 MPI_COMM_WORLD, &statusMPI);
1340 if (
X->Large.mode == M_MLTPLY ||
X->Large.mode ==M_CALCSPEC) {
1341 #pragma omp parallel for default(none)\ 1342 firstprivate(X, tmp_V, idim_max_buf, list_1buf_org) private(j, dmv, tmp_off) \ 1343 shared (tmp_v0, tmp_v1, v1buf) 1344 for (j = 1; j <= idim_max_buf; j++) {
1346 dmv =
v1buf[j] * tmp_V;
1347 tmp_v0[tmp_off] += dmv;
1370 double complex tmp_J,
1372 double complex *tmp_v0,
1373 double complex *tmp_v1
1376 unsigned long int off, j, num1;
1377 int origin, ierr, isite, IniSpin;
1378 double complex tmp_V, dmv, dam_pr;
1379 MPI_Status statusMPI;
1382 org_isite3 + 1, org_ispin3, org_ispin4, &off,
1383 X->Def.SiteToBit,
X->Def.Tpow) ==
TRUE)
1386 isite = org_isite1 + 1;
1387 IniSpin = org_ispin1;
1390 org_isite3 + 1, org_ispin4, org_ispin3, &off,
1391 X->Def.SiteToBit,
X->Def.Tpow) ==
TRUE)
1393 tmp_V = conj(tmp_J);
1394 if (
X->Large.mode == M_CORR ||
X->Large.mode == M_CALCSPEC) tmp_V = 0.0;
1395 isite = org_isite1 + 1;
1396 IniSpin = org_ispin1;
1402 ierr = MPI_Sendrecv(tmp_v1,
X->Check.idim_max + 1, MPI_DOUBLE_COMPLEX, origin, 0,
1403 v1buf,
X->Check.idim_max + 1, MPI_DOUBLE_COMPLEX, origin, 0,
1404 MPI_COMM_WORLD, &statusMPI);
1408 #pragma omp parallel default(none) reduction(+:dam_pr) firstprivate(X, tmp_V, isite, IniSpin) \ 1409 private(j, dmv, num1) shared (tmp_v0, tmp_v1, v1buf) 1411 if (
X->Large.mode == M_MLTPLY ||
X->Large.mode == M_CALCSPEC) {
1413 for (j = 1; j <=
X->Check.idim_max; j++) {
1416 dmv =
v1buf[j] * tmp_V;
1418 dam_pr += conj(tmp_v1[j]) * dmv;
1424 for (j = 1; j <=
X->Check.idim_max; j++) {
1427 dmv =
v1buf[j] * tmp_V;
1428 dam_pr += conj(tmp_v1[j]) * dmv;
1449 double complex tmp_J,
1451 double complex *tmp_v0,
1452 double complex *tmp_v1
1455 unsigned long int num1, j, off;
1456 int isite, IniSpin, FinSpin;
1457 double complex tmp_V, dmv, dam_pr;
1461 org_isite3+1, org_ispin3,
X->Def.SiteToBit,
X->Def.Tpow);
1464 isite = org_isite1 + 1;
1465 IniSpin = org_ispin2;
1466 FinSpin = org_ispin1;
1471 #pragma omp parallel default(none) reduction(+:dam_pr) \ 1472 firstprivate(X, tmp_V, isite, IniSpin, FinSpin) private(j, dmv, num1, off) \ 1473 shared (tmp_v0, tmp_v1, v1buf) 1475 if (
X->Large.mode == M_MLTPLY ||
X->Large.mode == M_CALCSPEC) {
1477 for (j = 1; j <=
X->Check.idim_max; j++) {
1479 X->Def.SiteToBit,
X->Def.Tpow) ==
TRUE)
1481 dmv = tmp_v1[j] * tmp_V;
1482 tmp_v0[off + 1] += dmv;
1483 dam_pr += conj(tmp_v1[off + 1]) * dmv;
1489 for (j = 1; j <=
X->Check.idim_max; j++) {
1491 X->Def.SiteToBit,
X->Def.Tpow) ==
TRUE)
1493 dmv = tmp_v1[j] * tmp_V;
1494 dam_pr += conj(tmp_v1[off + 1]) * dmv;
1516 double complex tmp_J,
1518 double complex *tmp_v0,
1519 double complex *tmp_v1
1522 unsigned long int off, j;
1523 int origin, ierr, isite, IniSpin, FinSpin;
1524 double complex tmp_V, dmv, dam_pr;
1525 MPI_Status statusMPI;
1528 org_isite3 + 1, org_ispin3, org_ispin4, &off,
1529 X->Def.SiteToBit,
X->Def.Tpow) ==
TRUE)
1532 isite = org_isite1 + 1;
1533 IniSpin = org_ispin2;
1534 FinSpin = org_ispin1;
1537 org_isite3 + 1, org_ispin4, org_ispin3, &off,
1538 X->Def.SiteToBit,
X->Def.Tpow) ==
TRUE)
1540 tmp_V = conj(tmp_J);
1541 if (
X->Large.mode == M_CORR ||
X->Large.mode == M_CALCSPEC) tmp_V = 0.0;
1542 isite = org_isite1 + 1;
1543 IniSpin = org_ispin1;
1544 FinSpin = org_ispin2;
1550 ierr = MPI_Sendrecv(tmp_v1,
X->Check.idim_max + 1, MPI_DOUBLE_COMPLEX, origin, 0,
1551 v1buf,
X->Check.idim_max + 1, MPI_DOUBLE_COMPLEX, origin, 0,
1552 MPI_COMM_WORLD, &statusMPI);
1556 #pragma omp parallel default(none) reduction(+:dam_pr) \ 1557 firstprivate(X, tmp_V, isite, IniSpin, FinSpin) private(j, dmv, off) shared (tmp_v0, tmp_v1, v1buf) 1559 if (
X->Large.mode == M_MLTPLY ||
X->Large.mode == M_CALCSPEC) {
1561 for (j = 1; j <=
X->Check.idim_max; j++) {
1563 X->Def.SiteToBit,
X->Def.Tpow) ==
TRUE)
1565 dmv =
v1buf[j] * tmp_V;
1566 tmp_v0[off + 1] += dmv;
1567 dam_pr += conj(tmp_v1[off + 1]) * dmv;
1573 for (j = 1; j <=
X->Check.idim_max; j++) {
1575 X->Def.SiteToBit,
X->Def.Tpow) ==
TRUE)
1577 dmv =
v1buf[j] * tmp_V;
1578 dam_pr += conj(tmp_v1[off + 1]) * dmv;
1598 double complex tmp_J,
1600 double complex *tmp_v0,
1601 double complex *tmp_v1
1604 unsigned long int j, num1;
1605 double complex tmp_V, dmv, dam_pr;
1609 if (num1 !=
FALSE) {
1615 #pragma omp parallel default(none) reduction(+:dam_pr) \ 1616 firstprivate(X, tmp_V, org_isite1, org_ispin1) private(j, dmv, num1) shared (tmp_v0, tmp_v1) 1618 if (
X->Large.mode == M_MLTPLY ||
X->Large.mode == M_CALCSPEC) {
1620 for (j = 1; j <=
X->Check.idim_max; j++) {
1621 num1 =
BitCheckGeneral(j - 1, org_isite1 + 1, org_ispin1,
X->Def.SiteToBit,
X->Def.Tpow);
1623 dmv = tmp_v1[j] * tmp_V * num1;
1625 dam_pr += conj(tmp_v1[j]) * dmv;
1630 for (j = 1; j <=
X->Check.idim_max; j++) {
1631 num1 =
BitCheckGeneral(j - 1, org_isite1 + 1, org_ispin1,
X->Def.SiteToBit,
X->Def.Tpow);
1632 dmv = tmp_v1[j] * tmp_V * num1;
1633 dam_pr += conj(tmp_v1[j]) * dmv;
1654 double complex tmp_J,
1656 double complex *tmp_v0,
1657 double complex *tmp_v1
1660 unsigned long int tmp_off, off, j, idim_max_buf;
1662 double complex tmp_V, dmv, dam_pr;
1663 MPI_Status statusMPI;
1680 if(ihermite==
FALSE){
1685 tmp_V = conj(tmp_J);
1686 if(
X->Large.mode == M_CORR||
X->Large.mode == M_CALCSPEC){
1698 ierr = MPI_Sendrecv(&
X->Check.idim_max, 1, MPI_UNSIGNED_LONG, origin, 0,
1699 &idim_max_buf, 1, MPI_UNSIGNED_LONG, origin, 0,
1700 MPI_COMM_WORLD, &statusMPI);
1702 ierr = MPI_Sendrecv(
list_1,
X->Check.idim_max + 1, MPI_UNSIGNED_LONG, origin, 0,
1703 list_1buf, idim_max_buf + 1, MPI_UNSIGNED_LONG, origin, 0,
1704 MPI_COMM_WORLD, &statusMPI);
1706 ierr = MPI_Sendrecv(tmp_v1,
X->Check.idim_max + 1, MPI_DOUBLE_COMPLEX, origin, 0,
1707 v1buf, idim_max_buf + 1, MPI_DOUBLE_COMPLEX, origin, 0,
1708 MPI_COMM_WORLD, &statusMPI);
1712 #pragma omp parallel default(none) reduction(+:dam_pr) firstprivate(X, tmp_V, idim_max_buf) \ 1713 private(j, dmv, off) shared (tmp_v0, tmp_v1, list_1buf, v1buf) 1715 if (
X->Large.mode == M_MLTPLY ||
X->Large.mode == M_CALCSPEC) {
1717 for (j = 1; j <= idim_max_buf; j++) {
1719 dmv =
v1buf[j] * tmp_V;
1721 dam_pr += conj(tmp_v1[off]) * dmv;
1726 for (j = 1; j <= idim_max_buf; j++) {
1728 dmv =
v1buf[j] * tmp_V;
1729 dam_pr += conj(tmp_v1[off]) * dmv;
1748 double complex tmp_J,
1750 double complex *tmp_v0,
1751 double complex *tmp_v1
1754 unsigned long int j, num1;
1755 double complex tmp_V, dmv, dam_pr;
1757 if (org_isite1 == org_isite3 && org_ispin1 == org_ispin3) {
1758 num1 =
BitCheckGeneral((
unsigned long int)
myrank, org_isite1 + 1, org_ispin1,
X->Def.SiteToBit,
X->Def.Tpow);
1759 if (num1 !=
FALSE) {
1767 num1 =
BitCheckGeneral((
unsigned long int)
myrank, org_isite1 + 1, org_ispin1,
X->Def.SiteToBit,
X->Def.Tpow);
1768 if (num1 !=
FALSE) {
1771 if (num1 !=
FALSE) {
1783 #pragma omp parallel default(none) reduction(+:dam_pr) firstprivate(X, tmp_V) private(j, dmv) \ 1784 shared (tmp_v0, tmp_v1) 1786 if (
X->Large.mode == M_MLTPLY ||
X->Large.mode == M_CALCSPEC) {
1788 for (j = 1; j <=
X->Check.idim_max; j++) {
1789 dmv = tmp_v1[j] * tmp_V;
1791 dam_pr += conj(tmp_v1[j]) * dmv;
1796 for (j = 1; j <=
X->Check.idim_max; j++) {
1797 dmv = tmp_v1[j] * tmp_V;
1798 dam_pr += conj(tmp_v1[j]) * dmv;
1817 double complex tmp_J,
1819 double complex *tmp_v0,
1820 double complex *tmp_v1
1824 unsigned long int j, num1;
1825 double complex tmp_V, dmv, dam_pr;
1828 num1 =
BitCheckGeneral((
unsigned long int)
myrank, org_isite3 + 1, org_ispin3,
X->Def.SiteToBit,
X->Def.Tpow);
1829 if (num1 !=
FALSE) {
1835 #pragma omp parallel default(none) reduction(+:dam_pr) \ 1836 firstprivate(X, tmp_V, org_isite1, org_ispin1) private(j, dmv, num1) shared (tmp_v0, tmp_v1, list_1) 1838 if (
X->Large.mode == M_MLTPLY ||
X->Large.mode == M_CALCSPEC) {
1840 for (j = 1; j <=
X->Check.idim_max; j++) {
1843 dmv = tmp_v1[j] * tmp_V * num1;
1845 dam_pr += conj(tmp_v1[j]) * dmv;
1850 for (j = 1; j <=
X->Check.idim_max; j++) {
1853 dmv = tmp_v1[j] * tmp_V * num1;
1854 dam_pr += conj(tmp_v1[j]) * dmv;
1875 double complex tmp_J,
1877 double complex *tmp_v0,
1878 double complex *tmp_v1
1881 unsigned long int tmp_off, off, j, idim_max_buf;
1882 int origin, ierr, isite, IniSpin, FinSpin;
1883 double complex tmp_V, dmv, dam_pr;
1884 MPI_Status statusMPI;
1887 org_isite3 + 1, org_ispin3, org_ispin4, &off,
1888 X->Def.SiteToBit,
X->Def.Tpow) ==
TRUE)
1891 isite = org_isite1 + 1;
1892 IniSpin = org_ispin2;
1893 FinSpin = org_ispin1;
1896 org_isite3 + 1, org_ispin4, org_ispin3, &off,
X->Def.SiteToBit,
X->Def.Tpow) ==
TRUE)
1898 tmp_V = conj(tmp_J);
1899 if (
X->Large.mode == M_CORR ||
X->Large.mode == M_CALCSPEC) tmp_V = 0.0;
1900 isite = org_isite1 + 1;
1901 IniSpin = org_ispin1;
1902 FinSpin = org_ispin2;
1908 ierr = MPI_Sendrecv(&
X->Check.idim_max, 1, MPI_UNSIGNED_LONG, origin, 0,
1909 &idim_max_buf, 1, MPI_UNSIGNED_LONG, origin, 0,
1910 MPI_COMM_WORLD, &statusMPI);
1912 ierr = MPI_Sendrecv(
list_1,
X->Check.idim_max + 1, MPI_UNSIGNED_LONG, origin, 0,
1913 list_1buf, idim_max_buf + 1, MPI_UNSIGNED_LONG, origin, 0,
1914 MPI_COMM_WORLD, &statusMPI);
1916 ierr = MPI_Sendrecv(tmp_v1,
X->Check.idim_max + 1, MPI_DOUBLE_COMPLEX, origin, 0,
1917 v1buf, idim_max_buf + 1, MPI_DOUBLE_COMPLEX, origin, 0,
1918 MPI_COMM_WORLD, &statusMPI);
1922 #pragma omp parallel default(none) reduction(+:dam_pr) \ 1923 firstprivate(X, tmp_V, idim_max_buf, IniSpin, FinSpin, isite) \ 1924 private(j, dmv, off, tmp_off) shared (tmp_v0, tmp_v1, list_1buf, v1buf) 1926 if (
X->Large.mode == M_MLTPLY ||
X->Large.mode == M_CALCSPEC) {
1928 for (j = 1; j <= idim_max_buf; j++) {
1931 X->Def.SiteToBit,
X->Def.Tpow) ==
TRUE)
1934 dmv =
v1buf[j] * tmp_V;
1936 dam_pr += conj(tmp_v1[off]) * dmv;
1942 for (j = 1; j <= idim_max_buf; j++) {
1945 X->Def.SiteToBit,
X->Def.Tpow) ==
TRUE)
1948 dmv =
v1buf[j] * tmp_V;
1949 dam_pr += conj(tmp_v1[off]) * dmv;
1969 double complex tmp_trans,
1971 double complex *tmp_v0 ,
1972 double complex *tmp_v1 )
1975 int mask1, state1, ierr, origin;
1976 unsigned long int idim_max_buf, j;
1977 MPI_Status statusMPI;
1978 double complex trans, dmv, dam_pr;
1980 mask1 = (int)
X->Def.Tpow[org_isite1];
1982 state1 = (origin & mask1)/mask1;
1986 if(state1 == org_ispin2){
1989 else if(state1 == org_ispin1) {
1990 trans = conj(tmp_trans);
1991 if(
X->Large.mode == M_CORR||
X->Large.mode ==M_CALCSPEC){
1999 ierr = MPI_Sendrecv(&
X->Check.idim_max, 1, MPI_UNSIGNED_LONG, origin, 0,
2000 &idim_max_buf, 1, MPI_UNSIGNED_LONG, origin, 0,
2001 MPI_COMM_WORLD, &statusMPI);
2003 ierr = MPI_Sendrecv(tmp_v1,
X->Check.idim_max + 1, MPI_DOUBLE_COMPLEX, origin, 0,
2004 v1buf, idim_max_buf + 1, MPI_DOUBLE_COMPLEX, origin, 0,
2005 MPI_COMM_WORLD, &statusMPI);
2009 #pragma omp parallel default(none) reduction(+:dam_pr) private(j, dmv) \ 2010 firstprivate(idim_max_buf, trans, X) shared(v1buf, tmp_v1, tmp_v0) 2012 if (
X->Large.mode == M_MLTPLY ||
X->Large.mode == M_CALCSPEC) {
2014 for (j = 1; j <=
X->Check.idim_max; j++) {
2015 dmv = trans *
v1buf[j];
2017 dam_pr += conj(tmp_v1[j]) * dmv;
2022 for (j = 1; j <=
X->Check.idim_max; j++) {
2023 dmv = trans *
v1buf[j];
2024 dam_pr += conj(tmp_v1[j]) * dmv;
2042 double complex tmp_trans,
2044 double complex *tmp_v0 ,
2045 double complex *tmp_v1,
2046 double complex *tmp_v1buf,
2047 unsigned long int idim_max,
2048 long unsigned int *Tpow,
2051 long unsigned int *list_2_1_target,
2052 long unsigned int *list_2_2_target,
2053 long unsigned int _irght,
2054 long unsigned int _ilft,
2055 long unsigned int _ihfbit
2058 int mask1, state1, ierr, origin;
2059 unsigned long int idim_max_buf, j;
2060 unsigned long int tmp_off;
2061 MPI_Status statusMPI;
2062 double complex trans, dmv;
2064 mask1 = (int)
X->Def.Tpow[org_isite1];
2066 state1 = (origin & mask1)/mask1;
2068 if(state1 == org_ispin2){
2077 ierr = MPI_Sendrecv(&idim_max, 1, MPI_UNSIGNED_LONG, origin, 0,
2078 &idim_max_buf, 1, MPI_UNSIGNED_LONG, origin, 0,
2079 MPI_COMM_WORLD, &statusMPI);
2082 ierr = MPI_Sendrecv(
list_1_org, idim_max + 1, MPI_UNSIGNED_LONG, origin, 0,
2083 list_1buf_org, idim_max_buf + 1, MPI_UNSIGNED_LONG, origin, 0,
2084 MPI_COMM_WORLD, &statusMPI);
2087 ierr = MPI_Sendrecv(tmp_v1, idim_max + 1, MPI_DOUBLE_COMPLEX, origin, 0,
2088 v1buf, idim_max_buf + 1, MPI_DOUBLE_COMPLEX, origin, 0,
2089 MPI_COMM_WORLD, &statusMPI);
2092 if (
X->Large.mode == M_MLTPLY ||
X->Large.mode == M_CALCSPEC) {
2093 #pragma omp parallel for default(none) private(j, dmv, tmp_off) \ 2094 firstprivate(idim_max_buf, trans, X, list_1buf_org, list_2_1_target, list_2_2_target) \ 2095 shared(v1buf, tmp_v0) 2096 for (j = 1; j <= idim_max_buf; j++) {
2098 dmv = trans *
v1buf[j];
2099 tmp_v0[tmp_off] += dmv;
2120 double complex tmp_trans,
2122 double complex *tmp_v0 ,
2123 double complex *tmp_v1
2126 long unsigned int j;
2129 double complex dam_pr;
2130 mask1 = (int)
X->Def.Tpow[org_isite1];
2131 ibit1 = (((
unsigned long int)
myrank& mask1)/mask1)^(1-org_ispin1);
2134 #pragma omp parallel reduction(+:dam_pr)default(none) shared(tmp_v1, tmp_v0, ibit1) \ 2135 firstprivate(X, tmp_trans) private(j) 2138 if (
X->Large.mode == M_MLTPLY ||
X->Large.mode == M_CALCSPEC) {
2140 for (j = 1; j <=
X->Check.idim_max; j++) {
2141 tmp_v0[j] += tmp_v1[j] * tmp_trans;
2142 dam_pr += tmp_trans * conj(tmp_v1[j]) * tmp_v1[j];
2147 for (j = 1; j <=
X->Check.idim_max; j++) {
2148 dam_pr += tmp_trans * conj(tmp_v1[j]) * tmp_v1[j];
2167 double complex tmp_trans,
2169 double complex *tmp_v0 ,
2170 double complex *tmp_v1
2173 long unsigned int j;
2176 double complex dam_pr;
2177 mask1 = (int)
X->Def.Tpow[org_isite1];
2178 ibit1 = (((
unsigned long int)
myrank& mask1) / mask1) ^ (1 - org_ispin1);
2181 #pragma omp parallel reduction(+:dam_pr)default(none) shared(tmp_v1, tmp_v0, ibit1) \ 2182 firstprivate(X, tmp_trans) private(j) 2185 if (
X->Large.mode == M_MLTPLY ||
X->Large.mode == M_CALCSPEC) {
2187 for (j = 1; j <=
X->Check.idim_max; j++) {
2188 tmp_v0[j] += tmp_v1[j] * tmp_trans;
2189 dam_pr += tmp_trans * conj(tmp_v1[j]) * tmp_v1[j];
2194 for (j = 1; j <=
X->Check.idim_max; j++) {
2195 dam_pr += tmp_trans * conj(tmp_v1[j]) * tmp_v1[j];
void GC_child_CisAitCiuAiv_spin_MPIdouble(unsigned long int i_int, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
Exchange and Pairlifting term in Spin model + GC When both site1 and site2 are in the inter process r...
void exitMPI(int errorcode)
MPI Abortation wrapper.
double complex X_child_CisAitCjuAjv_GeneralSpin_MPIsingle(int org_isite1, int org_ispin1, int org_ispin2, int org_isite3, int org_ispin3, int org_ispin4, double complex tmp_J, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
Compute term in the canonical general spin system when one of these sites is in the inter process re...
double complex X_GC_child_CisAisCjuAju_spin_MPIdouble(int org_isite1, int org_ispin1, int org_isite3, int org_ispin3, double complex tmp_J, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
CisAisCjuAjv term in Spin model + GC When both site1 and site2 are in the inter process region...
double complex X_GC_child_CisAitCjuAjv_GeneralSpin_MPIsingle(int org_isite1, int org_ispin1, int org_ispin2, int org_isite3, int org_ispin3, int org_ispin4, double complex tmp_J, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
Compute term in the grandcanonical general spin system when one of these site is in the inter proces...
double complex X_GC_child_CisAisCjuAjv_GeneralSpin_MPIdouble(int org_isite1, int org_ispin1, int org_isite3, int org_ispin3, int org_ispin4, double complex tmp_J, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
term in Spin model. When both site1 and site3 are in the inter process region.
void GC_child_CisAitCiuAiv_spin_MPIsingle(unsigned long int i_int, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
Exchange and Pairlifting term in Spin model + GC When only site2 is in the inter process region...
double complex X_GC_child_CisAis_GeneralSpin_MPIdouble(int org_isite1, int org_ispin1, double complex tmp_trans, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
Compute term in the grandcanonical general spin system when both site is in the inter process region...
double complex X_GC_child_CisAis_spin_MPIdouble(int org_isite1, int org_ispin1, double complex tmp_trans, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
Hopping term in Spin + GC When both site1 and site2 are in the inter process region.
double complex X_GC_child_CisAitCjuAju_GeneralSpin_MPIsingle(int org_isite1, int org_ispin1, int org_ispin2, int org_isite3, int org_ispin3, double complex tmp_J, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
Compute term in the grandcanonical general spin system when one of these site is in the inter proces...
double complex X_GC_child_CisAitCiuAiv_spin_MPIsingle(int org_isite1, int org_ispin1, int org_ispin2, int org_isite3, int org_ispin3, int org_ispin4, double complex tmp_J, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
Exchange and Pairlifting term in Spin model + GC When only site2 is in the inter process region...
double complex X_GC_child_CisAit_spin_MPIdouble(int org_isite1, int org_ispin1, int org_ispin2, double complex tmp_trans, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
Hopping term in Spin + GC When both site1 and site2 are in the inter process region.
double complex X_child_CisAisCjuAju_GeneralSpin_MPIsingle(int org_isite1, int org_ispin1, int org_isite3, int org_ispin3, double complex tmp_J, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
Compute term in the canonical general spin system when one of these sites is in the inter process re...
int X_SpinGC_CisAis(long unsigned int j, struct BindStruct *X, long unsigned int is1_spin, long unsigned int sigma1)
Compute the grandcanonical spin state with bit mask is1_spin.
long unsigned int * list_1buf
double complex X_child_CisAisCjuAju_GeneralSpin_MPIdouble(int org_isite1, int org_ispin1, int org_isite3, int org_ispin3, double complex tmp_J, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
Compute term in the canonical general spin system when both sites are in the inter process region...
void GC_child_CisAisCjuAjv_spin_MPIsingle(unsigned long int i_int, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
Wrapper for CisAisCjuAjv term in Spin model + GC When only site2 is in the inter process region...
int ConvertToList1GeneralSpin(const long unsigned int org_ibit, const long unsigned int ihlfbit, long unsigned int *_ilist1Comp)
function of converting component to list_1
void GC_child_CisAisCjuAjv_spin_MPIdouble(unsigned long int i_int, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
Wrapper for calculating CisAisCjuAjv term in Spin model + GC When both site1 and site2 are in the int...
double complex X_child_CisAitCjuAjv_GeneralSpin_MPIdouble(int org_isite1, int org_ispin1, int org_ispin2, int org_isite3, int org_ispin3, int org_ispin4, double complex tmp_J, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
Compute term in the canonical general spin system when both sites are in the inter process region...
double complex X_GC_child_CisAisCjuAju_GeneralSpin_MPIdouble(int org_isite1, int org_ispin1, int org_isite3, int org_ispin3, double complex tmp_J, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
Compute term in the grandcanonical general spin system when both site is in the inter process region...
double complex X_GC_child_CisAisCjuAju_spin_MPIsingle(int org_isite1, int org_ispin1, int org_isite3, int org_ispin3, double complex tmp_J, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
CisAisCjuAjv term in Spin model + GC When both site1 and site2 are in the inter process region...
double complex X_GC_child_CisAitCjuAjv_GeneralSpin_MPIdouble(int org_isite1, int org_ispin1, int org_ispin2, int org_isite3, int org_ispin3, int org_ispin4, double complex tmp_J, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
Compute term in the grandcanonical general spin system when both site is in the inter process region...
long unsigned int * list_1buf_org
double complex X_GC_child_CisAitCjuAju_spin_MPIsingle(int org_isite1, int org_ispin1, int org_ispin2, int org_isite3, int org_ispin3, double complex tmp_J, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
CisAisCjuAjv term in Spin model + GC When only site2 is in the inter process region.
double complex X_GC_child_CisAisCjuAjv_spin_MPIdouble(int org_isite1, int org_ispin1, int org_isite3, int org_ispin3, int org_ispin4, double complex tmp_J, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
CisAisCjuAjv term in Spin model + GC When both site1 and site2 are in the inter process region...
double complex X_GC_child_CisAit_GeneralSpin_MPIdouble(int org_isite1, int org_ispin1, int org_ispin2, double complex tmp_trans, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
Compute term in the grandcanonical general spin system when both site is in the inter process region...
double complex X_child_CisAit_spin_MPIdouble(int org_isite1, int org_ispin2, double complex tmp_trans, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1, double complex *tmp_v1buf, unsigned long int idim_max, long unsigned int *Tpow, long unsigned int *list_1_org, long unsigned int *list_1buf_org, long unsigned int *list_2_1_target, long unsigned int *list_2_2_target, long unsigned int _irght, long unsigned int _ilft, long unsigned int _ihfbit)
Hopping term in Spin + Canonical for CalcSpectrum When both site1 and site2 are in the inter process ...
void GC_child_CisAitCjuAju_spin_MPIsingle(unsigned long int i_int, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
Wrapper for CisAisCjuAjv term in Spin model + GC When only site2 is in the inter process region...
long unsigned int * list_1_org
int GetOffComp(long unsigned int *_list_2_1, long unsigned int *_list_2_2, long unsigned int _ibit, const long unsigned int _irght, const long unsigned int _ilft, const long unsigned int _ihfbit, long unsigned int *_ioffComp)
function of getting off-diagonal component
long unsigned int * list_1
void GC_child_CisAitCjuAju_spin_MPIdouble(unsigned long int i_int, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
Wrapper for calculating CisAitCjuAju term in Spin model + GC When both site1 and site2 are in the int...
double complex X_GC_child_AisCis_GeneralSpin_MPIdouble(int org_isite1, int org_ispin1, double complex tmp_trans, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
Compute term in the grandcanonical general spin system when both site is in the inter process region...
int BitCheckGeneral(const long unsigned int org_bit, const unsigned int org_isite, const unsigned int target_ispin, const long int *SiteToBit, const long unsigned int *Tpow)
bit check function for general spin
double complex X_GC_child_AisCis_spin_MPIdouble(int org_isite1, int org_ispin1, double complex tmp_trans, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
Hopping term in Spin + GC When both site1 and site2 are in the inter process region.
double complex X_GC_child_CisAitCjuAju_GeneralSpin_MPIdouble(int org_isite1, int org_ispin1, int org_ispin2, int org_isite3, int org_ispin3, double complex tmp_J, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
term in Spin model. When both site1 and site3 are in the inter process region.
double complex X_child_CisAit_GeneralSpin_MPIdouble(int org_isite1, int org_ispin1, int org_ispin2, double complex tmp_trans, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1, double complex *tmp_v1buf, unsigned long int idim_max, long unsigned int *list_1_org, long unsigned int *list_1buf_org, long unsigned int _ihfbit)
Compute term in the canonical general spin system when both site is in the inter process region...
double complex X_GC_child_CisAisCjuAjv_GeneralSpin_MPIsingle(int org_isite1, int org_ispin1, int org_isite3, int org_ispin3, int org_ispin4, double complex tmp_J, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
Compute term in the grandcanonical general spin system when one of these site is in the inter proces...
double complex X_GC_child_CisAisCjuAjv_spin_MPIsingle(int org_isite1, int org_ispin1, int org_isite3, int org_ispin3, int org_ispin4, double complex tmp_J, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
CisAisCjuAjv term in Spin model + GC When only site2 is in the inter process region.
int GetOffCompGeneralSpin(const long unsigned int org_ibit, const int org_isite, const int org_ispin, const int off_ispin, long unsigned int *_ioffComp, const long int *SiteToBit, const long unsigned int *Tpow)
function of getting off-diagonal component for general spin
int X_SpinGC_CisAit(long unsigned int j, struct BindStruct *X, long unsigned int is1_spin, long unsigned int sigma2, long unsigned int *tmp_off)
Compute index of final wavefunction by term (grandcanonical).
int myrank
Process ID, defined in InitializeMPI()
double complex X_GC_child_CisAitCiuAiv_spin_MPIdouble(int org_isite1, int org_ispin1, int org_ispin2, int org_isite3, int org_ispin3, int org_ispin4, double complex tmp_J, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
term in Spin model + GC. When both site1 and site2 are in the inter process region.
double complex X_GC_child_CisAitCjuAju_spin_MPIdouble(int org_isite1, int org_ispin1, int org_ispin2, int org_isite3, int org_ispin3, double complex tmp_J, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
CisAisCjuAjv term in Spin model + GC When both site1 and site2 are in the inter process region...
double complex X_GC_child_CisAisCjuAju_GeneralSpin_MPIsingle(int org_isite1, int org_ispin1, int org_isite3, int org_ispin3, double complex tmp_J, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
Compute term in the grandcanonical general spin system when one of these site is in the inter proces...