HPhi++  3.1.0
mltplyHubbard.cpp File Reference

Function for Hubbard Hamitonian. More...

#include <bitcalc.hpp>
#include "mltplyCommon.hpp"
#include "mltplyHubbard.hpp"
#include "mltplyMPIHubbard.hpp"
#include "CalcTime.hpp"
#include "mltplyHubbardCore.hpp"
#include "mltplyMPIHubbardCore.hpp"

Go to the source code of this file.

Functions

int mltplyHubbard (struct BindStruct *X, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1)
 perform Hamiltonian vector product for (extended) Hubbard type model. \({\bf v}_0 = {\hat H}{\bf v}_1\) More...
 
int mltplyHubbardGC (struct BindStruct *X, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1)
 perform Hamiltonian vector product for (extended) Hubbard type model (Grandcanonical). \({\bf v}_0 = {\hat H}{\bf v}_1\) More...
 
void child_pairhopp (int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1, struct BindStruct *X)
 Compute pairhopp term (canonical) More...
 
void child_exchange (int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1, struct BindStruct *X)
 Compute Exchange term (canonical) in single process. More...
 
void child_general_hopp (int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1, struct BindStruct *X, std::complex< double > trans)
 Compute hopping (canonical) More...
 
void GC_child_general_hopp (int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1, struct BindStruct *X, std::complex< double > trans)
 Commpute hopping term (grandcanonical) More...
 
void child_general_int (int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1, struct BindStruct *X)
 Compute inter-all term (canonical) More...
 
void GC_child_general_int (int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1, struct BindStruct *X)
 Compute inter-all term (canonical) More...
 
void GC_child_pairhopp (int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1, struct BindStruct *X)
 Compute pairhopp term (grandcanonical) More...
 
void GC_child_exchange (int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1, struct BindStruct *X)
 Compute Exchange term (grandcanonical) in single process. More...
 

Detailed Description

Function for Hubbard Hamitonian.

Canonical Canonical Grand Canonical Grand Canonical
Intra Process Inter Process Intra Process Inter Process
\(c_{i s}^\dagger\) ::Cis, X_Cis ::Cis_MPI, X_Cis_MPI GC_Cis, ::X_GC_Cis ::GC_Cis_MPI, X_GC_Cis_MPI
\(c_{j t}\) ::Ajt, X_Ajt ::Ajt_MPI, X_Ajt_MPI GC_Ajt, ::X_GC_Ajt ::GC_Ajt_MPI, X_GC_Ajt_MPI
\(c_{i s}^\dagger c_{i s}\) ::CisAis, X_CisAis ::child_CisAis_Hubbard_MPI, X_child_CisAis_Hubbard_MPI GC_CisAis, X_CisAis ::GC_child_CisAis_Hubbard_MPI, X_GC_child_CisAis_Hubbard_MPI
\(c_{i s}^\dagger c_{j t}\) CisAjt, X_CisAjt ::child_CisAjt_MPIsingle, ::child_CisAjt_MPIdouble, X_child_CisAjt_MPIsingle, X_child_CisAjt_MPIdouble GC_CisAjt, X_GC_CisAjt ::GC_child_CisAjt_Hubbard_MPI, X_GC_child_CisAjt_Hubbard_MPI
\(c_{i s}^\dagger c_{i s} c_{i s}^\dagger c_{i s}\) child_CisAisCisAis_element ::X_child_CisAisCisAis_Hubbard_MPI GC_child_CisAisCisAis_element ::X_GC_child_CisAisCisAis_Hubbard_MPI
\(c_{i s}^\dagger c_{i s} c_{j t}^\dagger c_{j t}\) ::child_CisAisCjtAjt_element X_child_CisAisCjtAjt_Hubbard_MPI ::GC_child_CisAisCjtAjt_element X_GC_child_CisAisCjtAjt_Hubbard_MPI
\(c_{i s}^\dagger c_{i s} c_{j t}^\dagger c_{k u}\) child_CisAisCjtAku_element X_child_CisAisCjtAku_Hubbard_MPI GC_child_CisAisCjtAku_element X_GC_child_CisAisCjtAku_Hubbard_MPI
\(c_{i s}^\dagger c_{j t} c_{k u}^\dagger c_{k u}\) child_CisAjtCkuAku_element X_child_CisAjtCkuAku_Hubbard_MPI GC_child_CisAjtCkuAku_element X_GC_child_CisAjtCkuAku_Hubbard_MPI
\(c_{i s}^\dagger c_{j t} c_{k u}^\dagger c_{l v}\) child_CisAjtCkuAlv_element X_child_CisAjtCkuAlv_Hubbard_MPI GC_child_CisAjtCkuAlv_element X_GC_child_CisAjtCkuAlv_Hubbard_MPI

Other

Get info Canonical Grandcanonical
Exchange child_exchange_GetInfo child_exchange, child_exchange_element GC_child_exchange, GC_child_exchange_element
Pair hop child_pairhopp_GetInfo child_pairhopp, child_pairhopp_element GC_child_pairhopp, GC_child_pairhopp_element
General int. child_general_int_GetInfo child_general_int GC_child_general_int
General hop child_general_hopp_GetInfo child_general_hopp, child_general_hopp_MPIsingle, child_general_hopp_MPIdouble GC_child_general_hopp, GC_child_general_hopp_MPIsingle, GC_child_general_hopp_MPIdouble

Definition in file mltplyHubbard.cpp.

Function Documentation

◆ child_exchange()

void child_exchange ( int  nstate,
std::complex< double > **  tmp_v0,
std::complex< double > **  tmp_v1,
struct BindStruct X 
)

Compute Exchange term (canonical) in single process.

Author
Takahiro Misawa (The University of Tokyo)
Kazuyoshi Yoshimi (The University of Tokyo)
Parameters
[in,out]tmp_v0Result vector
[in]tmp_v1Input producted vector
[in,out]X

Definition at line 543 of file mltplyHubbard.cpp.

References child_exchange_element(), LargeList::i_max, and BindStruct::Large.

Referenced by mltplyHubbard().

547  {
548  long int j;
549  long int i_max = X->Large.i_max;
550  long int off = 0;
551 
552 #pragma omp parallel for default(none) \
553  firstprivate(i_max, X,off) private(j) shared(tmp_v0, tmp_v1,nstate)
554  for (j = 1; j <= i_max; j++)
555  child_exchange_element(j, nstate, tmp_v0, tmp_v1, X, &off);
556  return;
557 }/*std::complex<double> child_exchange*/
void child_exchange_element(long int j, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1, struct BindStruct *X, long int *tmp_off)
Compute exchange term of canonical-Hubbard.
struct LargeList Large
Variables for Matrix-Vector product.
Definition: struct.hpp:397
long int i_max
Length of eigenvector.
Definition: struct.hpp:318

◆ child_general_hopp()

void child_general_hopp ( int  nstate,
std::complex< double > **  tmp_v0,
std::complex< double > **  tmp_v1,
struct BindStruct X,
std::complex< double >  trans 
)

Compute hopping (canonical)

Author
Takahiro Misawa (The University of Tokyo)
Kazuyoshi Yoshimi (The University of Tokyo)
Parameters
[in,out]tmp_v0Result vector
[in]tmp_v1Input producted vector
[in,out]X
[in]transHopping integral

Definition at line 563 of file mltplyHubbard.cpp.

References LargeList::A_spin, CisAjt(), LargeList::i_max, LargeList::is1_spin, LargeList::is2_spin, LargeList::isA_spin, and BindStruct::Large.

