Ejemplo n.º 1
0
typename MAT::type
det_rat_row_column_up(int flavor_ins, int flavor_rem, double t_ins, double t_rem, int row, int column, const MAT & M,
  const operator_container_t& creation_operators, const operator_container_t& annihilation_operators, const HYB& F, MAT2& sign_Fs, MAT2& Fe_M, double BETA) {

  typedef typename MAT::type SCALAR;
  
  const double sign=((row+column)%2==0 ? 1 : -1);
  
  if (annihilation_operators.size()>0) {
    operator_container_t::iterator it_c=creation_operators.begin();
    operator_container_t::iterator it_a=annihilation_operators.begin();
    Eigen::Matrix<SCALAR,Eigen::Dynamic,Eigen::Dynamic> Fe(1,annihilation_operators.size());
    if (annihilation_operators.size()!=creation_operators.size()) {
      throw std::runtime_error("annihilation_operators.size()!=creation_operators.size() in det_rat_row_column_up");
    }

    for (int i=0; i<(int)creation_operators.size(); i++) {
      Fe(0,i) = interpolate_F(t_rem-it_c->time(), BETA, F[flavor_rem][it_c->flavor()]);
      sign_Fs(i,0) = sign*interpolate_F(it_a->time()-t_ins, BETA, F[(int)(it_a->flavor())][flavor_ins]);
      it_c++;
      it_a++;
    }
    
    Fe_M = Fe*M.block();
  
    return sign*interpolate_F(t_rem-t_ins, BETA, F[flavor_rem][flavor_ins])-(Fe_M*sign_Fs)(0,0);
  } else {
    return sign*interpolate_F(t_rem-t_ins, BETA, F[flavor_rem][flavor_ins]);
  }
}
Ejemplo n.º 2
0
inline
double make_set_impl(const operator_container_t &annihilation_operators, double BETA, double dtau, std::set<boost::tuple<double,int,double> >& annset) {
  int row = -1;
  annset.clear();
  int num_op_shifted = 0;
  double perm = 1.0;
  for (operator_container_t::iterator ita = annihilation_operators.begin(); ita != annihilation_operators.end(); ita++) {
    row++;
    double p = 1.0;
    double t = ita->time() + dtau;
    if (t > BETA) {
      t -= BETA;
      p = -1.0;
      perm *= -1;
      ++num_op_shifted;
    }
    annset.insert(boost::make_tuple(t,row,p));
  }
  return perm * (
                 ((annihilation_operators.size()-num_op_shifted)*num_op_shifted)%2==0 ? 1 : -1
  );
}
Ejemplo n.º 3
0
void construct_blas_matrix(MAT & M, const operator_container_t &creation_operators,
  const operator_container_t &annihilation_operators, double BETA, const HYB & F)
{

  int N = creation_operators.size();
  M.resize(N, N);
  int row = -1;
  int column = -1;
  for (operator_container_t::iterator ita = annihilation_operators.begin(); ita != annihilation_operators.end(); ita++) {
    row++;
    for (operator_container_t::iterator itc = creation_operators.begin(); itc != creation_operators.end(); itc++) {
      column++;

      double argument = ita->time() - itc->time();
      double sign = 1;
      if (argument < 0) {
        argument += BETA;
        sign = -1;
      }
      M(row, column) = interpolate_F(argument, BETA, F[ita->flavor()][itc->flavor()]) * sign;
    }
    column = -1;
  }
}