Bridge++
Ver. 1.1.x
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
fopr_Wilson_Isochemical.cpp
Go to the documentation of this file.
1
14
#include "
fopr_Wilson_Isochemical.h
"
15
16
#ifdef USE_PARAMETERS_FACTORY
17
#include "
parameters_factory.h
"
18
#endif
19
20
using
std::valarray;
21
using
std::string;
22
23
//- parameter entries
24
namespace
{
25
void
append_entry(
Parameters
& param)
26
{
27
param.
Register_double
(
"hopping_parameter"
, 0.0);
28
param.
Register_double
(
"isospin_chemical_potential"
, 0.0);
29
param.
Register_int_vector
(
"boundary_condition"
, std::valarray<int>());
30
31
param.
Register_string
(
"verbose_level"
,
"NULL"
);
32
}
33
34
35
#ifdef USE_PARAMETERS_FACTORY
36
bool
init_param =
ParametersFactory::Register
(
"Fopr.Wilson_Isochemical"
, append_entry);
37
#endif
38
}
39
//- end
40
41
//- parameters class
42
Parameters_Fopr_Wilson_Isochemical::Parameters_Fopr_Wilson_Isochemical
() { append_entry(*
this
); }
43
//- end
44
45
//====================================================================
46
void
Fopr_Wilson_Isochemical::set_parameters
(
const
Parameters
& params)
47
{
48
const
string
str_vlevel = params.
get_string
(
"verbose_level"
);
49
50
m_vl
=
vout
.
set_verbose_level
(str_vlevel);
51
52
//- fetch and check input parameters
53
double
kappa, mu;
54
valarray<int> bc;
55
56
int
err = 0;
57
err += params.
fetch_double
(
"hopping_parameter"
, kappa);
58
err += params.
fetch_double
(
"isospin_chemical_potential"
, mu);
59
err += params.
fetch_int_vector
(
"boundary_condition"
, bc);
60
61
if
(err) {
62
vout
.
crucial
(
m_vl
,
"Fopr_Wilson_Isochemical: fetch error, input parameter not found.\n"
);
63
abort();
64
}
65
66
67
set_parameters
(kappa, mu, bc);
68
}
69
70
71
//====================================================================
72
void
Fopr_Wilson_Isochemical::set_parameters
(
const
double
kappa,
73
const
double
mu,
74
const
valarray<int> bc)
75
{
76
//- print input parameters
77
vout
.
general
(
m_vl
,
"Parameters of Fopr_Wilson_Isochemical:\n"
);
78
vout
.
general
(
m_vl
,
" kappa = %8.4f\n"
, kappa);
79
vout
.
general
(
m_vl
,
" mu = %8.4f\n"
, mu);
80
for
(
int
dir = 0; dir <
m_Ndim
; ++dir) {
81
vout
.
general
(
m_vl
,
" boundary[%d] = %2d\n"
, dir, bc[dir]);
82
}
83
84
//- range check
85
// NB. kappa,mu = 0 is allowed.
86
assert(bc.size() ==
m_Ndim
);
87
88
//- store values
89
m_kappa
= kappa;
90
m_mu
= mu;
91
m_exp_mu
= exp(mu);
92
93
m_boundary
.resize(m_Ndim);
94
for
(
int
dir = 0; dir <
m_Ndim
; ++dir) {
95
m_boundary
[dir] = bc[dir];
96
}
97
98
//- propagate parameters
99
m_fopr_w
->
set_parameters
(kappa, bc);
100
}
101
102
103
//====================================================================
104
void
Fopr_Wilson_Isochemical::init
(
string
repr)
105
{
106
m_Ndim =
CommonParameters::Ndim
();
107
108
m_boundary
.resize(m_Ndim);
109
m_U
= 0;
110
111
m_fopr_w
=
new
Fopr_Wilson
(repr);
112
}
113
114
115
//====================================================================
116
void
Fopr_Wilson_Isochemical::tidyup
()
117
{
118
delete
m_fopr_w
;
119
}
120
121
122
//====================================================================
123
void
Fopr_Wilson_Isochemical::D
(
Field
& w,
const
Field
& f)
124
{
125
int
Nvol =
field_nvol
();
126
int
Nin =
field_nin
();
127
int
Nex =
field_nex
();
128
Field
v(Nin, Nvol, Nex);
129
130
Dspc
(w, f);
131
132
v = 0.0;
133
m_fopr_w
->
mult_up
(3, v, f);
134
w.
addpart_ex
(0, v, 0, -m_kappa *
m_exp_mu
);
135
136
v = 0.0;
137
m_fopr_w
->
mult_dn
(3, v, f);
138
w.
addpart_ex
(0, v, 0, -m_kappa / m_exp_mu);
139
}
140
141
142
//====================================================================
143
void
Fopr_Wilson_Isochemical::Dminmu
(
Field
& w,
const
Field
& f)
144
{
145
int
Nvol =
field_nvol
();
146
int
Nin =
field_nin
();
147
int
Nex =
field_nex
();
148
Field
v(Nin, Nvol, Nex);
149
150
Dspc
(w, f);
151
152
v = 0.0;
153
m_fopr_w
->
mult_up
(3, v, f);
154
w.
addpart_ex
(0, v, 0, -m_kappa /
m_exp_mu
);
155
156
v = 0.0;
157
m_fopr_w
->
mult_dn
(3, v, f);
158
w.
addpart_ex
(0, v, 0, -m_kappa *
m_exp_mu
);
159
}
160
161
162
//====================================================================
163
void
Fopr_Wilson_Isochemical::Dspc
(
Field
& w,
const
Field
& f)
164
{
165
w = 0.0;
166
167
m_fopr_w
->
mult_up
(0, w, f);
168
m_fopr_w
->
mult_dn
(0, w, f);
169
170
m_fopr_w
->
mult_up
(1, w, f);
171
m_fopr_w
->
mult_dn
(1, w, f);
172
173
m_fopr_w
->
mult_up
(2, w, f);
174
m_fopr_w
->
mult_dn
(2, w, f);
175
176
w *= -
m_kappa
;
177
w += f;
178
}
179
180
181
//====================================================================
182
void
Fopr_Wilson_Isochemical::mult_gm5
(
Field
& v,
const
Field
& f)
183
{
184
m_fopr_w
->
mult_gm5
(v, f);
185
}
186
187
188
//====================================================================
189
const
Field_F
Fopr_Wilson_Isochemical::mult_gm5p
(
int
mu,
190
const
Field_F
& w)
191
{
192
Field
vt(w.
nin
(), w.
nvol
(), w.
nex
());
193
194
vt = 0.0;
195
196
m_fopr_w
->
mult_up
(mu, vt, (
Field
)w);
197
198
return
(
Field_F
)
m_fopr_w
->
mult_gm5
(vt);
199
}
200
201
202
//====================================================================
203
void
Fopr_Wilson_Isochemical::DdagD
(
Field
& w,
const
Field
& f)
204
{
205
Field
w2(f.
nin
(), f.
nvol
(), f.
nex
());
206
207
D
(w2, f);
208
mult_gm5
(w, w2);
209
Dminmu
(w2, w);
210
mult_gm5
(w, w2);
211
}
212
213
214
//====================================================================
215
void
Fopr_Wilson_Isochemical::Ddag
(
Field
& w,
const
Field
& f)
216
{
217
Field
w2(f.
nin
(), f.
nvol
(), f.
nex
());
218
219
mult_gm5
(w, f);
220
Dminmu
(w2, w);
221
mult_gm5
(w, w2);
222
}
223
224
225
//====================================================================
226
void
Fopr_Wilson_Isochemical::H
(
Field
& w,
const
Field
& f)
227
{
228
Field
w2(f.
nin
(), f.
nvol
(), f.
nex
());
229
230
D
(w2, f);
231
mult_gm5
(w, w2);
232
}
233
234
235
//====================================================================
236
void
Fopr_Wilson_Isochemical::Hdag
(
Field
& w,
const
Field
& f)
237
{
238
Field
w2(f.
nin
(), f.
nvol
(), f.
nex
());
239
240
Dminmu
(w2, f);
241
mult_gm5
(w, w2);
242
}
243
244
245
//====================================================================
246
//============================================================END=====
src
Fopr
fopr_Wilson_Isochemical.cpp
Generated on Tue Jul 23 2013 10:48:48 for Bridge++ by
1.8.3.1