HΦ  3.2.0
mltplyMPISpin.c
Go to the documentation of this file.
1 /* HPhi - Quantum Lattice Model Simulator */
2 /* Copyright (C) 2015 The University of Tokyo */
3 
4 /* This program is free software: you can redistribute it and/or modify */
5 /* it under the terms of the GNU General Public License as published by */
6 /* the Free Software Foundation, either version 3 of the License, or */
7 /* (at your option) any later version. */
8 
9 /* This program is distributed in the hope that it will be useful, */
10 /* but WITHOUT ANY WARRANTY; without even the implied warranty of */
11 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
12 /* GNU General Public License for more details. */
13 
14 /* You should have received a copy of the GNU General Public License */
15 /* along with this program. If not, see <http://www.gnu.org/licenses/>. */
20 #ifdef MPI
21 #include "mpi.h"
22 #endif
23 #include "Common.h"
24 #include "mltplyCommon.h"
25 #include "bitcalc.h"
26 #include "wrapperMPI.h"
27 #include "mltplyMPISpin.h"
28 #include "mltplyMPISpinCore.h"
29 
36  unsigned long int i_int,
37  struct BindStruct *X,
38  double complex *tmp_v0,
39  double complex *tmp_v1
40 ){
41 #ifdef MPI
42  double complex dam_pr = 0;
44  (int)X->Def.InterAll_OffDiagonal[i_int][0], (int)X->Def.InterAll_OffDiagonal[i_int][1],
45  (int)X->Def.InterAll_OffDiagonal[i_int][3], (int)X->Def.InterAll_OffDiagonal[i_int][4],
46  (int)X->Def.InterAll_OffDiagonal[i_int][5], (int)X->Def.InterAll_OffDiagonal[i_int][7],
47  X->Def.ParaInterAll_OffDiagonal[i_int], X, tmp_v0, tmp_v1);
52  X->Large.prdct += dam_pr;
53 #endif
54 }/*void child_general_int_spin_MPIdouble*/
62  int org_isite1,
63  int org_ispin1,
64  int org_ispin2,
65  int org_isite3,
66  int org_ispin3,
67  int org_ispin4,
68  double complex tmp_J,
69  struct BindStruct *X,
70  double complex *tmp_v0,
71  double complex *tmp_v1
72 ) {
73 #ifdef MPI
74  int mask1, mask2, state1, state2, ierr, origin;
75  unsigned long int idim_max_buf, j, ioff;
76  MPI_Status statusMPI;
77  double complex Jint, dmv, dam_pr;
78 
79  mask1 = (int)X->Def.Tpow[org_isite1];
80  mask2 = (int)X->Def.Tpow[org_isite3];
81  origin = myrank ^ (mask1 + mask2);
82 
83  state1 = (origin & mask1) / mask1;
84  state2 = (origin & mask2) / mask2;
85 
86  if (state1 == org_ispin2 && state2 == org_ispin4) {
87  Jint = tmp_J;
88  }
89  else if (state1 == org_ispin1 && state2 == org_ispin3) {
90  Jint = conj(tmp_J);
91  if (X->Large.mode == M_CORR || X->Large.mode == M_CALCSPEC) {
92  Jint = 0;
93  }
94  }
95  else return 0;
96 
97  ierr = MPI_Sendrecv(&X->Check.idim_max, 1, MPI_UNSIGNED_LONG, origin, 0,
98  &idim_max_buf, 1, MPI_UNSIGNED_LONG, origin, 0, MPI_COMM_WORLD, &statusMPI);
99  if (ierr != 0) exitMPI(-1);
100  ierr = MPI_Sendrecv(list_1, X->Check.idim_max + 1, MPI_UNSIGNED_LONG, origin, 0,
101  list_1buf, idim_max_buf + 1, MPI_UNSIGNED_LONG, origin, 0, MPI_COMM_WORLD, &statusMPI);
102  if (ierr != 0) exitMPI(-1);
103  ierr = MPI_Sendrecv(tmp_v1, X->Check.idim_max + 1, MPI_DOUBLE_COMPLEX, origin, 0,
104  v1buf, idim_max_buf + 1, MPI_DOUBLE_COMPLEX, origin, 0, MPI_COMM_WORLD, &statusMPI);
105  if (ierr != 0) exitMPI(-1);
106 
107  dam_pr = 0.0;
108  if (X->Large.mode == M_MLTPLY || X->Large.mode == M_CALCSPEC) {
109 #pragma omp parallel for default(none) reduction(+:dam_pr) private(j, dmv, ioff) \
110  firstprivate(idim_max_buf, Jint, X) shared(list_2_1, list_2_2, list_1buf, v1buf, tmp_v1, tmp_v0)
111  for (j = 1; j <= idim_max_buf; j++) {
113  X->Large.irght, X->Large.ilft, X->Large.ihfbit, &ioff);
114  dmv = Jint * v1buf[j];
115  tmp_v0[ioff] += dmv;
116  dam_pr += conj(tmp_v1[ioff]) * dmv;
117  }/*for (j = 1; j <= idim_max_buf; j++)*/
118  }/*if (X->Large.mode == M_MLTPLY || X->Large.mode == M_CALCSPEC)*/
119  else {
120 #pragma omp parallel for default(none) reduction(+:dam_pr) private(j, dmv, ioff) \
121  firstprivate(idim_max_buf, Jint, X) shared(list_2_1, list_2_2, list_1buf, v1buf, tmp_v1, tmp_v0)
122  for (j = 1; j <= idim_max_buf; j++) {
124  X->Large.irght, X->Large.ilft, X->Large.ihfbit, &ioff);
125  dmv = Jint * v1buf[j];
126  dam_pr += conj(tmp_v1[ioff]) * dmv;
127  }/*for (j = 1; j <= idim_max_buf; j++)*/
128  }/*if (! (X->Large.mode == M_MLTPLY || X->Large.mode == M_CALCSPEC))*/
129  return dam_pr;
130 #else
131  return 0.0;
132 #endif
133 }/*double complex X_child_general_int_spin_MPIdouble*/
141  int org_isite1,
142  int org_isite3,
143  struct BindStruct *X,
144  double complex *tmp_v0,
145  double complex *tmp_v1
146 ){
147 #ifdef MPI
148  int mask1, mask2, num1_up, num2_up, ierr, origin;
149  unsigned long int idim_max_buf, j, ioff, ibit_tmp;
150  MPI_Status statusMPI;
151  double complex dmv, dam_pr;
152 
153  mask1 = (int)X->Def.Tpow[org_isite1];
154  mask2 = (int)X->Def.Tpow[org_isite3];
155  if (mask1 == mask2) origin = myrank ^ mask1;
156  else origin = myrank ^ (mask1 + mask2);
157  num1_up = (origin & mask1) / mask1;
158  num2_up = (origin & mask2) / mask2;
159 
160  ibit_tmp = (num1_up) ^ (num2_up);
161  if (ibit_tmp == 0) return 0;
162 
163  ierr = MPI_Sendrecv(&X->Check.idim_max, 1, MPI_UNSIGNED_LONG, origin, 0,
164  &idim_max_buf, 1, MPI_UNSIGNED_LONG, origin, 0,
165  MPI_COMM_WORLD, &statusMPI);
166  if (ierr != 0) exitMPI(-1);
167  ierr = MPI_Sendrecv(list_1, X->Check.idim_max + 1, MPI_UNSIGNED_LONG, origin, 0,
168  list_1buf, idim_max_buf + 1, MPI_UNSIGNED_LONG, origin, 0,
169  MPI_COMM_WORLD, &statusMPI);
170  if (ierr != 0) exitMPI(-1);
171  ierr = MPI_Sendrecv(tmp_v1, X->Check.idim_max + 1, MPI_DOUBLE_COMPLEX, origin, 0,
172  v1buf, idim_max_buf + 1, MPI_DOUBLE_COMPLEX, origin, 0,
173  MPI_COMM_WORLD, &statusMPI);
174  if (ierr != 0) exitMPI(-1);
175 
176  dam_pr = 0.0;
177 #pragma omp parallel for default(none) reduction(+:dam_pr) private(j, dmv, ioff) \
178  firstprivate(idim_max_buf, X) shared(list_2_1, list_2_2, list_1buf, v1buf, tmp_v1, tmp_v0)
179  for (j = 1; j <= idim_max_buf; j++) {
181  X->Large.irght, X->Large.ilft, X->Large.ihfbit, &ioff);
182  dmv = 0.5 * v1buf[j];
183  dam_pr += conj(tmp_v1[ioff]) * dmv;
184  }/*for (j = 1; j <= idim_max_buf; j++)*/
185  return dam_pr;
186 #else
187  return 0.0;
188 #endif
189 }/*double complex X_child_general_int_spin_MPIdouble*/
197  unsigned long int i_int,
198  struct BindStruct *X,
199  double complex *tmp_v0,
200  double complex *tmp_v1
201 ){
202 #ifdef MPI
203  double complex dam_pr = 0;
204 
206  (int)X->Def.InterAll_OffDiagonal[i_int][0], (int)X->Def.InterAll_OffDiagonal[i_int][1],
207  (int)X->Def.InterAll_OffDiagonal[i_int][3], (int)X->Def.InterAll_OffDiagonal[i_int][4],
208  (int)X->Def.InterAll_OffDiagonal[i_int][5], (int)X->Def.InterAll_OffDiagonal[i_int][7],
209  X->Def.ParaInterAll_OffDiagonal[i_int], X, tmp_v0, tmp_v1);
214  X->Large.prdct += dam_pr;
215 #endif
216 }/*void child_general_int_spin_MPIsingle*/
217 /*
218 @brief General interaction term of canonical spin system.
219 site 3 is in the inter process region
220 @return @f$\langle v_1| H_{\rm this} | v_1 \rangle@f$
221 */
223  int org_isite1,
224  int org_ispin1,
225  int org_ispin2,
226  int org_isite3,
227  int org_ispin3,
228  int org_ispin4,
229  double complex tmp_J,
230  struct BindStruct *X,
231  double complex *tmp_v0,
232  double complex *tmp_v1
233 ) {
234 #ifdef MPI
235  int mask2, state2, ierr, origin;
236  unsigned long int mask1, idim_max_buf, j, ioff, state1, jreal, state1check;
237  MPI_Status statusMPI;
238  double complex Jint, dmv, dam_pr;
239  /*
240  Prepare index in the inter PE
241  */
242  mask2 = (int)X->Def.Tpow[org_isite3];
243  origin = myrank ^ mask2;
244  state2 = (origin & mask2) / mask2;
245 
246  if (state2 == org_ispin4) {
247  state1check = (unsigned long int) org_ispin2;
248  Jint = tmp_J;
249  }
250  else if (state2 == org_ispin3) {
251  state1check = (unsigned long int) org_ispin1;
252  Jint = conj(tmp_J);
253  if (X->Large.mode == M_CORR || X->Large.mode == M_CALCSPEC) {
254  Jint = 0;
255  }
256  }
257  else return 0;
258 
259  ierr = MPI_Sendrecv(&X->Check.idim_max, 1, MPI_UNSIGNED_LONG, origin, 0,
260  &idim_max_buf, 1, MPI_UNSIGNED_LONG, origin, 0,
261  MPI_COMM_WORLD, &statusMPI);
262  if (ierr != 0) exitMPI(-1);
263  ierr = MPI_Sendrecv(list_1, X->Check.idim_max + 1, MPI_UNSIGNED_LONG, origin, 0,
264  list_1buf, idim_max_buf + 1, MPI_UNSIGNED_LONG, origin, 0,
265  MPI_COMM_WORLD, &statusMPI);
266  if (ierr != 0) exitMPI(-1);
267  ierr = MPI_Sendrecv(tmp_v1, X->Check.idim_max + 1, MPI_DOUBLE_COMPLEX, origin, 0,
268  v1buf, idim_max_buf + 1, MPI_DOUBLE_COMPLEX, origin, 0,
269  MPI_COMM_WORLD, &statusMPI);
270  if (ierr != 0) exitMPI(-1);
271  /*
272  Index in the intra PE
273  */
274  mask1 = X->Def.Tpow[org_isite1];
275 
276  dam_pr = 0.0;
277  if (X->Large.mode == M_MLTPLY || X->Large.mode == M_CALCSPEC) {
278 #pragma omp parallel for default(none) reduction(+:dam_pr) private(j, dmv, ioff, jreal, state1) \
279 firstprivate(idim_max_buf, Jint, X, mask1, state1check, org_isite1) \
280 shared(list_2_1, list_2_2, list_1buf, v1buf, tmp_v1, tmp_v0)
281  for (j = 1; j <= idim_max_buf; j++) {
282 
283  jreal = list_1buf[j];
284 
285  state1 = (jreal & mask1) / mask1;
286  if (state1 == state1check) {
287  GetOffComp(list_2_1, list_2_2, jreal ^ mask1,
288  X->Large.irght, X->Large.ilft, X->Large.ihfbit, &ioff);
289 
290  dmv = Jint * v1buf[j];
291  tmp_v0[ioff] += dmv;
292  dam_pr += conj(tmp_v1[ioff]) * dmv;
293  }
294  }
295  }
296  else if (X->Large.mode == M_TOTALS) {
297 #pragma omp parallel for default(none) reduction(+:dam_pr) private(j, dmv, ioff, jreal, state1) \
298 firstprivate(idim_max_buf, Jint, X, mask1, state1check, org_isite1) \
299 shared(list_2_1, list_2_2, list_1buf, v1buf, tmp_v1, tmp_v0)
300  for (j = 1; j <= idim_max_buf; j++) {
301 
302  jreal = list_1buf[j];
303 
304  state1 = (jreal & mask1) / mask1;
305  if (state1 == state1check) {
306  GetOffComp(list_2_1, list_2_2, jreal ^ mask1,
307  X->Large.irght, X->Large.ilft, X->Large.ihfbit, &ioff);
308 
309  dmv = Jint * v1buf[j];
310  dmv = 0.5 * v1buf[j];
311  dam_pr += conj(tmp_v1[ioff]) * dmv;
312  }/*if (state1 == state1check)*/
313  }/*for (j = 1; j <= idim_max_buf; j++)*/
314  }/*if (X->Large.mode == M_TOTALS)*/
315  else {
316 #pragma omp parallel for default(none) reduction(+:dam_pr) private(j, dmv, ioff, jreal, state1) \
317 firstprivate(idim_max_buf, Jint, X, mask1, state1check, org_isite1) \
318 shared(list_2_1, list_2_2, list_1buf, v1buf, tmp_v1, tmp_v0)
319  for (j = 1; j <= idim_max_buf; j++) {
320 
321  jreal = list_1buf[j];
322 
323  state1 = (jreal & mask1) / mask1;
324  if (state1 == state1check) {
325  GetOffComp(list_2_1, list_2_2, jreal ^ mask1,
326  X->Large.irght, X->Large.ilft, X->Large.ihfbit, &ioff);
327  dmv = Jint * v1buf[j];
328  dam_pr += conj(tmp_v1[ioff]) * dmv;
329  }/*if (state1 == state1check)*/
330  }/*for (j = 1; j <= idim_max_buf; j++)*/
331  }
332  return dam_pr;
333 #else
334  return 0.0;
335 #endif
336 }/*double complex X_child_general_int_spin_MPIsingle*/
343  unsigned long int i_int,
344  struct BindStruct *X,
345  double complex *tmp_v0,
346  double complex *tmp_v1
347 ){
348  if (X->Def.InterAll_OffDiagonal[i_int][1] == X->Def.InterAll_OffDiagonal[i_int][3] &&
349  X->Def.InterAll_OffDiagonal[i_int][5] != X->Def.InterAll_OffDiagonal[i_int][7]) {
350  GC_child_CisAisCjuAjv_spin_MPIdouble(i_int, X, tmp_v0, tmp_v1);
351  }
352  else if (X->Def.InterAll_OffDiagonal[i_int][1] != X->Def.InterAll_OffDiagonal[i_int][3] &&
353  X->Def.InterAll_OffDiagonal[i_int][5] == X->Def.InterAll_OffDiagonal[i_int][7]) {
354  GC_child_CisAitCjuAju_spin_MPIdouble(i_int, X, tmp_v0, tmp_v1);
355  }
356  else {
357  GC_child_CisAitCiuAiv_spin_MPIdouble(i_int, X, tmp_v0, tmp_v1);
358  }
359 }/*void GC_child_general_int_spin_MPIdouble*/
366  unsigned long int i_int,
367  struct BindStruct *X,
368  double complex *tmp_v0,
369  double complex *tmp_v1
370 ){
371  if (X->Def.InterAll_OffDiagonal[i_int][1] == X->Def.InterAll_OffDiagonal[i_int][3] &&
372  X->Def.InterAll_OffDiagonal[i_int][5] != X->Def.InterAll_OffDiagonal[i_int][7]) {
373  GC_child_CisAisCjuAjv_spin_MPIsingle(i_int, X, tmp_v0, tmp_v1);
374  }
375  else if (X->Def.InterAll_OffDiagonal[i_int][1] != X->Def.InterAll_OffDiagonal[i_int][3] &&
376  X->Def.InterAll_OffDiagonal[i_int][5] == X->Def.InterAll_OffDiagonal[i_int][7]) {
377  GC_child_CisAitCjuAju_spin_MPIsingle(i_int, X, tmp_v0, tmp_v1);
378  }
379  else {
380  GC_child_CisAitCiuAiv_spin_MPIsingle(i_int, X, tmp_v0, tmp_v1);
381  }
382 }/*void GC_child_general_int_spin_MPIsingle*/
389  unsigned long int i_int,
390  struct BindStruct *X,
391  double complex *tmp_v0,
392  double complex *tmp_v1
393 ){
394 #ifdef MPI
395  double complex dam_pr;
396  // MPI_Status statusMPI;
397 
398  if (X->Def.InterAll_OffDiagonal[i_int][1] == X->Def.InterAll_OffDiagonal[i_int][3] &&
399  X->Def.InterAll_OffDiagonal[i_int][5] != X->Def.InterAll_OffDiagonal[i_int][7]) {
401  X->Def.InterAll_OffDiagonal[i_int][0], X->Def.InterAll_OffDiagonal[i_int][1],
402  X->Def.InterAll_OffDiagonal[i_int][4], X->Def.InterAll_OffDiagonal[i_int][5],
403  X->Def.InterAll_OffDiagonal[i_int][7], X->Def.ParaInterAll_OffDiagonal[i_int], X, tmp_v0, tmp_v1);
404  }
405  else if (X->Def.InterAll_OffDiagonal[i_int][1] != X->Def.InterAll_OffDiagonal[i_int][3] &&
406  X->Def.InterAll_OffDiagonal[i_int][5] == X->Def.InterAll_OffDiagonal[i_int][7]) {
408  X->Def.InterAll_OffDiagonal[i_int][0], X->Def.InterAll_OffDiagonal[i_int][1],
409  X->Def.InterAll_OffDiagonal[i_int][3], X->Def.InterAll_OffDiagonal[i_int][4],
410  X->Def.InterAll_OffDiagonal[i_int][5], X->Def.ParaInterAll_OffDiagonal[i_int], X, tmp_v0, tmp_v1);
411  }
412  else {
414  X->Def.InterAll_OffDiagonal[i_int][0], X->Def.InterAll_OffDiagonal[i_int][1],
415  X->Def.InterAll_OffDiagonal[i_int][3], X->Def.InterAll_OffDiagonal[i_int][4],
416  X->Def.InterAll_OffDiagonal[i_int][5], X->Def.InterAll_OffDiagonal[i_int][7],
417  X->Def.ParaInterAll_OffDiagonal[i_int], X, tmp_v0, tmp_v1);
418  }
419  X->Large.prdct += dam_pr;
420 #endif
421 }/*void GC_child_general_int_spin_MPIdouble*/
428  unsigned long int i_int,
429  struct BindStruct *X,
430  double complex *tmp_v0,
431  double complex *tmp_v1
432 ){
433 #ifdef MPI
434  double complex dam_pr;
435 
436  if (X->Def.InterAll_OffDiagonal[i_int][1] == X->Def.InterAll_OffDiagonal[i_int][3] &&
437  X->Def.InterAll_OffDiagonal[i_int][5] != X->Def.InterAll_OffDiagonal[i_int][7]) {
439  X->Def.InterAll_OffDiagonal[i_int][0], X->Def.InterAll_OffDiagonal[i_int][1],
440  X->Def.InterAll_OffDiagonal[i_int][4], X->Def.InterAll_OffDiagonal[i_int][5],
441  X->Def.InterAll_OffDiagonal[i_int][7], X->Def.ParaInterAll_OffDiagonal[i_int], X, tmp_v0, tmp_v1);
442  }
443  else if (X->Def.InterAll_OffDiagonal[i_int][1] != X->Def.InterAll_OffDiagonal[i_int][3] &&
444  X->Def.InterAll_OffDiagonal[i_int][5] == X->Def.InterAll_OffDiagonal[i_int][7]) {
446  X->Def.InterAll_OffDiagonal[i_int][0], X->Def.InterAll_OffDiagonal[i_int][1],
447  X->Def.InterAll_OffDiagonal[i_int][3], X->Def.InterAll_OffDiagonal[i_int][4],
448  X->Def.InterAll_OffDiagonal[i_int][5], X->Def.ParaInterAll_OffDiagonal[i_int], X, tmp_v0, tmp_v1);
449  }
450  else {
452  X->Def.InterAll_OffDiagonal[i_int][0], X->Def.InterAll_OffDiagonal[i_int][1],
453  X->Def.InterAll_OffDiagonal[i_int][3], X->Def.InterAll_OffDiagonal[i_int][4],
454  X->Def.InterAll_OffDiagonal[i_int][5], X->Def.InterAll_OffDiagonal[i_int][7],
455  X->Def.ParaInterAll_OffDiagonal[i_int], X, tmp_v0, tmp_v1);
456  }
457 
458  X->Large.prdct += dam_pr;
459 #endif
460 }/*void GC_child_general_int_spin_MPIsingle*/
467  unsigned long int i_int,
468  struct BindStruct *X,
469  double complex *tmp_v0,
470  double complex *tmp_v1
471 ){
472  double complex dam_pr;
474  X->Def.InterAll_OffDiagonal[i_int][0], X->Def.InterAll_OffDiagonal[i_int][1],
475  X->Def.InterAll_OffDiagonal[i_int][3], X->Def.InterAll_OffDiagonal[i_int][4],
476  X->Def.InterAll_OffDiagonal[i_int][5], X->Def.InterAll_OffDiagonal[i_int][7],
477  X->Def.ParaInterAll_OffDiagonal[i_int], X, tmp_v0, tmp_v1);
478  X->Large.prdct += dam_pr;
479 
480 }/*void GC_child_general_int_spin_MPIdouble*/
487  unsigned long int i_int,
488  struct BindStruct *X,
489  double complex *tmp_v0,
490  double complex *tmp_v1
491 ){
492  double complex dam_pr;
493 
495  X->Def.InterAll_OffDiagonal[i_int][0], X->Def.InterAll_OffDiagonal[i_int][1],
496  X->Def.InterAll_OffDiagonal[i_int][3], X->Def.InterAll_OffDiagonal[i_int][4],
497  X->Def.InterAll_OffDiagonal[i_int][5], X->Def.InterAll_OffDiagonal[i_int][7],
498  X->Def.ParaInterAll_OffDiagonal[i_int], X, tmp_v0, tmp_v1);
499 
500  X->Large.prdct += dam_pr;
501 }/*void GC_child_general_int_spin_MPIsingle*/
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.
Definition: wrapperMPI.c:86
struct DefineList Def
Definision of system (Hamiltonian) etc.
Definition: struct.h:410
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...
void GC_child_general_int_spin_MPIsingle(unsigned long int i_int, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
General interaction term in the Spin model + GC When both site1 and site2 are in the inter process re...
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...
long unsigned int ihfbit
Used for Ogata-Lin ???
Definition: struct.h:345
unsigned long int idim_max
The dimension of the Hilbert space of this process.
Definition: struct.h:303
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 prdct
The expectation value of the energy.
Definition: struct.h:314
long unsigned int * list_1buf
Definition: global.h:48
struct LargeList Large
Variables for Matrix-Vector product.
Definition: struct.h:412
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...
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 * ParaInterAll_OffDiagonal
[DefineList::NInterAll_OffDiagonal] Coupling constant of off-diagonal inter-all term. malloc in setmem_def().
Definition: struct.h:170
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...
int mode
multiply or expectation value.
Definition: struct.h:330
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...
int ** InterAll_OffDiagonal
[DefineList::NinterAll_OffDiagonal][8] Interacted quartet
Definition: struct.h:161
void child_general_int_GeneralSpin_MPIdouble(unsigned long int i_int, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
General interaction term in the Spin model + GC When both site1 and site2 are in the inter process re...
Bind.
Definition: struct.h:409
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 * Tpow
[2 * DefineList::NsiteMPI] malloc in setmem_def().
Definition: struct.h:90
long unsigned int ilft
Used for Ogata-Lin ???
Definition: struct.h:344
long unsigned int * list_2_1
Definition: global.h:49
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
Definition: bitcalc.c:195
void GC_child_general_int_spin_MPIdouble(unsigned long int i_int, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
General interaction term in the Spin model + GC When both site1 and site2 are in the inter process re...
void child_general_int_spin_MPIdouble(unsigned long int i_int, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
Exchange term in Spin model When both site1 and site2 are in the inter process region.
Definition: mltplyMPISpin.c:35
double complex X_child_general_int_spin_TotalS_MPIdouble(int org_isite1, int org_isite3, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
Exchange term in Spin model When both site1 and site2 are in the inter process region.
long unsigned int * list_1
Definition: global.h:47
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...
void GC_child_general_int_GeneralSpin_MPIsingle(unsigned long int i_int, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
General interaction term in the Spin model + GC When both site1 and site2 are in the inter process re...
long unsigned int * list_2_2
Definition: global.h:50
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_general_int_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)
Exchange term in Spin model When both site1 and site2 are in the inter process region.
Definition: mltplyMPISpin.c:61
struct EDMainCalStruct X
Definition: struct.h:432
long unsigned int irght
Used for Ogata-Lin ???
Definition: struct.h:343
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_child_general_int_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)
void child_general_int_spin_MPIsingle(unsigned long int i_int, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
Exchange term in Spin model When only site2 is in the inter process region.
int myrank
Process ID, defined in InitializeMPI()
Definition: global.h:163
double complex * v1buf
Definition: global.h:37
struct CheckList Check
Size of the Hilbert space.
Definition: struct.h:411
void child_general_int_GeneralSpin_MPIsingle(unsigned long int i_int, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
General interaction term in the Spin model + GC When both site1 and site2 are in the inter process re...
void GC_child_general_int_GeneralSpin_MPIdouble(unsigned long int i_int, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
General interaction term in the Spin model + GC When both site1 and site2 are in the inter process re...