QMCPACK
ConstantSPOSet.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) 2023 Raymond Clay and QMCPACK developers.
6 //
7 // File developed by: Raymond Clay, rclay@sandia.gov, Sandia National Laboratories
8 //
9 // File created by: Raymond Clay, rclay@sandia.gov, Sandia National Laboratories
10 //////////////////////////////////////////////////////////////////////////////////////
11 
12 
13 #ifndef QMCPLUSPLUS_CONSTANTSPOSET_H
14 #define QMCPLUSPLUS_CONSTANTSPOSET_H
15 
17 
18 namespace qmcplusplus
19 {
20 /** Constant SPOSet for testing purposes. Fixed N_elec x N_orb matrices storing value, gradients, and laplacians, etc.,
21  * These values are accessed through standard SPOSet calls like evaluateValue, evaluateVGL, etc.
22  * Exists to provide deterministic and known output to objects requiring SPOSet evaluations.
23  *
24  */
25 class ConstantSPOSet : public SPOSet
26 {
27 public:
28  ConstantSPOSet(const std::string& my_name) = delete;
29 
30  //Constructor needs number of particles and number of orbitals. This is the minimum
31  //amount of information needed to sanely construct all data members and perform size
32  //checks later.
33  ConstantSPOSet(const std::string& my_name, const int nparticles, const int norbitals);
34 
35  std::unique_ptr<SPOSet> makeClone() const override;
36 
37  std::string getClassName() const override;
38 
39  void checkOutVariables(const opt_variables_type& active) override;
40 
41  void setOrbitalSetSize(int norbs) override;
42 
43  /**
44  * @brief Setter method to set \phi_j(r_i). Stores input matrix in ref_psi_.
45  * @param Nelec x Nion ValueType matrix of \phi_j(r_i)
46  * @return void
47  */
48  void setRefVals(const ValueMatrix& vals);
49  /**
50  * @brief Setter method to set \nabla_i \phi_j(r_i). Stores input matrix in ref_egrad_.
51  * @param Nelec x Nion GradType matrix of \grad_i \phi_j(r_i)
52  * @return void
53  */
54  void setRefEGrads(const GradMatrix& grads);
55  /**
56  * @brief Setter method to set \nabla^2_i \phi_j(r_i). Stores input matrix in ref_elapl_.
57  * @param Nelec x Nion GradType matrix of \grad^2_i \phi_j(r_i)
58  * @return void
59  */
60  void setRefELapls(const ValueMatrix& lapls);
61 
62  void evaluateValue(const ParticleSet& P, int iat, ValueVector& psi) override;
63 
64  void evaluateVGL(const ParticleSet& P, int iat, ValueVector& psi, GradVector& dpsi, ValueVector& d2psi) override;
65 
66  void evaluate_notranspose(const ParticleSet& P,
67  int first,
68  int last,
69  ValueMatrix& logdet,
70  GradMatrix& dlogdet,
71  ValueMatrix& d2logdet) override;
72 
73 private:
74  const int numparticles_; /// evaluate_notranspose arrays are nparticle x norb matrices.
75  /// To ensure consistent array sizing and enforcement,
76  /// we agree at construction how large these matrices will be.
77  /// norb is stored in SPOSet::OrbitalSetSize.
78 
79  //Value, electron gradient, and electron laplacian at "reference configuration".
80  //i.e. before any attempted moves.
81 
85 };
86 } // namespace qmcplusplus
87 #endif
base class for Single-particle orbital sets
Definition: SPOSet.h:46
void evaluate_notranspose(const ParticleSet &P, int first, int last, ValueMatrix &logdet, GradMatrix &dlogdet, ValueMatrix &d2logdet) override
evaluate the values, gradients and laplacians of this single-particle orbital for [first...
void setRefELapls(const ValueMatrix &lapls)
Setter method to set ^2_i (r_i).
helper functions for EinsplineSetBuilder
Definition: Configuration.h:43
std::unique_ptr< SPOSet > makeClone() const override
make a clone of itself every derived class must implement this to have threading working correctly...
void evaluateVGL(const ParticleSet &P, int iat, ValueVector &psi, GradVector &dpsi, ValueVector &d2psi) override
evaluate the values, gradients and laplacians of this single-particle orbital set ...
void evaluateValue(const ParticleSet &P, int iat, ValueVector &psi) override
evaluate the values of this single-particle orbital set
OrbitalSetTraits< ValueType >::ValueMatrix ValueMatrix
Definition: SPOSet.h:50
void setOrbitalSetSize(int norbs) override
set the OrbitalSetSize
OrbitalSetTraits< ValueType >::GradMatrix GradMatrix
Definition: SPOSet.h:52
Specialized paritlce class for atomistic simulations.
Definition: ParticleSet.h:55
void setRefVals(const ValueMatrix &vals)
Setter method to set (r_i).
ConstantSPOSet(const std::string &my_name)=delete
ValueMatrix ref_psi_
evaluate_notranspose arrays are nparticle x norb matrices.
void setRefEGrads(const GradMatrix &grads)
Setter method to set (r_i).
OrbitalSetTraits< ValueType >::ValueVector ValueVector
Definition: SPOSet.h:49
class to handle a set of variables that can be modified during optimizations
Definition: VariableSet.h:49
std::string getClassName() const override
return class name
Constant SPOSet for testing purposes.
OrbitalSetTraits< ValueType >::GradVector GradVector
Definition: SPOSet.h:51
void checkOutVariables(const opt_variables_type &active) override
check out variational optimizable variables