Referenced by expec_cisajs_Hubbard(), GetPairExcitedStateHubbard(), and mltplyHubbard().

569  {
570  long int j, isite1, isite2, Asum, Adiff;
571  long int i_max = X->Large.i_max;
572 
573  isite1 = X->Large.is1_spin;
574  isite2 = X->Large.is2_spin;
575  Asum = X->Large.isA_spin;
576  Adiff = X->Large.A_spin;
577 #pragma omp parallel for default(none) private(j) shared(tmp_v0, tmp_v1,nstate) \
578 firstprivate(i_max,X,Asum,Adiff,isite1,isite2,trans)
579  for (j = 1; j <= i_max; j++)
580  CisAjt(j, nstate, tmp_v0, tmp_v1, X, isite1, isite2, Asum, Adiff, trans);
581  return;
582 }/*std::complex<double> child_general_hopp*/
long int is2_spin
Mask used in the bit oeration.
Definition: struct.hpp:334
struct LargeList Large
Variables for Matrix-Vector product.
Definition: struct.hpp:397
long int A_spin
Mask used in the bit oeration.
Definition: struct.hpp:342
long int i_max
Length of eigenvector.
Definition: struct.hpp:318
long int is1_spin
Mask used in the bit oeration.
Definition: struct.hpp:333
long int isA_spin
Mask used in the bit oeration.
Definition: struct.hpp:347
void CisAjt(long int j, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1, struct BindStruct *X, long int is1_spin, long int is2_spin, long int sum_spin, long int diff_spin, std::complex< double > tmp_V)
term for canonical Hubbard

◆ child_general_int()

void child_general_int ( int  nstate,
std::complex< double > **  tmp_v0,
std::complex< double > **  tmp_v1,
struct BindStruct X 
)

Compute inter-all term (canonical)

Author
Takahiro Misawa (The University of Tokyo)
Kazuyoshi Yoshimi (The University of Tokyo)
Parameters
[in,out]tmp_v0Result vector
[in]tmp_v1Input producted vector
[in,out]X

Definition at line 622 of file mltplyHubbard.cpp.

References LargeList::A_spin, LargeList::B_spin, child_CisAisCisAis_element(), child_CisAisCjtAku_element(), child_CisAjtCkuAku_element(), child_CisAjtCkuAlv_element(), LargeList::i_max, LargeList::is1_spin, LargeList::is2_spin, LargeList::is3_spin, LargeList::is4_spin, LargeList::isA_spin, LargeList::isB_spin, BindStruct::Large, and LargeList::tmp_V.

Referenced by mltplyHubbard().

626  {
627  std::complex<double> tmp_V;
628  long int j, i_max;
629  long int isite1, isite2, isite3, isite4;
630  long int Asum, Bsum, Adiff, Bdiff;
631  long int tmp_off = 0;
632  long int tmp_off_2 = 0;
633 
634  //note: this site is labeled for not only site but site with spin.
635  i_max = X->Large.i_max;
636  isite1 = X->Large.is1_spin;
637  isite2 = X->Large.is2_spin;
638  Asum = X->Large.isA_spin;
639  Adiff = X->Large.A_spin;
640 
641  isite3 = X->Large.is3_spin;
642  isite4 = X->Large.is4_spin;
643  Bsum = X->Large.isB_spin;
644  Bdiff = X->Large.B_spin;
645 
646  tmp_V = X->Large.tmp_V;
647 
648 #pragma omp parallel default(none) \
649 private(j, tmp_off, tmp_off_2) \
650 firstprivate(i_max, X, isite1, isite2, isite3, isite4, Asum, Bsum, Adiff, Bdiff, tmp_V) \
651  shared(tmp_v0, tmp_v1,nstate)
652  {
653  if (isite1 == isite2 && isite3 == isite4) {
654 #pragma omp for
655  for (j = 1; j <= i_max; j++)
656  child_CisAisCisAis_element(j, isite1, isite3, tmp_V, nstate, tmp_v0, tmp_v1);
657  }/*if (isite1 == isite2 && isite3 == isite4)*/
658  else if (isite1 == isite2 && isite3 != isite4) {
659 #pragma omp for
660  for (j = 1; j <= i_max; j++)
662  j, isite1, isite3, isite4, Bsum, Bdiff, tmp_V, nstate, tmp_v0, tmp_v1, X, &tmp_off);
663  }/*if (isite1 == isite2 && isite3 != isite4)*/
664  else if (isite1 != isite2 && isite3 == isite4) {
665 #pragma omp for
666  for (j = 1; j <= i_max; j++)
667  child_CisAjtCkuAku_element(j, isite1, isite2, isite3, Asum, Adiff, tmp_V, nstate, tmp_v0, tmp_v1, X, &tmp_off);
668  }/*if (isite1 != isite2 && isite3 == isite4)*/
669  else if (isite1 != isite2 && isite3 != isite4) {
670 #pragma omp for
671  for (j = 1; j <= i_max; j++)
673  j, isite1, isite2, isite3, isite4, Asum, Adiff, Bsum, Bdiff, tmp_V, nstate, tmp_v0, tmp_v1, X, &tmp_off_2);
674  }/*if (isite1 != isite2 && isite3 != isite4)*/
675  }/*End of parallel region*/
676  return;
677 }/*std::complex<double> child_general_int*/
void child_CisAjtCkuAku_element(long int j, long int isite1, long int isite2, long int isite3, long int Asum, long int Adiff, std::complex< double > tmp_V, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1, struct BindStruct *X, long int *tmp_off)
Compute term of canonical Hubbard system.
long int is2_spin
Mask used in the bit oeration.
Definition: struct.hpp:334
struct LargeList Large
Variables for Matrix-Vector product.
Definition: struct.hpp:397
long int is4_spin
Mask used in the bit oeration.
Definition: struct.hpp:336
long int A_spin
Mask used in the bit oeration.
Definition: struct.hpp:342
long int B_spin
Mask used in the bit oeration.
Definition: struct.hpp:343
void child_CisAisCjtAku_element(long int j, long int isite1, long int isite3, long int isite4, long int Bsum, long int Bdiff, std::complex< double > tmp_V, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1, struct BindStruct *X, long int *tmp_off)
Compute term of canonical Hubbard system.
long int i_max
Length of eigenvector.
Definition: struct.hpp:318
void child_CisAjtCkuAlv_element(long int j, long int isite1, long int isite2, long int isite3, long int isite4, long int Asum, long int Adiff, long int Bsum, long int Bdiff, std::complex< double > tmp_V, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1, struct BindStruct *X, long int *tmp_off_2)
Compute term of canonical Hubbard system.
void child_CisAisCisAis_element(long int j, long int isite1, long int isite3, std::complex< double > tmp_V, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1)
Compute term of canonical Hubbard system.
long int is3_spin
Mask used in the bit oeration.
Definition: struct.hpp:335
long int is1_spin
Mask used in the bit oeration.
Definition: struct.hpp:333
long int isA_spin
Mask used in the bit oeration.
Definition: struct.hpp:347
long int isB_spin
Mask used in the bit oeration.
Definition: struct.hpp:348
std::complex< double > tmp_V
Coupling constant.
Definition: struct.hpp:349

◆ child_pairhopp()

void child_pairhopp ( int  nstate,
std::complex< double > **  tmp_v0,
std::complex< double > **  tmp_v1,
struct BindStruct X 
)

