QMCPACK
SkPot.cpp
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: Jeongnim Kim, jeongnim.kim@gmail.com, University of Illinois at Urbana-Champaign
8 // Jeremy McMinnis, jmcminis@gmail.com, University of Illinois at Urbana-Champaign
9 // Mark A. Berrill, berrillma@ornl.gov, Oak Ridge National Laboratory
10 //
11 // File created by: Jeongnim Kim, jeongnim.kim@gmail.com, University of Illinois at Urbana-Champaign
12 //////////////////////////////////////////////////////////////////////////////////////
13 
14 
15 #include "SkPot.h"
17 #include "OhmmsData/AttributeSet.h"
18 
19 namespace qmcplusplus
20 {
22 {
23  sourcePtcl = &source;
25  NumK = source.getSimulationCell().getKLists().numk;
26  OneOverN = 1.0 / static_cast<RealType>(source.getTotalNum());
27  Kshell = source.getSimulationCell().getKLists().kshell;
28  MaxKshell = Kshell.size() - 1;
30  Fk.resize(NumK);
31  Kmag.resize(MaxKshell);
32  OneOverDnk.resize(MaxKshell);
33  for (int ks = 0; ks < MaxKshell; ks++)
34  {
35  Kmag[ks] = std::sqrt(source.getSimulationCell().getKLists().ksq[Kshell[ks]]);
36  OneOverDnk[ks] = 1.0 / static_cast<RealType>(Kshell[ks + 1] - Kshell[ks]);
37  }
38 }
39 
41 
43 {
44  throw std::runtime_error("SkPot::evaluate not implemented. There was an implementation with"
45  " complex-valued storage that may be resurrected using real-valued storage.");
46 }
47 
48 bool SkPot::put(xmlNodePtr cur)
49 {
50  OhmmsAttributeSet Tattrib;
51  Tattrib.add(K_0, "k0");
52  Tattrib.add(V_0, "v0");
53  Tattrib.put(cur);
54  app_log() << "KSpacePot parameters" << std::endl;
55  app_log() << " k0: " << K_0 << std::endl;
56  app_log() << " v0: " << V_0 << std::endl;
57  FillFk();
58  return true;
59 }
60 
61 
62 bool SkPot::get(std::ostream& os) const { return true; }
63 
64 std::unique_ptr<OperatorBase> SkPot::makeClone(ParticleSet& qp, TrialWaveFunction& psi)
65 {
66  std::unique_ptr<SkPot> myclone = std::make_unique<SkPot>(*this);
67  myclone->FillFk();
68  return myclone;
69 }
70 } // namespace qmcplusplus
void resize(size_type n, Type_t val=Type_t())
Resize the container.
Definition: OhmmsVector.h:166
Vector< ComplexType > RhokTot
for species index
Definition: SkPot.h:71
bool put(xmlNodePtr cur) override
Read the input parameter.
Definition: SkPot.cpp:48
helper functions for EinsplineSetBuilder
Definition: Configuration.h:43
SkPot(ParticleSet &elns)
Definition: SkPot.cpp:21
void FillFk()
Definition: SkPot.h:41
size_t getTotalNum() const
Definition: ParticleSet.h:493
std::ostream & app_log()
Definition: OutputManager.h:65
RealType V_0
Definition: SkPot.h:73
bool put(xmlNodePtr cur)
assign attributes to the set
Definition: AttributeSet.h:55
int NumSpecies
number of species
Definition: SkPot.h:57
Declare SkPot.
std::unique_ptr< OperatorBase > makeClone(ParticleSet &qp, TrialWaveFunction &psi) final
Definition: SkPot.cpp:64
Return_t evaluate(ParticleSet &P) override
Evaluate the local energy contribution of this component.
Definition: SkPot.cpp:42
int getTotalNum() const
return the number of species
Definition: SpeciesSet.h:55
const auto & getSimulationCell() const
Definition: ParticleSet.h:250
Specialized paritlce class for atomistic simulations.
Definition: ParticleSet.h:55
std::vector< RealType > OneOverDnk
1.0/degenracy for a ksell
Definition: SkPot.h:69
Vector< RealType > Fk
Definition: SkPot.h:72
class to handle a set of attributes of an xmlNode
Definition: AttributeSet.h:24
std::vector< int > Kshell
kshell counters
Definition: SkPot.h:65
std::vector< RealType > Kmag
instantaneous structure factor
Definition: SkPot.h:67
RealType OneOverN
normalization factor
Definition: SkPot.h:63
SpeciesSet & getSpeciesSet()
retrun the SpeciesSet of this particle set
Definition: ParticleSet.h:231
FullPrecRealType Return_t
type of return value of evaluate
Definition: OperatorBase.h:64
MakeReturn< UnaryNode< FnSqrt, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t sqrt(const Vector< T1, C1 > &l)
int NumK
number of kpoints
Definition: SkPot.h:59
bool get(std::ostream &os) const override
write about the class
Definition: SkPot.cpp:62
Class to represent a many-body trial wave function.
RealType K_0
Definition: SkPot.h:73
ParticleSet * sourcePtcl
Definition: SkPot.h:55
void add(PDT &aparam, const std::string &aname, std::vector< PDT > candidate_values={}, TagStatus status=TagStatus::OPTIONAL)
add a new attribute
Definition: AttributeSet.h:42
int MaxKshell
number of kshells
Definition: SkPot.h:61
void resetTargetParticleSet(ParticleSet &P) override
Reset the data with the target ParticleSet.
Definition: SkPot.cpp:40