HPhi++  3.1.0
mltplySpinCore.cpp File Reference

Functions for spin Hamiltonian (Core) More...

#include <bitcalc.hpp>
#include "xsetmem.hpp"
#include "wrapperMPI.hpp"
#include "mltplyCommon.hpp"
#include "mltplySpinCore.hpp"

Go to the source code of this file.

Functions

int child_exchange_spin_GetInfo (int iExchange, struct BindStruct *X)
 Set parameters for the bit operation of spin-exchange term. More...
 
int child_pairlift_spin_GetInfo (int iPairLift, struct BindStruct *X)
 Set parameters for the bit operation of spin-pairlift term. More...
 
int child_general_int_spin_GetInfo (struct BindStruct *X, long int isite1, long int isite2, long int sigma1, long int sigma2, long int sigma3, long int sigma4, std::complex< double > tmp_V)
 Set parameters for the bit operation of spin-general interaction term. More...
 
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 \(c_{is}^\dagger c_{it}\) term. More...
 
int X_Spin_CisAis (long int j, long int is1_spin, long int sigma1)
 Compute the spin state with bit mask is1_spin. More...
 
int X_SpinGC_CisAis (long int j, long int is1_spin, long int sigma1)
 Compute the grandcanonical spin state with bit mask is1_spin. More...
 
int X_SpinGC_CisAit (long int j, long int is1_spin, long int sigma2, long int *tmp_off)
 Compute index of final wavefunction by \(c_{is}^\dagger c_{it}\) term (grandcanonical). More...
 
int X_child_exchange_spin_element (long int j, struct BindStruct *X, long int isA_up, long int isB_up, long int sigmaA, long int sigmaB, long int *tmp_off)
 Compute index of final wavefunction associated to spin-exchange term. More...
 
void child_exchange_spin_element (long int j, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1, struct BindStruct *X, long int *tmp_off)
 Multiply Hamiltonian of exchange term of canonical spin system. More...
 
void GC_child_exchange_spin_element (long int j, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1, struct BindStruct *X, long int *tmp_off)
 Multiply Hamiltonian of exchange term of grandcanonical spin system. More...
 
void GC_child_pairlift_spin_element (long int j, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1, struct BindStruct *X, long int *tmp_off)
 Multiply Hamiltonian of pairlift term of grandcanonical spin system. More...
 
void child_CisAisCisAis_spin_element (long int j, long int isA_up, long int isB_up, long int org_sigma2, long int org_sigma4, std::complex< double > tmp_V, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1)
 Compute \(c_{is}^\dagger c_{is} c_{is}^\dagger c_{is}\) term of canonical spsin system. More...
 
void GC_child_CisAisCisAis_spin_element (long int j, long int isA_up, long int isB_up, long int org_sigma2, long int org_sigma4, std::complex< double > tmp_V, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1)
 Compute \(c_{is}^\dagger c_{is} c_{is}^\dagger c_{is}\) term of grandcanonical spsin system. More...
 
void GC_child_CisAisCitAiu_spin_element (long int j, long int org_sigma2, long int org_sigma4, long int isA_up, long int isB_up, std::complex< double > tmp_V, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1, long int *tmp_off)
 Compute \(c_{is}^\dagger c_{is} c_{it}^\dagger c_{iu}\) term of grandcanonical spsin system. More...
 
void GC_child_CisAitCiuAiu_spin_element (long int j, long int org_sigma2, long int org_sigma4, long int isA_up, long int isB_up, std::complex< double > tmp_V, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1, long int *tmp_off)
 Compute \(c_{is}^\dagger c_{it} c_{iu}^\dagger c_{iu}\) term of grandcanonical spsin system. More...
 
void GC_child_CisAitCiuAiv_spin_element (long int j, long int org_sigma2, long int org_sigma4, long int isA_up, long int isB_up, std::complex< double > tmp_V, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1, long int *tmp_off_2)
 Compute \(c_{is}^\dagger c_{it} c_{iu}^\dagger c_{iv}\) term of grandcanonical spsin system. More...
 

Detailed Description

Functions for spin Hamiltonian (Core)

Definition in file mltplySpinCore.cpp.

Function Documentation

◆ child_CisAisCisAis_spin_element()

void child_CisAisCisAis_spin_element ( long int  j,
long int  isA_up,
long int  isB_up,
long int  org_sigma2,
long int  org_sigma4,
std::complex< double >  tmp_V,
int  nstate,
std::complex< double > **  tmp_v0,
std::complex< double > **  tmp_v1 
)

Compute \(c_{is}^\dagger c_{is} c_{is}^\dagger c_{is}\) term of canonical spsin system.

Author
Takahiro Misawa (The University of Tokyo)
Kazuyoshi Yoshimi (The University of Tokyo)
Parameters
[in]jIndex of initial wavefunction
[in]isA_upBit mask for spin 1
[in]isB_upBit mask for spin 2
[in]org_sigma2Target for spin 1
[in]org_sigma4Target for spin 2
[in]tmp_VCoupling constatnt
[in]tmp_v0Resulting wavefunction
[in]tmp_v1Wavefunction to be multiplied