Compute pairhopp term (canonical)

Author
Takahiro Misawa (The University of Tokyo)
Kazuyoshi Yoshimi (The University of Tokyo)
Parameters
[in,out]tmp_v0Result vector
[in]tmp_v1Input producted vector
[in,out]X

Definition at line 523 of file mltplyHubbard.cpp.

References child_pairhopp_element(), LargeList::i_max, and BindStruct::Large.

Referenced by mltplyHubbard().

527  {
528  long int j;
529  long int i_max = X->Large.i_max;
530  long int off = 0;
531 
532 #pragma omp parallel for default(none) \
533  firstprivate(i_max, X,off) private(j) shared(tmp_v0, tmp_v1,nstate)
534  for (j = 1; j <= i_max; j++)
535  child_pairhopp_element(j, nstate, tmp_v0, tmp_v1, X, &off);
536  return;
537 }/*std::complex<double> child_pairhopp*/
struct LargeList Large
Variables for Matrix-Vector product.
Definition: struct.hpp:397
long int i_max
Length of eigenvector.
Definition: struct.hpp:318
void child_pairhopp_element(long int j, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1, struct BindStruct *X, long int *tmp_off)
Compute pairhopp term of canonical Hubbard system.

◆ GC_child_exchange()

void GC_child_exchange ( int  nstate,
std::complex< double > **  tmp_v0,
std::complex< double > **  tmp_v1,
struct BindStruct X 
)

Compute Exchange term (grandcanonical) in single process.

Author
Takahiro Misawa (The University of Tokyo)
Kazuyoshi Yoshimi (The University of Tokyo)

Definition at line 764 of file mltplyHubbard.cpp.

References GC_child_exchange_element(), LargeList::i_max, and BindStruct::Large.

Referenced by mltplyHubbardGC().

768  {
769  long int j;
770  long int i_max = X->Large.i_max;
771  long int off = 0;
772 
773 #pragma omp parallel for default(none) \
774  firstprivate(i_max, X,off) private(j) shared(tmp_v0, tmp_v1,nstate)
775  for (j = 1; j <= i_max; j++)
776  GC_child_exchange_element(j, nstate, tmp_v0, tmp_v1, X, &off);
777  return;
778 }/*std::complex<double> GC_child_exchange*/
void GC_child_exchange_element(long int j, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1, struct BindStruct *X, long int *tmp_off)
Compute exchange term of grandcanonical Hubbard system.
struct LargeList Large
Variables for Matrix-Vector product.
Definition: struct.hpp:397
long int i_max
Length of eigenvector.
Definition: struct.hpp:318

◆ GC_child_general_hopp()

void GC_child_general_hopp ( int  nstate,
std::complex< double > **  tmp_v0,
std::complex< double > **  tmp_v1,
struct BindStruct X,
std::complex< double >  trans 
)

Commpute hopping term (grandcanonical)

Author
Takahiro Misawa (The University of Tokyo)
Kazuyoshi Yoshimi (The University of Tokyo)
Parameters
[in,out]tmp_v0Result vector
[in]tmp_v1Input producted vector
[in,out]X
[in]transHopping integral

Definition at line 588 of file mltplyHubbard.cpp.

References LargeList::A_spin, GC_CisAis(), GC_CisAjt(), LargeList::i_max, LargeList::is1_spin, LargeList::is2_spin, LargeList::isA_spin, and BindStruct::Large.

Referenced by expec_cisajs_HubbardGC(), GetPairExcitedStateHubbardGC(), and mltplyHubbardGC().

593  {
594  long int j, isite1, isite2, Asum, Adiff;
595  long int tmp_off;
596  long int i_max = X->Large.i_max;
597 
598  isite1 = X->Large.is1_spin;
599  isite2 = X->Large.is2_spin;
600  Asum = X->Large.isA_spin;
601  Adiff = X->Large.A_spin;
602 
603  if (isite1 == isite2) {
604 #pragma omp parallel for default(none) \
605  private(j) firstprivate(i_max,X,isite1, trans) shared(tmp_v0, tmp_v1,nstate)
606  for (j = 1; j <= i_max; j++)
607  GC_CisAis(j, nstate, tmp_v0, tmp_v1, isite1, trans);
608  }/*if (isite1 == isite2)*/
609  else {
610 #pragma omp parallel for default(none) private(j,tmp_off) shared(tmp_v0,tmp_v1,nstate) \
611 firstprivate(i_max,X,Asum,Adiff,isite1,isite2,trans)
612  for (j = 1; j <= i_max; j++)
613  GC_CisAjt(j, nstate, tmp_v0, tmp_v1, isite1, isite2, Asum, Adiff, trans, &tmp_off);
614  }
615  return;
616 }/*std::complex<double> GC_child_general_hopp*/
long int is2_spin
Mask used in the bit oeration.
Definition: struct.hpp:334
void GC_CisAjt(long int j, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1, long int is1_spin, long int is2_spin, long int sum_spin, long int diff_spin, std::complex< double > tmp_V, long int *tmp_off)
term for grandcanonical Hubbard
struct LargeList Large
Variables for Matrix-Vector product.
Definition: struct.hpp:397
long int A_spin
Mask used in the bit oeration.
Definition: struct.hpp:342
void GC_CisAis(long int j, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1, long int is1_spin, std::complex< double > tmp_trans)
Operation of (Grandcanonical)
long int i_max
Length of eigenvector.
Definition: struct.hpp:318
long int is1_spin
Mask used in the bit oeration.
Definition: struct.hpp:333
long int isA_spin
Mask used in the bit oeration.
Definition: struct.hpp:347

◆ GC_child_general_int()

void GC_child_general_int ( int  nstate,
std::complex< double > **  tmp_v0,
std::complex< double > **  tmp_v1,
struct BindStruct X 
)

Compute inter-all term (canonical)

Author
Takahiro Misawa (The University of Tokyo)
Kazuyoshi Yoshimi (The University of Tokyo)
Parameters
[in,out]tmp_v0Result vector
[in]tmp_v1Input producted vector
[in,out]X

Definition at line 683 of file mltplyHubbard.cpp.

References LargeList::A_spin, LargeList::B_spin, GC_child_CisAisCisAis_element(), GC_child_CisAisCjtAku_element(), GC_child_CisAjtCkuAku_element(), GC_child_CisAjtCkuAlv_element(), LargeList::i_max, LargeList::is1_spin, LargeList::is2_spin, LargeList::is3_spin, LargeList::is4_spin, LargeList::isA_spin, LargeList::isB_spin, BindStruct::Large, and LargeList::tmp_V.

Referenced by mltplyHubbardGC().

