Skip to content
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
2b977cf
broken, but initial update of qmcfinite to new code
camelto2 Feb 28, 2020
545c267
edits to make qmcfinitesize up to date with develop
camelto2 Mar 4, 2020
638152d
changes to output formatting
camelto2 Mar 4, 2020
519ba94
Merge branch 'develop' into qmcFScorr
camelto2 Mar 5, 2020
2a3387b
clang-formatting
camelto2 Mar 5, 2020
0150c9b
removed empty file SkParserHDF5.h
camelto2 Mar 5, 2020
0326b05
remove unused code
camelto2 Mar 6, 2020
9493edb
improved spherical grid and handling cases outside spline grid
camelto2 Mar 10, 2020
c741895
add warning for S(k) not being convegred
camelto2 Mar 10, 2020
901c0ef
small fix
camelto2 Mar 10, 2020
4e69879
Merge remote-tracking branch 'upstream/develop' into qmcFScorr
camelto2 Mar 10, 2020
d21f65b
isolate qmcfinitesize in cmake
camelto2 Mar 10, 2020
3f34114
small change to spherical_grid
camelto2 Mar 11, 2020
4575b2b
refactoring for error estimates
camelto2 Mar 11, 2020
273c40b
add stats function, and get potential corr ready for bootstrap
camelto2 Mar 11, 2020
971336b
FS corrections with bootstrapped error estimate
camelto2 Mar 11, 2020
2b180af
Merge remote-tracking branch 'upstream/develop' into qmcFScorr
camelto2 Mar 11, 2020
920fe12
clang format and remove unused CellParserBase
camelto2 Mar 11, 2020
e425e64
fix to rng to work with mixed precision build
camelto2 Mar 11, 2020
65e8602
removed empty CMakeLists
camelto2 Mar 18, 2020
f5a36af
Merge remote-tracking branch 'upstream/develop' into qmcFScorr
camelto2 Mar 23, 2020
f852a4c
initial unit test architecture for QMCTools and QMCFiniteSize
camelto2 Mar 23, 2020
c0b999f
adding unit test, interface to vlr_k in LRHandlers
camelto2 Mar 27, 2020
d06cda6
Merge remote-tracking branch 'upstream/develop' into qmcFScorr
camelto2 Mar 27, 2020
327a9e2
clang-formatting and copyright updates on touched files
camelto2 Mar 27, 2020
34a226f
Merge branch 'develop' into qmcFScorr
prckent Mar 30, 2020
dcada08
fix constructor initialization order and no return type
camelto2 Mar 30, 2020
15cf71f
Merge remote-tracking branch 'upstream/develop' into qmcFScorr
camelto2 Mar 30, 2020
a506037
Merge remote-tracking branch 'origin/qmcFScorr' into qmcFScorr
camelto2 Mar 30, 2020
5d9e634
to trigger the CI
PDoakORNL Mar 30, 2020
8f7dba4
fix compiler warnings for return types and QMCFiniteSize initializatino
camelto2 Mar 30, 2020
2f8ad91
Merge branch 'qmcFScorr' of https://github.com/camelto2/qmcpack into …
camelto2 Mar 30, 2020
2113d4c
to trigger CI
PDoakORNL Mar 30, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions src/LongRange/LRHandlerBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,19 @@ struct LRHandlerBase
return vk;
}

inline mRealType evaluate_w_sk(const std::vector<int>& kshell, const pRealType* restrict sk)
{
mRealType vk = 0.0;
for (int ks = 0, ki = 0; ks < MaxKshell; ks++)
{
mRealType u = 0;
for (; ki < kshell[ks + 1]; ki++)
u += (*sk++);
vk += Fk_symm[ks] * u;
}
return vk;
}

inline mRealType evaluate(const std::vector<int>& kshell,
const pRealType* restrict rk1_r,
const pRealType* restrict rk1_i,
Expand Down Expand Up @@ -303,7 +316,7 @@ struct DummyLRHandler : public LRHandlerBase
Fk.resize(KList.kpts_cart.size());
for (ksh = 0, ik = 0; ksh < MaxKshell; ksh++, ik++)
{
mRealType v = norm * myFunc(kk[KList.kshell[ksh]]); //rpa=u0/kk[ik];
mRealType v = norm * myFunc(kk[KList.kshell[ksh]]); //rpa=u0/kk[ik];
Fk_symm[ksh] = v;
for (; ik < KList.kshell[ksh + 1]; ik++)
Fk[ik] = v;
Expand All @@ -314,8 +327,8 @@ struct DummyLRHandler : public LRHandlerBase
mRealType evaluateLR(mRealType r) { return 0.0; }
mRealType srDf(mRealType r, mRealType rinv) { return 0.0; }
void Breakup(ParticleSet& ref, mRealType rs_in) {}
void resetTargetParticleSet(ParticleSet& ref) {}
virtual LRHandlerBase* makeClone(ParticleSet& ref){return new DummyLRHandler<Func>(LR_kc);}
void resetTargetParticleSet(ParticleSet& ref) {}
virtual LRHandlerBase* makeClone(ParticleSet& ref) { return new DummyLRHandler<Func>(LR_kc); }
};

} // namespace qmcplusplus
Expand Down
18 changes: 17 additions & 1 deletion src/QMCTools/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ PROJECT(qmctools)

SET(MOSRCS
../Particle/InitMolecularSystem.cpp
../Particle/ParticleSetPool.cpp
QMCGaussianParserBase.cpp
GaussianFCHKParser.cpp
GamesXmlParser.cpp
Expand Down Expand Up @@ -69,6 +68,23 @@ TARGET_LINK_LIBRARIES(convertpw4qmc PRIVATE qmcutil Math::FFTW3)
INSTALL(TARGETS convertpw4qmc
RUNTIME DESTINATION bin)

SET(FSSRCS
QMCFiniteSize/QMCFiniteSize.cpp
QMCFiniteSize/SkParserBase.cpp
QMCFiniteSize/SkParserASCII.cpp
QMCFiniteSize/SkParserScalarDat.cpp
QMCFiniteSize/FSUtilities.cpp
)

ADD_LIBRARY(fstool ${FSSRCS})
TARGET_LINK_LIBRARIES(fstool PUBLIC qmc qmcbase qmcwfs)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you check if the dependencies here are necessary?
Do you need qmcwfs or just einspline?
Is qmc target really necessary?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

at the moment, it only needs einspline. this will change in the future when a kinetic energy FS correction is added, which will depend on the 2body jastrow and a kspace jastrow. if it is preferable to just add the various .cpp files in FSSRCS that each thing depends on I can do that instead as opposed to targetting libraries that include those dependencies

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let us put einspline and change it to qmcwfs when actual WFS dependence comes in.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For user friendliness, this tool should work with any QMCPACK xml input file. Unfortunately, even if you're not using any wavefunction specific information, the system initialization path that allows you to grab a particle set and box from ESHDF file, in the event it's not specified in the XML, needs to go through the wavefunction builder. So I think that qmcwfs is a necessary dependency right now.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I see. The dependency is needed right now.


ADD_EXECUTABLE(qmcfinitesize qmcfinitesize.cpp)
TARGET_LINK_LIBRARIES(qmcfinitesize PRIVATE fstool)

INSTALL(TARGETS qmcfinitesize
RUNTIME DESTINATION bin)

#ppconvert
if( BUILD_PPCONVERT )
SUBDIRS(ppconvert)
Expand Down
Empty file.
48 changes: 48 additions & 0 deletions src/QMCTools/QMCFiniteSize/FSUtilities.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#include "FSUtilities.h"
#include <algorithm>

namespace qmcplusplus
{
void get_gridinfo_from_posgrid(const std::vector<PosType>& posgridlist,
const IndexType& axis,
RealType& lx,
RealType& rx,
RealType& dx,
IndexType& Nx)
{
std::vector<RealType> kx;
kx.resize(posgridlist.size());

for (IndexType i = 0; i < posgridlist.size(); i++)
kx[i] = posgridlist[i][axis];

std::vector<RealType>::iterator it;

std::sort(kx.begin(), kx.end());

it = std::unique(kx.begin(), kx.end());

lx = *(kx.begin());
rx = *(it - 1);
Nx = it - kx.begin();
dx = (rx - lx) / RealType(Nx - 1);
}

void getStats(const std::vector<RealType>& vals, RealType& avg, RealType& err)
{
avg = 0.0;
for (int i = 0; i < vals.size(); i++)
{
avg += vals[i];
}
avg /= vals.size();
err = 0.0;
for (int i = 0; i < vals.size(); i++)
{
err += (vals[i] - avg) * (vals[i] - avg);
}
err /= vals.size();
err = std::sqrt(err);
}

} // namespace qmcplusplus
23 changes: 23 additions & 0 deletions src/QMCTools/QMCFiniteSize/FSUtilities.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#ifndef FS_UTILITIES_H
#define FS_UTILITIES_H

#include <vector>
#include "Configuration.h"

namespace qmcplusplus
{
typedef QMCTraits::PosType PosType;
typedef QMCTraits::RealType RealType;
typedef QMCTraits::IndexType IndexType;

void get_gridinfo_from_posgrid(const std::vector<PosType>& posgridlist, //list of grid points
const IndexType& axis, //the axis to get grid info. 0=x, 1=y,etc
RealType& lx, //the lower bound of grid (aka "left").
RealType& rx, //the upper bound (aka "right")
RealType& dx, // the grid spacing
IndexType& Nx); // the number of grid points

void getStats(const std::vector<RealType>& vals, RealType& avg, RealType& err);

} // namespace qmcplusplus
#endif
Loading