QMCPACK
Backflow_ee_kSpace Class Reference
+ Inheritance diagram for Backflow_ee_kSpace:
+ Collaboration diagram for Backflow_ee_kSpace:

Public Member Functions

 Backflow_ee_kSpace (ParticleSet &ions, ParticleSet &els)
 
void initialize (ParticleSet &P, std::vector< RealType > &yk)
 
void resize (int NT)
 
std::unique_ptr< BackflowFunctionBase > makeClone (ParticleSet &tqp) const override
 
void addFunc (int ia, int ib)
 
void registerData (WFBufferType &buf) override
 
void reportStatus (std::ostream &os) override
 
void resetParameters (const opt_variables_type &active) override
 
void checkInVariables (opt_variables_type &active) override
 
void checkOutVariables (const opt_variables_type &active) override
 
bool isOptimizable () override
 
int indexOffset () override
 
void acceptMove (int iat, int UpdateMode) override
 
void restore (int iat, int UpdateType) override
 
void evaluate (const ParticleSet &P, ParticleSet &QP) override
 calculate quasi-particle coordinates only More...
 
void evaluate (const ParticleSet &P, ParticleSet &QP, GradVector &Bmat, HessMatrix &Amat)
 
void evaluate (const ParticleSet &P, ParticleSet &QP, GradMatrix &Bmat_full, HessMatrix &Amat) override
 calculate quasi-particle coordinates, Bmat and Amat More...
 
void evaluatePbyP (const ParticleSet &P, ParticleSet::ParticlePos &newQP, const std::vector< int > &index) override
 calculate quasi-particle coordinates after pbyp move More...
 
void evaluatePbyP (const ParticleSet &P, int iat, ParticleSet::ParticlePos &newQP) override
 calculate quasi-particle coordinates after pbyp move More...
 
void evaluatePbyP (const ParticleSet &P, ParticleSet::ParticlePos &newQP, const std::vector< int > &index, HessMatrix &Amat) override
 calculate quasi-particle coordinates and Amat after pbyp move More...
 
void evaluatePbyP (const ParticleSet &P, int iat, ParticleSet::ParticlePos &newQP, HessMatrix &Amat) override
 calculate quasi-particle coordinates and Amat after pbyp move More...
 
void evaluatePbyP (const ParticleSet &P, ParticleSet::ParticlePos &newQP, const std::vector< int > &index, GradMatrix &Bmat, HessMatrix &Amat) override
 calculate quasi-particle coordinates and Amat after pbyp move More...
 
void evaluatePbyP (const ParticleSet &P, int iat, ParticleSet::ParticlePos &newQP, GradMatrix &Bmat, HessMatrix &Amat) override
 calculate quasi-particle coordinates and Amat after pbyp move More...
 
void evaluateBmatOnly (const ParticleSet &P, GradMatrix &Bmat_full) override
 calculate only Bmat This is used in pbyp moves, in updateBuffer() More...
 
void evaluateWithDerivatives (const ParticleSet &P, ParticleSet &QP, GradMatrix &Bmat_full, HessMatrix &Amat, GradMatrix &Cmat, GradMatrix &Ymat, HessArray &Xmat) override
 calculate quasi-particle coordinates, Bmat and Amat calculate derivatives wrt to variational parameters More...
 
- Public Member Functions inherited from BackflowFunctionBase
 BackflowFunctionBase (ParticleSet &ions, ParticleSet &els)
 
void resize (int NT, int NC)
 
virtual ~BackflowFunctionBase ()
 
int setParamIndex (int n)
 
void updateBuffer (WFBufferType &buf)
 
void copyFromBuffer (WFBufferType &buf)
 

Public Attributes

bool Optimize
 
int numParams
 
std::vector< RealType > Fk
 
std::vector< int > offsetPrms
 
int NumGroups
 
int NumKShells
 
int NumKVecs
 
Vector< ComplexType > Rhok
 
Matrix< int > PairID
 
opt_variables_type myVars
 set of variables to be optimized More...
 
- Public Attributes inherited from BackflowFunctionBase
ParticleSet & CenterSys
 Reference to the center. More...
 
int NumCenters
 number of centers, e.g., ions More...
 
int NumTargets
 number of quantum particles More...
 
int numParams
 
int indexOfFirstParam
 
std::vector< TinyVector< RealType, 3 > > derivs
 
Matrix< PosType > UIJ
 
Vector< PosType > UIJ_temp
 
HessMatrix AIJ
 
HessVector AIJ_temp
 
GradMatrix BIJ
 
GradVector BIJ_temp
 
RealType * FirstOfU
 
RealType * LastOfU
 
RealType * FirstOfA
 
RealType * LastOfA
 
RealType * FirstOfB
 
RealType * LastOfB
 
bool uniqueFunctions
 
opt_variables_type myVars
 

Private Types

using ComplexType = QMCTraits::ComplexType
 
using opt_variables_type = optimize::VariableSet
 typedef for real values More...
 

Additional Inherited Members

- Public Types inherited from BackflowFunctionBase
enum  { DIM = OHMMS_DIM }
 
enum  {
  ORB_PBYP_RATIO, ORB_PBYP_ALL, ORB_PBYP_PARTIAL, ORB_WALKER,
  ORB_ALLWALKER
}
 enum for a update mode More...
 
using Walker_t = ParticleSet::Walker_t
 
using WFBufferType = Walker_t::WFBuffer_t
 
using RealType = OHMMS_PRECISION
 
using IndexType = int
 
using PosType = TinyVector< RealType, DIM >
 
using GradType = TinyVector< RealType, DIM >
 
using HessType = Tensor< RealType, DIM >
 
using IndexVector = Vector< IndexType >
 
using GradVector = Vector< GradType >
 
using GradMatrix = Matrix< GradType >
 
using HessVector = Vector< HessType >
 
using HessMatrix = Matrix< HessType >
 
using HessArray = Array< HessType, 3 >
 

Detailed Description

Definition at line 26 of file Backflow_ee_kSpace.h.

Member Typedef Documentation

◆ ComplexType

Definition at line 28 of file Backflow_ee_kSpace.h.

◆ opt_variables_type

typedef for real values

typedef for variableset: this is going to be replaced

Definition at line 32 of file Backflow_ee_kSpace.h.

Constructor & Destructor Documentation

◆ Backflow_ee_kSpace()

Backflow_ee_kSpace ( ParticleSet &  ions,
ParticleSet &  els 
)
inline

Definition at line 50 of file Backflow_ee_kSpace.h.

References ParticleSet::GroupID, ParticleSet::groups(), Backflow_ee_kSpace::NumGroups, Backflow_ee_kSpace::numParams, BackflowFunctionBase::NumTargets, Backflow_ee_kSpace::offsetPrms, Backflow_ee_kSpace::Optimize, Backflow_ee_kSpace::PairID, Backflow_ee_kSpace::resize(), and Matrix< T, Alloc >::resize().

50  : BackflowFunctionBase(ions, els)
51  {
52  Optimize = false;
53  numParams = 0;
55  NumGroups = els.groups();
57  for (int i = 0; i < NumTargets; ++i)
58  for (int j = 0; j < NumTargets; ++j)
59  PairID(i, j) = els.GroupID[i] * NumGroups + els.GroupID[j];
60  offsetPrms.resize(NumGroups * NumGroups, 0);
61  }
int NumTargets
number of quantum particles
void resize(size_type n, size_type m)
Resize the container.
Definition: OhmmsMatrix.h:99
BackflowFunctionBase(ParticleSet &ions, ParticleSet &els)

Member Function Documentation

◆ acceptMove()

void acceptMove ( int  iat,
int  UpdateMode 
)
inlineoverridevirtual

Implements BackflowFunctionBase.

Definition at line 173 of file Backflow_ee_kSpace.h.

References BackflowFunctionBase::AIJ, BackflowFunctionBase::BIJ, BackflowFunctionBase::ORB_PBYP_ALL, BackflowFunctionBase::ORB_PBYP_PARTIAL, BackflowFunctionBase::ORB_PBYP_RATIO, Matrix< T, Alloc >::rows(), and BackflowFunctionBase::UIJ.

174  {
175  int num;
176  switch (UpdateMode)
177  {
178  case ORB_PBYP_RATIO:
179  num = UIJ.rows();
180  for (int i = 0; i < num; i++)
181  {
182  // UIJ(iat,i) = UIJ_temp(i);
183  // UIJ(i,iat) = -1.0*UIJ_temp(i);
184  }
185  break;
186  case ORB_PBYP_PARTIAL:
187  num = UIJ.rows();
188  for (int i = 0; i < num; i++)
189  {
190  // UIJ(iat,i) = UIJ_temp(i);
191  // UIJ(i,iat) = -1.0*UIJ_temp(i);
192  }
193  num = AIJ.rows();
194  for (int i = 0; i < num; i++)
195  {
196  // AIJ(iat,i) = AIJ_temp(i);
197  // AIJ(i,iat) = AIJ_temp(i);
198  }
199  break;
200  case ORB_PBYP_ALL:
201  num = UIJ.rows();
202  for (int i = 0; i < num; i++)
203  {
204  // UIJ(iat,i) = UIJ_temp(i);
205  // UIJ(i,iat) = -1.0*UIJ_temp(i);
206  }
207  num = AIJ.rows();
208  for (int i = 0; i < num; i++)
209  {
210  // AIJ(iat,i) = AIJ_temp(i);
211  // AIJ(i,iat) = AIJ_temp(i);
212  }
213  num = BIJ.rows();
214  for (int i = 0; i < num; i++)
215  {
216  // BIJ(iat,i) = BIJ_temp(i);
217  // BIJ(i,iat) = -1.0*BIJ_temp(i);
218  }
219  break;
220  default:
221  num = UIJ.rows();
222  for (int i = 0; i < num; i++)
223  {
224  // UIJ(iat,i) = UIJ_temp(i);
225  // UIJ(i,iat) = -1.0*UIJ_temp(i);
226  }
227  num = AIJ.rows();
228  for (int i = 0; i < num; i++)
229  {
230  // AIJ(iat,i) = AIJ_temp(i);
231  // AIJ(i,iat) = AIJ_temp(i);
232  }
233  num = BIJ.rows();
234  for (int i = 0; i < num; i++)
235  {
236  // BIJ(iat,i) = BIJ_temp(i);
237  // BIJ(i,iat) = -1.0*BIJ_temp(i);
238  }
239  break;
240  }
241  // UIJ_temp=0.0;
242  // AIJ_temp=0.0;
243  // BIJ_temp=0.0;
244  }
size_type rows() const
Definition: OhmmsMatrix.h:77

◆ addFunc()

void addFunc ( int  ia,
int  ib 
)
inline

Definition at line 101 of file Backflow_ee_kSpace.h.

Referenced by BackflowBuilder::makeLongRange_twoBody().

102  {
103  /*
104  uniqueRadFun.push_back(rf);
105  if(first) {
106  // initialize all with rf the first time
107  for(int i=0; i<RadFun.size(); i++)
108  RadFun[i]=rf;
109  first=false;
110  } else {
111  RadFun[ia*NumGroups+ib] = rf;
112  RadFun[ib*NumGroups+ia] = rf;
113  }
114  */
115  }

◆ checkInVariables()

void checkInVariables ( opt_variables_type &  active)
inlineoverridevirtual

Implements BackflowFunctionBase.

Definition at line 151 of file Backflow_ee_kSpace.h.

References VariableSet::insertFrom(), Backflow_ee_kSpace::myVars, and Backflow_ee_kSpace::Optimize.

152  {
153  if (Optimize)
154  active.insertFrom(myVars);
155  }
opt_variables_type myVars
set of variables to be optimized

