QMCPACK
LatticeGaussianProductBuilder Class Reference

LatticeGaussianProduct LatticeGaussianProduct Builder with constraints. More...

+ Inheritance diagram for LatticeGaussianProductBuilder:
+ Collaboration diagram for LatticeGaussianProductBuilder:

Public Member Functions

 LatticeGaussianProductBuilder (Communicate *comm, ParticleSet &p, const PSetMap &psets)
 
std::unique_ptr< WaveFunctionComponent > buildComponent (xmlNodePtr cur) override
 process a xml node at cur More...
 
- Public Member Functions inherited from WaveFunctionComponentBuilder
 WaveFunctionComponentBuilder (Communicate *comm, ParticleSet &p)
 constructor More...
 
virtual ~WaveFunctionComponentBuilder ()=default
 
- Public Member Functions inherited from MPIObjectBase
 MPIObjectBase (Communicate *c)
 constructor with communicator More...
 
int rank () const
 return the rank of the communicator More...
 
int getGroupID () const
 return the group id of the communicator More...
 
Communicate * getCommunicator () const
 return myComm More...
 
Communicate & getCommRef () const
 return a TEMPORARY reference to Communicate More...
 
mpi_comm_type getMPI () const
 return MPI communicator if one wants to use MPI directly More...
 
bool is_manager () const
 return true if the rank == 0 More...
 
const std::string & getName () const
 return the name More...
 
void setName (const std::string &aname)
 

Private Member Functions

void resetOptions ()
 reset the options More...
 

Private Attributes

const PSetMap & ptclPool
 particleset pool to get ParticleSet other than the target More...
 
int LatticeGaussianProductType
 index for the jastrow type: 1, 2, 3 More...
 
std::string nameOpt
 name More...
 
std::string typeOpt
 type More...
 
Vector< RealType > widthOpt
 function More...
 
std::string spinOpt
 spin More...
 
std::string transformOpt
 transform More...
 
std::string sourceOpt
 source More...
 

Additional Inherited Members

- Public Types inherited from WaveFunctionComponentBuilder
using RealType = WaveFunctionComponent::RealType
 
using ValueType = WaveFunctionComponent::ValueType
 
using PosType = WaveFunctionComponent::PosType
 
using GradType = WaveFunctionComponent::GradType
 
using PSetMap = std::map< std::string, const std::unique_ptr< ParticleSet > >
 
- Public Types inherited from MPIObjectBase
using mpi_comm_type = Communicate::mpi_comm_type
 
- Static Public Attributes inherited from WaveFunctionComponentBuilder
static std::string wfs_tag = "wavefunction"
 reserved tags for the elements associated with the many-body wavefunctions More...
 
static std::string param_tag = "parameter"
 the element name for a parameter More...
 
static std::string dtable_tag = "distancetable"
 the element name for a distancetable More...
 
static std::string jastrow_tag = "jastrow"
 the element name for jatrow More...
 
static std::string detset_tag = "determinantset"
 the element name for a set of Slater determinants, contains 1..* Slater determinants More...
 
static std::string sd_tag = "slaterdeterminant"
 the element name for a Slater determinant, contains 1..* determinants More...
 
static std::string det_tag = "determinant"
 the element name for a determinant, may contain (0..*) orbital or parameter element More...
 
static std::string rn_tag = "determinant_rn"
 the element name for a released node determinant, may contain (0..*) orbital or parameter element More...
 
static std::string spo_tag = "psi"
 the element name for single-particle orbital More...
 
static std::string sposet_tag = "sposet"
 the element name for single-particle orbital set More...
 
static std::string ionorb_tag = "ionwf"
 the element name for an ion wavefunction More...
 
static std::string backflow_tag = "backflow"
 the element name for a backflow transformation More...
 
static std::string multisd_tag = "multideterminant"
 the element name for a multi slater determinant wavefunction More...
 
- Protected Attributes inherited from WaveFunctionComponentBuilder
ParticleSet & targetPtcl
 reference to the particle set on which targetPsi is defined More...
 
xmlNodePtr myNode
 xmlNode operated by this object More...
 
- Protected Attributes inherited from MPIObjectBase
Communicate * myComm
 pointer to Communicate More...
 
std::string ClassName
 class Name More...
 
std::string myName
 name of the object More...
 

Detailed Description

LatticeGaussianProduct LatticeGaussianProduct Builder with constraints.

Definition at line 23 of file LatticeGaussianProductBuilder.h.

Constructor & Destructor Documentation

◆ LatticeGaussianProductBuilder()

LatticeGaussianProductBuilder ( Communicate *  comm,
ParticleSet &  p,
const PSetMap &  psets 
)

Definition at line 21 of file LatticeGaussianProductBuilder.cpp.

23 {}
WaveFunctionComponentBuilder(Communicate *comm, ParticleSet &p)
constructor
const PSetMap & ptclPool
particleset pool to get ParticleSet other than the target

