49 std::ifstream fin(fname.c_str());
53 search(fin,
"do_pseudo", aline);
63 std::cout <<
"usingECP: " << (
ECP ? (
"yes") : (
"no")) << std::endl;
66 search(fin,
"multi_det", aline);
73 std::cout <<
"Multideterminant: " << (
multideterminant ? (
"yes") : (
"no")) << std::endl;
76 search(fin,
"ao_num", aline);
79 std::cout <<
"NUMBER OF AOs: " <<
numAO << std::endl;
83 search(fin,
"mo_num", aline);
86 std::cout <<
"NUMBER OF MOs: " <<
numMO << std::endl;
89 search(fin,
"elec_alpha_num", aline);
92 std::cout <<
"Number of alpha electrons: " <<
NumberOfAlpha << std::endl;
93 search(fin,
"elec_beta_num", aline);
96 std::cout <<
"Number of beta electrons: " <<
NumberOfBeta << std::endl;
99 search(fin,
"elec_tot_num", aline);
102 std::cout <<
"Number of electrons: " <<
NumberOfEls << std::endl;
105 search(fin,
"spin_multiplicity", aline);
113 search(fin,
"nucl_num", aline);
116 std::cout <<
"NUMBER OF ATOMS: " <<
NumberOfAtoms << std::endl;
134 fin.open(fname.c_str());
137 search(fin,
"BEGIN_DET", aline);
141 std::cout <<
"Found " <<
currentWords[1] <<
" Determinants" << std::endl;
147 std::cout <<
"# core, #active, #external: " <<
NFZC <<
" " <<
NAC <<
" " <<
NEXT << std::endl;
156 std::vector<int> atomic_number, core;
157 std::vector<double> q, pos;
162 bool notfound =
true;
168 std::cerr <<
"Could not find atomic coordinates. \n";
187 atomic_number.push_back(zint);
199 std::cerr <<
"Could not find atomic coordinates for all atoms. \n";
212 std::cerr <<
"Problem looking for ECPs, this should not happen. Contact developers for help. \n";
229 std::cerr <<
"2 Found ECPs, but problem looking ZCORE data.\n";
243 std::vector<std::string>::iterator it, it0;
248 std::cerr <<
"Problem with ECP data. Didn't found ATOM tag\n";
249 std::cerr << is.rdbuf() << std::endl;
253 int nq0 = atoi(it0->c_str()) - 1;
257 core[nq0] = atoi(it->c_str());
260 std::cout <<
"1 Found ECP for atom " << nq0 <<
" with zcore " << core[nq0] << std::endl;
267 std::cerr <<
"Problem with ECP data. Didn't found ATOM tag\n";
268 std::cerr <<
"Atom: " << nq0 << std::endl;
271 std::vector<std::string>::iterator it2 = it;
273 int nq = atoi(it2->c_str());
276 std::cerr <<
"Problem with ECP data. ID's don't agree\n";
277 std::cerr <<
"Atom: " << nq0 << std::endl;
283 std::cerr <<
"Problem with ECP data (2).\n";
284 std::cerr <<
"Atom: " << nq0 << std::endl;
287 nq = atoi((it + 1)->c_str());
288 core[nq0] = core[nq - 1];
290 std::cout <<
"2 Found ECP for atom " << nq0 <<
" with zcore " << core[nq0] << std::endl;
314 int speciesID = species.addSpecies(
GroupName[i]);
323 std::string Shell_temp;
327 std::map<std::string, int> basisDataMap;
331 std::map<std::string, int>::iterator it(basisDataMap.find(
tags[i]));
332 if (it == basisDataMap.end())
334 basisDataMap[
tags[i]] = nUniqAt++;
337 std::vector<std::vector<double>> expo(nUniqAt), coef(nUniqAt), coef2(nUniqAt);
338 std::vector<int> nshll(nUniqAt, 0);
339 std::vector<std::vector<int>> ncoeffpershell(nUniqAt);
340 std::vector<std::vector<std::string>> shID(nUniqAt);
341 std::map<std::string, int> gsMap;
342 gsMap[std::string(
"S")] = 1;
343 gsMap[std::string(
"SP")] = 2;
344 gsMap[std::string(
"P")] = 3;
345 gsMap[std::string(
"D")] = 4;
346 gsMap[std::string(
"F")] = 5;
347 gsMap[std::string(
"G")] = 6;
348 gsMap[std::string(
"H")] = 7;
349 gsMap[std::string(
"I")] = 8;
356 std::cerr <<
"Problem with basis set data.\n";
371 lookFor(is,
"BEGIN_BASIS_SET");
372 int NbCoeffperShell = 0;
375 while (allbase ==
true)
381 std::map<std::string, int>::iterator it(basisDataMap.find(
currentWords[0]));
382 if (it == basisDataMap.end())
384 std::cerr <<
"Error in parser.\n";
387 currPos = it->second;
389 ncoeffpershell[currPos].clear();
390 ncoeffpershell[currPos].push_back(0);
391 shID[currPos].clear();
392 shID[currPos].push_back(
"NONE");
404 ncoeffpershell[currPos][nshll[currPos]] = NbCoeffperShell;
405 for (
int nbcoef = 0; nbcoef < NbCoeffperShell; nbcoef++)
410 shID[currPos][nshll[currPos]] = Shell_temp;
413 std::cout << currPos <<
":" << expo[currPos].back() <<
" " << coef[currPos].back() <<
" " 414 << ncoeffpershell[currPos][nshll[currPos]] <<
" " << shID[currPos][nshll[currPos]] << std::endl;
418 ncoeffpershell[currPos].push_back(0);
419 shID[currPos].push_back(
"NONE");
435 }
while (group ==
true);
439 std::cerr <<
"error in parser" << std::endl;
453 std::map<std::string, int>::iterator it(basisDataMap.find(
tags[i]));
454 if (it == basisDataMap.end())
456 std::cerr <<
"Error in parser.\n";
460 int indx = it->second;
462 for (
int k = 0; k < nshll[indx]; k++)
464 gShell.push_back(gsMap[shID[indx][k]]);
466 for (
int k = 0; k < nshll[indx]; k++)
467 gNumber.push_back(ncoeffpershell[indx][k]);
468 for (
int k = 0; k < expo[indx].size(); k++)
469 gExp.push_back(expo[indx][k]);
470 for (
int k = 0; k < coef[indx].size(); k++)
471 gC0.push_back(coef[indx][k]);
485 std::vector<double> dummy(50);
487 std::streampos pivot;
501 for (
int i = 0; i <
numMO; i++)
503 EigVec[cnt++] = CartMat[i][k];
513 for (
int i = 0; i <
numMO; i++)
515 EigVec[cnt++] = CartMat[i][k];
516 std::cout <<
"Finished reading MO." << std::endl;
524 for (
int i = 0; i < nq; i++)
539 std::cerr <<
"Problem reading orbitals!!" << std::endl;
553 for (
int i = 0; i < rem; i++)
555 CartMat[cnt + i][k] = atof(
currentWords[2 + i].c_str());
573 for (
int i = 0; i <
ci_size; i++)
578 std::cout <<
"Done reading determinants" << std::endl;
593 for (
int i = 0; i <
CIalpha[0].size(); i++)
596 for (
int i = 0; i <
CIbeta[0].size(); i++)
597 if (
CIbeta[0].at(i) ==
'1')
601 std::cerr <<
"QMCPACK can't handle different number of active orbitals in alpha and beta channels right now. " 602 "Contact developers for help (Miguel).\n";
610 std::cout <<
" Done reading CIs!!" << std::endl;
std::vector< value_type > EigVal_beta
std::vector< std::string > currentWords
std::vector< double > CIcoeff
void getMO(std::istream &is)
std::vector< std::string > tags
std::vector< std::string > GroupName
void parse(const std::string &fname)
ParticleIndex GroupID
Species ID.
std::vector< value_type > EigVal_alpha
std::vector< int > gBound
std::vector< value_type > gC0
unsigned parsewords(const char *inbuf, std::vector< std::string > &slist, const std::string &extra_tokens)
std::vector< value_type > EigVec
int search(std::istream &is, const std::string &keyword)
std::vector< value_type > gExp
static std::map< int, std::string > IonName
SpeciesSet & getSpeciesSet()
retrun the SpeciesSet of this particle set
std::vector< std::string > CIalpha
void create(const std::vector< int > &agroup)
create grouped particles
bool lookFor(std::istream &is, const std::string &keyword)
std::streampos pivot_begin
std::vector< int > gNumber
Custom container for set of attributes for a set of species.
int getwords(std::vector< std::string > &slist, std::istream &fp, std::string &aline)
std::vector< std::string > CIbeta
std::vector< value_type > gC1
void getGeometry(std::istream &is)
void getMO_single_set(std::istream &is, Matrix< double > &CartMat, std::vector< value_type > &EigVal_alpha)
void getQPCI(std::istream &is)
void getGaussianCenters(std::istream &is)
std::vector< int > gShell