17 #include "PairExSpin.hpp" 18 #include "bitcalc.hpp" 19 #include "wrapperMPI.hpp" 20 #include "mltplyMPISpinCore.hpp" 21 #include "mltplySpinCore.hpp" 22 #include "mltplyCommon.hpp" 24 #include "common/setmemory.hpp" 37 std::complex<double> **tmp_v0,
38 std::complex<double> **tmp_v1,
43 long int org_isite1, org_isite2, org_sigma1, org_sigma2;
46 std::complex<double> tmp_trans = 0, dmv;
58 if (org_isite1 == org_isite2) {
60 if (org_sigma1 == org_sigma2) {
74 isite1 = X->
Def.
Tpow[org_isite1 - 1];
75 if (org_sigma1 == org_sigma2) {
78 #pragma omp parallel for default(none) private(j, tmp_sgn,dmv) \ 79 firstprivate(i_max, isite1, org_sigma1, X,tmp_trans) shared(one,nstate,tmp_v0, tmp_v1) 80 for (j = 1; j <= i_max; j++) {
82 zaxpy_(&nstate, &dmv, tmp_v1[j], &one, tmp_v0[j], &one);
87 #pragma omp parallel for default(none) private(j, tmp_sgn,dmv) \ 88 firstprivate(i_max, isite1, org_sigma1, X,tmp_trans) shared(tmp_v0, tmp_v1,one,nstate) 89 for (j = 1; j <= i_max; j++) {
90 dmv = (std::complex<double>)
X_SpinGC_CisAis(j, isite1, org_sigma1)* tmp_trans;
91 zaxpy_(&nstate, &dmv, tmp_v1[j], &one, tmp_v0[j], &one);
98 #pragma omp parallel for default(none) private(j, tmp_sgn, tmp_off,dmv) \ 99 firstprivate(i_max, isite1, org_sigma2, X, tmp_trans) shared(tmp_v0, tmp_v1,one,nstate) 100 for (j = 1; j <= i_max; j++) {
103 dmv = (std::complex<double>)tmp_sgn * tmp_trans;
104 zaxpy_(&nstate, &dmv, tmp_v1[j], &one, tmp_v0[tmp_off + 1], &one);
111 fprintf(
stdoutMPI,
"ERROR: hopping is not allowed in localized spin system\n");
128 std::complex<double> **tmp_v0,
129 std::complex<double> **tmp_v1,
134 long int org_isite1, org_isite2, org_sigma1, org_sigma2;
135 long int tmp_off = 0;
137 std::complex<double> tmp_trans = 0, dmv;
147 if (org_isite1 == org_isite2) {
149 if (org_sigma1 == org_sigma2) {
164 if (org_sigma1 == org_sigma2) {
167 #pragma omp parallel for default(none) private(j,num1,dmv) \ 168 firstprivate(i_max,org_isite1,org_sigma1,X,tmp_trans) shared(tmp_v0,tmp_v1,one,nstate) 169 for (j = 1; j <= i_max; j++) {
171 dmv = -tmp_trans * (1.0 - num1);
172 zaxpy_(&nstate, &dmv, tmp_v1[j], &one, tmp_v0[j], &one);
177 #pragma omp parallel for default(none) private(j,num1,dmv) \ 178 firstprivate(i_max,org_isite1,org_sigma1,X,tmp_trans) shared(tmp_v0,tmp_v1,one,nstate) 179 for (j = 1; j <= i_max; j++) {
181 dmv = tmp_trans * (std::complex<double>)num1;
182 zaxpy_(&nstate, &dmv, tmp_v1[j], &one, tmp_v0[j], &one);
188 #pragma omp parallel for default(none) private(j,num1,dmv) \ 189 firstprivate(i_max,org_isite1,org_sigma1,org_sigma2,X,tmp_off,tmp_trans) \ 190 shared(tmp_v0,tmp_v1,one,nstate) 191 for (j = 1; j <= i_max; j++) {
194 dmv = tmp_trans * (std::complex<double>)num1;
195 zaxpy_(&nstate, &dmv, tmp_v1[j], &one, tmp_v0[tmp_off + 1], &one);
202 fprintf(
stdoutMPI,
"ERROR: hopping is not allowed in localized spin system\n");
218 int nstate, std::complex<double> **tmp_v0,
219 std::complex<double> **tmp_v1,
243 std::complex<double> **tmp_v0,
244 std::complex<double> **tmp_v1,
250 long int org_isite1, org_isite2, org_sigma1, org_sigma2;
251 long int tmp_off = 0;
252 std::complex<double> tmp_trans = 0, dmv;
266 if (org_sigma1 == org_sigma2) {
267 if (org_isite1 == org_isite2) {
269 is1_up = X->
Def.
Tpow[org_isite1 - 1];
274 #pragma omp parallel for default(none) shared(tmp_v0, tmp_v1,one,nstate,dmv) \ 275 firstprivate(i_max, tmp_trans) private(j) 276 for (j = 1; j <= i_max; j++) {
277 zaxpy_(&nstate, &dmv, tmp_v1[j], &one, tmp_v0[j], &one);
283 #pragma omp parallel for default(none) shared(tmp_v0, tmp_v1,one,nstate) \ 284 firstprivate(i_max, tmp_trans) private(j) 285 for (j = 1; j <= i_max; j++)
286 zaxpy_(&nstate, &tmp_trans, tmp_v1[j], &one, tmp_v0[j], &one);
291 isite1 = X->
Def.
Tpow[org_isite1 - 1];
292 if (org_isite1 == org_isite2 && org_sigma1 == org_sigma2 &&
294 #pragma omp parallel for default(none) private(j,dmv) \ 295 firstprivate(i_max,isite1,org_sigma1,X,tmp_trans) shared(tmp_v0,tmp_v1,one,nstate) 296 for (j = 1; j <= i_max; j++) {
297 dmv = (1.0 -
X_Spin_CisAis(j, isite1, org_sigma1)) * (-tmp_trans);
298 zaxpy_(&nstate, &dmv, tmp_v1[j], &one, tmp_v0[j], &one);
302 #pragma omp parallel for default(none) private(j,dmv) \ 303 firstprivate(i_max,isite1,org_sigma1,X,tmp_trans) shared(tmp_v0,tmp_v1,one,nstate) 304 for (j = 1; j <= i_max; j++) {
305 dmv = (std::complex<double>)
X_Spin_CisAis(j, isite1, org_sigma1) * tmp_trans;
306 zaxpy_(&nstate, &dmv, tmp_v1[j], &one, tmp_v0[j], &one);
312 fprintf(
stdoutMPI,
"Error: isite1 must be equal to isite2 for Spin system. \n");
319 X, nstate, tmp_v0, tmp_v1, i_max);
322 isite1 = X->
Def.
Tpow[org_isite1 - 1];
323 #pragma omp parallel for default(none) private(j,tmp_off,num1,dmv) \ 324 firstprivate(i_max,isite1,org_sigma2,X,tmp_trans,list_1_org,list_1,list_2_1,list_2_2) \ 325 shared(tmp_v0,tmp_v1,one,nstate) 326 for (j = 1; j <= i_max; j++) {
329 dmv = tmp_trans*(double)num1;
330 zaxpy_(&nstate, &dmv, tmp_v1[j], &one, tmp_v0[tmp_off], &one);
349 std::complex<double> **tmp_v0,
350 std::complex<double> **tmp_v1,
355 long int org_isite1, org_isite2, org_sigma1, org_sigma2;
356 long int tmp_off = 0;
358 std::complex<double> tmp_trans = 0, dmv;
360 int tmp_sgn, num1, one = 1;
369 if (org_isite1 == org_isite2) {
371 if (org_sigma1 == org_sigma2) {
377 #pragma omp parallel for default(none) private(j,dmv) \ 378 firstprivate(i_max, tmp_trans) \ 379 shared(tmp_v0, tmp_v1,one,nstate) 380 for (j = 1; j <= i_max; j++) {
382 zaxpy_(&nstate, &dmv, tmp_v1[j], &one, tmp_v0[j], &one);
388 #pragma omp parallel for default(none) private(j) \ 389 firstprivate(i_max, tmp_trans) shared(tmp_v0, tmp_v1,one,nstate) 390 for (j = 1; j <= i_max; j++) {
391 zaxpy_(&nstate, &tmp_trans, tmp_v1[j], &one, tmp_v0[j], &one);
398 tmp_trans, X, nstate, tmp_v0, tmp_v1, i_max);
402 if (org_sigma1 == org_sigma2) {
405 #pragma omp parallel for default(none) private(j, num1,dmv) \ 406 firstprivate(i_max, org_isite1, org_sigma1, X, tmp_trans) \ 407 shared(tmp_v0, tmp_v1, list_1,one,nstate) 408 for (j = 1; j <= i_max; j++) {
410 dmv = -tmp_trans * (1.0 - num1);
411 zaxpy_(&nstate, &dmv, tmp_v1[j], &one, tmp_v0[j], &one);
415 #pragma omp parallel for default(none) private(j, num1,dmv) \ 416 firstprivate(i_max, org_isite1, org_sigma1, X, tmp_trans) \ 417 shared(tmp_v0, tmp_v1, list_1,one,nstate) 418 for (j = 1; j <= i_max; j++) {
420 dmv = tmp_trans * (std::complex<double>)num1;
421 zaxpy_(&nstate, &dmv, tmp_v1[j], &one, tmp_v0[j], &one);
426 #pragma omp parallel for default(none) private(j, tmp_sgn, tmp_off) \ 427 firstprivate(i_max, org_isite1, org_sigma1, org_sigma2, X, off, tmp_trans, myrank) \ 428 shared(tmp_v0, tmp_v1, list_1_org, list_1,one,nstate) 429 for (j = 1; j <= i_max; j++) {
432 if (tmp_sgn != FALSE) {
434 zaxpy_(&nstate, &tmp_trans, tmp_v1[j], &one, tmp_v0[tmp_off], &one);
441 fprintf(
stdoutMPI,
"ERROR: hopping is not allowed in localized spin system\n");
459 std::complex<double> **tmp_v0,
460 std::complex<double> **tmp_v1,
struct DefineList Def
Definision of system (Hamiltonian) etc.
FILE * stdoutMPI
File pointer to the standard output defined in InitializeMPI()
void X_GC_child_AisCis_GeneralSpin_MPIdouble(int org_isite1, int org_ispin1, std::complex< double > tmp_trans, struct BindStruct *X, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1)
Compute term in the grandcanonical general spin system when both site is in the inter process region...
int BitCheckGeneral(const long int org_bit, const int org_isite, const int target_ispin, const long int *SiteToBit, const long int *Tpow)
bit check function for general spin
void X_child_CisAit_GeneralSpin_MPIdouble(int org_isite1, int org_ispin1, int org_ispin2, std::complex< double > tmp_trans, struct BindStruct *X, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1, long int idim_max)
Compute term in the canonical general spin system when both site is in the inter process region...
int X_Spin_CisAis(long int j, long int is1_spin, long int sigma1)
Compute the spin state with bit mask is1_spin.
int Nsite
Number of sites in the INTRA process region.
long int idim_maxOrg
The local Hilbert-space dimention of original state for the spectrum.
int X_SpinGC_CisAis(long int j, long int is1_spin, long int sigma1)
Compute the grandcanonical spin state with bit mask is1_spin.
struct LargeList Large
Variables for Matrix-Vector product.
void X_GC_child_CisAis_GeneralSpin_MPIdouble(int org_isite1, int org_ispin1, std::complex< double > tmp_trans, struct BindStruct *X, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1)
Compute term in the grandcanonical general spin system when both site is in the inter process region...
int ConvertToList1GeneralSpin(const long int org_ibit, const long int ihlfbit, long int *_ilist1Comp)
function of converting component to list_1
int * NPairExcitationOperator
Number of pair excitaion operator for spectrum.
void X_GC_child_CisAit_GeneralSpin_MPIdouble(int org_isite1, int org_ispin1, int org_ispin2, std::complex< double > tmp_trans, struct BindStruct *X, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1)
Compute term in the grandcanonical general spin system when both site is in the inter process region...
int GetPairExcitedStateGeneralSpin(struct BindStruct *X, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1, int iEx)
void X_child_CisAit_spin_MPIdouble(int org_isite1, int org_ispin2, std::complex< double > tmp_trans, struct BindStruct *X, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1, long int idim_max)
Hopping term in Spin + Canonical for CalcSpectrum When both site1 and site2 are in the inter process ...
std::complex< double > ** ParaPairExcitationOperator
[DefineList::NPairExcitationOperator] Coefficient of pair excitaion operator for spectrum. malloc in setmem_def().
int GetOffCompGeneralSpin(const long int org_ibit, const int org_isite, const int org_ispin, const int off_ispin, long int *_ioffComp, const long int *SiteToBit, const long int *Tpow)
function of getting off-diagonal component for general spin
long int ihfbit
Used for Ogata-Lin ???
void X_GC_child_CisAis_spin_MPIdouble(int org_isite1, int org_ispin1, std::complex< double > tmp_trans, struct BindStruct *X, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1)
Hopping term in Spin + GC When both site1 and site2 are in the inter process region.
int myrank
Process ID, defined in InitializeMPI()
int iFlgGeneralSpin
Flag for the general (Sz/=1/2) spin.
void X_GC_child_CisAit_spin_MPIdouble(int org_isite1, int org_ispin1, 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 Spin + GC When both site1 and site2 are in the inter process region.
long int * SiteToBit
[DefineList::NsiteMPI] Similar to DefineList::Tpow. For general spin.
long int * Tpow
[2 * DefineList::NsiteMPI] malloc in setmem_def().
int GetPairExcitedStateSpinGC(struct BindStruct *X, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1, int iEx)
Calculation of pair excited state for Spin Grand canonical system.
int X_SpinGC_CisAit(long int j, long int is1_spin, long int sigma2, long int *tmp_off)
Compute index of final wavefunction by term (grandcanonical).
int GetPairExcitedStateHalfSpinGC(struct BindStruct *X, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1, int iEx)
int GetPairExcitedStateHalfSpin(struct BindStruct *X, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1, int iEx)
void X_GC_child_AisCis_spin_MPIdouble(int org_isite1, int org_ispin1, std::complex< double > tmp_trans, struct BindStruct *X, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1)
Hopping term in Spin + GC When both site1 and site2 are in the inter process region.
int GetPairExcitedStateSpin(struct BindStruct *X, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1, int iEx)
int X_Spin_CisAit(long int j, struct BindStruct *X, long int is1_spin, long int sigma2, long int *tmp_off)
Compute index of final wavefunction by term.
int GetPairExcitedStateGeneralSpinGC(struct BindStruct *X, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1, int iEx)
struct CheckList Check
Size of the Hilbert space.
int *** PairExcitationOperator
[DefineList::NPairExcitationOperator][5] Indices of pair excitaion operator for spectrum. malloc in setmem_def().