3
0
mirror of https://github.com/triqs/dft_tools synced 2025-01-12 22:18:23 +01:00

gf : cleaning the imtime evaluator

This commit is contained in:
Laura Messio 2013-09-06 18:13:38 +02:00 committed by Olivier Parcollet
parent 257bdb9d6a
commit 29a6a9f5df
2 changed files with 7 additions and 8 deletions

View File

@ -77,15 +77,14 @@ namespace triqs { namespace gfs {
double beta = g->mesh().domain().beta;
int p = std::floor(tau/beta);
tau -= p*beta;
double a = tau/g->mesh().delta();
long n = std::floor(a);
double w = a-n;
assert(n < g->mesh().size()-1);
auto _ = arrays::ellipsis();
size_t n; double w; bool in;
std::tie(in, n, w) = windowing(g->mesh(),tau);
if (!in) TRIQS_RUNTIME_ERROR <<" Evaluation out of bounds";
auto gg = on_mesh(*g);
if ((g->mesh().domain().statistic == Fermion) && (p%2==1))
_tmp = - w*g->data()(n, _) - (1-w)*g->data()(n+1, _);
_tmp = - (1-w)*gg(n) - w*gg(n+1);
else
_tmp = w*g->data()(n, _) + (1-w)*g->data()(n+1, _);
_tmp = (1-w)*gg(n) + w*gg(n+1);
//else { // Speed test to redo when incoparated qview in main branch
// _tmp(0,0) = w*g->data()(n, 0,0) + (1-w)*g->data()(n+1, 0,0);
// _tmp(0,1) = w*g->data()(n, 0,1) + (1-w)*g->data()(n+1, 0,1);

View File

@ -193,7 +193,7 @@ namespace triqs { namespace gfs {
template<typename D>
std::tuple<bool, size_t, double> windowing ( linear_mesh<D> const & mesh, typename D::point_t const & x) {
double a = (x - mesh.x_min())/mesh.delta();
long i = floor(a);
long i = std::floor(a);
bool in = (! ((i<0) || (i>long(mesh.size())-1)));
double w = a-i;
// std::cerr << " window "<< i << " "<< in << " "<< w<< std::endl ;