687  {
688  std::complex<double> tmp_V;
689  long int j, i_max;
690  long int isite1, isite2, isite3, isite4;
691  long int Asum, Bsum, Adiff, Bdiff;
692  long int tmp_off = 0;
693  long int tmp_off_2 = 0;
694 
695  i_max = X->Large.i_max;
696  isite1 = X->Large.is1_spin;
697  isite2 = X->Large.is2_spin;
698  Asum = X->Large.isA_spin;
699  Adiff = X->Large.A_spin;
700 
701  isite3 = X->Large.is3_spin;
702  isite4 = X->Large.is4_spin;
703  Bsum = X->Large.isB_spin;
704  Bdiff = X->Large.B_spin;
705 
706  tmp_V = X->Large.tmp_V;
707 
708 #pragma omp parallel default(none) private(j) \
709 firstprivate(i_max, X, isite1, isite2, isite4, isite3, Asum, Bsum, Adiff, Bdiff, tmp_off, tmp_off_2, tmp_V) \
710 shared(tmp_v0, tmp_v1,nstate)
711  {
712  if (isite1 == isite2 && isite3 == isite4) {
713 #pragma omp for
714  for (j = 1; j <= i_max; j++)
715  GC_child_CisAisCisAis_element(j, isite1, isite3, tmp_V, nstate, tmp_v0, tmp_v1);
716  }/*if (isite1 == isite2 && isite3 == isite4)*/
717  else if (isite1 == isite2 && isite3 != isite4) {
718 #pragma omp for
719  for (j = 1; j <= i_max; j++)
720  GC_child_CisAisCjtAku_element(j, isite1, isite3, isite4, Bsum, Bdiff, tmp_V, nstate, tmp_v0, tmp_v1, &tmp_off);
721  }/*if (isite1 == isite2 && isite3 != isite4)*/
722  else if (isite1 != isite2 && isite3 == isite4) {
723 #pragma omp for
724  for (j = 1; j <= i_max; j++)
726  j, isite1, isite2, isite3, Asum, Adiff, tmp_V, nstate, tmp_v0, tmp_v1, &tmp_off);
727  }/*if (isite1 != isite2 && isite3 == isite4)*/
728  else if (isite1 != isite2 && isite3 != isite4) {
729 #pragma omp for
730  for (j = 1; j <= i_max; j++)
732  j, isite1, isite2, isite3, isite4, Asum, Adiff, Bsum, Bdiff, tmp_V,
733  nstate, tmp_v0, tmp_v1, &tmp_off_2);
734  }/*if (isite1 != isite2 && isite3 != isite4)*/
735  }/*End of parallel region*/
736  return;
737 }/*std::complex<double> GC_child_general_int*/
long int is2_spin
Mask used in the bit oeration.
Definition: struct.hpp:334
struct LargeList Large
Variables for Matrix-Vector product.
Definition: struct.hpp:397
void GC_child_CisAisCjtAku_element(long int j, long int isite1, long int isite3, long int isite4, long int Bsum, long int Bdiff, std::complex< double > tmp_V, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1, long int *tmp_off)
Compute term of grandcanonical Hubbard system.
long int is4_spin
Mask used in the bit oeration.
Definition: struct.hpp:336
long int A_spin
Mask used in the bit oeration.
Definition: struct.hpp:342
long int B_spin
Mask used in the bit oeration.
Definition: struct.hpp:343
long int i_max
Length of eigenvector.
Definition: struct.hpp:318
void GC_child_CisAjtCkuAlv_element(long int j, long int isite1, long int isite2, long int isite3, long int isite4, long int Asum, long int Adiff, long int Bsum, long int Bdiff, std::complex< double > tmp_V, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1, long int *tmp_off_2)
Compute term of grandcanonical Hubbard system.
long int is3_spin
Mask used in the bit oeration.
Definition: struct.hpp:335
long int is1_spin
Mask used in the bit oeration.
Definition: struct.hpp:333
long int isA_spin
Mask used in the bit oeration.
Definition: struct.hpp:347
void GC_child_CisAjtCkuAku_element(long int j, long int isite1, long int isite2, long int isite3, long int Asum, long int Adiff, std::complex< double > tmp_V, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1, long int *tmp_off)
Compute term of grandcanonical Hubbard system.
long int isB_spin
Mask used in the bit oeration.
Definition: struct.hpp:348
void GC_child_CisAisCisAis_element(long int j, long int isite1, long int isite3, std::complex< double > tmp_V, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1)
Compute term of grandcanonical Hubbard system.
std::complex< double > tmp_V
Coupling constant.
Definition: struct.hpp:349

◆ GC_child_pairhopp()

void GC_child_pairhopp ( int  nstate,
std::complex< double > **  tmp_v0,
std::complex< double > **  tmp_v1,
struct BindStruct X 
)

Compute pairhopp term (grandcanonical)

Author
Takahiro Misawa (The University of Tokyo)
Kazuyoshi Yoshimi (The University of Tokyo)
Parameters
[in,out]tmp_v0Result vector
[in]tmp_v1Input producted vector
[in,out]X

Definition at line 743 of file mltplyHubbard.cpp.

References GC_child_pairhopp_element(), LargeList::i_max, and BindStruct::Large.

Referenced by mltplyHubbardGC().

747  {
748  long int j;
749  long int i_max = X->Large.i_max;
750  long int off = 0;
751 
752 #pragma omp parallel for default(none) \
753 firstprivate(i_max,X,off) private(j) shared(tmp_v0, tmp_v1,nstate)
754  for (j = 1; j <= i_max; j++)
755  GC_child_pairhopp_element(j, nstate, tmp_v0, tmp_v1, X, &off);
756 
757  return;
758 }/*std::complex<double> GC_child_pairhopp*/
struct LargeList Large
Variables for Matrix-Vector product.
Definition: struct.hpp:397
void GC_child_pairhopp_element(long int j, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1, struct BindStruct *X, long int *tmp_off)
Compute pairhopp term of grandcanonical Hubbard system.
long int i_max
Length of eigenvector.
Definition: struct.hpp:318

◆ mltplyHubbard()

int mltplyHubbard ( struct BindStruct X,
int  nstate,
std::complex< double > **  tmp_v0,
std::complex< double > **  tmp_v1 
)

perform Hamiltonian vector product for (extended) Hubbard type model. \({\bf v}_0 = {\hat H}{\bf v}_1\)

Returns
errorcode. 0 for normal, other error
Author
Kazuyoshi Yoshimi (The University of Tokyo)

Transfer

InterAll

Pair hopping

Exchange

Parameters
[in,out]X
[in,out]tmp_v0Result vector
[in]tmp_v1Input producted vector

Definition at line 150 of file mltplyHubbard.cpp.

References CheckPE(), child_exchange(), child_exchange_GetInfo(), child_general_hopp(), child_general_hopp_GetInfo(), child_general_hopp_MPIdouble(), child_general_hopp_MPIsingle(), child_general_int(), child_general_int_GetInfo(), child_pairhopp(), child_pairhopp_GetInfo(), BindStruct::Def, DefineList::EDGeneralTransfer, DefineList::EDNTransfer, DefineList::EDParaGeneralTransfer, DefineList::ExchangeCoupling, DefineList::InterAll_OffDiagonal, BindStruct::Large, DefineList::NExchangeCoupling, DefineList::NInterAll_OffDiagonal, DefineList::NPairHopping, DefineList::Nsite, DefineList::OrgTpow, DefineList::PairHopping, DefineList::ParaExchangeCoupling, DefineList::ParaInterAll_OffDiagonal, DefineList::ParaPairHopping, StartTimer(), StopTimer(), LargeList::tmp_trans, X_child_CisAisCjtAjt_Hubbard_MPI(), X_child_CisAisCjtAku_Hubbard_MPI(), X_child_CisAjtCkuAku_Hubbard_MPI(), and X_child_CisAjtCkuAlv_Hubbard_MPI().

Referenced by mltply().

154  {
155  long int i;
156  long int isite1, isite2, sigma1, sigma2;
157  long int isite3, isite4, sigma3, sigma4;
158  long int ibitsite1, ibitsite2, ibitsite3, ibitsite4;
159 
160  std::complex<double> tmp_trans;
161  /*[s] For InterAll */
162  std::complex<double> tmp_V;
163  /*[e] For InterAll */
164 
165  int ihermite=0;
166  int idx=0;
167 
168  StartTimer(300);
172  StartTimer(310);
173  for (i = 0; i < X->Def.EDNTransfer; i+=2) {
174  if (X->Def.EDGeneralTransfer[i][0] + 1 > X->Def.Nsite &&
175  X->Def.EDGeneralTransfer[i][2] + 1 > X->Def.Nsite) {
176  StartTimer(311);
177  child_general_hopp_MPIdouble(i, X, nstate, tmp_v0, tmp_v1);
178  StopTimer(311);
179  }
180  else if (X->Def.EDGeneralTransfer[i][2] + 1 > X->Def.Nsite) {
181  StartTimer(312);
182  child_general_hopp_MPIsingle(i, X, nstate, tmp_v0, tmp_v1);
183  StopTimer(312);
184  }
185  else if (X->Def.EDGeneralTransfer[i][0] + 1 > X->Def.Nsite) {
186  StartTimer(312);
187  child_general_hopp_MPIsingle(i + 1, X, nstate, tmp_v0, tmp_v1);
188  StopTimer(312);
189  }
190  else {
191  StartTimer(313);
192  for (ihermite = 0; ihermite<2; ihermite++) {
193  idx = i + ihermite;
194  isite1 = X->Def.EDGeneralTransfer[idx][0] + 1;
195  isite2 = X->Def.EDGeneralTransfer[idx][2] + 1;
196  sigma1 = X->Def.EDGeneralTransfer[idx][1];
197  sigma2 = X->Def.EDGeneralTransfer[idx][3];
198  if (child_general_hopp_GetInfo(X, isite1, isite2, sigma1, sigma2) != 0) {
199  return -1;
200  }
201  tmp_trans = -X->Def.EDParaGeneralTransfer[idx];
202  X->Large.tmp_trans = tmp_trans;
203  child_general_hopp(nstate, tmp_v0, tmp_v1, X, tmp_trans);
204  }
205  StopTimer(313);
206  }
207  }/*for (i = 0; i < X->Def.EDNTransfer; i+=2)*/
208  StopTimer(310);
212  StartTimer(320);
213  for (i = 0; i < X->Def.NInterAll_OffDiagonal; i+=2) {
214 
215  isite1 = X->Def.InterAll_OffDiagonal[i][0] + 1;
216  isite2 = X->Def.InterAll_OffDiagonal[i][2] + 1;
217  isite3 = X->Def.InterAll_OffDiagonal[i][4] + 1;
218  isite4 = X->Def.InterAll_OffDiagonal[i][6] + 1;
219  sigma1 = X->Def.InterAll_OffDiagonal[i][1];
220  sigma2 = X->Def.InterAll_OffDiagonal[i][3];
221  sigma3 = X->Def.InterAll_OffDiagonal[i][5];
222  sigma4 = X->Def.InterAll_OffDiagonal[i][7];
223  tmp_V = X->Def.ParaInterAll_OffDiagonal[i];
224 
225  if (CheckPE(isite1 - 1, X) == TRUE || CheckPE(isite2 - 1, X) == TRUE ||
226  CheckPE(isite3 - 1, X) == TRUE || CheckPE(isite4 - 1, X) == TRUE) {
227  StartTimer(321);
228  ibitsite1 = X->Def.OrgTpow[2*isite1-2+sigma1] ;
229  ibitsite2 = X->Def.OrgTpow[2 * isite2 - 2 + sigma2];
230  ibitsite3 = X->Def.OrgTpow[2 * isite3 - 2 + sigma3];
231  ibitsite4 = X->Def.OrgTpow[2 * isite4 - 2 + sigma4];
232  if (ibitsite1 == ibitsite2 && ibitsite3 == ibitsite4) {
233  X_child_CisAisCjtAjt_Hubbard_MPI(isite1 - 1, sigma1,
234  isite3 - 1, sigma3,
235  tmp_V, X, nstate, tmp_v0, tmp_v1);
236  }
237  else if (ibitsite1 == ibitsite2 && ibitsite3 != ibitsite4) {
238  X_child_CisAisCjtAku_Hubbard_MPI(isite1 - 1, sigma1,
239  isite3 - 1, sigma3, isite4 - 1, sigma4,
240  tmp_V, X, nstate, tmp_v0, tmp_v1);
241  }
242  else if (ibitsite1 != ibitsite2 && ibitsite3 == ibitsite4) {
243  X_child_CisAjtCkuAku_Hubbard_MPI(isite1 - 1, sigma1, isite2 - 1, sigma2,
244  isite3 - 1, sigma3, tmp_V, X, nstate, tmp_v0, tmp_v1);
245  }
246  else if (ibitsite1 != ibitsite2 && ibitsite3 != ibitsite4) {
247  X_child_CisAjtCkuAlv_Hubbard_MPI(isite1 - 1, sigma1, isite2 - 1, sigma2,
248  isite3 - 1, sigma3, isite4 - 1, sigma4, tmp_V, X, nstate, tmp_v0, tmp_v1);
249  }
250  StopTimer(321);
251  }
252  else {
253  StartTimer(322);
254  for (ihermite = 0; ihermite < 2; ihermite++) {
255  idx = i + ihermite;
256  isite1 = X->Def.InterAll_OffDiagonal[idx][0] + 1;
257  isite2 = X->Def.InterAll_OffDiagonal[idx][2] + 1;
258  isite3 = X->Def.InterAll_OffDiagonal[idx][4] + 1;
259  isite4 = X->Def.InterAll_OffDiagonal[idx][6] + 1;
260  sigma1 = X->Def.InterAll_OffDiagonal[idx][1];
261  sigma2 = X->Def.InterAll_OffDiagonal[idx][3];
262  sigma3 = X->Def.InterAll_OffDiagonal[idx][5];
263  sigma4 = X->Def.InterAll_OffDiagonal[idx][7];
264  tmp_V = X->Def.ParaInterAll_OffDiagonal[idx];
265 
266  child_general_int_GetInfo(X, isite1, isite2, isite3, isite4,
267  sigma1, sigma2, sigma3, sigma4, tmp_V);
268 
269  child_general_int(nstate, tmp_v0, tmp_v1, X);
270  }/*for (ihermite = 0; ihermite < 2; ihermite++)*/
271  StopTimer(322);
272  }
273  }/*for (i = 0; i < X->Def.NInterAll_OffDiagonal; i+=2)*/
274  StopTimer(320);
278  StartTimer(330);
279  for (i = 0; i < X->Def.NPairHopping; i +=2) {
280  sigma1=0;
281  sigma2=1;
282 
283  if ( X->Def.PairHopping[i][0] + 1 > X->Def.Nsite
284  || X->Def.PairHopping[i][1] + 1 > X->Def.Nsite)
285  {
286  StartTimer(331);
288  X->Def.PairHopping[i][0], sigma1, X->Def.PairHopping[i][1], sigma1,
289  X->Def.PairHopping[i][0], sigma2, X->Def.PairHopping[i][1], sigma2,
290  X->Def.ParaPairHopping[i], X, nstate, tmp_v0, tmp_v1);
291  StopTimer(331);
292  }
293  else {
294  StartTimer(332);
295  for (ihermite = 0; ihermite<2; ihermite++) {
296  idx = i + ihermite;
297  child_pairhopp_GetInfo(idx, X);
298  child_pairhopp(nstate, tmp_v0, tmp_v1, X);
299  }/*for (ihermite = 0; ihermite<2; ihermite++)*/
300  StopTimer(332);
301  }
302  }/*for (i = 0; i < X->Def.NPairHopping; i += 2)*/
303  StopTimer(330);
307  StartTimer(340);
308  for (i = 0; i < X->Def.NExchangeCoupling; i ++) {
309  sigma1 = 0;
310  sigma2 = 1;
311  if (X->Def.ExchangeCoupling[i][0] + 1 > X->Def.Nsite ||
312  X->Def.ExchangeCoupling[i][1] + 1 > X->Def.Nsite)
313  {
314  StartTimer(341);
316  X->Def.ExchangeCoupling[i][0], sigma1, X->Def.ExchangeCoupling[i][1], sigma1,
317  X->Def.ExchangeCoupling[i][1], sigma2, X->Def.ExchangeCoupling[i][0], sigma2,
318  X->Def.ParaExchangeCoupling[i], X, nstate, tmp_v0, tmp_v1);
319  StopTimer(341);
320  }
321  else {
322  StartTimer(342);
324  child_exchange(nstate, tmp_v0, tmp_v1, X);
325  StopTimer(342);
326  }
327  }/*for (i = 0; i < X->Def.NExchangeCoupling; i ++)*/
328  StopTimer(340);
329 
330  StopTimer(300);
331  return 0;
332 }/*int mltplyHubbard*/
int child_exchange_GetInfo(int iExchange, struct BindStruct *X)
Compute mask for bit operation of exchange term.
struct DefineList Def
Definision of system (Hamiltonian) etc.
Definition: struct.hpp:395
std::complex< double > * EDParaGeneralTransfer
Value of general transfer integrals by a def file. malloc in setmem_def(). Data Format [DefineList::N...
Definition: struct.hpp:116
void child_general_hopp(int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1, struct BindStruct *X, std::complex< double > trans)
Compute hopping (canonical)
long int * OrgTpow
[2 * DefineList::NsiteMPI] malloc in setmem_def().
Definition: struct.hpp:92
int ** ExchangeCoupling
[DefineList::NExchangeCoupling][2] Index of exchange term. malloc in setmem_def().
Definition: struct.hpp:146
void X_child_CisAisCjtAku_Hubbard_MPI(int org_isite1, int org_ispin1, int org_isite3, int org_ispin3, int org_isite4, int org_ispin4, std::complex< double > tmp_V, struct BindStruct *X, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1)
Compute term of canonical Hubbard system.
std::complex< double > tmp_trans
Hopping parameter.
Definition: struct.hpp:323
int Nsite
Number of sites in the INTRA process region.
Definition: struct.hpp:56
struct LargeList Large
Variables for Matrix-Vector product.
Definition: struct.hpp:397
void child_general_int(int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1, struct BindStruct *X)
Compute inter-all term (canonical)
int ** EDGeneralTransfer
Index of transfer integrals for calculation. malloc in setmem_def(). Data Format [DefineList::NTransf...
Definition: struct.hpp:110
void X_child_CisAjtCkuAlv_Hubbard_MPI(int org_isite1, int org_ispin1, int org_isite2, int org_ispin2, int org_isite3, int org_ispin3, int org_isite4, int org_ispin4, std::complex< double > tmp_V, struct BindStruct *X, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1)
Compute term of canonical Hubbard system.
int ** InterAll_OffDiagonal
[DefineList::NinterAll_OffDiagonal][8] Interacted quartet
Definition: struct.hpp:161
void X_child_CisAjtCkuAku_Hubbard_MPI(int org_isite1, int org_ispin1, int org_isite2, int org_ispin2, int org_isite3, int org_ispin3, std::complex< double > tmp_V, struct BindStruct *X, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1)
Compute term of canonical Hubbard system.
int ** PairHopping
[DefineList::NPairHopping][2] Index of pair-hopping. malloc in setmem_def().
Definition: struct.hpp:140
int EDNTransfer
Number of transfer integrals for calculation.
Definition: struct.hpp:105
int child_pairhopp_GetInfo(int iPairHopp, struct BindStruct *X)
Compute mask for bit operation of pairhop term.
double * ParaExchangeCoupling
[DefineList::NExchangeCoupling] Coupling constant of exchange term. malloc in setmem_def().
Definition: struct.hpp:148
void child_general_hopp_MPIsingle(long int itrans, struct BindStruct *X, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1)
Hopping term in Hubbard (Kondo) + Canonical ensemble When only site2 is in the inter process region...
void child_exchange(int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1, struct BindStruct *X)
Compute Exchange term (canonical) in single process.
int NExchangeCoupling
Number of exchange term.
Definition: struct.hpp:145
std::complex< double > * ParaInterAll_OffDiagonal
[DefineList::NInterAll_OffDiagonal] Coupling constant of off-diagonal inter-all term. malloc in setmem_def().
Definition: struct.hpp:170
void StopTimer(int n)
function for calculating elapse time [elapse time=StartTimer-StopTimer]
Definition: time.cpp:83
int NInterAll_OffDiagonal
Number of interall term (off-diagonal)
Definition: struct.hpp:165
double * ParaPairHopping
[DefineList::NPairHopping] Coupling constant of pair-hopping term. malloc in setmem_def().
Definition: struct.hpp:142
int child_general_hopp_GetInfo(struct BindStruct *X, long int isite1, long int isite2, long int sigma1, long int sigma2)
Compute mask for bit operation of hopping term.
int child_general_int_GetInfo(struct BindStruct *X, long int isite1, long int isite2, long int isite3, long int isite4, long int sigma1, long int sigma2, long int sigma3, long int sigma4, std::complex< double > tmp_V)
Compute mask for bit operation of general interaction term.
void child_pairhopp(int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1, struct BindStruct *X)
Compute pairhopp term (canonical)
int NPairHopping
Number of pair-hopping term.
Definition: struct.hpp:139
void X_child_CisAisCjtAjt_Hubbard_MPI(int org_isite1, int org_ispin1, int org_isite3, int org_ispin3, std::complex< double > tmp_V, struct BindStruct *X, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1)
Compute term of canonical Hubbard system.
int CheckPE(int org_isite, struct BindStruct *X)
Check whether this site is in the inter process region or not.
void child_general_hopp_MPIdouble(long int itrans, struct BindStruct *X, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1)
Hopping term in Hubbard (Kondo) + Canonical ensemble When both site1 and site2 are in the inter proce...
void StartTimer(int n)
function for initializing elapse time [start]
Definition: time.cpp:71

◆ mltplyHubbardGC()

int mltplyHubbardGC ( struct BindStruct X,
int  nstate,
std::complex< double > **  tmp_v0,
std::complex< double > **  tmp_v1 
)

perform Hamiltonian vector product for (extended) Hubbard type model (Grandcanonical). \({\bf v}_0 = {\hat H}{\bf v}_1\)

Returns
errorcode. 0 for normal, other error

Transfer

Inter All

Pair hopping

Exchange

Parameters
[in,out]X
[in,out]tmp_v0Result vector
[in]tmp_v1Input producted vector

Definition at line 339 of file mltplyHubbard.cpp.

References CheckPE(), child_exchange_GetInfo(), child_general_hopp_GetInfo(), child_general_int_GetInfo(), child_pairhopp_GetInfo(), BindStruct::Def, DefineList::EDGeneralTransfer, DefineList::EDNTransfer, DefineList::EDParaGeneralTransfer, DefineList::ExchangeCoupling, GC_child_exchange(), GC_child_general_hopp(), GC_child_general_hopp_MPIdouble(), GC_child_general_hopp_MPIsingle(), GC_child_general_int(), GC_child_pairhopp(), DefineList::InterAll_OffDiagonal, DefineList::NExchangeCoupling, DefineList::NInterAll_OffDiagonal, DefineList::NPairHopping, DefineList::Nsite, DefineList::OrgTpow, DefineList::PairHopping, DefineList::ParaExchangeCoupling, DefineList::ParaInterAll_OffDiagonal, DefineList::ParaPairHopping, StartTimer(), StopTimer(), X_GC_child_CisAisCjtAjt_Hubbard_MPI(), X_GC_child_CisAisCjtAku_Hubbard_MPI(), X_GC_child_CisAjtCkuAku_Hubbard_MPI(), and X_GC_child_CisAjtCkuAlv_Hubbard_MPI().

Referenced by mltply().

343  {
344  long int i;
345  long int isite1, isite2, sigma1, sigma2;
346  long int isite3, isite4, sigma3, sigma4;
347  long int ibitsite1, ibitsite2, ibitsite3, ibitsite4;
348 
349  std::complex<double> tmp_trans;
350  /*[s] For InterAll */
351  std::complex<double> tmp_V;
352  /*[e] For InterAll */
353 
354  int ihermite=0;
355  int idx=0;
356 
357  StartTimer(200);
361  StartTimer(210);
362  for (i = 0; i < X->Def.EDNTransfer; i += 2) {
363  if (X->Def.EDGeneralTransfer[i][0] + 1 > X->Def.Nsite &&
364  X->Def.EDGeneralTransfer[i][2] + 1 > X->Def.Nsite) {
365  StartTimer(211);
366  GC_child_general_hopp_MPIdouble(i, X, nstate, tmp_v0, tmp_v1);
367  StopTimer(211);
368  }
369  else if (X->Def.EDGeneralTransfer[i][2] + 1 > X->Def.Nsite){
370  StartTimer(212);
371  GC_child_general_hopp_MPIsingle(i, X, nstate, tmp_v0, tmp_v1);
372  StopTimer(212);
373  }
374  else if (X->Def.EDGeneralTransfer[i][0] + 1 > X->Def.Nsite) {
375  StartTimer(212);
376  GC_child_general_hopp_MPIsingle(i+1, X, nstate, tmp_v0, tmp_v1);
377  StopTimer(212);
378  }
379  else {
380  StartTimer(213);
381  for (ihermite = 0; ihermite<2; ihermite++) {
382  idx = i + ihermite;
383  isite1 = X->Def.EDGeneralTransfer[idx][0] + 1;
384  isite2 = X->Def.EDGeneralTransfer[idx][2] + 1;
385  sigma1 = X->Def.EDGeneralTransfer[idx][1];
386  sigma2 = X->Def.EDGeneralTransfer[idx][3];
387  if (child_general_hopp_GetInfo(X, isite1, isite2, sigma1, sigma2) != 0) {
388  return -1;
389  }
390  tmp_trans = -X->Def.EDParaGeneralTransfer[idx];
391  GC_child_general_hopp(nstate, tmp_v0, tmp_v1, X, tmp_trans);
392  }
393  StopTimer(213);
394  }
395  }/*for (i = 0; i < X->Def.EDNTransfer; i += 2)*/
396  StopTimer(210);
400  StartTimer(220);
401  for (i = 0; i < X->Def.NInterAll_OffDiagonal; i+=2) {
402  isite1 = X->Def.InterAll_OffDiagonal[i][0] + 1;
403  isite2 = X->Def.InterAll_OffDiagonal[i][2] + 1;
404  isite3 = X->Def.InterAll_OffDiagonal[i][4] + 1;
405  isite4 = X->Def.InterAll_OffDiagonal[i][6] + 1;
406  sigma1 = X->Def.InterAll_OffDiagonal[i][1];
407  sigma2 = X->Def.InterAll_OffDiagonal[i][3];
408  sigma3 = X->Def.InterAll_OffDiagonal[i][5];
409  sigma4 = X->Def.InterAll_OffDiagonal[i][7];
410  tmp_V = X->Def.ParaInterAll_OffDiagonal[i];
411 
412  if ( CheckPE(isite1 - 1, X) == TRUE || CheckPE(isite2 - 1, X) == TRUE
413  || CheckPE(isite3 - 1, X) == TRUE || CheckPE(isite4 - 1, X) == TRUE)
414  {
415  StartTimer(221);
416  ibitsite1 = X->Def.OrgTpow[2 * isite1 - 2 + sigma1];
417  ibitsite2 = X->Def.OrgTpow[2 * isite2 - 2 + sigma2];
418  ibitsite3 = X->Def.OrgTpow[2 * isite3 - 2 + sigma3];
419  ibitsite4 = X->Def.OrgTpow[2 * isite4 - 2 + sigma4];
420  if (ibitsite1 == ibitsite2 && ibitsite3 == ibitsite4)
422  isite1 - 1, sigma1, isite3 - 1, sigma3, tmp_V, X, nstate, tmp_v0, tmp_v1);
423  else if (ibitsite1 == ibitsite2 && ibitsite3 != ibitsite4)
425  isite1 - 1, sigma1, isite3 - 1, sigma3, isite4 - 1, sigma4, tmp_V, X, nstate, tmp_v0, tmp_v1);
426  else if (ibitsite1 != ibitsite2 && ibitsite3 == ibitsite4)
428  isite1 - 1, sigma1, isite2 - 1, sigma2, isite3 - 1, sigma3, tmp_V, X, nstate, tmp_v0, tmp_v1);
429  else if (ibitsite1 != ibitsite2 && ibitsite3 != ibitsite4)
431  isite1 - 1, sigma1, isite2 - 1, sigma2, isite3 - 1, sigma3, isite4 - 1, sigma4, tmp_V, X, nstate, tmp_v0, tmp_v1);
432  StopTimer(221);
433  }//InterPE
434  else{
435  StartTimer(222);
436  for(ihermite=0; ihermite<2; ihermite++){
437  idx=i+ihermite;
438  isite1 = X->Def.InterAll_OffDiagonal[idx][0] + 1;
439  isite2 = X->Def.InterAll_OffDiagonal[idx][2] + 1;
440  isite3 = X->Def.InterAll_OffDiagonal[idx][4] + 1;
441  isite4 = X->Def.InterAll_OffDiagonal[idx][6] + 1;
442  sigma1 = X->Def.InterAll_OffDiagonal[idx][1];
443  sigma2 = X->Def.InterAll_OffDiagonal[idx][3];
444  sigma3 = X->Def.InterAll_OffDiagonal[idx][5];
445  sigma4 = X->Def.InterAll_OffDiagonal[idx][7];
446  tmp_V = X->Def.ParaInterAll_OffDiagonal[idx];
447 
448  child_general_int_GetInfo(X, isite1, isite2, isite3, isite4,
449  sigma1, sigma2, sigma3, sigma4, tmp_V);
450  GC_child_general_int(nstate, tmp_v0, tmp_v1, X);
451  }/*for(ihermite=0; ihermite<2; ihermite++)*/
452  StopTimer(222);
453  }
454  }/*for (i = 0; i < X->Def.NInterAll_OffDiagonal; i+=2)*/
455  StopTimer(220);
459  StartTimer(230);
460  for (i = 0; i < X->Def.NPairHopping; i +=2) {
461  sigma1 = 0;
462  sigma2 = 1;
463  if ( X->Def.PairHopping[i][0] + 1 > X->Def.Nsite
464  || X->Def.PairHopping[i][1] + 1 > X->Def.Nsite)
465  {
466  StartTimer(231);
468  X->Def.PairHopping[i][0], sigma1, X->Def.PairHopping[i][1], sigma1,
469  X->Def.PairHopping[i][0], sigma2, X->Def.PairHopping[i][1], sigma2,
470  X->Def.ParaPairHopping[i], X, nstate, tmp_v0, tmp_v1);
471  StopTimer(231);
472  }
473  else {
474  StartTimer(232);
475  for (ihermite = 0; ihermite<2; ihermite++) {
476  idx = i + ihermite;
477  child_pairhopp_GetInfo(idx, X);
478  GC_child_pairhopp(nstate, tmp_v0, tmp_v1, X);
479  }/*for (ihermite = 0; ihermite<2; ihermite++)*/
480  StopTimer(232);
481  }
482  }/*for (i = 0; i < X->Def.NPairHopping; i += 2)*/
483  StopTimer(230);
487  StartTimer(240);
488  for (i = 0; i < X->Def.NExchangeCoupling; i++) {
489  sigma1=0;
490  sigma2=1;
491  if ( X->Def.ExchangeCoupling[i][0] + 1 > X->Def.Nsite
492  || X->Def.ExchangeCoupling[i][1] + 1 > X->Def.Nsite)
493  {
494  StartTimer(241);
496  X->Def.ExchangeCoupling[i][0], sigma1, X->Def.ExchangeCoupling[i][1], sigma1,
497  X->Def.ExchangeCoupling[i][1], sigma2, X->Def.ExchangeCoupling[i][0], sigma2,
498  X->Def.ParaExchangeCoupling[i], X, nstate, tmp_v0, tmp_v1);
499  StopTimer(241);
500  }
501  else {
502  StartTimer(242);
504  GC_child_exchange(nstate, tmp_v0, tmp_v1, X);
505  StopTimer(242);
506  }
507  }/*for (i = 0; i < X->Def.NExchangeCoupling; i++)*/
508  StopTimer(240);
509 
510  StopTimer(200);
511  return 0;
512 }/*int mltplyHubbardGC*/
int child_exchange_GetInfo(int iExchange, struct BindStruct *X)
Compute mask for bit operation of exchange term.
struct DefineList Def
Definision of system (Hamiltonian) etc.
Definition: struct.hpp:395
std::complex< double > * EDParaGeneralTransfer
Value of general transfer integrals by a def file. malloc in setmem_def(). Data Format [DefineList::N...
Definition: struct.hpp:116
void GC_child_general_hopp_MPIsingle(long int itrans, struct BindStruct *X, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1)
Hopping term in Hubbard + GC When only site2 is in the inter process region.
void GC_child_general_hopp_MPIdouble(long int itrans, struct BindStruct *X, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1)
Hopping term in Hubbard + GC When both site1 and site2 are in the inter process region.
long int * OrgTpow
[2 * DefineList::NsiteMPI] malloc in setmem_def().
Definition: struct.hpp:92
int ** ExchangeCoupling
[DefineList::NExchangeCoupling][2] Index of exchange term. malloc in setmem_def().
Definition: struct.hpp:146
int Nsite
Number of sites in the INTRA process region.
Definition: struct.hpp:56
int ** EDGeneralTransfer
Index of transfer integrals for calculation. malloc in setmem_def(). Data Format [DefineList::NTransf...
Definition: struct.hpp:110
void X_GC_child_CisAjtCkuAlv_Hubbard_MPI(int org_isite1, int org_ispin1, int org_isite2, int org_ispin2, int org_isite3, int org_ispin3, int org_isite4, int org_ispin4, std::complex< double > tmp_V, struct BindStruct *X, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1)
Compute term of grandcanonical Hubbard system.
int ** InterAll_OffDiagonal
[DefineList::NinterAll_OffDiagonal][8] Interacted quartet
Definition: struct.hpp:161
int ** PairHopping
[DefineList::NPairHopping][2] Index of pair-hopping. malloc in setmem_def().
Definition: struct.hpp:140
int EDNTransfer
Number of transfer integrals for calculation.
Definition: struct.hpp:105
int child_pairhopp_GetInfo(int iPairHopp, struct BindStruct *X)
Compute mask for bit operation of pairhop term.
double * ParaExchangeCoupling
[DefineList::NExchangeCoupling] Coupling constant of exchange term. malloc in setmem_def().
Definition: struct.hpp:148
void GC_child_general_int(int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1, struct BindStruct *X)
Compute inter-all term (canonical)
void X_GC_child_CisAjtCkuAku_Hubbard_MPI(int org_isite1, int org_ispin1, int org_isite2, int org_ispin2, int org_isite3, int org_ispin3, std::complex< double > tmp_V, struct BindStruct *X, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1)
Compute term of grandcanonical Hubbard system.
void GC_child_pairhopp(int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1, struct BindStruct *X)
Compute pairhopp term (grandcanonical)
int NExchangeCoupling
Number of exchange term.
Definition: struct.hpp:145
std::complex< double > * ParaInterAll_OffDiagonal
[DefineList::NInterAll_OffDiagonal] Coupling constant of off-diagonal inter-all term. malloc in setmem_def().
Definition: struct.hpp:170
void StopTimer(int n)
function for calculating elapse time [elapse time=StartTimer-StopTimer]
Definition: time.cpp:83
int NInterAll_OffDiagonal
Number of interall term (off-diagonal)
Definition: struct.hpp:165
double * ParaPairHopping
[DefineList::NPairHopping] Coupling constant of pair-hopping term. malloc in setmem_def().
Definition: struct.hpp:142
int child_general_hopp_GetInfo(struct BindStruct *X, long int isite1, long int isite2, long int sigma1, long int sigma2)
Compute mask for bit operation of hopping term.
void GC_child_exchange(int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1, struct BindStruct *X)
Compute Exchange term (grandcanonical) in single process.
int child_general_int_GetInfo(struct BindStruct *X, long int isite1, long int isite2, long int isite3, long int isite4, long int sigma1, long int sigma2, long int sigma3, long int sigma4, std::complex< double > tmp_V)
Compute mask for bit operation of general interaction term.
void X_GC_child_CisAisCjtAku_Hubbard_MPI(int org_isite1, int org_ispin1, int org_isite3, int org_ispin3, int org_isite4, int org_ispin4, std::complex< double > tmp_V, struct BindStruct *X, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1)
Compute term of grandcanonical Hubbard system.
int NPairHopping
Number of pair-hopping term.
Definition: struct.hpp:139
int CheckPE(int org_isite, struct BindStruct *X)
Check whether this site is in the inter process region or not.
void GC_child_general_hopp(int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1, struct BindStruct *X, std::complex< double > trans)
Commpute hopping term (grandcanonical)
void StartTimer(int n)
function for initializing elapse time [start]
Definition: time.cpp:71
void X_GC_child_CisAisCjtAjt_Hubbard_MPI(int org_isite1, int org_ispin1, int org_isite3, int org_ispin3, std::complex< double > tmp_V, struct BindStruct *X, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1)
Compute term of grandcanonical Hubbard system.