◆ checkOutVariables()

void checkOutVariables ( const opt_variables_type &  active)
inlineoverridevirtual

Implements BackflowFunctionBase.

Definition at line 157 of file Backflow_ee_kSpace.h.

References VariableSet::getIndex(), Backflow_ee_kSpace::myVars, and Backflow_ee_kSpace::Optimize.

158  {
159  if (Optimize)
160  myVars.getIndex(active);
161  }
int getIndex(const std::string &vname) const
return the Index vaule for the named parameter
opt_variables_type myVars
set of variables to be optimized

◆ evaluate() [1/3]

void evaluate ( const ParticleSet &  P,
ParticleSet &  QP 
)
inlineoverridevirtual

calculate quasi-particle coordinates only

Implements BackflowFunctionBase.

Definition at line 255 of file Backflow_ee_kSpace.h.

256  {
257  throw std::runtime_error("Backflow_ee_kSpace::evaluate not implemented. There was an implementation with"
258  " complex-valued storage that may be resurrected using real-valued storage.");
259  }

◆ evaluate() [2/3]

void evaluate ( const ParticleSet &  P,
ParticleSet &  QP,
GradVector &  Bmat,
HessMatrix &  Amat 
)
inline

Definition at line 261 of file Backflow_ee_kSpace.h.

References APP_ABORT.

262  {
263  APP_ABORT("This shouldn't be called: Backflow_ee_kSpace::evaluate(Bmat)");
264  }
#define APP_ABORT(msg)
Widely used but deprecated fatal error macros from legacy code.
Definition: AppAbort.h:27

◆ evaluate() [3/3]

void evaluate ( const ParticleSet &  P,
ParticleSet &  QP,
GradMatrix &  Bmat_full,
HessMatrix &  Amat 
)
inlineoverridevirtual

calculate quasi-particle coordinates, Bmat and Amat

Implements BackflowFunctionBase.

Definition at line 269 of file Backflow_ee_kSpace.h.

270  {
271  throw std::runtime_error("Backflow_ee_kSpace::evaluate not implemented. There was an implementation with"
272  " complex-valued storage that may be resurrected using real-valued storage.");
273  }

◆ evaluateBmatOnly()

void evaluateBmatOnly ( const ParticleSet &  P,
GradMatrix &  Bmat_full 
)
inlineoverridevirtual

calculate only Bmat This is used in pbyp moves, in updateBuffer()

Implements BackflowFunctionBase.

Definition at line 319 of file Backflow_ee_kSpace.h.

319 {}

◆ evaluatePbyP() [1/6]

void evaluatePbyP ( const ParticleSet &  P,
ParticleSet::ParticlePos &  newQP,
const std::vector< int > &  index 
)
inlineoverridevirtual

calculate quasi-particle coordinates after pbyp move

Implements BackflowFunctionBase.

Definition at line 277 of file Backflow_ee_kSpace.h.

280  {}

◆ evaluatePbyP() [2/6]

void evaluatePbyP ( const ParticleSet &  P,
int  iat,
ParticleSet::ParticlePos &  newQP 
)
inlineoverridevirtual

calculate quasi-particle coordinates after pbyp move

Implements BackflowFunctionBase.

Definition at line 284 of file Backflow_ee_kSpace.h.

284 {}

◆ evaluatePbyP() [3/6]

void evaluatePbyP ( const ParticleSet &  P,
ParticleSet::ParticlePos &  newQP,
const std::vector< int > &  index,
HessMatrix &  Amat 
)
inlineoverridevirtual

calculate quasi-particle coordinates and Amat after pbyp move

Implements BackflowFunctionBase.

Definition at line 288 of file Backflow_ee_kSpace.h.

292  {}

◆ evaluatePbyP() [4/6]

void evaluatePbyP ( const ParticleSet &  P,
int  iat,
ParticleSet::ParticlePos &  newQP,
HessMatrix &  Amat 
)
inlineoverridevirtual

