HPhi++  3.1.0
PairEx.cpp
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.hpp"
18 #include "mltplyCommon.hpp"
19 #include "PairEx.hpp"
20 #include "PairExHubbard.hpp"
21 #include "PairExSpin.hpp"
22 
47 (
48  struct BindStruct *X,
49  int nstate, std::complex<double> **tmp_v0,
50  std::complex<double> **tmp_v1,
51  int iEx
52 )
53 {
54  int iret;
55  long int irght, ilft, ihfbit;
56 
57  // i_max = X->Check.idim_max;
58  if (X->Def.iFlgGeneralSpin == FALSE) {
59  if (GetSplitBitByModel(X->Def.Nsite, X->Def.iCalcModel, &irght, &ilft, &ihfbit) != 0) {
60  return -1;
61  }
62  }
63  else {
64  if (GetSplitBitForGeneralSpin(X->Def.Nsite, &ihfbit, X->Def.SiteToBit) != 0) {
65  return -1;
66  }
67  }
68 
69  X->Large.i_max = X->Check.idim_maxOrg;
70  X->Large.irght = irght;
71  X->Large.ilft = ilft;
72  X->Large.ihfbit = ihfbit;
73  X->Large.mode = M_CALCSPEC;
74 
75  switch (X->Def.iCalcModel) {
76  case HubbardGC:
77  iret = GetPairExcitedStateHubbardGC(X, nstate, tmp_v0, tmp_v1, iEx);
78  break;
79 
80  case KondoGC:
81  case Hubbard:
82  case Kondo:
83  iret = GetPairExcitedStateHubbard(X, nstate, tmp_v0, tmp_v1, iEx);
84  break;
85 
86  case Spin: // for the Sz-conserved spin system
87  iret = GetPairExcitedStateSpin(X, nstate, tmp_v0, tmp_v1, iEx);
88  break;
89 
90  case SpinGC:
91  iret = GetPairExcitedStateSpinGC(X, nstate, tmp_v0, tmp_v1, iEx);
92  break;
93 
94  default:
95  iret = FALSE;
96  break;
97  }
98 
99  return iret;
100 }
struct DefineList Def
Definision of system (Hamiltonian) etc.
Definition: struct.hpp:395
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.
Definition: bitcalc.cpp:78
int Nsite
Number of sites in the INTRA process region.
Definition: struct.hpp:56
long int idim_maxOrg
The local Hilbert-space dimention of original state for the spectrum.
Definition: struct.hpp:307
int GetPairExcitedStateHubbardGC(struct BindStruct *X, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1, int iEx)
int GetPairExcitedState(struct BindStruct *X, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1, int iEx)
Calculating the pair excited state by the pair operator; , where indicates a creation (anti-creat...
Definition: PairEx.cpp:47
struct LargeList Large
Variables for Matrix-Vector product.
Definition: struct.hpp:397
int mode
multiply or expectation value.
Definition: struct.hpp:331
long int irght
Used for Ogata-Lin ???
Definition: struct.hpp:344
long int ilft
Used for Ogata-Lin ???
Definition: struct.hpp:345
Bind.
Definition: struct.hpp:394
int GetSplitBitForGeneralSpin(const int Nsite, long int *ihfbit, const long int *SiteToBit)
function of getting right, left and half bits corresponding to a original space.
Definition: bitcalc.cpp:124
long int ihfbit
Used for Ogata-Lin ???
Definition: struct.hpp:346
long int i_max
Length of eigenvector.
Definition: struct.hpp:318
int GetPairExcitedStateHubbard(struct BindStruct *X, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1, int iEx)
int iFlgGeneralSpin
Flag for the general (Sz/=1/2) spin.
Definition: struct.hpp:86
long int * SiteToBit
[DefineList::NsiteMPI] Similar to DefineList::Tpow. For general spin.
Definition: struct.hpp:94
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.
Definition: PairExSpin.cpp:216
int GetPairExcitedStateSpin(struct BindStruct *X, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1, int iEx)
Definition: PairExSpin.cpp:456
int iCalcModel
Switch for model. 0:Hubbard, 1:Spin, 2:Kondo, 3:HubbardGC, 4:SpinGC, 5:KondoGC, 6:HubbardNConserved.
Definition: struct.hpp:200
struct CheckList Check
Size of the Hilbert space.
Definition: struct.hpp:396