Member Function Documentation

◆ buildComponent()

std::unique_ptr< WaveFunctionComponent > buildComponent ( xmlNodePtr  cur)
overridevirtual

process a xml node at cur

Implements WaveFunctionComponentBuilder.

Definition at line 25 of file LatticeGaussianProductBuilder.cpp.

References OhmmsAttributeSet::add(), qmcplusplus::app_error(), qmcplusplus::app_warning(), ParticleSet::getTotalNum(), LatticeGaussianProductBuilder::nameOpt, LatticeGaussianProductBuilder::ptclPool, OhmmsAttributeSet::put(), Vector< T, Alloc >::resize(), LatticeGaussianProductBuilder::sourceOpt, WaveFunctionComponentBuilder::targetPtcl, and LatticeGaussianProductBuilder::widthOpt.

Referenced by qmcplusplus::TEST_CASE().

26 {
27  ParticleSet& p = targetPtcl;
28  // initialize widths to zero; if no user input, then abort
30  OhmmsAttributeSet oAttrib;
31  oAttrib.add(sourceOpt, "source");
32  oAttrib.add(nameOpt, "name");
33  oAttrib.add(widthOpt, "width");
34  oAttrib.put(cur);
35  if (nameOpt == "")
36  {
37  app_warning() << " LatticeGaussianProductBuilder::put does not have name " << std::endl;
38  }
39 
40  auto pa_it(ptclPool.find(sourceOpt));
41  if (pa_it == ptclPool.end())
42  {
43  app_error() << "Could not find source ParticleSet " << sourceOpt << " for ion wave function.\n";
44  }
45  auto& sourcePtcl = *pa_it->second;
46  auto orb = std::make_unique<LatticeGaussianProduct>(sourcePtcl, targetPtcl);
47  orb->ParticleAlpha.resize(targetPtcl.getTotalNum());
48  orb->ParticleCenter.resize(targetPtcl.getTotalNum());
49  int num_nonzero = 0;
50  for (int iat = 0; iat < p.getTotalNum(); iat++)
51  {
52  RealType w = widthOpt[iat];
53  if (w > 0.0)
54  {
55  orb->ParticleCenter[iat] = num_nonzero++;
56  orb->ParticleAlpha[iat] = 0.5 / (w * w);
57  }
58  else
59  {
60  orb->ParticleCenter[iat] = -1;
61  orb->ParticleAlpha[iat] = 0.0;
62  }
63  }
64  if (num_nonzero != sourcePtcl.getTotalNum())
65  {
66  app_error() << " The number of nonzero widths should be the same as the number of\n"
67  << " centers for the ionwf.\n";
68  abort();
69  }
70  assert(num_nonzero == sourcePtcl.getTotalNum());
71  return orb;
72 }
void resize(size_type n, Type_t val=Type_t())
Resize the container.
Definition: OhmmsVector.h:166
std::ostream & app_warning()
Definition: OutputManager.h:69
size_t getTotalNum() const
Definition: ParticleSet.h:493
bool put(xmlNodePtr cur)
assign attributes to the set
Definition: AttributeSet.h:55
std::ostream & app_error()
Definition: OutputManager.h:67
ParticleSet & targetPtcl
reference to the particle set on which targetPsi is defined
class to handle a set of attributes of an xmlNode
Definition: AttributeSet.h:24
const PSetMap & ptclPool
particleset pool to get ParticleSet other than the target
QMCTraits::RealType RealType
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

◆ resetOptions()

void resetOptions ( )
private

reset the options

Member Data Documentation

◆ LatticeGaussianProductType

int LatticeGaussianProductType
private

index for the jastrow type: 1, 2, 3

Definition at line 34 of file LatticeGaussianProductBuilder.h.

◆ nameOpt

std::string nameOpt
private

◆ ptclPool

const PSetMap& ptclPool
private

particleset pool to get ParticleSet other than the target

Definition at line 32 of file LatticeGaussianProductBuilder.h.

Referenced by LatticeGaussianProductBuilder::buildComponent().

◆ sourceOpt

std::string sourceOpt
private

source

Definition at line 46 of file LatticeGaussianProductBuilder.h.

Referenced by LatticeGaussianProductBuilder::buildComponent().

◆ spinOpt

std::string spinOpt
private

spin

Definition at line 42 of file LatticeGaussianProductBuilder.h.

◆ transformOpt

std::string transformOpt
private

transform

Definition at line 44 of file LatticeGaussianProductBuilder.h.

◆ typeOpt

std::string typeOpt
private

type

Definition at line 38 of file LatticeGaussianProductBuilder.h.

◆ widthOpt

Vector<RealType> widthOpt
private

function

Definition at line 40 of file LatticeGaussianProductBuilder.h.

Referenced by LatticeGaussianProductBuilder::buildComponent().


The documentation for this class was generated from the following files: