17 #include "bitcalc.hpp" 18 #include "wrapperMPI.hpp" 19 #include "mltplyCommon.hpp" 20 #include "mltplyHubbard.hpp" 21 #include "mltplyHubbardCore.hpp" 22 #include "mltplyMPIHubbard.hpp" 23 #include "mltplyMPIHubbardCore.hpp" 25 #include "common/setmemory.hpp" 40 std::complex<double> **tmp_v0,
41 std::complex<double> **tmp_v1,
46 long int org_isite1, org_isite2, org_sigma1, org_sigma2;
48 std::complex<double> tmp_trans = 0;
62 if (org_isite1 == org_isite2 && org_sigma1 == org_sigma2) {
64 if (org_sigma1 == 0) {
65 is = X->
Def.
Tpow[2 * org_isite1 - 2];
68 is = X->
Def.
Tpow[2 * org_isite1 - 1];
70 ibit = (
long int)
myrank & is;
73 zaxpy_long(i_max*nstate, -tmp_trans, &tmp_v1[1][0], &tmp_v0[1][0]);
77 if (org_sigma1 == 0) {
78 is = X->
Def.
Tpow[2 * org_isite1 - 2];
81 is = X->
Def.
Tpow[2 * org_isite1 - 1];
83 ibit = (
long int)
myrank & is;
85 zaxpy_long(i_max*nstate, tmp_trans, &tmp_v1[1][0], &tmp_v0[1][0]);
91 -tmp_trans, X, nstate, tmp_v0, tmp_v1);
95 if (org_isite1 < org_isite2) {
97 -tmp_trans, X, nstate, tmp_v0, tmp_v1);
101 -conj(tmp_trans), X, nstate, tmp_v0, tmp_v1);
107 isite1 = X->
Def.
Tpow[2 * org_isite1 - 2 + org_sigma1];
108 #pragma omp parallel for default(none) private(j) \ 109 firstprivate(i_max,X,isite1, tmp_trans) shared(tmp_v0,tmp_v1,nstate) 110 for (j = 1; j <= i_max; j++) {
111 GC_AisCis(j, nstate, tmp_v0, tmp_v1, isite1, -tmp_trans);
135 int nstate, std::complex<double> **tmp_v0,
136 std::complex<double> **tmp_v1,
140 long int irght, ilft, ihfbit;
141 long int org_isite1, org_isite2, org_sigma1, org_sigma2;
142 long int tmp_off = 0;
144 std::complex<double> tmp_trans = 0, dmv;
146 int tmp_sgn, num1, one = 1;
148 long int is, Asum, Adiff;
149 long int ibitsite1, ibitsite2;
168 ibitsite1 = X->
Def.
OrgTpow[2 * org_isite1 - 2 + org_sigma1];
169 ibitsite2 = X->
Def.
OrgTpow[2 * org_isite2 - 2 + org_sigma2];
175 && org_sigma1 != org_sigma2) {
180 -tmp_trans, X, nstate, tmp_v0, tmp_v1);
185 if (org_isite1 < org_isite2) {
187 -tmp_trans, X, nstate, tmp_v0, tmp_v1);
191 -conj(tmp_trans), X, nstate, tmp_v0, tmp_v1);
195 #pragma omp parallel for default(none) shared(tmp_v0,tmp_v1,one,nstate) \ 196 firstprivate(i_max,tmp_trans,Asum,Adiff,ibitsite1,ibitsite2,X,list_1_org,list_1,myrank) \ 197 private(j,tmp_sgn,tmp_off,dmv) 198 for (j = 1; j <= i_max; j++) {
200 dmv = tmp_trans * (std::complex<double>)tmp_sgn;
201 zaxpy_(&nstate, &dmv, tmp_v1[j], &one, tmp_v0[tmp_off], &one);
208 if (org_isite1 == org_isite2 && org_sigma1 == org_sigma2) {
209 is = X->
Def.
Tpow[2 * org_isite1 - 2 + org_sigma1];
210 ibit = (
long int)
myrank & is;
214 #pragma omp parallel for default(none) shared(tmp_v0, tmp_v1,one,dmv,nstate) \ 215 firstprivate(i_max, tmp_trans) private(j) 216 for (j = 1; j <= i_max; j++) {
217 zaxpy_(&nstate, &dmv, tmp_v1[j], &one, tmp_v0[j], &one);
223 zaxpy_long(i_max*nstate, tmp_trans, &tmp_v1[1][0], &tmp_v0[1][0]);
229 -tmp_trans, X, nstate, tmp_v0, tmp_v1);
233 if (org_isite1 < org_isite2) {
235 -tmp_trans, X, nstate, tmp_v0, tmp_v1);
239 -conj(tmp_trans), X, nstate, tmp_v0, tmp_v1);
246 if (org_isite1 == org_isite2 && org_sigma1 == org_sigma2) {
247 is = X->
Def.
Tpow[2 * org_isite1 - 2 + org_sigma1];
249 #pragma omp parallel for default(none) shared(list_1,nstate,tmp_v0,tmp_v1,one) \ 250 firstprivate(i_max,is,tmp_trans) private(num1,ibit,dmv) 251 for (j = 1; j <= i_max; j++) {
253 num1 = (1 - ibit / is);
254 dmv = -tmp_trans * (std::complex<double>)num1;
255 zaxpy_(&nstate, &dmv, tmp_v1[j], &one, tmp_v0[j], &one);
259 #pragma omp parallel for default(none) shared(list_1,nstate,tmp_v0,tmp_v1,one) \ 260 firstprivate(i_max,is,tmp_trans) private(num1,ibit,dmv) 261 for (j = 1; j <= i_max; j++) {
264 dmv = tmp_trans * (std::complex<double>)num1;
265 zaxpy_(&nstate, &dmv, tmp_v1[j], &one, tmp_v0[j], &one);
struct DefineList Def
Definision of system (Hamiltonian) etc.
int GetSplitBitByModel(const int Nsite, const int iCalcModel, long int *irght, long int *ilft, long int *ihfbit)
function of splitting original bit into right and left spaces.
void GC_AisCis(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)
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().
int iFlagListModified
When the Hilbert space of excited state differs from the original one.
int Nsite
Number of sites in the INTRA process region.
void zaxpy_long(long int n, std::complex< double > a, std::complex< double > *x, std::complex< double > *y)
Wrapper of zaxpy.
long int idim_maxOrg
The local Hilbert-space dimention of original state for the spectrum.
int GetPairExcitedStateHubbardGC(struct BindStruct *X, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1, int iEx)
struct LargeList Large
Variables for Matrix-Vector product.
void X_child_CisAjt_MPIdouble(int org_isite1, int org_ispin1, int org_isite2, int org_ispin2, std::complex< double > tmp_trans, struct BindStruct *X, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1)
Hopping term in Hubbard + MPI When both site1 and site2 are in the inter process region.
int * NPairExcitationOperator
Number of pair excitaion operator for spectrum.
int mode
multiply or expectation value.
long int irght
Used for Ogata-Lin ???
std::complex< double > ** ParaPairExcitationOperator
[DefineList::NPairExcitationOperator] Coefficient of pair excitaion operator for spectrum. malloc in setmem_def().
long int A_spin
Mask used in the bit oeration.
long int ilft
Used for Ogata-Lin ???
void X_child_general_hopp_MPIsingle(int org_isite1, int org_ispin1, int org_isite2, int org_ispin2, std::complex< double > tmp_trans, 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...
long int ihfbit
Used for Ogata-Lin ???
long int i_max
Length of eigenvector.
int myrank
Process ID, defined in InitializeMPI()
int X_CisAjt(long int list_1_j, struct BindStruct *X, long int is1_spin, long int is2_spin, long int sum_spin, long int diff_spin, long int *tmp_off)
Compute index of wavefunction of final state.
int GetPairExcitedStateHubbard(struct BindStruct *X, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1, int iEx)
long int * Tpow
[2 * DefineList::NsiteMPI] malloc in setmem_def().
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 iCalcModel
Switch for model. 0:Hubbard, 1:Spin, 2:Kondo, 3:HubbardGC, 4:SpinGC, 5:KondoGC, 6:HubbardNConserved.
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)
long int isA_spin
Mask used in the bit oeration.
void X_child_CisAjt_MPIsingle(int org_isite1, int org_ispin1, int org_isite2, int org_ispin2, std::complex< double > tmp_trans, 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...
struct CheckList Check
Size of the Hilbert space.
void X_child_general_hopp_MPIdouble(int org_isite1, int org_ispin1, int org_isite2, int org_ispin2, std::complex< double > tmp_trans, 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 X_GC_child_general_hopp_MPIdouble(int org_isite1, int org_ispin1, int org_isite2, int org_ispin2, std::complex< double > tmp_trans, 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.
void X_GC_child_general_hopp_MPIsingle(int org_isite1, int org_ispin1, int org_isite2, int org_ispin2, std::complex< double > tmp_trans, 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.
int *** PairExcitationOperator
[DefineList::NPairExcitationOperator][5] Indices of pair excitaion operator for spectrum. malloc in setmem_def().