Definition at line 357 of file mltplySpinCore.cpp.

References X_Spin_CisAis().

Referenced by expec_cisajscktalt_SpinHalf().

366  {
367  int tmp_sgn;
368  std::complex<double> dmv;
369  int one = 1;
370 
371  tmp_sgn = X_Spin_CisAis(j, isB_up, org_sigma4);
372  tmp_sgn *= X_Spin_CisAis(j, isA_up, org_sigma2);
373  dmv = (std::complex<double>)tmp_sgn * tmp_V;
374  zaxpy_(&nstate, &dmv, &tmp_v1[j][0], &one, &tmp_v0[j][0], &one);
375 }/*std::complex<double> child_CisAisCisAis_spin_element*/
int X_Spin_CisAis(long int j, long int is1_spin, long int sigma1)
Compute the spin state with bit mask is1_spin.

◆ child_exchange_spin_element()

void child_exchange_spin_element ( long int  j,
int  nstate,
std::complex< double > **  tmp_v0,
std::complex< double > **  tmp_v1,
struct BindStruct X,
long int *  tmp_off 
)

Multiply Hamiltonian of exchange term of canonical spin system.

Author
Takahiro Misawa (The University of Tokyo)
Kazuyoshi Yoshimi (The University of Tokyo)
Parameters
[in]jIndex of initial wavefunction
[out]tmp_v0Resulting wavefunction
[in]tmp_v1Wavefunction to be multiplied
[in,out]X
[out]tmp_offIndex of final wavefunction

Definition at line 266 of file mltplySpinCore.cpp.

References GetOffComp(), LargeList::ihfbit, LargeList::ilft, LargeList::irght, LargeList::isA_spin, BindStruct::Large, list_1, list_2_1, list_2_2, and LargeList::tmp_J.

Referenced by child_exchange_spin().

272  {
273  long int off;
274  long int iexchg;
275  long int is_up = X->Large.isA_spin;
276  long int irght = X->Large.irght;
277  long int ilft = X->Large.ilft;
278  long int ihfbit = X->Large.ihfbit;
279  std::complex<double> tmp_J = X->Large.tmp_J;
280  long int ibit_tmp;
281  int one = 1;
282 
283  ibit_tmp = (list_1[j] & is_up);
284  if (ibit_tmp == 0 || ibit_tmp == is_up) {
285  return;
286  }
287  else {
288  iexchg = list_1[j] ^ is_up;
289  GetOffComp(list_2_1, list_2_2, iexchg, irght, ilft, ihfbit, &off);
290  *tmp_off = off;
291  zaxpy_(&nstate, &tmp_J, &tmp_v1[j][0], &one, &tmp_v0[off][0], &one);
292  }
293 }/*std::complex<double> child_exchange_spin_element*/
long int * list_2_1
Definition: global.cpp:27
long int * list_2_2
Definition: global.cpp:28
struct LargeList Large
Variables for Matrix-Vector product.
Definition: struct.hpp:397
std::complex< double > tmp_J
Coupling constant.
Definition: struct.hpp:324
long int irght
Used for Ogata-Lin ???
Definition: struct.hpp:344
long int ilft
Used for Ogata-Lin ???
Definition: struct.hpp:345
int GetOffComp(long int *_list_2_1, long int *_list_2_2, long int _ibit, const long int _irght, const long int _ilft, const long int _ihfbit, long int *_ioffComp)
function of getting off-diagonal component
Definition: bitcalc.cpp:195
long int ihfbit
Used for Ogata-Lin ???
Definition: struct.hpp:346
long int isA_spin
Mask used in the bit oeration.
Definition: struct.hpp:347
long int * list_1
Definition: global.cpp:25

◆ child_exchange_spin_GetInfo()

int child_exchange_spin_GetInfo ( int  iExchange,
struct BindStruct X 
)

Set parameters for the bit operation of spin-exchange term.

Returns
Always return 0
Author
Takahiro Misawa (The University of Tokyo)
Kazuyoshi Yoshimi (The University of Tokyo)

Set the exchange coupling constant (LargeList::tmp_J)

Set the bit mask for computing spin state of both site (LargeList::is1_up, LargeList::is2_up)

Set the bit mask for exchange 2 spins (LargeList::isA_spin)

Parameters
[in]iExchangeCounter of exchange interaction
[in,out]X

Definition at line 35 of file mltplySpinCore.cpp.

References BindStruct::Def, DefineList::ExchangeCoupling, LargeList::is1_up, LargeList::is2_up, LargeList::isA_spin, BindStruct::Large, DefineList::ParaExchangeCoupling, LargeList::tmp_J, and DefineList::Tpow.

