QMCPACK
HarmonicExternalPotential.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: Jaron T. Krogel, krogeljt@ornl.gov, Oak Ridge National Laboratory
8 // Mark A. Berrill, berrillma@ornl.gov, Oak Ridge National Laboratory
9 //
10 // File created by: Jaron T. Krogel, krogeljt@ornl.gov, Oak Ridge National Laboratory
11 //////////////////////////////////////////////////////////////////////////////////////
12 
13 
14 #ifndef QMCPLUSPLUS_HARMONIC_EXTERNAL_POTENTIAL_H
15 #define QMCPLUSPLUS_HARMONIC_EXTERNAL_POTENTIAL_H
16 
18 
19 
20 namespace qmcplusplus
21 {
23 {
24  //data members
29  const ParticleSet& Ps;
30 
31 #if !defined(REMOVE_TRACEMANAGER)
32  ///single particle trace sample array
34 #endif
35 
36  //construction/destruction
38  {
41  }
42 
44 
45  std::string getClassName() const override { return "HarmonicExternalPotential"; }
46  //unneeded interface functions
47  void resetTargetParticleSet(ParticleSet& P) override {}
48 
49  //standard interface functions
50  bool put(xmlNodePtr cur) override;
51  bool get(std::ostream& os) const override;
52  std::unique_ptr<OperatorBase> makeClone(ParticleSet& P, TrialWaveFunction& psi) final;
53 
54  //functions for physical (hamiltonian component) estimator
55  Return_t evaluate(ParticleSet& P) override;
56  inline Return_t evaluate(ParticleSet& P, std::vector<NonLocalData>& Txy) { return evaluate(P); }
57 
58 #if !defined(REMOVE_TRACEMANAGER)
59  //traces interface
61 
63  {
66  V_sample = tm.checkout_real<1>(name_, Ps);
67  }
68 
69  void deleteParticleQuantities() override
70  {
72  delete V_sample;
73  }
74 
75  // not really for interface, just collects traces
76  inline Return_t evaluate_sp(ParticleSet& P);
77 #endif
78 };
79 } // namespace qmcplusplus
80 #endif
std::unique_ptr< OperatorBase > makeClone(ParticleSet &P, TrialWaveFunction &psi) final
helper functions for EinsplineSetBuilder
Definition: Configuration.h:43
bool streaming_array(const std::string &name)
Definition: TraceManager.h:249
QTBase::RealType RealType
Definition: Configuration.h:58
void resetTargetParticleSet(ParticleSet &P) override
Reset the data with the target ParticleSet.
Declaration of OperatorBase.
Return_t evaluate(ParticleSet &P, std::vector< NonLocalData > &Txy)
TraceRequest request_
whether traces are being collected
Definition: OperatorBase.h:531
Array< TraceReal, 1 > * V_sample
single particle trace sample array
std::string name_
name of this object
Definition: OperatorBase.h:527
Specialized paritlce class for atomistic simulations.
Definition: ParticleSet.h:55
void checkoutParticleQuantities(TraceManager &tm) override
std::string getClassName() const override
return class name
void oneBodyQuantumDomain(const ParticleSet &P)
set quantum domain for one-body operator
void setEnergyDomain(EnergyDomains edomain)
Set the Energy Domain.
Array< TraceReal, D > * checkout_real(const std::string &name, int n1=1, int n2=0, int n3=0, int n4=0)
An abstract class for Local Energy operators.
Definition: OperatorBase.h:59
FullPrecRealType Return_t
type of return value of evaluate
Definition: OperatorBase.h:64
bool put(xmlNodePtr cur) override
Read the input parameter.
Class to represent a many-body trial wave function.
void contribute_array(const std::string &name, bool default_quantity=false)
Definition: TraceManager.h:198
BareKineticEnergy::Return_t Return_t
Return_t evaluate(ParticleSet &P) override
Evaluate the local energy contribution of this component.