calculate quasi-particle coordinates and Amat after pbyp move

Implements BackflowFunctionBase.

Definition at line 296 of file Backflow_ee_kSpace.h.

296 {}

◆ evaluatePbyP() [5/6]

void evaluatePbyP ( const ParticleSet &  P,
ParticleSet::ParticlePos &  newQP,
const std::vector< int > &  index,
GradMatrix &  Bmat,
HessMatrix &  Amat 
)
inlineoverridevirtual

calculate quasi-particle coordinates and Amat after pbyp move

Implements BackflowFunctionBase.

Definition at line 300 of file Backflow_ee_kSpace.h.

305  {}

◆ evaluatePbyP() [6/6]

void evaluatePbyP ( const ParticleSet &  P,
int  iat,
ParticleSet::ParticlePos &  newQP,
GradMatrix &  Bmat,
HessMatrix &  Amat 
)
inlineoverridevirtual

calculate quasi-particle coordinates and Amat after pbyp move

Implements BackflowFunctionBase.

Definition at line 309 of file Backflow_ee_kSpace.h.

314  {}

◆ evaluateWithDerivatives()

void evaluateWithDerivatives ( const ParticleSet &  P,
ParticleSet &  QP,
GradMatrix &  Bmat_full,
HessMatrix &  Amat,
GradMatrix &  Cmat,
GradMatrix &  Ymat,
HessArray &  Xmat 
)
inlineoverridevirtual

calculate quasi-particle coordinates, Bmat and Amat calculate derivatives wrt to variational parameters

Implements BackflowFunctionBase.

Definition at line 324 of file Backflow_ee_kSpace.h.

331  {}

◆ indexOffset()

int indexOffset ( )
inlineoverridevirtual

Implements BackflowFunctionBase.

Definition at line 165 of file Backflow_ee_kSpace.h.

References Backflow_ee_kSpace::myVars, Backflow_ee_kSpace::Optimize, and VariableSet::where().

166  {
167  if (Optimize)
168  return myVars.where(0);
169  else
170  return 0;
171  }
opt_variables_type myVars
set of variables to be optimized
int where(int i) const
return the locator of the i-th Index
Definition: VariableSet.h:90

◆ initialize()

◆ isOptimizable()

bool isOptimizable ( )
inlineoverridevirtual

Implements BackflowFunctionBase.

Definition at line 163 of file Backflow_ee_kSpace.h.

References Backflow_ee_kSpace::Optimize.

◆ makeClone()

std::unique_ptr<BackflowFunctionBase> makeClone ( ParticleSet &  tqp) const
inlineoverridevirtual

Implements BackflowFunctionBase.

Definition at line 75 of file Backflow_ee_kSpace.h.

References BackflowFunctionBase::CenterSys, qmcplusplus::clone, and BackflowFunctionBase::NumTargets.

76  {
77  auto clone = std::make_unique<Backflow_ee_kSpace>(CenterSys, tqp);
78  clone->resize(NumTargets);
79  // clone->uniqueRadFun.resize(uniqueRadFun.size());
80  // clone->RadFun.resize(RadFun.size());
81  /*
82  for(int i=0; i<uniqueRadFun.size(); i++)
83  clone->uniqueRadFun[i] = new FT(*(uniqueRadFun[i]));
84  for(int i=0; i<RadFun.size(); i++)
85  {
86  bool done=false;
87  for(int k=0; k<uniqueRadFun.size(); k++)
88  if(RadFun[i] == uniqueRadFun[k]) {
89  done=true;
90  clone->RadFun[i] = clone->uniqueRadFun[k];
91  break;
92  }
93  if(!done) {
94  APP_ABORT("Error cloning Backflow_ee_kSpace object. \n");
95  }
96  }
97  */
98  return clone;
99  }
int NumTargets
number of quantum particles
ParticleSet & CenterSys
Reference to the center.

◆ registerData()

