From: Karol M. L. <kar...@gm...> - 2009-07-15 15:26:14
|
On Friday 12 June 2009 10:41:29 Hugh Chaffey-Millar wrote: > Hi Karol > > > Could I also look over your code and input/output example? > > Sure, I'll send these in a separate email to you only, since Noel has it > already. Thanks for that code. It's been a while, but I implemented parsing gradients today for Gaussian. I write the code from scratch, but used your log files. There is a small fragment in the comment of the latest commit. Is that OK? It's really quite short - that would be revision 850. Here's the diff: http://cclib.svn.sourceforge.net/viewvc/cclib/trunk/src/cclib/parser/gaussianparser.py?r1=850&r2=849&pathrev=850&diff_format=h At this point, the parser parses the cartesian forces into a regular mxnx3 matrix, where n is the number of atoms and m in the number of optimization steps. The numbers are in gaussian-esque hartree/bohr - I guess I should convert that to eV/angstrem... what do you say Noel? Here is one of your log files parsed with the new code: langner@machine:~$ cat <<EOF | python > import cclib > a = cclib.parser.ccopen("MeOMe-grad.log").parse() > print a.grads > EOF [Gaussian MeOMe-grad.log INFO] Creating attribute charge: 0 [Gaussian MeOMe-grad.log INFO] Creating attribute mult: 1 [Gaussian MeOMe-grad.log INFO] Creating attribute atomnos[] [Gaussian MeOMe-grad.log INFO] Creating attribute natom: 9 [Gaussian MeOMe-grad.log INFO] Creating attribute atomcoords[] [Gaussian MeOMe-grad.log INFO] Creating attribute nbasis: 57 [Gaussian MeOMe-grad.log INFO] Creating attribute nmo: 57 [Gaussian MeOMe-grad.log INFO] Creating attribute scftargets[] [Gaussian MeOMe-grad.log INFO] Creating attribute scfenergies[] [Gaussian MeOMe-grad.log INFO] Creating attribute mosyms[] [Gaussian MeOMe-grad.log INFO] Creating attribute homos[] [Gaussian MeOMe-grad.log INFO] Creating attribute moenergies[] [Gaussian MeOMe-grad.log INFO] Creating attribute grads[] [Gaussian MeOMe-grad.log INFO] Creating attribute geovalues[] [Gaussian MeOMe-grad.log INFO] Creating attribute geotargets[] [Gaussian MeOMe-grad.log INFO] Creating attribute coreelectrons[] [[[ 0.01026324 0.01389559 0.02445051] [ 0.00747792 -0.01446347 0.00280476] [ 0.00470098 0.00834956 -0.01982187] [-0.0217437 -0.00201811 -0.00282018] [-0.00126088 0.00092114 -0.00145291] [ 0.00980594 -0.02822511 -0.00185482] [-0.02168228 0.00376007 0.00074849] [ 0.00764326 0.00369573 0.01417389] [ 0.00479553 0.01408459 -0.01622786]]] It should also work with the current standard geometry optimization tests we have, so there's no need for more tests at the moment. I'll add some tests soon for the standard tests. Cheers, Karol -- written by Karol Langner Wed Jul 15 17:04:13 CEST 2009 |