Referenced by mltplyHalfSpin(), and mltplyHalfSpinGC().

38  {
39  int isite1 = X->Def.ExchangeCoupling[iExchange][0] + 1;
40  int isite2 = X->Def.ExchangeCoupling[iExchange][1] + 1;
44  X->Large.tmp_J = X->Def.ParaExchangeCoupling[iExchange];
49  X->Large.is1_up = X->Def.Tpow[isite1 - 1];
50  X->Large.is2_up = X->Def.Tpow[isite2 - 1];
54  X->Large.isA_spin = X->Large.is1_up + X->Large.is2_up;
55  return 0;
56 }/*int child_exchange_spin_GetInfo*/
struct DefineList Def
Definision of system (Hamiltonian) etc.
Definition: struct.hpp:395
int ** ExchangeCoupling
[DefineList::NExchangeCoupling][2] Index of exchange term. malloc in setmem_def().
Definition: struct.hpp:146
long int is1_up
Mask used in the bit oeration.
Definition: struct.hpp:326
struct LargeList Large
Variables for Matrix-Vector product.
Definition: struct.hpp:397
std::complex< double > tmp_J
Coupling constant.
Definition: struct.hpp:324
double * ParaExchangeCoupling
[DefineList::NExchangeCoupling] Coupling constant of exchange term. malloc in setmem_def().
Definition: struct.hpp:148
long int * Tpow
[2 * DefineList::NsiteMPI] malloc in setmem_def().
Definition: struct.hpp:90
long int isA_spin
Mask used in the bit oeration.
Definition: struct.hpp:347
long int is2_up
Mask used in the bit oeration.
Definition: struct.hpp:328

◆ child_general_int_spin_GetInfo()

int child_general_int_spin_GetInfo ( struct BindStruct X,
long int  isite1,
long int  isite2,
long int  sigma1,
long int  sigma2,
long int  sigma3,
long int  sigma4,
std::complex< double >  tmp_V 
)

Set parameters for the bit operation of spin-general interaction term.

Returns
Always return 0
Author
Takahiro Misawa (The University of Tokyo)
Kazuyoshi Yoshimi (The University of Tokyo)

Set the pairlift coupling constant (LargeList::tmp_J)

Set the bit mask for computing spin state of both site (LargeList::is1_up, LargeList::is2_up)

Set the bit mask for general interaction (LargeList::is1_spin, LargeList::is2_spin, LargeList::is3_spin, LargeList::is4_spin)

Parameters
[in,out]X
[in]isite1Site 1
[in]isite2Site 2
[in]sigma1Sigma 1, final state of site 1
[in]sigma2Sigma 3, initial state of site 1
[in]sigma3Sigma 3, final state of site 2
[in]sigma4Sigma 4, initial state of site 2
[in]tmp_VGeneral interaction constatnt

Definition at line 91 of file mltplySpinCore.cpp.

References BindStruct::Def, LargeList::is1_spin, LargeList::is1_up, LargeList::is2_spin, LargeList::is2_up, LargeList::is3_spin, LargeList::is4_spin, LargeList::isite1, LargeList::isite2, BindStruct::Large, LargeList::tmp_V, and DefineList::Tpow.

Referenced by mltplyHalfSpin(), and mltplyHalfSpinGC().

100  {
104  X->Large.tmp_V = tmp_V;
105  X->Large.isite1 = isite1;
106  X->Large.isite2 = isite2;
111  X->Large.is1_up = X->Def.Tpow[isite1 - 1];
112  X->Large.is2_up = X->Def.Tpow[isite2 - 1];
117  X->Large.is1_spin = sigma1;
118  X->Large.is2_spin = sigma2;
119  X->Large.is3_spin = sigma3;
120  X->Large.is4_spin = sigma4;
121  return 0;
122 }/*int child_general_int_spin_GetInfo*/
struct DefineList Def
Definision of system (Hamiltonian) etc.
Definition: struct.hpp:395
long int is2_spin
Mask used in the bit oeration.
Definition: struct.hpp:334
long int is1_up
Mask used in the bit oeration.
Definition: struct.hpp:326
struct LargeList Large
Variables for Matrix-Vector product.
Definition: struct.hpp:397
int isite2
Is it realy used ???
Definition: struct.hpp:338
long int is4_spin
Mask used in the bit oeration.
Definition: struct.hpp:336
long int * Tpow
[2 * DefineList::NsiteMPI] malloc in setmem_def().
Definition: struct.hpp:90
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
int isite1
Is it realy used ???
Definition: struct.hpp:337
long int is2_up
Mask used in the bit oeration.
Definition: struct.hpp:328
std::complex< double > tmp_V
Coupling constant.
Definition: struct.hpp:349

◆ child_pairlift_spin_GetInfo()

int child_pairlift_spin_GetInfo ( int  iPairLift,
struct BindStruct X 
)

Set parameters for the bit operation of spin-pairlift term.