void registerData ( WFBufferType &  buf)
inlineoverridevirtual

Implements BackflowFunctionBase.

Definition at line 117 of file Backflow_ee_kSpace.h.

118  {
119  /*
120  FirstOfU = &(UIJ(0,0)[0]);
121  LastOfU = FirstOfU + OHMMS_DIM*NumTargets*NumTargets;
122  FirstOfA = &(AIJ(0,0)[0]);
123  LastOfA = FirstOfA + OHMMS_DIM*OHMMS_DIM*NumTargets*NumTargets;
124  FirstOfB = &(BIJ(0,0)[0]);
125  LastOfB = FirstOfB + OHMMS_DIM*NumTargets*NumTargets;
126  buf.add(FirstOfU,LastOfU);
127  buf.add(FirstOfA,LastOfA);
128  buf.add(FirstOfB,LastOfB);
129  */
130  }

◆ reportStatus()

void reportStatus ( std::ostream &  os)
inlineoverridevirtual

Implements BackflowFunctionBase.

Definition at line 132 of file Backflow_ee_kSpace.h.

References Backflow_ee_kSpace::myVars, and VariableSet::print().

132 { myVars.print(os); }
void print(std::ostream &os, int leftPadSpaces=0, bool printHeader=false) const
opt_variables_type myVars
set of variables to be optimized

◆ resetParameters()

void resetParameters ( const opt_variables_type &  active)
inlineoverridevirtual

Implements BackflowFunctionBase.

Definition at line 134 of file Backflow_ee_kSpace.h.

References Backflow_ee_kSpace::Fk, Backflow_ee_kSpace::myVars, Backflow_ee_kSpace::Optimize, and VariableSet::where().

135  {
136  if (Optimize)
137  {
138  for (int i = 0; i < Fk.size(); ++i)
139  {
140  int loc = myVars.where(i);
141  if (loc >= 0)
142  {
143  myVars[i] = active[loc];
144  Fk[i] = std::real(myVars[i]);
145  //Fk[i] = myVars[i] = active[loc];
146  }
147  }
148  }
149  }
QMCTraits::RealType real
opt_variables_type myVars
set of variables to be optimized
int where(int i) const
return the locator of the i-th Index
Definition: VariableSet.h:90

◆ resize()

void resize ( int  NT)
inline

Definition at line 73 of file Backflow_ee_kSpace.h.

References BackflowFunctionBase::NumTargets.

Referenced by Backflow_ee_kSpace::Backflow_ee_kSpace().

73 { NumTargets = NT; }
int NumTargets
number of quantum particles

◆ restore()

void restore ( int  iat,
int  UpdateType 
)
inlineoverridevirtual

Implements BackflowFunctionBase.

Definition at line 246 of file Backflow_ee_kSpace.h.

247  {
248  // UIJ_temp=0.0;
249  // AIJ_temp=0.0;
250  // BIJ_temp=0.0;
251  }

Member Data Documentation

◆ Fk

std::vector<RealType> Fk

◆ myVars

◆ NumGroups

int NumGroups

Definition at line 40 of file Backflow_ee_kSpace.h.

Referenced by Backflow_ee_kSpace::Backflow_ee_kSpace().

◆ NumKShells

int NumKShells

◆ NumKVecs

int NumKVecs

Definition at line 42 of file Backflow_ee_kSpace.h.

Referenced by Backflow_ee_kSpace::initialize().

◆ numParams

◆ offsetPrms

std::vector<int> offsetPrms

Definition at line 39 of file Backflow_ee_kSpace.h.

Referenced by Backflow_ee_kSpace::Backflow_ee_kSpace().

◆ Optimize

◆ PairID

Matrix<int> PairID

Definition at line 46 of file Backflow_ee_kSpace.h.

Referenced by Backflow_ee_kSpace::Backflow_ee_kSpace().

◆ Rhok

Definition at line 44 of file Backflow_ee_kSpace.h.

Referenced by Backflow_ee_kSpace::initialize().


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