29 : first_force_index_(-1),
30 n_nuc_(ions.getTotalNum()),
31 n_el_(elns.getTotalNum()),
51 for (
int iat = 0; iat <
n_nuc_; iat++)
55 std::ostringstream obsName;
56 obsName <<
prefix_ <<
"_" << iat <<
"_" << x;
57 plist.
add(obsName.str());
69 std::ostringstream obsName;
70 obsName <<
prefix_ <<
"_" << i <<
"_" << j;
71 plist.
add(obsName.str());
77 std::vector<int> ndim(2);
82 auto& h5o = h5list.back();
89 for (
int iat = 0; iat <
n_nuc_; iat++)
102 for (
int iat = 0; iat <
OHMMS_DIM; iat++)
104 for (
int jat = iat; jat <
OHMMS_DIM; jat++)
106 plist[index] =
stress_(iat, jat);
116 for (
int iat = 0; iat <
n_nuc_; iat++)
120 plist[index] =
forces_[iat][x];
129 for (
int iat = 0; iat <
OHMMS_DIM; iat++)
131 for (
int jat = iat; jat <
OHMMS_DIM; jat++)
133 plist[index] =
stress_(iat, jat);
149 std::vector<Real> h(numFuncs);
151 ck_.resize(numFuncs, 0.0);
154 for (
int i = 0; i <
m_; i++)
156 for (
int j = 1; j <= numFuncs; j++)
158 h[j - 1] = R2jp1 /
Real(j + 1);
160 for (
int k = 1; k <= numFuncs; k++)
162 S(k - 1, j - 1) = R2m * R2k * R2jp1 / (
Real)(
m_ + k + j + 1);
169 for (
int i = 0; i < numFuncs; i++)
171 for (
int j = 0; j < numFuncs; j++)
172 ck_[i] += S(i, j) * h[j];
174 FILE* fout = fopen(
"g_r.dat",
"w");
175 for (
double r = 0.0; r <
rcut_; r += 0.001)
176 fprintf(fout,
"%1.10f %1.10e\n", r,
g(r));
178 app_log() <<
"Initialized variance reduction coefs.\n";
void resize(size_type n, Type_t val=Type_t())
Resize the container.
MatrixA::value_type invert_matrix(MatrixA &M, bool getdet=true)
invert a matrix
void setForcesIonIon(const ParticleSet::ParticlePos &forces_ion_ion)
const std::string & getName() const
return the name
void setObservablesStress(QMCTraits::PropertySetType &plist)
helper functions for EinsplineSetBuilder
void setForces(const ParticleSet::ParticlePos &forces)
ParticleSet::ParticlePos forces_
void addObservablesF(QMCTraits::PropertySetType &plist)
Vectorized record engine for scalar properties.
ForceBase(ParticleSet &ions, ParticleSet &elns)
Attaches a unit to a Vector for IO.
void registerObservablesF(std::vector< ObservableHelper > &h5list, hdf_archive &file) const
MakeReturn< BinaryNode< FnPow, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t, typename CreateLeaf< Vector< T2, C2 > >::Leaf_t > >::Expression_t pow(const Vector< T1, C1 > &l, const Vector< T2, C2 > &r)
void initVarReduction(Real rcut, int m, int numFuncs)
void addObservablesStress(QMCTraits::PropertySetType &plist)
Specialized paritlce class for atomistic simulations.
void setParticleSetStress(QMCTraits::PropertySetType &plist, int offset)
int add(const std::string &aname)
Final class and should not be derived.
declaration of ProgressReportEngine
void setParticleSetF(QMCTraits::PropertySetType &plist, int offset)
QMCTraits::RealType Real
cheat, need to use virtual inheriance to clean up
Define determinant operators.
void setObservablesF(QMCTraits::PropertySetType &plist)
SymTensor< Real, OHMMS_DIM > stress_
ParticleSet::ParticlePos forces_ion_ion_