53 bool opt_C =
true, opt_F =
true;
54 bool debug_flag =
false;
55 int period = 0, seqlen = 0;
58 cur = cur->xmlChildrenNode;
61 std::string cname((
const char*)cur->name);
63 if (cname ==
"region")
67 std::string opt =
"true";
69 oAttrib.
add(opt,
"opt");
70 oAttrib.
add(type,
"type");
72 opt_C = (opt ==
"true" || opt ==
"yes");
74 xmlNodePtr cur2 = cur->xmlChildrenNode;
75 if (type ==
"normalized_gaussian")
79 std::string cname2((
const char*)cur2->name);
80 if (cname2 ==
"function")
85 oAttrib2.
add(fid,
"id");
88 auto func = std::make_unique<FunctorType>(fid);
90 C->addFunc(std::move(func), fid);
96 else if (type ==
"voronoi")
101 std::string cname2((
const char*)cur2->name);
107 oAttrib2.
add(vname,
"name");
109 if (vname ==
"alpha")
121 std::ostringstream os;
126 bool opt_g = opt_C && (i != 0);
129 std::string fid = os.str();
130 auto func = std::make_unique<FunctorType>(fid, alpha, gr, opt_g);
131 C->addFunc(std::move(func), fid);
137 F.resize(Fdim, Fdim);
138 for (
int I = 0;
I < Fdim; ++
I)
139 for (
int J = 0;
J < Fdim; ++
J)
149 std::string namestr =
"none";
150 oAttrib.
add(namestr,
"name");
155 std::string form =
"upper_triang";
156 std::string opt =
"true";
158 rAttrib2.
add(opt,
"opt");
159 rAttrib2.
add(form,
"form");
161 opt_F = (opt ==
"yes" || opt ==
"true");
163 if (form ==
"upper_triang")
166 std::vector<RealType> F_utri;
168 int Fdim = (
std::sqrt(8 * F_utri.size() + 1) - 1) / 2;
170 if (!(F_utri.size() == Fdim * (Fdim + 1) / 2))
172 std::ostringstream err;
173 err <<
"CountingJastrow::put: F needs to be the upper-triangular component of a square matrix: " 174 << F_utri.size() <<
" != " << Fdim * (Fdim + 1) / 2 << std::endl;
178 F.resize(Fdim, Fdim);
179 auto it = F_utri.begin();
180 for (
int I = 0;
I < Fdim; ++
I)
181 for (
int J =
I;
J < Fdim; ++
J, ++it)
182 F(
I,
J) = F(
J,
I) = (*it);
184 else if (form ==
"full_matrix")
189 RealType x = F(F.rows() - 1, F.cols() - 1);
190 for (
int I = 0;
I < F.rows(); ++
I)
191 for (
int J = 0;
J < F.cols(); ++
J)
194 if (namestr ==
"debug")
199 rAttrib2.
add(period,
"period");
200 rAttrib2.
add(seqlen,
"seqlen");
206 auto CJ = std::make_unique<CJOrbitalType>(
targetPtcl, std::move(
C), F, opt_C, opt_F);
208 CJ->addDebug(debug_flag, seqlen, period);
const std::string & getName() const
return the name
helper functions for EinsplineSetBuilder
An abstract class for wave function builders.
bool put(xmlNodePtr cur)
assign attributes to the set
std::unique_ptr< WaveFunctionComponent > createCJ(xmlNodePtr cur)
ParticleSet & targetPtcl
reference to the particle set on which targetPsi is defined
Wrapping information on parallelism.
Specialized paritlce class for atomistic simulations.
Final class and should not be derived.
class to handle a set of attributes of an xmlNode
declaration of ProgressReportEngine
std::unique_ptr< WaveFunctionComponent > buildComponent(xmlNodePtr cur) override
process a xml node at cur
std::string ClassName
class Name
#define APP_ABORT(msg)
Widely used but deprecated fatal error macros from legacy code.
WaveFunctionComponent::RealType RealType
SpeciesSet & getSpeciesSet()
retrun the SpeciesSet of this particle set
bool putContent(T &a, xmlNodePtr cur)
replaces a's value with the first "element" in the "string" returned by XMLNodeString{cur}.
MakeReturn< UnaryNode< FnSqrt, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t sqrt(const Vector< T1, C1 > &l)
Custom container for set of attributes for a set of species.
void add(PDT &aparam, const std::string &aname, std::vector< PDT > candidate_values={}, TagStatus status=TagStatus::OPTIONAL)
add a new attribute
CountingJastrowBuilder(Communicate *comm, ParticleSet &target, ParticleSet &source)