QMCPACK
WaveFunctionTester.h
Go to the documentation of this file.
1 //////////////////////////////////////////////////////////////////////////////////////
2 // This file is distributed under the University of Illinois/NCSA Open Source License.
3 // See LICENSE file in top directory for details.
4 //
5 // Copyright (c) 2016 Jeongnim Kim and QMCPACK developers.
6 //
7 // File developed by: Ken Esler, kpesler@gmail.com, University of Illinois at Urbana-Champaign
8 // Miguel Morales, moralessilva2@llnl.gov, Lawrence Livermore National Laboratory
9 // Jeremy McMinnis, jmcminis@gmail.com, University of Illinois at Urbana-Champaign
10 // Jeongnim Kim, jeongnim.kim@gmail.com, University of Illinois at Urbana-Champaign
11 // Mark Dewing, markdewing@gmail.com, University of Illinois at Urbana-Champaign
12 // Mark A. Berrill, berrillma@ornl.gov, Oak Ridge National Laboratory
13 //
14 // File created by: Jeongnim Kim, jeongnim.kim@gmail.com, University of Illinois at Urbana-Champaign
15 //////////////////////////////////////////////////////////////////////////////////////
16 
17 
18 #ifndef QMCPLUSPLUS_WAVEFUNCTIONTEST_H
19 #define QMCPLUSPLUS_WAVEFUNCTIONTEST_H
20 
21 #include "QMCDrivers/QMCDriver.h"
23 namespace qmcplusplus
24 {
25 /** Information for output of relative error in wavefunction derivatives
26  vs. finite difference delta.
27 */
29 {
30 public:
32  bool put(xmlNodePtr q);
33 
36  std::string outputFile;
37 };
38 
39 /** Test the correctness of TrialWaveFunction for the values,
40  gradients and laplacians
41 */
43 {
44 public:
45  /// type definition
47 
48  /// Constructor.
49  WaveFunctionTester(const ProjectData& project_data,
51  TrialWaveFunction& psi,
52  QMCHamiltonian& h,
53  ParticleSetPool& ptclPool,
54  Communicate* comm);
55 
56  ~WaveFunctionTester() override;
57 
58  bool run() override;
59  bool put(xmlNodePtr q) override;
60 
61 private:
65  std::string checkBasic, checkRatioV;
66  xmlNodePtr myNode;
67  double deltaParam;
70  bool checkSlaterDet; // flag to perform determinant-resolved test of SlaterDet
71  std::string checkSlaterDetOption;
73 
74  /// Copy Constructor (disabled)
75  WaveFunctionTester(const WaveFunctionTester&) = delete;
76  /// Copy Operator (disabled)
78 
79  /** basic tests for G and L */
80  void runBasicTest();
81  /** the basic ratios check */
82  void runRatioTest();
83  void runRatioTest2();
84  /** test ratios with virtual moves */
85  void runRatioV();
86  /** test clone implementations of new wavefunctions and operators */
87  void runCloneTest();
88  void runDerivTest();
89  void runDerivNLPPTest();
90  void runDerivCloneTest();
91  void runGradSourceTest();
92  void runZeroVarianceTest();
93  void runNodePlot();
94  void printEloc();
95 
96  // compute numerical gradient and laplacian
98 
99  bool checkGradients(int lower_iat,
100  int upper_iat,
105  std::stringstream& log,
106  int indent = 0);
107 
108  bool checkGradientAtConfiguration(MCWalkerConfiguration::Walker_t* W1, std::stringstream& fail_log, bool& ignore);
109 
111  //vector<RealType> Mv3(std::vector<std::vector<RealType> >& M, std::vector<RealType>& v);
112 
113  std::ofstream fout;
114  const size_t ndim;
115 };
116 } // namespace qmcplusplus
117 #endif
void runRatioTest()
the basic ratios check
WaveFunctionTester(const ProjectData &project_data, MCWalkerConfiguration &w, TrialWaveFunction &psi, QMCHamiltonian &h, ParticleSetPool &ptclPool, Communicate *comm)
Constructor.
Information for output of relative error in wavefunction derivatives vs.
A set of walkers that are to be advanced by Metropolis Monte Carlo.
helper functions for EinsplineSetBuilder
Definition: Configuration.h:43
QTBase::RealType RealType
Definition: Configuration.h:58
class ProjectData
Definition: ProjectData.h:36
Collection of Local Energy Operators.
void runRatioV()
test ratios with virtual moves
abstract base class for QMC engines
Definition: QMCDriver.h:71
Attaches a unit to a Vector for IO.
bool run() override
Test the evaluation of the wavefunction, gradient and laplacian by comparing to the numerical evaluat...
std::complex< QTFull::RealType > LogValue
Wrapping information on parallelism.
Definition: Communicate.h:68
WaveFunctionComponent::LogValue LogValue
type definition
Declaration of QMCDriver.
Test the correctness of TrialWaveFunction for the values, gradients and laplacians.
WaveFunctionTester & operator=(const WaveFunctionTester &)=delete
Copy Operator (disabled)
Manage a collection of ParticleSet objects.
void runBasicTest()
basic tests for G and L
ParticleSet::ParticlePos deltaR
bool put(xmlNodePtr q) override
MakeReturn< UnaryNode< FnLog, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t log(const Vector< T1, C1 > &l)
Class to represent a many-body trial wave function.
ParticleAttrib< SingleParticlePos > ParticlePos
Definition: Configuration.h:92
traits for QMC variables
Definition: Configuration.h:49
void computeNumericalGrad(RealType delta, ParticleSet::ParticleGradient &G_fd, ParticleSet::ParticleLaplacian &L_fd)
void runCloneTest()
test clone implementations of new wavefunctions and operators
A container class to represent a walker.
Definition: Walker.h:49
bool checkGradientAtConfiguration(MCWalkerConfiguration::Walker_t *W1, std::stringstream &fail_log, bool &ignore)
Declaration of ParticleSetPool.
bool checkGradients(int lower_iat, int upper_iat, ParticleSet::ParticleGradient &G, ParticleSet::ParticleLaplacian &L, ParticleSet::ParticleGradient &G_fd, ParticleSet::ParticleLaplacian &L_fd, std::stringstream &log, int indent=0)