mirror of https://github.com/QMCPACK/qmcpack.git
Merge branch 'develop' into cleanup_pseudopotentials
This commit is contained in:
commit
d8ed1e365f
|
@ -49,7 +49,7 @@ SET(MOSRCS
|
|||
# create libmocommon
|
||||
ADD_LIBRARY(mocommon ${MOSRCS})
|
||||
|
||||
set(QTOOLS convert4qmc MSDgenerator extract-eshdf-kvectors)
|
||||
set(QTOOLS convert4qmc extract-eshdf-kvectors)
|
||||
ADD_EXECUTABLE(getSupercell getSupercell.cpp)
|
||||
|
||||
FOREACH(p ${QTOOLS})
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
#include "Numerics/OneDimGridFunctor.h"
|
||||
#include "Numerics/OneDimCubicSpline.h"
|
||||
#include "QMCWaveFunctions/OrbitalBuilderBase.h"
|
||||
#include "QMCTools/MolecularOrbitalBasis.h"
|
||||
#include "QMCTools/RGFBuilderBase.h"
|
||||
|
||||
namespace qmcplusplus
|
||||
|
|
|
@ -1,148 +0,0 @@
|
|||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
// This file is distributed under the University of Illinois/NCSA Open Source License.
|
||||
// See LICENSE file in top directory for details.
|
||||
//
|
||||
// Copyright (c) 2016 Jeongnim Kim and QMCPACK developers.
|
||||
//
|
||||
// File developed by: Miguel Morales, moralessilva2@llnl.gov, Lawrence Livermore National Laboratory
|
||||
// Jeremy McMinnis, jmcminis@gmail.com, University of Illinois at Urbana-Champaign
|
||||
// Mark A. Berrill, berrillma@ornl.gov, Oak Ridge National Laboratory
|
||||
//
|
||||
// File created by: Miguel Morales, moralessilva2@llnl.gov, Lawrence Livermore National Laboratory
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#include <iostream>
|
||||
#include <cstdlib>
|
||||
#include <sstream>
|
||||
#include <iomanip>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include "OhmmsData/OhmmsElementBase.h"
|
||||
#include "QMCTools/CasinoParser.h"
|
||||
#include "QMCTools/GaussianFCHKParser.h"
|
||||
#include "QMCTools/GamesXmlParser.h"
|
||||
#include "QMCTools/GamesAsciiParser.h"
|
||||
#include "QMCTools/BParser.h"
|
||||
#include "Message/Communicate.h"
|
||||
#include "OhmmsData/FileUtility.h"
|
||||
#include "Utilities/RandomGenerator.h"
|
||||
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
int nea=16,neb=16,nca=0,ncb=0,nstates=32;
|
||||
double wgt=0.00,thr=0.0;
|
||||
bool useCSF=true;
|
||||
std::string name = "dummy.xml";
|
||||
OHMMS::Controller->initialize(argc,argv);
|
||||
if (OHMMS::Controller->rank() != 0) {
|
||||
outputManager.shutOff();
|
||||
}
|
||||
Random.init(0,1,-1);
|
||||
std::cout.setf(std::ios::scientific, std::ios::floatfield);
|
||||
std::cout.setf(std::ios::right,std::ios::adjustfield);
|
||||
std::cout.precision(12);
|
||||
QMCGaussianParserBase::init();
|
||||
QMCGaussianParserBase *parser=0;
|
||||
parser = new GamesAsciiParser(argc,argv);
|
||||
parser->multideterminant = true;
|
||||
parser->SpinRestricted=true;
|
||||
parser->zeroCI=false;
|
||||
parser->orderByExcitation=false;
|
||||
parser->NumberOfEls=nca+ncb+nea+neb;
|
||||
parser->SpinMultiplicity=(parser->NumberOfEls-2*neb)+1;
|
||||
parser->NumberOfAlpha=nca+nea;
|
||||
parser->NumberOfBeta=ncb+neb;
|
||||
parser->ci_nca=nca;
|
||||
parser->ci_ncb=ncb;
|
||||
parser->ci_nea=nea;
|
||||
parser->ci_neb=neb;
|
||||
parser->ci_nstates=nstates;
|
||||
parser->ci_threshold=thr;
|
||||
parser->usingCSF=useCSF;
|
||||
std::vector<std::string> &CIalpha=parser->CIalpha;
|
||||
std::vector<std::string> &CIbeta=parser->CIbeta;
|
||||
std::vector<std::string> &CSFocc=parser->CSFocc;
|
||||
std::vector<std::vector<std::string> > &CSFalpha=parser->CSFalpha;
|
||||
std::vector<std::vector<std::string> > &CSFbeta=parser->CSFbeta;
|
||||
std::vector<std::vector<double> > &CSFexpansion=parser->CSFexpansion;
|
||||
std::vector<double> &CIcoeff=parser->CIcoeff;
|
||||
std::vector<std::pair<int,double> > &coeff2csf=parser->coeff2csf;
|
||||
if(useCSF)
|
||||
{
|
||||
// dummy for now
|
||||
std::string alpha0(nstates,'0'),beta0(nstates,'0'),occ0(nstates,'0');
|
||||
std::vector<std::string> dummy;
|
||||
for(int i=0; i<nea; i++)
|
||||
alpha0[i]='1';
|
||||
for(int i=0; i<neb; i++)
|
||||
beta0[i]='1';
|
||||
for(int i=0; i<neb; i++)
|
||||
occ0[i]='2';
|
||||
for(int i=neb; i<nea; i++)
|
||||
occ0[i]='1';
|
||||
std::vector<double> vec;
|
||||
std::pair<int,double> dum(1,0.95);
|
||||
// HF
|
||||
coeff2csf.push_back(dum);
|
||||
CSFocc.push_back(occ0);
|
||||
CSFexpansion.push_back(vec);
|
||||
CSFexpansion.back().push_back(1.0);
|
||||
CSFalpha.push_back(dummy);
|
||||
CSFalpha.back().push_back(alpha0);
|
||||
CSFbeta.push_back(dummy);
|
||||
CSFbeta.back().push_back(beta0);
|
||||
// singles, assume multiplicity of 1
|
||||
for(int i=0; i<nea; i++)
|
||||
{
|
||||
for(int v=0; v<nstates-nea; v++)
|
||||
{
|
||||
coeff2csf.push_back(dum);
|
||||
coeff2csf.back().second = wgt;
|
||||
CSFocc.push_back(occ0);
|
||||
CSFocc.back().at(i) = '1';
|
||||
CSFocc.back().at(nea+v) = '1';
|
||||
CSFexpansion.push_back(vec);
|
||||
CSFexpansion.back().push_back(1.0/std::sqrt(2.0));
|
||||
CSFexpansion.back().push_back(1.0/std::sqrt(2.0));
|
||||
CSFalpha.push_back(dummy);
|
||||
CSFalpha.back().push_back(alpha0);
|
||||
CSFalpha.back().back().at(i)='0';
|
||||
CSFalpha.back().back().at(nea+v)='1';
|
||||
CSFalpha.back().push_back(alpha0);
|
||||
CSFalpha.back().back().at(i)='1';
|
||||
CSFalpha.back().back().at(nea+v)='0';
|
||||
CSFbeta.push_back(dummy);
|
||||
CSFbeta.back().push_back(beta0);
|
||||
CSFbeta.back().back().at(i)='1';
|
||||
CSFbeta.back().back().at(nea+v)='0';
|
||||
CSFbeta.back().push_back(beta0);
|
||||
CSFbeta.back().back().at(i)='0';
|
||||
CSFbeta.back().back().at(nea+v)='1';
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
if(useCSF)
|
||||
parser->ci_size = CSFocc.size();
|
||||
else
|
||||
parser->ci_size = CIcoeff.size();
|
||||
xmlDocPtr doc = xmlNewDoc((const xmlChar*)"1.0");
|
||||
xmlNodePtr qm_root = xmlNewNode(NULL, BAD_CAST "qmcsystem");
|
||||
xmlNodePtr multislaterdetPtr=NULL;
|
||||
multislaterdetPtr = parser->createMultiDeterminantSet();
|
||||
xmlAddChild(qm_root,multislaterdetPtr);
|
||||
xmlDocSetRootElement(doc, qm_root);
|
||||
xmlSaveFormatFile(name.c_str(),doc,1);
|
||||
xmlFreeDoc(doc);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1,275 +0,0 @@
|
|||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
// This file is distributed under the University of Illinois/NCSA Open Source License.
|
||||
// See LICENSE file in top directory for details.
|
||||
//
|
||||
// Copyright (c) 2016 Jeongnim Kim and QMCPACK developers.
|
||||
//
|
||||
// File developed by: Jeongnim Kim, jeongnim.kim@gmail.com, University of Illinois at Urbana-Champaign
|
||||
// Jeremy McMinnis, jmcminis@gmail.com, University of Illinois at Urbana-Champaign
|
||||
// Mark A. Berrill, berrillma@ornl.gov, Oak Ridge National Laboratory
|
||||
//
|
||||
// File created by: Jeongnim Kim, jeongnim.kim@gmail.com, University of Illinois at Urbana-Champaign
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#ifndef QMCPLUSPLUS_MOLECULARORBITALBASIS_H
|
||||
#define QMCPLUSPLUS_MOLECULARORBITALBASIS_H
|
||||
|
||||
#include "OhmmsPETE/OhmmsMatrix.h"
|
||||
#include "Particle/DistanceTable.h"
|
||||
|
||||
namespace qmcplusplus
|
||||
{
|
||||
|
||||
class DistanceTableData;
|
||||
|
||||
/** Class for a molecular orbital basis
|
||||
*
|
||||
*The molecular orbital \f$ \psi_i \f$ can be written as a linear
|
||||
*combination of basis functions \f$ \{\phi\} \f$ such that
|
||||
\f[
|
||||
\psi_i ({\bf r}_j) = \sum_I \sum_k C_{ikI} \phi_{ikI}({\bf r}_j-{\bf R}_I).
|
||||
\f]
|
||||
*This class performs the evaluation of the basis functions and their
|
||||
*derivatives for each of the N-particles in a configuration. All that
|
||||
*is required to generate the actual molecular orbitals is to multiply
|
||||
*by the coefficient matrix.
|
||||
*
|
||||
*The template (C)entered(O)rbital(T)ype should provide the fuctions
|
||||
<ul>
|
||||
<li> evaluate(int source, int first, int nptcl, int offset,
|
||||
VM& y, GM& dy, VM& d2y) {
|
||||
</ul>
|
||||
*An example being SphericalOrbitalSet
|
||||
*/
|
||||
template<class COT>
|
||||
class MolecularOrbitalBasis: public QMCTraits
|
||||
{
|
||||
public:
|
||||
|
||||
const ParticleSet* IonConfig;
|
||||
///constructor
|
||||
MolecularOrbitalBasis(): NumWalkers(1),myTable(0), IonConfig(0) { }
|
||||
|
||||
///constructor with ncenters
|
||||
explicit MolecularOrbitalBasis(int ncenters):NumWalkers(1), myTable(0), IonConfig(0)
|
||||
{
|
||||
for(int ic=0; ic<ncenters; ic++)
|
||||
AOs.push_back(0);
|
||||
}
|
||||
|
||||
/**
|
||||
@param atable the distance table (ion-electron)
|
||||
@brief Assign the distance table (ion-electron) and
|
||||
*determine the total number of basis states.
|
||||
*/
|
||||
void setTable(DistanceTableData* atable)
|
||||
{
|
||||
IonConfig=&(atable->origin());
|
||||
myTable = atable;
|
||||
//first set up the center list
|
||||
const ParticleSet& ptcl_ref = myTable->origin();
|
||||
I.resize(myTable->centers());
|
||||
for(int ic=0; ic<I.size(); ic++)
|
||||
{
|
||||
I[ic] = ptcl_ref.GroupID[ic];
|
||||
}
|
||||
//reset the distance table for the atomic orbitals
|
||||
for(int i=0; i<AOs.size(); i++)
|
||||
AOs[i]->setTable(myTable);
|
||||
//evaluate the total basis dimension and offset for each center
|
||||
Basis.resize(I.size()+1);
|
||||
Basis[0] = 0;
|
||||
for(int c=0; c<I.size(); c++)
|
||||
{
|
||||
Basis[c+1] = Basis[c]+AOs[I[c]]->getBasisSetSize();
|
||||
}
|
||||
TotalBasis = Basis[I.size()];
|
||||
}
|
||||
|
||||
void reset()
|
||||
{
|
||||
// DO NOTHING
|
||||
}
|
||||
|
||||
void resetParameters(VarRegistry<RealType>& optVariables)
|
||||
{
|
||||
for(int i=0; i<AOs.size(); i++)
|
||||
AOs[i]->resetParameters(optVariables);
|
||||
}
|
||||
|
||||
|
||||
/** return the size of the basis set
|
||||
*/
|
||||
inline int size() const
|
||||
{
|
||||
return TotalBasis;
|
||||
}
|
||||
|
||||
/** reset the distance table with a new target P
|
||||
*/
|
||||
void resetTargetParticleSet(ParticleSet& P)
|
||||
{
|
||||
LOGMSG("MolecularOrbitalBasis::resetTargetParticleSet")
|
||||
myTable = DistanceTable::add(*IonConfig,P,DT_AOS);
|
||||
for(int i=0; i<AOs.size(); i++)
|
||||
AOs[i]->setTable(myTable);
|
||||
}
|
||||
|
||||
/**
|
||||
@param nptcl number of particles
|
||||
@brief resize the containers for data
|
||||
for nptcl particles and TotalBasis basis functions
|
||||
*/
|
||||
inline void resize(int nptcl)
|
||||
{
|
||||
NumPtcls = nptcl;
|
||||
Y.resize(nptcl,TotalBasis);
|
||||
dY.resize(nptcl,TotalBasis);
|
||||
d2Y.resize(nptcl,TotalBasis);
|
||||
}
|
||||
|
||||
|
||||
/** Evalaute the values of basis functions
|
||||
@param P input configuration containing N particles
|
||||
@brief For each center, evaluate all the Atomic Orbitals belonging to that center.
|
||||
*
|
||||
The data members contain
|
||||
- \f[ Y[i,j] = \phi_j(r_i-R_I) \f]
|
||||
- \f[ dY[i,j] = {\bf \nabla}_i \phi_j(r_i-R_I) \f]
|
||||
- \f[ d2Y[i,j] = \nabla^2_i \phi_j(r_i-R_I), \f]
|
||||
where \f$ {\bf R_I} \f$ is the correct center for the basis function \f$ \phi_j \f$
|
||||
*/
|
||||
inline void
|
||||
evaluate(const ParticleSet& P)
|
||||
{
|
||||
for(int c=0; c<I.size(); c++)
|
||||
{
|
||||
AOs[I[c]]->evaluate(c,0,P.getTotalNum(),Basis[c],Y,dY,d2Y);
|
||||
}
|
||||
}
|
||||
|
||||
inline void
|
||||
evaluate(const ParticleSet& P, int iat)
|
||||
{
|
||||
for(int c=0; c<I.size(); c++)
|
||||
{
|
||||
AOs[I[c]]->evaluate(c,iat,Basis[c],Y);
|
||||
}
|
||||
}
|
||||
|
||||
inline void
|
||||
evaluateAll(const ParticleSet& P, int iat)
|
||||
{
|
||||
for(int c=0; c<I.size(); c++)
|
||||
{
|
||||
AOs[I[c]]->evaluate(c,iat,Basis[c],Y,dY,d2Y);
|
||||
}
|
||||
}
|
||||
|
||||
/** add a new set of Centered Atomic Orbitals
|
||||
*@param aos a set of Centered Atomic Orbitals
|
||||
*/
|
||||
inline void add(COT* aos)
|
||||
{
|
||||
ERRORMSG("!!!!!! this should not be used !!!!!! ")
|
||||
AOs.push_back(aos);
|
||||
}
|
||||
|
||||
/** add a new set of Centered Atomic Orbitals
|
||||
* @param aos a set of Centered Atomic Orbitals
|
||||
* @param icenter the index of the center
|
||||
*/
|
||||
inline void add(COT* aos, int icenter)
|
||||
{
|
||||
AOs[icenter]=aos;
|
||||
}
|
||||
|
||||
void print(std::ostream& os)
|
||||
{
|
||||
for(int i=0; i<Y.rows(); i++)
|
||||
{
|
||||
for(int j=0; j<Y.cols(); j++)
|
||||
{
|
||||
os << Y(i,j) << " " << dY(i,j) << " " << d2Y(i,j) << std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
///row i of matrix Y
|
||||
inline const ValueType* restrict y(int i)
|
||||
{
|
||||
return &Y(i,0);
|
||||
}
|
||||
///row i of vector matrix dY
|
||||
inline const GradType* restrict dy(int i)
|
||||
{
|
||||
return &dY(i,0);
|
||||
}
|
||||
///row i of matrix d2Y
|
||||
inline const ValueType* restrict d2y(int i)
|
||||
{
|
||||
return &d2Y(i,0);
|
||||
}
|
||||
|
||||
#ifdef USE_FASTWALKER
|
||||
inline const ValueType* restrict y(int iw, int ia)
|
||||
{
|
||||
return &Y(iw+NumWalkers*ia,0);
|
||||
}
|
||||
inline const GradType* restrict dy(int iw, int ia)
|
||||
{
|
||||
return &dY(iw+NumWalkers*ia,0);
|
||||
}
|
||||
inline const ValueType* restrict d2y(int iw, int ia)
|
||||
{
|
||||
return &d2Y(iw+NumWalkers*ia,0);
|
||||
}
|
||||
#else
|
||||
inline const ValueType* restrict y(int iw, int ia)
|
||||
{
|
||||
return &Y(iw*NumPtcls+ia,0);
|
||||
}
|
||||
inline const GradType* restrict dy(int iw, int ia)
|
||||
{
|
||||
return &dY(iw*NumPtcls+ia,0);
|
||||
}
|
||||
inline const ValueType* restrict d2y(int iw, int ia)
|
||||
{
|
||||
return &d2Y(iw*NumPtcls+ia,0);
|
||||
}
|
||||
#endif
|
||||
|
||||
///the number of particles
|
||||
int NumPtcls;
|
||||
///the number of walkers
|
||||
int NumWalkers;
|
||||
///total number of basis functions
|
||||
int TotalBasis;
|
||||
///container for the id's of the centers (ions),
|
||||
///several centers may share the same id
|
||||
std::vector<int> I;
|
||||
///container to store the offsets of the basis functions,
|
||||
///the number of basis states for center J is Basis[J+1]-Basis[J]
|
||||
std::vector<int> Basis;
|
||||
///container for the pointers to the Atomic Orbitals,
|
||||
///the size of this container being determined by the number
|
||||
///of unique centers
|
||||
std::vector<COT*> AOs;
|
||||
///matrix to store values \f$ Y[i,j] = \phi_j(r_i) \f$
|
||||
Matrix<ValueType> Y;
|
||||
///matrix to store gradients \f$ dY[i,j] = {\bf \nabla}_i \phi_j(r_i) \f$
|
||||
Matrix<GradType> dY;
|
||||
///matrix to store laplacians \f$ d2Y[i,j] = \nabla^2_i \phi_j(r_i) \f$
|
||||
Matrix<ValueType> d2Y;
|
||||
///the distance table (ion-electron)
|
||||
DistanceTableData* myTable;
|
||||
};
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue