32 std::string use_tmove =
"no";
40 m_param.
add(use_tmove,
"nonlocalmove");
41 m_param.
add(use_tmove,
"nonlocalmoves");
42 bool success = m_param.
put(cur);
47 if (use_tmove ==
"no")
50 o <<
" Using Locality Approximation";
52 else if (use_tmove ==
"yes" || use_tmove ==
"v0")
55 o <<
" Using Non-local T-moves v0, M. Casula, PRB 74, 161102(R) (2006)";
57 else if (use_tmove ==
"v1")
60 o <<
" Using Non-local T-moves v1, M. Casula et al., JCP 132, 154113 (2010)";
62 else if (use_tmove ==
"v3")
65 o <<
" Using Non-local T-moves v3, an approximation to v1";
68 throw std::runtime_error(
"NonLocalTOperator::put unknown nonlocalmove option " + use_tmove);
71 app_log() << o.str() << std::endl;
88 if (non_local_move_option ==
"no")
90 else if (non_local_move_option ==
"yes" || non_local_move_option ==
"v0")
92 else if (non_local_move_option ==
"v1")
94 else if (non_local_move_option ==
"v3")
97 throw std::runtime_error(
"NonLocalTOperator::put unknown nonlocalmove option " + non_local_move_option);
106 for (
int i = 0; i < txy.size(); i++)
109 if (txy[i].Weight > 0)
115 const RealType target = prob * wgt_t;
121 return ibar > 0 ? &(txy[ibar - 1]) :
nullptr;
127 for (
int i = 0; i < num_elec; i++)
130 for (
int i = 0; i < txy.size(); i++)
132 assert(txy[i].PID >= 0 && txy[i].PID < num_elec);
void groupByElectron(size_t num_elec, const std::vector< NonLocalData > &txy)
sort all the Txy elements by electron
helper functions for EinsplineSetBuilder
int thingsThatShouldBeInMyConstructor(const std::string &non_local_move_option, const double tau, const double alpha, const double gamma)
replacement for put because wouldn't it be cool to know what the classes configuration actually is...
Declaration of NonLocalTOperator.
std::vector< std::vector< NonLocalData > > txy_by_elec_
bool put(std::istream &is) override
read from std::istream
class to handle a set of parameters
NonLocalData::RealType RealType
int put(xmlNodePtr cur)
initialize the parameters
std::vector< RealType > txy_scan_
void add(PDT &aparam, const std::string &aname_in, std::vector< PDT > candidate_values={}, TagStatus status=TagStatus::OPTIONAL)
add a new parameter corresponding to an xmlNode <parameter>
const NonLocalData * selectMove(RealType prob, const std::vector< NonLocalData > &txy)
select the move for a given probability
RealType plusFactor
factor applied on >0 weight
RealType minusFactor
factor applied on <=0 weight