QMCPACK
PWOrbitalSet.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: 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 Dewing, markdewing@gmail.com, University of Illinois at Urbana-Champaign
10 //
11 // File created by: Jeongnim Kim, jeongnim.kim@gmail.com, University of Illinois at Urbana-Champaign
12 //////////////////////////////////////////////////////////////////////////////////////
13 
14 
15 /** @file PWOrbitalSet.h
16  * @brief Definition of member functions of Plane-wave basis set
17  */
18 #ifndef QMCPLUSPLUS_PLANEWAVE_ORBITALSET_BLAS_H
19 #define QMCPLUSPLUS_PLANEWAVE_ORBITALSET_BLAS_H
20 
23 #include "CPU/BLAS.hpp"
24 
25 namespace qmcplusplus
26 {
27 class PWOrbitalSet : public SPOSet
28 {
29 public:
31  using PWBasisPtr = PWBasis*;
32 
33  /** inherit the enum of BasisSet_t */
34  enum
35  {
42  };
43 
44  /** default constructor
45  */
46  PWOrbitalSet(const std::string& my_name)
47  : SPOSet(my_name), OwnBasisSet(false), myBasisSet(nullptr), BasisSetSize(0), C(nullptr), IsCloned(false)
48  {}
49 
50  std::string getClassName() const override { return "PWOrbitalSet"; }
51 
52 
53  /** delete BasisSet only it owns this
54  *
55  * Builder takes care of who owns what
56  */
57  ~PWOrbitalSet() override;
58 
59  std::unique_ptr<SPOSet> makeClone() const override;
60  /** resize the orbital base
61  * @param bset PWBasis
62  * @param nbands number of bands
63  * @param cleaup if true, owns PWBasis. Will clean up.
64  */
65  void resize(PWBasisPtr bset, int nbands, bool cleanup = false);
66 
67  /** Builder class takes care of the assertion
68  */
69  void addVector(const std::vector<ComplexType>& coefs, int jorb);
70  void addVector(const std::vector<RealType>& coefs, int jorb);
71 
72  void setOrbitalSetSize(int norbs) override;
73 
74  inline ValueType evaluate(int ib, const PosType& pos)
75  {
76  myBasisSet->evaluate(pos);
77  return BLAS::dot(BasisSetSize, (*C)[ib], myBasisSet->Zv.data());
78  }
79 
80  void evaluateValue(const ParticleSet& P, int iat, ValueVector& psi) override;
81 
82  void evaluateVGL(const ParticleSet& P, int iat, ValueVector& psi, GradVector& dpsi, ValueVector& d2psi) override;
83 
84  void evaluate_notranspose(const ParticleSet& P,
85  int first,
86  int last,
87  ValueMatrix& logdet,
88  GradMatrix& dlogdet,
89  ValueMatrix& d2logdet) override;
90 
91  /** boolean
92  *
93  * If true, this has to delete the BasisSet
94  */
96  ///TwistAngle of this PWOrbitalSet
98  ///My basis set
100  ///number of basis
102  /** pointer to matrix containing the coefficients
103  *
104  * makeClone makes a shallow copy and flag IsCloned
105  */
107  ///if true, do not clean up
108  bool IsCloned;
109  /////Plane-wave coefficients: (iband,g-vector)
110  //Matrix<ValueType> Coefs;
111  /** temporary array to perform gemm operation */
113 };
114 } // namespace qmcplusplus
115 #endif
base class for Single-particle orbital sets
Definition: SPOSet.h:46
void resize(PWBasisPtr bset, int nbands, bool cleanup=false)
resize the orbital base
helper functions for EinsplineSetBuilder
Definition: Configuration.h:43
void evaluate(const PosType &pos)
Definition: PWBasis.h:284
IndexType BasisSetSize
number of basis
Definition: PWOrbitalSet.h:101
Matrix< ValueType > Temp
temporary array to perform gemm operation
Definition: PWOrbitalSet.h:112
void addVector(const std::vector< ComplexType > &coefs, int jorb)
Builder class takes care of the assertion.
PosType TwistAngle
TwistAngle of this PWOrbitalSet.
Definition: PWOrbitalSet.h:97
ValueType evaluate(int ib, const PosType &pos)
Definition: PWOrbitalSet.h:74
std::unique_ptr< SPOSet > makeClone() const override
make a clone of itself every derived class must implement this to have threading working correctly...
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...
OrbitalSetTraits< ValueType >::ValueMatrix ValueMatrix
Definition: SPOSet.h:50
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 ...
OrbitalSetTraits< ValueType >::ValueVector ValueVector
ValueMatrix * C
pointer to matrix containing the coefficients
Definition: PWOrbitalSet.h:106
PWBasisPtr myBasisSet
My basis set.
Definition: PWOrbitalSet.h:99
Vector< ComplexType > Zv
Definition: PWBasis.h:89
OrbitalSetTraits< ValueType >::GradMatrix GradMatrix
Definition: SPOSet.h:52
std::string getClassName() const override
return class name
Definition: PWOrbitalSet.h:50
~PWOrbitalSet() override
delete BasisSet only it owns this
Specialized paritlce class for atomistic simulations.
Definition: ParticleSet.h:55
static T dot(int n, const T *restrict a, const T *restrict b)
Definition: BLAS.hpp:304
OHMMS_INDEXTYPE IndexType
define other types
Definition: Configuration.h:65
void evaluateValue(const ParticleSet &P, int iat, ValueVector &psi) override
evaluate the values of this single-particle orbital set
OrbitalSetTraits< ValueType >::GradVector GradVector
Definition: SPOSet.h:51
PWOrbitalSet(const std::string &my_name)
default constructor
Definition: PWOrbitalSet.h:46
bool IsCloned
if true, do not clean up
Definition: PWOrbitalSet.h:108
LatticeGaussianProduct::ValueType ValueType
Plane-wave basis set.
Definition: PWBasis.h:40
Declaration of Plane-wave basis set.
void setOrbitalSetSize(int norbs) override
set the OrbitalSetSize