25 const std::string&
snone =
"none";
63 using namespace Units;
70 std::string units_in =
snone;
81 attrib.
add(units_in,
"units");
93 APP_ABORT(
"SPOSetInputInfo::put group must be positive");
98 if (units_in ==
snone)
99 APP_ABORT(
"SPOSetInputInfo::put ecut or energy range present, but units have not been provided");
110 xmlNodePtr element = cur->xmlChildrenNode;
111 while (element != NULL)
113 std::string ename((
const char*)element->name);
114 if (ename ==
"indices")
119 else if (ename ==
"energies")
125 attrib.
add(units_in,
"units");
128 if (units_in ==
snone)
129 APP_ABORT(
"SPOSetInputInfo::put energies present, but units have not been provided");
137 std::vector<double> entmp;
142 element = element->next;
176 for (
int i = 0; i <
occ.size(); ++i)
189 for (
int i = 0; i <
indices.size(); ++i)
216 for (
int i = 0; i <
energies.size(); ++i)
228 app_log() << pad <<
"SPOSetInput report" << std::endl;
237 app_log() << pad <<
" size = " <<
size << std::endl;
240 app_log() << pad <<
" occ = " <<
occ << std::endl;
241 app_log() << pad <<
" ecut = " <<
ecut << std::endl;
244 app_log() << pad <<
" # of indices = " <<
indices.size() << std::endl;
245 app_log() << pad <<
" indices = \n ";
246 for (
int i = 0; i <
indices.size(); ++i)
249 app_log() << pad <<
" # of energies = " <<
energies.size() << std::endl;
250 app_log() << pad <<
" energies = \n ";
251 for (
int i = 0; i <
energies.size(); ++i)
259 app_log() << pad <<
"end SPOSetInput report" << std::endl;
270 if (
group >= states_vec.size())
271 APP_ABORT(
"SPOSetInputInfo::get_indices orbital group index is out of range");
278 APP_ABORT(
"SPOSetInputInfo::get_indices\n energies requested for sposet\n but state info is incomplete");
293 APP_ABORT(
"SPOSetInputInfo::get_indices requested state indices outside the range of states");
296 APP_ABORT(
"SPOSetInputInfo::get_indices no states matched request");
310 for (
int i = 0; i <
size; ++i)
323 occupy(
"index_range", ind);
338 for (
int i = 0; i <
occ.size(); ++i)
350 for (
int i = 0; i < states.
size(); ++i)
352 const SPOInfo& state = *states[i];
354 ind.push_back(state.
index);
365 for (
int i = 0; i < states.
size(); ++i)
367 const SPOInfo& state = *states[i];
369 ind.push_back(state.
index);
371 occupy(
"energy_range", ind);
381 "SPOSetInputInfo::load_indices(energies)\n states are not energy ordered\n this is a developer error");
388 while (i < states.
size())
390 const SPOInfo& state = *states[i];
393 ind.push_back(state.
index);
403 APP_ABORT(
"SPOSetInputInfo::load_indices(energies)\n energy eigenvalue not found");
412 int imin = std::numeric_limits<int>::max();
414 for (
int i = 0; i < ind.size(); ++i)
418 imax = std::max(imax, ival);
421 APP_ABORT(
"SPOSetInputInfo::occupy(" + loc +
")\n indices are negative");
422 for (
int i = 0; i < ind.size(); ++i)
429 for (
int j = old_size; j <
occupations.size(); ++j)
433 APP_ABORT(
"SPOSetInputInfo::occupy(" + loc +
")\n sposet request has overlapping index ranges");
QMCTraits::RealType RealType
helper functions for EinsplineSetBuilder
QTBase::RealType RealType
MakeReturn< UnaryNode< FnFabs, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t abs(const Vector< T1, C1 > &l)
void convert(const PL &lat, const PV &pin, PV &pout)
bool put(xmlNodePtr cur)
assign attributes to the set
void occupy_index_range()
bool all_indices_computed
std::vector< int > indices_t
int index
original orbital index in the maximal basis
RealType energy
energy of the orbital (in Hartree units)
void find_index_extrema()
void occupy_ecut(const SPOSetInfo &states)
base class to describe a single orbital in an SPOSet
void occupy_energies(const SPOSetInfo &states)
const std::string & snone
bool energy_ordered() const
class to handle a set of attributes of an xmlNode
void occupy_energy_range(const SPOSetInfo &states)
collection of orbital info for SPOSet instance or builder
units energy_unit(const std::string &su)
convert from std::string to energy unit
#define APP_ABORT(msg)
Widely used but deprecated fatal error macros from legacy code.
void report(const std::string &pad="")
bool has_energies() const
bool putContent(T &a, xmlNodePtr cur)
replaces a's value with the first "element" in the "string" returned by XMLNodeString{cur}.
QMCTraits::RealType RealType
void find_energy_extrema()
std::vector< bool > occupations
void add(PDT &aparam, const std::string &aname, std::vector< PDT > candidate_values={}, TagStatus status=TagStatus::OPTIONAL)
add a new attribute
void occupy(const std::string &loc, const indices_t &ind)
void convert_array(array &values, units units_in, units units_out)
indices_t & get_indices(const std::vector< std::unique_ptr< SPOSetInfo >> &states_vec)