37 APP_ABORT(
"SpinDensity is not implemented for open boundary conditions at present\n please contact the developers " 38 "if you need this feature");
47 name_ =
"SpinDensity";
55 return std::make_unique<SpinDensity>(*this);
64 std::string write_report =
"no";
67 attrib.
add(write_report,
"report");
71 bool have_grid =
false;
72 bool have_center =
false;
73 bool have_corner =
false;
74 bool have_cell =
false;
82 xmlNodePtr element = cur->xmlChildrenNode;
83 while (element != NULL)
85 std::string ename((
const char*)element->name);
86 if (ename ==
"parameter")
94 else if (name ==
"grid")
99 else if (name ==
"corner")
104 else if (name ==
"center")
109 else if (name ==
"cell")
114 else if (name ==
"test_moves")
117 element = element->next;
120 if (have_dr && have_grid)
122 APP_ABORT(
"SpinDensity::put dr and grid are provided, this is ambiguous");
124 else if (!have_dr && !have_grid)
125 APP_ABORT(
"SpinDensity::put must provide dr or grid");
127 if (have_corner && have_center)
128 APP_ABORT(
"SpinDensity::put corner and center are provided, this is ambiguous");
132 if (!have_corner && !have_center)
133 APP_ABORT(
"SpinDensity::put must provide corner or center");
142 for (
int d = 0; d <
DIM; ++d)
146 for (
int d = 0; d <
DIM; ++d)
149 for (
int d = 1; d <
DIM; ++d)
152 if (write_report ==
"yes")
163 app_log() << pad <<
"SpinDensity report" << std::endl;
164 app_log() << pad <<
" dim = " <<
DIM << std::endl;
166 app_log() << pad <<
" grid = " <<
grid << std::endl;
170 app_log() << pad <<
" cell " << std::endl;
171 for (
int d = 0; d <
DIM; ++d)
172 app_log() << pad <<
" " << d <<
" " <<
cell.
Rv[d] << std::endl;
173 app_log() << pad <<
" end cell " << std::endl;
176 app_log() << pad <<
" species[" <<
s <<
"]" 178 app_log() << pad <<
"end SpinDensity report" << std::endl;
186 collectables.
add(tmp.begin(), tmp.end());
192 std::vector<int> ng(1);
199 auto&
oh = h5desc.back();
220 for (
int d = 0; d <
DIM; ++d)
231 app_log() <<
" SpinDensity test" << std::endl;
234 int pmin = std::numeric_limits<int>::max();
236 for (
int m = 0;
m < moves; ++
m)
238 for (
int p = 0; p < particles; ++p)
241 for (
int d = 0; d <
DIM; ++d)
247 app_log() <<
" end SpinDensity test" << std::endl;
248 APP_ABORT(
"SpinDensity::test test complete");
261 for (
int d = 0; d <
DIM; ++d)
262 inside &= u[d] > 0.0 && u[d] < 1.0;
266 for (
int d = 0; d <
DIM; ++d)
267 point +=
gdims[d] * ((
int)(u[d] *
grid[d]));
268 pmin =
std::min(pmin, point - offset);
269 pmax = std::max(pmax, point - offset);
272 app_log() <<
" pmin = " << pmin <<
" pmax = " << pmax <<
" npoints = " <<
npoints << std::endl;
void set(const Tensor< TT, D > &lat)
set the lattice vector from the command-line options
SingleParticlePos Center
Center of the cell sum(Rv[i])/2.
helper functions for EinsplineSetBuilder
bool put(xmlNodePtr cur) override
Read the input parameter.
QTBase::RealType RealType
std::vector< int > species_size
size_t getTotalNum() const
int my_index_
starting index of this object
bool put(xmlNodePtr cur)
assign attributes to the set
Vectorized record engine for scalar properties.
Return_t test_evaluate(ParticleSet &P, int &pmin, int &pmax)
int size() const
return the number of species
SpinDensity(ParticleSet &P)
void addObservables(PropertySetType &plist, BufferType &olist) override
named values to the property list Default implementaton uses addValue(plist_)
TinyVector< SingleParticlePos, D > Rv
Real-space unit vectors.
TinyVector< int, DIM > gdims
std::string name_
name of this object
Specialized paritlce class for atomistic simulations.
std::unique_ptr< OperatorBase > makeClone(ParticleSet &P, TrialWaveFunction &psi) final
Return_t evaluate(ParticleSet &P) override
Evaluate the local energy contribution of this component.
MakeReturn< UnaryNode< FnCeil, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t ceil(const Vector< T1, C1 > &l)
class to handle a set of attributes of an xmlNode
int groupsize(int igroup) const
return the size of a group
void report(const std::string &pad)
#define APP_ABORT(msg)
Widely used but deprecated fatal error macros from legacy code.
SingleParticlePos toUnit(const TinyVector< T1, D > &r) const
Convert a cartesian vector to a unit vector.
size_type current() const
Walker_t * t_walker_
reference to the current walker
std::string getXMLAttributeValue(const xmlNodePtr cur, const std::string_view name)
get the value string for attribute name if name is unfound in cur you get an empty string back this i...
Buffer_t Collectables
observables in addition to those registered in Properties/PropertyList
SpeciesSet & getSpeciesSet()
retrun the SpeciesSet of this particle set
void registerCollectables(std::vector< ObservableHelper > &h5desc, hdf_archive &file) const override
std::vector< std::string > speciesName
Species name list.
bool putContent(T &a, xmlNodePtr cur)
replaces a's value with the first "element" in the "string" returned by XMLNodeString{cur}.
FullPrecRealType Return_t
type of return value of evaluate
MakeReturn< UnaryNode< FnSqrt, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t sqrt(const Vector< T1, C1 > &l)
Class to represent a many-body trial wave function.
void set_dimensions(const std::vector< int > &dims, int first)
set the shape of this observable
void test(int moves, ParticleSet &P)
FullPrecRealType Weight
Weight of the walker.
const auto & getLattice() const
Tensor< typename BinaryReturn< T1, T2, OpMultiply >::Type_t, D > dot(const AntiSymTensor< T1, D > &lhs, const AntiSymTensor< T2, D > &rhs)
std::vector< std::string > species_name
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
Declaration of a MCWalkerConfiguration.
std::bitset< 8 > update_mode_
set the current update mode
MakeReturn< UnaryNode< FnFloor, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t floor(const Vector< T1, C1 > &l)
TinyVector< int, DIM > grid