Returns
Always return 0
Author
Takahiro Misawa (The University of Tokyo)
Kazuyoshi Yoshimi (The University of Tokyo)

Set the pairlift coupling constant (LargeList::tmp_J)

Set the bit mask for computing spin state of both site (LargeList::is1_up, LargeList::is2_up)

Set the bit mask for exchange 2 spins (LargeList::isA_spin)

Definition at line 63 of file mltplySpinCore.cpp.

References BindStruct::Def, LargeList::is1_up, LargeList::is2_up, LargeList::isA_spin, BindStruct::Large, DefineList::PairLiftCoupling, DefineList::ParaPairLiftCoupling, LargeList::tmp_J, and DefineList::Tpow.

Referenced by mltplyHalfSpinGC().

66  {
67  int isite1 = X->Def.PairLiftCoupling[iPairLift][0] + 1;
68  int isite2 = X->Def.PairLiftCoupling[iPairLift][1] + 1;
72  X->Large.tmp_J = X->Def.ParaPairLiftCoupling[iPairLift];
77  X->Large.is1_up = X->Def.Tpow[isite1 - 1];
78  X->Large.is2_up = X->Def.Tpow[isite2 - 1];
82  X->Large.isA_spin = X->Large.is1_up + X->Large.is2_up;
83  return 0;
84 }/*int child_pairlift_spin_GetInfo*/
struct DefineList Def
Definision of system (Hamiltonian) etc.
Definition: struct.hpp:395
long int is1_up
Mask used in the bit oeration.
Definition: struct.hpp:326
struct LargeList Large
Variables for Matrix-Vector product.
Definition: struct.hpp:397
std::complex< double > tmp_J
Coupling constant.
Definition: struct.hpp:324
int ** PairLiftCoupling
[DefineList::NPairHopping][2] Index of pair-lift term. malloc in setmem_def().
Definition: struct.hpp:154
double * ParaPairLiftCoupling
[DefineList::NPairHopping] Coupling constant of pair-lift term. malloc in setmem_def().
Definition: struct.hpp:156
long int * Tpow
[2 * DefineList::NsiteMPI] malloc in setmem_def().
Definition: struct.hpp:90
long int isA_spin
Mask used in the bit oeration.
Definition: struct.hpp:347
long int is2_up
Mask used in the bit oeration.
Definition: struct.hpp:328

◆ GC_child_CisAisCisAis_spin_element()

void GC_child_CisAisCisAis_spin_element ( long int  j,
long int  isA_up,
long int  isB_up,
long int  org_sigma2,
long int  org_sigma4,
std::complex< double >  tmp_V,
int  nstate,
std::complex< double > **  tmp_v0,
std::complex< double > **  tmp_v1 
)

Compute \(c_{is}^\dagger c_{is} c_{is}^\dagger c_{is}\) term of grandcanonical spsin system.

Author
Takahiro Misawa (The University of Tokyo)
Kazuyoshi Yoshimi (The University of Tokyo)
Parameters
[in]jIndex of initial wavefunction
[in]isA_upBit mask for spin 1
[in]isB_upBit mask for spin 2
[in]org_sigma2Target for spin 1
[in]org_sigma4Target for spin 2
[in]tmp_VCoupling constatnt
[in]tmp_v0Resulting wavefunction
[in]tmp_v1Wavefunction to be multiplied

Definition at line 386 of file mltplySpinCore.cpp.

References X_SpinGC_CisAis().

Referenced by expec_cisajscktalt_SpinGCHalf(), and GC_child_general_int_spin().

395  {
396  int tmp_sgn;
397  std::complex<double> dmv = 0;
398  int one = 1;
399 
400  tmp_sgn = X_SpinGC_CisAis(j, isB_up, org_sigma4);
401  tmp_sgn *= X_SpinGC_CisAis(j, isA_up, org_sigma2);
402  if (tmp_sgn != 0) {
403  dmv = (std::complex<double>)tmp_sgn * tmp_V;
404  zaxpy_(&nstate, &dmv, &tmp_v1[j][0], &one, &tmp_v0[j][0], &one);
405  }
406 }/*std::complex<double> GC_child_CisAisCisAis_spin_element*/
int X_SpinGC_CisAis(long int j, long int is1_spin, long int sigma1)
Compute the grandcanonical spin state with bit mask is1_spin.

◆ GC_child_CisAisCitAiu_spin_element()

void GC_child_CisAisCitAiu_spin_element ( long int  j,
long int  org_sigma2,
long int  org_sigma4,
long int  isA_up,
long int  isB_up,
std::complex< double >  tmp_V,
int  nstate,
std::complex< double > **  tmp_v0,
std::complex< double > **  tmp_v1,
long int *  tmp_off 
)

Compute \(c_{is}^\dagger c_{is} c_{it}^\dagger c_{iu}\) term of grandcanonical spsin system.

Author
Takahiro Misawa (The University of Tokyo)
Kazuyoshi Yoshimi (The University of Tokyo)
Parameters
[in]jIndex of initial wavefunction
[in]org_sigma2Target for spin 1
[in]org_sigma4Target for spin 2
[in]isA_upBit mask for spin 1
[in]isB_upBit mask for spin 2
[in]tmp_VCoupling constatnt
[in]tmp_v0Resulting wavefunction
[in]tmp_v1Wavefunction to be multiplied
[out]tmp_offIndex of final wavefunction

Definition at line 413 of file mltplySpinCore.cpp.

References X_SpinGC_CisAis(), and X_SpinGC_CisAit().

Referenced by expec_cisajscktalt_SpinGCHalf(), and GC_child_general_int_spin().

423  {
424  int tmp_sgn;
425  std::complex<double> dmv;
426  int one = 1;
427  tmp_sgn = X_SpinGC_CisAit(j, isB_up, org_sigma4, tmp_off);
428  if (tmp_sgn != 0) {
429  tmp_sgn *= X_SpinGC_CisAis((*tmp_off + 1), isA_up, org_sigma2);
430  if (tmp_sgn != 0) {
431  dmv = (std::complex<double>)tmp_sgn * tmp_V;
432  zaxpy_(&nstate, &dmv, &tmp_v1[j][0], &one, &tmp_v0[*tmp_off + 1][0], &one);
433  }/*if (tmp_sgn != 0)*/
434  }/*if (tmp_sgn != 0)*/
435 }/*std::complex<double> GC_child_CisAisCitAiu_spin_element*/
int X_SpinGC_CisAis(long int j, long int is1_spin, long int sigma1)
Compute the grandcanonical spin state with bit mask is1_spin.
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).

◆ GC_child_CisAitCiuAiu_spin_element()

void GC_child_CisAitCiuAiu_spin_element ( long int  j,
long int  org_sigma2,
long int  org_sigma4,
long int  isA_up,
long int  isB_up,
std::complex< double >  tmp_V,
int  nstate,
std::complex< double > **  tmp_v0,
std::complex< double > **  tmp_v1,
long int *  tmp_off 
)

Compute \(c_{is}^\dagger c_{it} c_{iu}^\dagger c_{iu}\) term of grandcanonical spsin system.

Author
Takahiro Misawa (The University of Tokyo)
Kazuyoshi Yoshimi (The University of Tokyo)
Parameters
[in]jIndex of initial wavefunction
[in]org_sigma2Target for spin 1
[in]org_sigma4Target for spin 2
[in]isA_upBit mask for spin 1
[in]isB_upBit mask for spin 2
[in]tmp_VCoupling constatnt
[in]tmp_v0Resulting wavefunction
[in]tmp_v1Wavefunction to be multiplied
[out]tmp_offIndex of final wavefunction

Definition at line 442 of file mltplySpinCore.cpp.

References X_SpinGC_CisAis(), and X_SpinGC_CisAit().

Referenced by expec_cisajscktalt_SpinGCHalf(), and GC_child_general_int_spin().

452  {
453  int tmp_sgn;
454  std::complex<double> dmv;
455  int one = 1;
456  tmp_sgn = X_SpinGC_CisAis(j, isB_up, org_sigma4);
457  if (tmp_sgn != 0) {
458  tmp_sgn *= X_SpinGC_CisAit(j, isA_up, org_sigma2, tmp_off);
459  if (tmp_sgn != 0) {
460  dmv = (std::complex<double>)tmp_sgn * tmp_V;
461  zaxpy_(&nstate, &dmv, &tmp_v1[j][0], &one, &tmp_v0[*tmp_off + 1][0], &one);
462  }/*if (tmp_sgn != 0)*/
463  }/*if (tmp_sgn != 0)*/
464 }/*std::complex<double> GC_child_CisAitCiuAiu_spin_element*/
int X_SpinGC_CisAis(long int j, long int is1_spin, long int sigma1)
Compute the grandcanonical spin state with bit mask is1_spin.
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).

◆ GC_child_CisAitCiuAiv_spin_element()

void GC_child_CisAitCiuAiv_spin_element ( long int  j,
long int  org_sigma2,
long int  org_sigma4,
long int  isA_up,
long int  isB_up,
std::complex< double >  tmp_V,
int  nstate,
std::complex< double > **  tmp_v0,
std::complex< double > **  tmp_v1,
long int *  tmp_off_2 
)

Compute \(c_{is}^\dagger c_{it} c_{iu}^\dagger c_{iv}\) term of grandcanonical spsin system.

Author
Takahiro Misawa (The University of Tokyo)
Kazuyoshi Yoshimi (The University of Tokyo)
Parameters
[in]jIndex of initial wavefunction
[in]org_sigma2Target for spin 1
[in]org_sigma4Target for spin 2
[in]isA_upBit mask for spin 1
[in]isB_upBit mask for spin 2
[in]tmp_VCoupling constatnt
[in]tmp_v0Resulting wavefunction
[in]tmp_v1Wavefunction to be multiplied
[out]tmp_off_2Index of final wavefunction

