HΦ  3.2.0
PairEx.c
Go to the documentation of this file.
1 /* HPhi - Quantum Lattice Model Simulator */
2 /* Copyright (C) 2015 The University of Tokyo */
3 
4 /* This program is free software: you can redistribute it and/or modify */
5 /* it under the terms of the GNU General Public License as published by */
6 /* the Free Software Foundation, either version 3 of the License, or */
7 /* (at your option) any later version. */
8 
9 /* This program is distributed in the hope that it will be useful, */
10 /* but WITHOUT ANY WARRANTY; without even the implied warranty of */
11 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
12 /* GNU General Public License for more details. */
13 
14 /* You should have received a copy of the GNU General Public License */
15 /* along with this program. If not, see <http://www.gnu.org/licenses/>. */
16 /*-------------------------------------------------------------*/
17 #include "bitcalc.h"
18 #include "mltplyCommon.h"
19 #include "PairEx.h"
20 #include "PairExHubbard.h"
21 #include "PairExSpin.h"
22 
47 (
48  struct BindStruct *X,
49  double complex *tmp_v0,
50  double complex *tmp_v1
51  )
52 {
53  int iret;
54  long unsigned int irght,ilft,ihfbit;
55 
56  // i_max = X->Check.idim_max;
57  if(X->Def.iFlgGeneralSpin == FALSE) {
58  if (GetSplitBitByModel(X->Def.Nsite, X->Def.iCalcModel, &irght, &ilft, &ihfbit) != 0) {
59  return -1;
60  }
61  }
62  else {
63  if (GetSplitBitForGeneralSpin(X->Def.Nsite, &ihfbit, X->Def.SiteToBit) != 0) {
64  return -1;
65  }
66  }
67 
68  X->Large.i_max = X->Check.idim_maxOrg;
69  X->Large.irght = irght;
70  X->Large.ilft = ilft;
71  X->Large.ihfbit = ihfbit;
72  X->Large.mode=M_CALCSPEC;
73 
74  switch(X->Def.iCalcModel){
75  case HubbardGC:
76  iret=GetPairExcitedStateHubbardGC(X, tmp_v0, tmp_v1);
77  break;
78 
79  case KondoGC:
80  case Hubbard:
81  case Kondo:
82  iret=GetPairExcitedStateHubbard(X, tmp_v0, tmp_v1);
83  break;
84 
85  case Spin: // for the Sz-conserved spin system
86  iret =GetPairExcitedStateSpin(X, tmp_v0, tmp_v1);
87  break;
88 
89  case SpinGC:
90  iret=GetPairExcitedStateSpinGC(X,tmp_v0, tmp_v1);
91  break;
92 
93  default:
94  iret =FALSE;
95  break;
96  }
97 
98  return iret;
99 }
struct DefineList Def
Definision of system (Hamiltonian) etc.
Definition: struct.h:410
int GetPairExcitedStateHubbardGC(struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
Definition: PairExHubbard.c:37
int GetSplitBitForGeneralSpin(const int Nsite, long unsigned int *ihfbit, const long int *SiteToBit)
function of getting right, left and half bits corresponding to a original space.
Definition: bitcalc.c:124
long unsigned int ihfbit
Used for Ogata-Lin ???
Definition: struct.h:345
struct LargeList Large
Variables for Matrix-Vector product.
Definition: struct.h:412
int GetPairExcitedStateSpinGC(struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
Calculation of pair excited state for Spin Grand canonical system.
Definition: PairExSpin.c:35
int mode
multiply or expectation value.
Definition: struct.h:330
int GetPairExcitedState(struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
Calculating the pair excited state by the pair operator; , where indicates a creation (anti-creat...
Definition: PairEx.c:47
Bind.
Definition: struct.h:409
unsigned long int idim_maxOrg
The local Hilbert-space dimention of original state for the spectrum.
Definition: struct.h:305
unsigned int Nsite
Number of sites in the INTRA process region.
Definition: struct.h:56
int GetPairExcitedStateSpin(struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
Definition: PairExSpin.c:226
long unsigned int ilft
Used for Ogata-Lin ???
Definition: struct.h:344
int GetSplitBitByModel(const int Nsite, const int iCalcModel, long unsigned int *irght, long unsigned int *ilft, long unsigned int *ihfbit)
function of splitting original bit into right and left spaces.
Definition: bitcalc.c:78
long int i_max
Length of eigenvector.
Definition: struct.h:317
int iFlgGeneralSpin
Flag for the general (Sz/=1/2) spin.
Definition: struct.h:86
#define FALSE
Definition: global.h:25
long int * SiteToBit
[DefineList::NsiteMPI] Similar to DefineList::Tpow. For general spin.
Definition: struct.h:94
int GetPairExcitedStateHubbard(struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
struct EDMainCalStruct X
Definition: struct.h:432
long unsigned int irght
Used for Ogata-Lin ???
Definition: struct.h:343
int iCalcModel
Switch for model. 0:Hubbard, 1:Spin, 2:Kondo, 3:HubbardGC, 4:SpinGC, 5:KondoGC, 6:HubbardNConserved.
Definition: struct.h:198
struct CheckList Check
Size of the Hilbert space.
Definition: struct.h:411