QMCPACK
LCAOrbitalBuilder.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: Miguel Morales, moralessilva2@llnl.gov, Lawrence Livermore National Laboratory
8 // Jeremy McMinnis, jmcminis@gmail.com, University of Illinois at Urbana-Champaign
9 // Jaron T. Krogel, krogeljt@ornl.gov, Oak Ridge National Laboratory
10 // Jeongnim Kim, jeongnim.kim@gmail.com, University of Illinois at Urbana-Champaign
11 // Ye Luo, yeluo@anl.gov, Argonne National Laboratory
12 // Mark A. Berrill, berrillma@ornl.gov, Oak Ridge National Laboratory
13 //
14 // File created by: Jeongnim Kim, jeongnim.kim@intel.com, Intel Corp.
15 //////////////////////////////////////////////////////////////////////////////////////
16 
17 
18 #ifndef QMCPLUSPLUS_SOA_LCAO_ORBITAL_BUILDER_H
19 #define QMCPLUSPLUS_SOA_LCAO_ORBITAL_BUILDER_H
20 
21 #include <map>
25 
26 namespace qmcplusplus
27 {
28 /** SPOSetBuilder using new LCAOrbitalSet and Soa versions
29  *
30  * Reimplement MolecularSPOSetBuilder
31  * - support both CartesianTensor and SphericalTensor
32  */
34 {
35 public:
37  /** constructor
38  * \param els reference to the electrons
39  * \param ions reference to the ions
40  */
41  LCAOrbitalBuilder(ParticleSet& els, ParticleSet& ions, Communicate* comm, xmlNodePtr cur);
42  ~LCAOrbitalBuilder() override;
43  std::unique_ptr<SPOSet> createSPOSetFromXML(xmlNodePtr cur) override;
44 
45  // For testing
46  using BasissetMap = std::map<std::string, std::unique_ptr<BasisSet_t>>;
47  const BasissetMap& getBasissetMap() const { return basisset_map_; }
48 
49 protected:
50  ///target ParticleSet
52  ///source ParticleSet
54  /// localized basis set map
55  std::map<std::string, std::unique_ptr<BasisSet_t>> basisset_map_;
56  /// if true, add cusp correction to orbitals
57  bool cuspCorr;
58  ///Path to HDF5 Wavefunction
59  std::string h5_path;
60  ///Number of periodic Images for Orbital evaluation
62  ///Coordinates Super Twist
64  ///Periodic Image Phase Factors. Correspond to the phase from the PBCImages. Computed only once.
67  ///Store Lattice parameters from HDF5 to use in PeriodicImagePhaseFactors
69 
70  /// Enable cusp correction
72  /// Captured gpu input string
73  std::string useGPU;
74 
75  /** create basis set
76  *
77  * Use ao_traits<T,I,J> to match (ROT)x(SH) combo
78  */
79  template<int I, int J>
80  BasisSet_t* createBasisSet(xmlNodePtr cur);
81  template<int I, int J>
83 
84  // The following items were previously in SPOSet
85  ///occupation number
87  bool loadMO(LCAOrbitalSet& spo, xmlNodePtr cur);
88  bool putOccupation(LCAOrbitalSet& spo, xmlNodePtr occ_ptr);
89  bool putFromXML(LCAOrbitalSet& spo, xmlNodePtr coeff_ptr);
90  bool putFromH5(LCAOrbitalSet& spo, xmlNodePtr coeff_ptr);
91  bool putPBCFromH5(LCAOrbitalSet& spo, xmlNodePtr coeff_ptr);
92  // the dimensions of Ctemp are determined by the dataset on file
94  int setVal,
96  Matrix<std::complex<RealType>>& Ctemp,
97  bool MultiDet);
98  // the dimensions of Creal are determined by the dataset on file
99  void LoadFullCoefsFromH5(hdf_archive& hin, int setVal, PosType& SuperTwist, Matrix<RealType>& Creal, bool Multidet);
102  Vector<RealType, OffloadPinnedAllocator<RealType>>& LocPeriodicImagePhaseFactors,
103  Array<RealType, 2, OffloadPinnedAllocator<RealType>>& LocPeriodicImageDisplacements);
106  Vector<std::complex<RealType>, OffloadPinnedAllocator<std::complex<RealType>>>& LocPeriodicImagePhaseFactors,
107  Array<RealType, 2, OffloadPinnedAllocator<RealType>>& LocPeriodicImageDisplacements);
108  /** read matrix from h5 file
109  * \param[in] hin: hdf5 arhive to be read from
110  * \param setname: where to read from in hdf5 archive
111  * \param[out] Creal: matrix read from h5
112  *
113  * added in header to allow use from derived class LCAOSpinorBuilder as well
114  */
116  const std::string& setname,
118 
119 private:
120  ///load a basis set from XML input
121  std::unique_ptr<BasisSet_t> loadBasisSetFromXML(xmlNodePtr cur, xmlNodePtr parent);
122  ///load a basis set from h5 file
123  std::unique_ptr<BasisSet_t> loadBasisSetFromH5(xmlNodePtr parent);
124  ///determine radial orbital type based on "keyword" and "transform" attributes
125  int determineRadialOrbType(xmlNodePtr cur) const;
126 };
127 
128 
129 } // namespace qmcplusplus
130 #endif
bool cuspCorr
if true, add cusp correction to orbitals
bool loadMO(LCAOrbitalSet &spo, xmlNodePtr cur)
Parse the xml file for information on the Dirac determinants.
ParticleSet & targetPtcl
target ParticleSet
Vector< ValueType, OffloadPinnedAllocator< ValueType > > PeriodicImagePhaseFactors
Periodic Image Phase Factors. Correspond to the phase from the PBCImages. Computed only once...
helper functions for EinsplineSetBuilder
Definition: Configuration.h:43
const BasissetMap & getBasissetMap() const
bool putPBCFromH5(LCAOrbitalSet &spo, xmlNodePtr coeff_ptr)
read data from a hdf5 file
std::string useGPU
Captured gpu input string.
void LoadFullCoefsFromH5(hdf_archive &hin, int setVal, PosType &SuperTwist, Matrix< std::complex< RealType >> &Ctemp, bool MultiDet)
Vector< RealType > Occ
occupation number
std::unique_ptr< BasisSet_t > loadBasisSetFromXML(xmlNodePtr cur, xmlNodePtr parent)
load a basis set from XML input
SPOSetBuilder using new LCAOrbitalSet and Soa versions.
class to handle hdf file
Definition: hdf_archive.h:51
Wrapping information on parallelism.
Definition: Communicate.h:68
PosType SuperTwist
Coordinates Super Twist.
Specialized paritlce class for atomistic simulations.
Definition: ParticleSet.h:55
base class for the real SPOSet builder
Definition: SPOSetBuilder.h:47
std::map< std::string, std::unique_ptr< BasisSet_t > > basisset_map_
localized basis set map
Declaration of a base class of SPOSet Builders.
int determineRadialOrbType(xmlNodePtr cur) const
determine radial orbital type based on "keyword" and "transform" attributes
Array< RealType, 2, OffloadPinnedAllocator< RealType > > PeriodicImageDisplacements
ParticleSet & sourcePtcl
source ParticleSet
LCAOrbitalBuilder(ParticleSet &els, ParticleSet &ions, Communicate *comm, xmlNodePtr cur)
constructor
std::unique_ptr< SPOSet > createSPOSetFromXML(xmlNodePtr cur) override
create an sposet from xml (legacy)
bool putOccupation(LCAOrbitalSet &spo, xmlNodePtr occ_ptr)
Tensor< double, 3 > Lattice
Store Lattice parameters from HDF5 to use in PeriodicImagePhaseFactors.
OMPallocator is an allocator with fused device and dualspace allocator functionality.
std::string h5_path
Path to HDF5 Wavefunction.
BasisSet_t * createBasisSet(xmlNodePtr cur)
create basis set
bool putFromXML(LCAOrbitalSet &spo, xmlNodePtr coeff_ptr)
void readRealMatrixFromH5(hdf_archive &hin, const std::string &setname, Matrix< LCAOrbitalBuilder::RealType > &Creal) const
read matrix from h5 file
bool putFromH5(LCAOrbitalSet &spo, xmlNodePtr coeff_ptr)
read data from a hdf5 file
TinyVector< int, 3 > PBCImages
Number of periodic Images for Orbital evaluation.
std::unique_ptr< BasisSet_t > loadBasisSetFromH5(xmlNodePtr parent)
load a basis set from h5 file
class to handle linear combinations of basis orbitals used to evaluate the Dirac determinants.
Definition: LCAOrbitalSet.h:30
std::map< std::string, std::unique_ptr< BasisSet_t > > BasissetMap
A D-dimensional Array class based on PETE.
Definition: OhmmsArray.h:25
bool doCuspCorrection
Enable cusp correction.
SoaBasisSetBase< ValueType > basis_type
Definition: LCAOrbitalSet.h:33
void EvalPeriodicImagePhaseFactors(PosType SuperTwist, Vector< RealType, OffloadPinnedAllocator< RealType >> &LocPeriodicImagePhaseFactors, Array< RealType, 2, OffloadPinnedAllocator< RealType >> &LocPeriodicImageDisplacements)
Periodic Image Phase Factors computation to be determined.
Declaration of a base class of BasisSet.
Base for real basis set.
Definition: BasisSetBase.h:132