Definition at line 471 of file mltplySpinCore.cpp.

References X_SpinGC_CisAit().

Referenced by expec_cisajscktalt_SpinGCHalf(), and GC_child_general_int_spin().

481  {
482  int tmp_sgn;
483  long int tmp_off_1;
484  std::complex<double> dmv;
485  int one = 1;
486  tmp_sgn = X_SpinGC_CisAit(j, isB_up, org_sigma4, &tmp_off_1);
487  if (tmp_sgn != 0) {
488  tmp_sgn *= X_SpinGC_CisAit((tmp_off_1 + 1), isA_up, org_sigma2, tmp_off_2);
489  if (tmp_sgn != 0) {
490  dmv = (std::complex<double>)tmp_sgn * tmp_V;
491  zaxpy_(&nstate, &dmv, &tmp_v1[j][0], &one, &tmp_v0[*tmp_off_2 + 1][0], &one);
492  }/*if (tmp_sgn != 0)*/
493  }/*if (tmp_sgn != 0)*/
494 }/*std::complex<double> GC_child_CisAitCiuAiv_spin_element*/
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).

◆ GC_child_exchange_spin_element()

void GC_child_exchange_spin_element ( long int  j,
int  nstate,
std::complex< double > **  tmp_v0,
std::complex< double > **  tmp_v1,
struct BindStruct X,
long int *  tmp_off 
)

Multiply Hamiltonian of exchange term of grandcanonical spin system.

Author
Takahiro Misawa (The University of Tokyo)
Kazuyoshi Yoshimi (The University of Tokyo)
Parameters
[in]jIndex of initial wavefunction
[out]tmp_v0Resulting wavefunction
[in]tmp_v1Wavefunction to be multiplied
[in,out]X
[out]tmp_offIndex of final wavefunction

Definition at line 299 of file mltplySpinCore.cpp.

References LargeList::isA_spin, BindStruct::Large, and LargeList::tmp_J.

Referenced by GC_child_exchange_spin().

305  {
306  long int is_up = X->Large.isA_spin;
307  std::complex<double> tmp_J = X->Large.tmp_J;
308  long int list_1_j, list_1_off;
309  int one = 1;
310 
311  list_1_j = j - 1;
312 
313  long int ibit_tmp;
314  ibit_tmp = (list_1_j & is_up);
315  if (ibit_tmp == 0 || ibit_tmp == is_up) {
316  return;
317  }
318  else {
319  list_1_off = list_1_j ^ is_up;
320  *tmp_off = list_1_off;
321  zaxpy_(&nstate, &tmp_J, &tmp_v1[j][0], &one, &tmp_v0[list_1_off + 1][0], &one);
322  }
323 }/*std::complex<double> GC_child_exchange_spin_element*/
struct LargeList Large
Variables for Matrix-Vector product.
Definition: struct.hpp:397
std::complex< double > tmp_J
Coupling constant.
Definition: struct.hpp:324
long int isA_spin
Mask used in the bit oeration.
Definition: struct.hpp:347

◆ GC_child_pairlift_spin_element()

void GC_child_pairlift_spin_element ( long int  j,
int  nstate,
std::complex< double > **  tmp_v0,
std::complex< double > **  tmp_v1,
struct BindStruct X,
long int *  tmp_off 
)

Multiply Hamiltonian of pairlift term of grandcanonical spin system.

Author
Takahiro Misawa (The University of Tokyo)
Kazuyoshi Yoshimi (The University of Tokyo)
Parameters
[in]jIndex of initial wavefunction
[out]tmp_v0Resulting wavefunction
[in]tmp_v1Wavefunction to be multiplied
[in,out]X
[out]tmp_offIndex of final wavefunction

Definition at line 329 of file mltplySpinCore.cpp.

References LargeList::isA_spin, BindStruct::Large, and LargeList::tmp_J.

Referenced by GC_child_pairlift_spin().

335  {
336  long int is_up = X->Large.isA_spin;
337  std::complex<double> tmp_J = X->Large.tmp_J;
338  int one = 1;
339  long int list_1_off;
340  long int list_1_j = j - 1;
341  long int ibit_tmp;
342  //ibit_tmp = ((list_1_j & is1_up) / is1_up) ^ ((list_1_j & is2_up) / is2_up);
343  ibit_tmp = (list_1_j & is_up);
344  if (ibit_tmp == 0 || ibit_tmp == is_up) {
345  list_1_off = list_1_j ^ is_up; //Change: ++ -> -- or -- -> ++
346  *tmp_off = list_1_off;
347  zaxpy_(&nstate, &tmp_J, &tmp_v1[j][0], &one, &tmp_v0[list_1_off + 1][0], &one);
348  }
349 }/*std::complex<double> GC_child_pairlift_spin_element*/
struct LargeList Large
Variables for Matrix-Vector product.
Definition: struct.hpp:397
std::complex< double > tmp_J
Coupling constant.
Definition: struct.hpp:324
long int isA_spin
Mask used in the bit oeration.
Definition: struct.hpp:347

