QMCPACK / qmcpack

Main repository for QMCPACK, an open-source production level many-body ab initio Quantum Monte Carlo code for computing the electronic structure of atoms, molecules, and solids with full performance portable GPU support
http://www.qmcpack.org
Other
297 stars 138 forks source link

Gamess CI converter fails for nact < 6 #38

Closed qmc-robot closed 7 years ago

qmc-robot commented 7 years ago

Reported by: markdewing

Reported by Kevin Gasperich on the QMC google group, quoted below. Example files also attached.

"I've found a minor issue regarding the QMCPACK converter and GAMESS ALDET type calculations (either SCFTYP=MCSCF and CISTEP=ALDET or CITYP=ALDET). If one is using fewer than six orbitals in the active space (NACT in $DET or $CIDET of the GAMESS input), the QMCPACK converter does not properly parse the GAMESS output. In searching for a determinant expansion, the converter splits lines in the GAMESS output into strings separated by whitespace. It then looks for the strings "ALPHA", "BETA", and "COEFFICIENT" in positions 0, 2, and 4 of the split line. For NACT>=6, a line similar to " ALPHA | BETA | COEFFICIENT" will precede the determinant expansion, with varying amounts of whitespace around "ALPHA" and "BETA"; this is parsed correctly. If NACT=5 the line reads "ALPHA |BETA | COEFFICIENT" NACT=4: "ALPHA |BETA | COEFFICIENT" NACT=3: "ALPHA|BETA | COEFFICIENT" NACT=2: "ALPH|BETA| COEFFICIENT" For any of these four cases, the lack of whitespace around the pipe characters will cause a problem with the parser: the converter will output "Could not find CI expansion." to stderr, and then it will abort. The relevant code is in function "getCI" in trunk/src/QMCTools/GamesAsciiParser.cpp Splitting on "|" instead of whitespace would solve this problem for NACT > 2 (for NACT=2 one would also need to account for the truncated "ALPHA").
qmc-robot commented 7 years ago

Comment by: markdewing

File: gamess-aldet-examples.tar.gz

qmc-robot commented 7 years ago

Comment by: prckent

Were you able to reproduce the error from the sample files? Check with Miguel if needed.

qmc-robot commented 7 years ago

Comment by: markdewing

Yes, I was able to reproduce the issue. (The bug report and the examples were excellent.)

Possible fixes

  1. Modify if-test in getCI to check for special header cases (ALPH|BETA, etc). The coefficients have proper whitespace in all cases. Ugly, but minimally invasive.
  2. Add | to token list in parsewords. Simple, but I'm not sure about unintended consequences of adding that parse token everywhere.
  3. Change getwords/parsewords to accept an optional parameter with additional tokens to parse. Most invasive for the code, but changes the parsing behavior less than option 2. Could be driven by unit testing quite easily.
qmc-robot commented 7 years ago

Comment by: prckent

My vote is #3. It seems that a bit of wildcarding (ALP, ALPH, ALPHA? ) would help with robustness too.

First thing would be to add a testcase to the converter tests.

The converter is not very helpful in terms of printed messages and guidance. I had to check the tutorial.

qmc-robot commented 7 years ago

Comment by: prckent

These issues are fixed by Mark Dewing. Full converter tests of the different combinations that we support are still needed; ideally GAMESS will write our XML at full precision.