HΦ  3.1.0
PairExSpin.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/>. */
16 /*-------------------------------------------------------------*/
17 #include "PairExSpin.h"
18 #include "bitcalc.h"
19 #include "wrapperMPI.h"
20 #include "mltplyMPISpinCore.h"
21 #include "mltplySpinCore.h"
22 #ifdef MPI
23 #include "mfmemory.h"
24 #endif
25 
26 //
36  struct BindStruct *X,
37  double complex *tmp_v0,
38  double complex *tmp_v1
40 ){
41 
42  int iret=0;
43  if (X->Def.iFlgGeneralSpin == FALSE) {
44  iret=GetPairExcitedStateHalfSpinGC(X, tmp_v0, tmp_v1);
45  }
46  else{
47  iret=GetPairExcitedStateGeneralSpinGC(X, tmp_v0, tmp_v1);
48  }
49  return iret;
50 }
51 
52 
53 //
63  struct BindStruct *X,
64  double complex *tmp_v0,
65  double complex *tmp_v1
67 ){
68  long unsigned int i,j;
69  long unsigned int isite1;
70  long unsigned int org_isite1,org_isite2,org_sigma1,org_sigma2;
71  long unsigned int tmp_off=0;
72 
73  double complex tmp_trans=0;
74  long int i_max;
75  int tmp_sgn;
76  i_max = X->Check.idim_maxOrg;
77 
78  for(i=0;i<X->Def.NPairExcitationOperator;i++){
79  org_isite1 = X->Def.PairExcitationOperator[i][0]+1;
80  org_isite2 = X->Def.PairExcitationOperator[i][2]+1;
81  org_sigma1 = X->Def.PairExcitationOperator[i][1];
82  org_sigma2 = X->Def.PairExcitationOperator[i][3];
83  tmp_trans = X->Def.ParaPairExcitationOperator[i];
84  if(org_isite1 == org_isite2){
85  if(org_isite1 > X->Def.Nsite){
86  if(org_sigma1==org_sigma2){ // longitudinal magnetic field
87  if(X->Def.PairExcitationOperator[i][4]==0) {
88  X_GC_child_CisAis_spin_MPIdouble(org_isite1 - 1, org_sigma1, tmp_trans, X, tmp_v0, tmp_v1);
89  }
90  else{
91  X_GC_child_AisCis_spin_MPIdouble(org_isite1 - 1, org_sigma1, -tmp_trans, X, tmp_v0, tmp_v1);
92  }
93  }
94  else{ // transverse magnetic field
95  //fprintf(stdoutMPI, "Debug: test, org_isite1=%d, org_sigma1=%d, orgsima_2=%d\n", org_isite1, org_sigma1, org_sigma2);
96  X_GC_child_CisAit_spin_MPIdouble(org_isite1-1, org_sigma1, org_sigma2, tmp_trans, X, tmp_v0, tmp_v1);
97  }
98  }else{
99  isite1 = X->Def.Tpow[org_isite1-1];
100  if(org_sigma1==org_sigma2) {
101  if (X->Def.PairExcitationOperator[i][4] == 1) {
102  // longitudinal magnetic field
103 #pragma omp parallel for default(none) private(j, tmp_sgn) firstprivate(i_max, isite1, org_sigma1, X,tmp_trans) shared(tmp_v0, tmp_v1)
104  for (j = 1; j <= i_max; j++) {
105  tmp_v0[j] += (1.0-X_SpinGC_CisAis(j, X, isite1, org_sigma1)) * tmp_v1[j] * (-tmp_trans);
106  }
107  }
108  else {
109  // longitudinal magnetic field
110 #pragma omp parallel for default(none) private(j, tmp_sgn) firstprivate(i_max, isite1, org_sigma1, X,tmp_trans) shared(tmp_v0, tmp_v1)
111  for (j = 1; j <= i_max; j++) {
112  tmp_v0[j] += X_SpinGC_CisAis(j, X, isite1, org_sigma1) * tmp_v1[j] * tmp_trans;
113  }
114  }
115  }else{
116  // transverse magnetic field
117  // fprintf(stdoutMPI, "Debug: isite1=%d, org_sigma2=%d\n", isite1, org_sigma2);
118 #pragma omp parallel for default(none) private(j, tmp_sgn, tmp_off) firstprivate(i_max, isite1, org_sigma2, X, tmp_trans) shared(tmp_v0, tmp_v1)
119  for(j=1;j<=i_max;j++){
120  tmp_sgn = X_SpinGC_CisAit(j,X, isite1,org_sigma2,&tmp_off);
121  if(tmp_sgn !=0){
122  tmp_v0[tmp_off+1]+= tmp_sgn*tmp_v1[j]*tmp_trans;
123  }
124  }
125  }
126  }
127  }else{
128  fprintf(stdoutMPI, "ERROR: hopping is not allowed in localized spin system\n");
129  return FALSE;
130  }
131  }
132  return TRUE;
133 }
134 
135 //
145  struct BindStruct *X,
146  double complex *tmp_v0,
147  double complex *tmp_v1
149 ) {
150  long unsigned int i, j;
151  int num1;
152  long unsigned int org_isite1, org_isite2, org_sigma1, org_sigma2;
153  long unsigned int tmp_off = 0;
154 
155  double complex tmp_trans = 0;
156  long int i_max;
157  i_max = X->Check.idim_maxOrg;
158 
159  for(i=0;i<X->Def.NPairExcitationOperator;i++){
160  org_isite1 = X->Def.PairExcitationOperator[i][0]+1;
161  org_isite2 = X->Def.PairExcitationOperator[i][2]+1;
162  org_sigma1 = X->Def.PairExcitationOperator[i][1];
163  org_sigma2 = X->Def.PairExcitationOperator[i][3];
164  tmp_trans = X->Def.ParaPairExcitationOperator[i];
165  if(org_isite1 == org_isite2){
166  if(org_isite1 > X->Def.Nsite){
167  if(org_sigma1==org_sigma2){
168  if(X->Def.PairExcitationOperator[i][4]==0) {
169  // longitudinal magnetic field
170  X_GC_child_CisAis_GeneralSpin_MPIdouble(org_isite1 - 1, org_sigma1, tmp_trans, X, tmp_v0, tmp_v1);
171  }
172  else{
173  X_GC_child_AisCis_GeneralSpin_MPIdouble(org_isite1 - 1, org_sigma1, -tmp_trans, X, tmp_v0, tmp_v1);
174  }
175  }else{
176  // transverse magnetic field
177  X_GC_child_CisAit_GeneralSpin_MPIdouble(org_isite1-1, org_sigma1, org_sigma2, tmp_trans, X, tmp_v0, tmp_v1);
178  }
179  }
180  else{//org_isite1 <= X->Def.Nsite
181  if(org_sigma1==org_sigma2){
182  if(X->Def.PairExcitationOperator[i][4]==0) {
183  // longitudinal magnetic field
184 #pragma omp parallel for default(none) private(j, num1) firstprivate(i_max, org_isite1, org_sigma1, X, tmp_trans) shared(tmp_v0, tmp_v1)
185  for (j = 1; j <= i_max; j++) {
186  num1 = BitCheckGeneral(j - 1, org_isite1, org_sigma1, X->Def.SiteToBit, X->Def.Tpow);
187  tmp_v0[j] += tmp_trans * tmp_v1[j] * num1;
188  }
189  }
190  else{
191  // longitudinal magnetic field
192 #pragma omp parallel for default(none) private(j, num1) firstprivate(i_max, org_isite1, org_sigma1, X, tmp_trans) shared(tmp_v0, tmp_v1)
193  for (j = 1; j <= i_max; j++) {
194  num1 = BitCheckGeneral(j - 1, org_isite1, org_sigma1, X->Def.SiteToBit, X->Def.Tpow);
195  tmp_v0[j] += -tmp_trans * tmp_v1[j] * (1.0-num1);
196  }
197  }
198  }else{
199  // transverse magnetic field
200 #pragma omp parallel for default(none) private(j, num1) firstprivate(i_max, org_isite1, org_sigma1, org_sigma2, X,tmp_off, tmp_trans) shared(tmp_v0, tmp_v1)
201  for(j=1;j<=i_max;j++){
202  num1 = GetOffCompGeneralSpin(j-1, org_isite1, org_sigma2, org_sigma1, &tmp_off, X->Def.SiteToBit, X->Def.Tpow);
203  if(num1 !=0){
204  tmp_v0[tmp_off+1] += tmp_trans*tmp_v1[j]*num1;
205  }
206  }
207  }
208  }
209  }else{
210  fprintf(stdoutMPI, "ERROR: hopping is not allowed in localized spin system\n");
211  return FALSE;
212  }
213  }
214  return TRUE;
215 }
216 
217 //
227  struct BindStruct *X,
228  double complex *tmp_v0,
229  double complex *tmp_v1
231 ){
232  int iret=0;
233  if (X->Def.iFlgGeneralSpin == FALSE) {
234  iret=GetPairExcitedStateHalfSpin(X, tmp_v0, tmp_v1);
235  }
236  else{
237  iret=GetPairExcitedStateGeneralSpin(X, tmp_v0, tmp_v1);
238  }
239  return iret;
240 }
241 
242 //
252  struct BindStruct *X,
253  double complex *tmp_v0,
254  double complex *tmp_v1
256 )
257 {
258  long unsigned int i,j, idim_maxMPI;
259  long unsigned int isite1;
260  long unsigned int org_isite1,org_isite2,org_sigma1,org_sigma2;
261  long unsigned int tmp_off=0;
262 
263  double complex tmp_trans=0;
264  long int i_max;
265  int num1;
266  long int ibit1;
267  long unsigned int is1_up;
268 
269  i_max = X->Check.idim_maxOrg;
270 
271  double complex *tmp_v1bufOrg;
272  //set size
273 #ifdef MPI
274  idim_maxMPI = MaxMPI_li(X->Check.idim_maxOrg);
275  c_malloc1(tmp_v1bufOrg, idim_maxMPI + 1);
276 #endif // MPI
277 
278  for (i = 0; i < X->Def.NPairExcitationOperator; i++) {
279  org_isite1 = X->Def.PairExcitationOperator[i][0] + 1;
280  org_isite2 = X->Def.PairExcitationOperator[i][2] + 1;
281  org_sigma1 = X->Def.PairExcitationOperator[i][1];
282  org_sigma2 = X->Def.PairExcitationOperator[i][3];
283  tmp_trans = X->Def.ParaPairExcitationOperator[i];
284  if (org_sigma1 == org_sigma2) {
285  if (org_isite1 == org_isite2) {
286  if (org_isite1 > X->Def.Nsite) {
287  is1_up = X->Def.Tpow[org_isite1 - 1];
288  ibit1 = X_SpinGC_CisAis((unsigned long int) myrank + 1, X, is1_up, org_sigma1);
289  if (X->Def.PairExcitationOperator[i][4] == 0) {
290  if (ibit1 != 0) {
291 #pragma omp parallel for default(none) shared(tmp_v0, tmp_v1) \
292  firstprivate(i_max, tmp_trans) private(j)
293  for (j = 1; j <= i_max; j++) tmp_v0[j] += tmp_trans * tmp_v1[j];
294  }
295  } else {
296  if (ibit1 == 0) {
297 #pragma omp parallel for default(none) shared(tmp_v0, tmp_v1) \
298  firstprivate(i_max, tmp_trans) private(j)
299  for (j = 1; j <= i_max; j++) tmp_v0[j] += tmp_trans * tmp_v1[j];
300  }
301  }
302  }// org_isite1 > X->Def.Nsite
303  else {
304  isite1 = X->Def.Tpow[org_isite1 - 1];
305  if (org_isite1 == org_isite2 && org_sigma1 == org_sigma2 &&
306  X->Def.PairExcitationOperator[i][4] == 1) {
307 #pragma omp parallel for default(none) private(j) firstprivate(i_max, isite1, org_sigma1, X, tmp_trans) shared(tmp_v0, tmp_v1)
308  for (j = 1; j <= i_max; j++) {
309  tmp_v0[j] += (1.0 - X_Spin_CisAis(j, X, isite1, org_sigma1)) * tmp_v1[j] * (-tmp_trans);
310  }
311  } else {
312 #pragma omp parallel for default(none) private(j) firstprivate(i_max, isite1, org_sigma1, X, tmp_trans) shared(tmp_v0, tmp_v1)
313  for (j = 1; j <= i_max; j++) {
314  tmp_v0[j] += X_Spin_CisAis(j, X, isite1, org_sigma1) * tmp_v1[j] * tmp_trans;
315  }
316  }
317  }
318  } else {
319  fprintf(stdoutMPI, "Error: isite1 must be equal to isite2 for Spin system. \n");
320  return FALSE;
321  }
322  } else { //org_sigma1 != org_sigma2 // for the canonical case
323  if (org_isite1 > X->Def.Nsite) {//For MPI
324  X_child_CisAit_spin_MPIdouble(org_isite1-1, org_sigma2, tmp_trans, X, tmp_v0, tmp_v1, tmp_v1bufOrg, i_max, X->Def.Tpow,list_1_org, list_1buf_org, list_2_1, list_2_2, X->Large.irght, X->Large.ilft,X->Large.ihfbit);
325 
326  } else {
327  isite1 = X->Def.Tpow[org_isite1 - 1];
328 #pragma omp parallel for default(none) private(j, tmp_off, num1) \
329  firstprivate(i_max, isite1, org_sigma2, X, tmp_trans, list_1_org, list_1, list_2_1, list_2_2) shared(tmp_v0, tmp_v1)
330  for (j = 1; j <= i_max; j++) {
331  num1=X_Spin_CisAit(j, X, isite1, org_sigma2, list_1_org, list_2_1, list_2_2, &tmp_off);
332  if (num1 != 0) tmp_v0[tmp_off] += tmp_v1[j] * tmp_trans*(double)num1;
333  }
334  }
335  }
336  }
337  return TRUE;
338 }
339 
340 
341 //
351  struct BindStruct *X,
352  double complex *tmp_v0,
353  double complex *tmp_v1
355 )
356 {
357  long unsigned int i,j, idim_maxMPI;
358  long unsigned int org_isite1,org_isite2,org_sigma1,org_sigma2;
359  long unsigned int tmp_off=0;
360  long unsigned int off=0;
361 
362  double complex tmp_trans=0;
363  long int i_max;
364  int tmp_sgn, num1;
365  i_max = X->Check.idim_maxOrg;
366 
367  double complex *tmp_v1bufOrg;
368  //set size
369 #ifdef MPI
370  idim_maxMPI = MaxMPI_li(X->Check.idim_maxOrg);
371  c_malloc1(tmp_v1bufOrg, idim_maxMPI + 1);
372 #endif // MPI
373 
374  for(i=0;i<X->Def.NPairExcitationOperator;i++){
375  org_isite1 = X->Def.PairExcitationOperator[i][0]+1;
376  org_isite2 = X->Def.PairExcitationOperator[i][2]+1;
377  org_sigma1 = X->Def.PairExcitationOperator[i][1];
378  org_sigma2 = X->Def.PairExcitationOperator[i][3];
379  tmp_trans = X->Def.ParaPairExcitationOperator[i];
380  if(org_isite1 == org_isite2){
381  if(org_isite1 >X->Def.Nsite){
382  if(org_sigma1==org_sigma2){
383  // longitudinal magnetic field
384  num1 = BitCheckGeneral((unsigned long int)myrank,
385  org_isite1, org_sigma1, X->Def.SiteToBit, X->Def.Tpow);
386  if(X->Def.PairExcitationOperator[i][4]==0) {
387  if (num1 != 0) {
388 #pragma omp parallel for default(none) private(j) firstprivate(i_max, tmp_trans) shared(tmp_v0,tmp_v1)
389  for (j = 1; j <= i_max; j++) {
390  tmp_v0[j] += tmp_trans * tmp_v1[j];
391  }
392  }
393  }
394  else {
395  if (num1 == 0) {
396 #pragma omp parallel for default(none) private(j) firstprivate(i_max, tmp_trans) shared(tmp_v0,tmp_v1)
397  for (j = 1; j <= i_max; j++) {
398  tmp_v0[j] += -tmp_trans * tmp_v1[j];
399  }
400  }
401  }
402  }//org_sigma1=org_sigma2
403  else{//org_sigma1 != org_sigma2
404  X_child_CisAit_GeneralSpin_MPIdouble(org_isite1-1, org_sigma1, org_sigma2, tmp_trans, X, tmp_v0, tmp_v1, tmp_v1bufOrg, i_max, list_1_org, list_1buf_org, X->Large.ihfbit);
405  }
406  }
407  else {//org_isite1 <= X->Def.Nsite
408  if(org_sigma1==org_sigma2) {
409  // longitudinal magnetic field
410  if (X->Def.PairExcitationOperator[i][4] == 0) {
411 #pragma omp parallel for default(none) private(j, num1) firstprivate(i_max, org_isite1, org_sigma1, X, tmp_trans) shared(tmp_v0,tmp_v1, list_1)
412  for (j = 1; j <= i_max; j++) {
413  num1 = BitCheckGeneral(list_1[j], org_isite1, org_sigma1, X->Def.SiteToBit, X->Def.Tpow);
414  tmp_v0[j] += tmp_trans * tmp_v1[j] * num1;
415  }
416  }else {
417 #pragma omp parallel for default(none) private(j, num1) firstprivate(i_max, org_isite1, org_sigma1, X, tmp_trans) shared(tmp_v0,tmp_v1, list_1)
418  for (j = 1; j <= i_max; j++) {
419  num1 = BitCheckGeneral(list_1[j], org_isite1, org_sigma1, X->Def.SiteToBit, X->Def.Tpow);
420  tmp_v0[j] += -tmp_trans * tmp_v1[j] * (1.0 - num1);
421  }
422  }
423  }//org_sigma1=org_sigma2
424  else{//org_sigma1 != org_sigma2
425 #pragma omp parallel for default(none) private(j, tmp_sgn,tmp_off) \
426  firstprivate(i_max, org_isite1, org_sigma1, org_sigma2, X, off, tmp_trans, myrank) \
427  shared(tmp_v0, tmp_v1, list_1_org, list_1)
428  for (j = 1; j <= i_max; j++) {
429  tmp_sgn = GetOffCompGeneralSpin(list_1_org[j], org_isite1, org_sigma2, org_sigma1, &off, X->Def.SiteToBit, X->Def.Tpow);
430  if(tmp_sgn !=FALSE){
431  ConvertToList1GeneralSpin(off, X->Large.ihfbit, &tmp_off);
432 #ifdef _DEBUG
433  printf("rank=%d, org=%ld, tmp_off=%ld, list_1=%ld, ihfbit=%ld\n",myrank, list_1_org[j], off, list_1[tmp_off], X->Large.ihfbit);
434 #endif
435  tmp_v0[tmp_off] += tmp_v1[j]*tmp_trans;
436  }
437  }
438 
439  }
440  }
441  }else{
442  fprintf(stdoutMPI, "ERROR: hopping is not allowed in localized spin system\n");
443  return FALSE;
444  }//org_isite1 != org_isite2
445  }
446 
447  return TRUE;
448 }
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.
int GetPairExcitedStateHalfSpinGC(struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
Definition: PairExSpin.c:62
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.
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.
int ConvertToList1GeneralSpin(const long unsigned int org_ibit, const long unsigned int ihlfbit, long unsigned int *_ilist1Comp)
function of converting component to list_1
Definition: bitcalc.c:285
int X_Spin_CisAis(long unsigned int j, struct BindStruct *X, long unsigned int is1_spin, long unsigned int sigma1)
Compute the spin state with bit mask is1_spin.
int GetPairExcitedStateSpinGC(struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
Calculation of pair excited state for Spin Grand canonical system.
Definition: PairExSpin.c:35
#define TRUE
Definition: global.h:26
long unsigned int * list_1buf_org
Definition: global.h:54
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 ...
Bind.
Definition: struct.h:408
int GetPairExcitedStateSpin(struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
Definition: PairExSpin.c:226
long unsigned int * list_1_org
Definition: global.h:53
unsigned long int MaxMPI_li(unsigned long int idim)
MPI wrapper function to obtain maximum unsigned long integer across processes.
Definition: wrapperMPI.c:171
long unsigned int * list_2_1
Definition: global.h:49
int X_Spin_CisAit(long unsigned int j, struct BindStruct *X, long unsigned int is1_spin, long unsigned int sigma2, long unsigned int *list_1_Org_, long unsigned int *list_2_1_, long unsigned int *list_2_2_, long unsigned int *tmp_off)
Compute index of final wavefunction by term.
#define FALSE
Definition: global.h:25
long unsigned int * list_1
Definition: global.h:47
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...
long unsigned int * list_2_2
Definition: global.h:50
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
Definition: bitcalc.c:393
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.
int GetPairExcitedStateGeneralSpin(struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
Definition: PairExSpin.c:350
int GetPairExcitedStateHalfSpin(struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
Definition: PairExSpin.c:251
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...
struct EDMainCalStruct X
Definition: struct.h:431
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
Definition: bitcalc.c:243
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()
Definition: global.h:162
int GetPairExcitedStateGeneralSpinGC(struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
Definition: PairExSpin.c:144
FILE * stdoutMPI
File pointer to the standard output defined in InitializeMPI()
Definition: global.h:164