◆ X_child_exchange_spin_element()

int X_child_exchange_spin_element ( long int  j,
struct BindStruct X,
long int  isA_up,
long int  isB_up,
long int  sigmaA,
long int  sigmaB,
long int *  tmp_off 
)

Compute index of final wavefunction associated to spin-exchange term.

Returns
1 if spin of site 1 is sigmaA and spin of site 2 is sigmaB. 0 if not.
Author
Takahiro Misawa (The University of Tokyo)
Kazuyoshi Yoshimi (The University of Tokyo)
Parameters
[in]jIndex of initial wavefunction
[in,out]X
[in]isA_upBit mask for spin 1
[in]isB_upBit mask for spin 2
[in]sigmaATarget of spin 1
[in]sigmaBTarget of spin 2
[out]tmp_offIndex of final wavefunction

Definition at line 233 of file mltplySpinCore.cpp.

References GetOffComp(), LargeList::ihfbit, LargeList::ilft, LargeList::irght, BindStruct::Large, list_1, list_2_1, and list_2_2.

Referenced by child_general_int_spin(), and expec_cisajscktalt_SpinHalf().

241  {
242  long int iexchg, off;
243  long int irght = X->Large.irght;
244  long int ilft = X->Large.ilft;
245  long int ihfbit = X->Large.ihfbit;
246  long int ibit_tmp_A, ibit_tmp_B;
247 
248  ibit_tmp_A = ((list_1[j] & isA_up) / isA_up);
249  ibit_tmp_B = ((list_1[j] & isB_up) / isB_up);
250  if (ibit_tmp_A == sigmaA && ibit_tmp_B == sigmaB) {
251  iexchg = list_1[j] ^ (isA_up + isB_up);
252  GetOffComp(list_2_1, list_2_2, iexchg, irght, ilft, ihfbit, &off);
253  *tmp_off = off;
254  return 1;
255  }
256  else {
257  *tmp_off = 0; // just tentative
258  return 0;
259  }
260 }/*int X_child_exchange_spin_element*/
long int * list_2_1
Definition: global.cpp:27
long int * list_2_2
Definition: global.cpp:28
struct LargeList Large
Variables for Matrix-Vector product.
Definition: struct.hpp:397
long int irght
Used for Ogata-Lin ???
Definition: struct.hpp:344
long int ilft
Used for Ogata-Lin ???
Definition: struct.hpp:345
int GetOffComp(long int *_list_2_1, long int *_list_2_2, long int _ibit, const long int _irght, const long int _ilft, const long int _ihfbit, long int *_ioffComp)
function of getting off-diagonal component
Definition: bitcalc.cpp:195
long int ihfbit
Used for Ogata-Lin ???
Definition: struct.hpp:346
long int * list_1
Definition: global.cpp:25

◆ X_Spin_CisAis()

int X_Spin_CisAis ( long int  j,
long int  is1_spin,
long int  sigma1 
)

Compute the spin state with bit mask is1_spin.

Returns
1 if the spin state with bit mask is1_spin is sigma1, 0 for the other.
Author
Takahiro Misawa (The University of Tokyo)
Kazuyoshi Yoshimi (The University of Tokyo)
Parameters
[in]jIndex of wavefunction
[in]is1_spinBit mask
[in]sigma1Target spin state

Definition at line 163 of file mltplySpinCore.cpp.

References list_1.

Referenced by child_CisAisCisAis_spin_element(), expec_cisajs_SpinHalf(), expec_cisajscktalt_SpinHalf(), GetPairExcitedStateHalfSpin(), SetDiagonalInterAll(), and SetDiagonalTEInterAll().

167  {
168  int A_ibit_tmp;
169  // off = j
170  A_ibit_tmp = ((list_1[j] & is1_spin) / is1_spin) ^ (1 - sigma1);
171  return A_ibit_tmp;
172 }/*int X_Spin_CisAis*/
long int * list_1
Definition: global.cpp:25

◆ X_Spin_CisAit()

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 \(c_{is}^\dagger c_{it}\) term.

Returns
1 if bit-mask is1_spin is sigma2, 0 for the other
Author
Takahiro Misawa (The University of Tokyo)
Kazuyoshi Yoshimi (The University of Tokyo)
Parameters
[in]jIndex of initial wavefunction
[in,out]X
[in]is1_spinBit mask for computing spin state
[in]sigma2Spin state at site 2
[out]tmp_offIndex of final wavefunction

Definition at line 138 of file mltplySpinCore.cpp.

References GetOffComp(), LargeList::ihfbit, LargeList::ilft, LargeList::irght, BindStruct::Large, list_1_org, list_2_1, list_2_2, and X_SpinGC_CisAit().

Referenced by GetPairExcitedStateHalfSpin().

144  {
145  long int list_1_j;
146  long int off;
147  list_1_j = list_1_org[j];
148  if (X_SpinGC_CisAit(list_1_j + 1, is1_spin, sigma2, &off) != 0) {
149  GetOffComp(list_2_1, list_2_2, off, X->Large.irght, X->Large.ilft, X->Large.ihfbit, tmp_off);
150  return 1;
151  }
152  else {
153  *tmp_off = 0;
154  return 0;
155  }
156 }/*int X_Spin_CisAit*/
long int * list_2_1
Definition: global.cpp:27
long int * list_2_2
Definition: global.cpp:28
struct LargeList Large
Variables for Matrix-Vector product.
Definition: struct.hpp:397
long int * list_1_org
Definition: global.cpp:31
long int irght
Used for Ogata-Lin ???
Definition: struct.hpp:344
long int ilft
Used for Ogata-Lin ???
Definition: struct.hpp:345
int GetOffComp(long int *_list_2_1, long int *_list_2_2, long int _ibit, const long int _irght, const long int _ilft, const long int _ihfbit, long int *_ioffComp)
function of getting off-diagonal component
Definition: bitcalc.cpp:195
long int ihfbit
Used for Ogata-Lin ???
Definition: struct.hpp:346
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).

◆ X_SpinGC_CisAis()

int X_SpinGC_CisAis ( long int  j,
long int  is1_spin,
long int  sigma1 
)

Compute the grandcanonical spin state with bit mask is1_spin.

Returns
1 if the spin state with bit mask is1_spin is sigma1, 0 for the other.
Author
Takahiro Misawa (The University of Tokyo)
Kazuyoshi Yoshimi (The University of Tokyo)
Parameters
[in]jIndex of wavefunction
[in]is1_spinBit mask
[in]sigma1Target spin state

Definition at line 179 of file mltplySpinCore.cpp.

Referenced by expec_cisajs_SpinGCHalf(), expec_cisajs_SpinHalf(), expec_cisajscktalt_SpinHalf(), GC_child_CisAisCisAis_spin_element(), GC_child_CisAisCitAiu_spin_element(), GC_child_CisAitCiuAiu_spin_element(), GetPairExcitedStateHalfSpin(), SetDiagonalInterAll(), SetDiagonalTEInterAll(), totalspin_Spin(), totalspin_SpinGC(), X_GC_child_CisAisCjuAju_spin_MPIdouble(), X_GC_child_CisAisCjuAju_spin_MPIsingle(), X_GC_child_CisAisCjuAjv_spin_MPIdouble(), and X_GC_child_CisAitCjuAju_spin_MPIdouble().

183  {
184  int A_ibit_tmp;
185  long int list_1_j;
186  // off = j
187  list_1_j = j - 1;
188  A_ibit_tmp = ((list_1_j & is1_spin) / is1_spin) ^ (1 - sigma1);
189  return A_ibit_tmp;
190 }/*int X_SpinGC_CisAis*/

◆ X_SpinGC_CisAit()

int X_SpinGC_CisAit ( long int  j,
long int  is1_spin,
long int  sigma2,
long int *  tmp_off 
)

Compute index of final wavefunction by \(c_{is}^\dagger c_{it}\) term (grandcanonical).

Returns
1 if bit-mask is1_spin is sigma2, 0 for the other
Author
Takahiro Misawa (The University of Tokyo)
Kazuyoshi Yoshimi (The University of Tokyo)
Parameters
[in]jIndex of wavefunction
[in]is1_spinBit mask for computing spin state
[in]sigma2Spin state at site 2
[out]tmp_offIndex of final wavefunction

Definition at line 198 of file mltplySpinCore.cpp.

Referenced by expec_cisajs_SpinGCHalf(), GC_child_CisAisCitAiu_spin_element(), GC_child_CisAitCiuAiu_spin_element(), GC_child_CisAitCiuAiv_spin_element(), mltplyHalfSpinGC(), X_GC_child_CisAitCiuAiv_spin_MPIsingle(), and X_Spin_CisAit().

203  {
204  long int list_1_j, ibit_tmp_1;
205 
206  list_1_j = j - 1;
207 
208  ibit_tmp_1 = list_1_j & is1_spin;
209  if (ibit_tmp_1 == 0 && sigma2 == 0) { // down -> up
210  *tmp_off = list_1_j + is1_spin;
211  return 1;
212  }
213  else if (ibit_tmp_1 != 0 && sigma2 == 1) { // up -> down
214  *tmp_off = list_1_j - is1_spin;
215  return 1;
216  }
217  else {
218  *tmp_off = 0;
219  return 0;
220  }
221 }/*int X_SpinGC_CisAit*/