From: Noel O'B. <bao...@gm...> - 2009-06-06 15:42:02
|
2009/6/6 Hugh Chaffey-Millar <hug...@ch...>: > Hi Noel > > That's probably reasonable, but the code only extracts internal coordinates > if these were given in the input file as a z-matrix, and if this is the > case, the "user" will know what they refer to. Returning gradients in the > context of the supplied z-matrix is particularly important if the user wants > to implement a custom geometry optimisation strategy and, for example, > freeze some bonds, project out some forces, etc. If cclib were to only > return the forces in terms of Cartesians, then the programmer would need to > somehow construct a matrix of dX_i/dI_j, i.e. the matrix whose elements are > the change of cartesian coordinate X_i with respect to internal coordinate > I_j, for each point in the optimisation. That's a good defense. Regarding the first point though, I would like as much as possible for all the necessary information to be available simply by parsing the log file. I will look again through a variety of the log files I have here. > In light of the fact that other packages only give cartesians it's probably > reasonable, in the name of uniformity to extract these from a Gaussian file, > but I believe forces in terms of the supplied z-matrix are also important. > I, for example, for my current research, need to know the forces in terms of > the z-matrix variables. That's fine. BTW to clarify, it may not be that the other packages only give cartesians - it may just be the nature of the input provided in our test suite. > If you want I can add code to extract the cartesians as well. Just let me > know. I think that would be good. It would also be useful to consider how other programs handle this problem and try to find some commonality. The wiki is often useful for gathering together this sort of information. > Also, if you have any other comments about my python coding style or > other suggestions regarding the way in which you'd like it to be written, > please feel free to pass them on. I've only been coding in python for a few > months. The code looks good. > As I may have mentioned, I will probably add support for a number of other > programs, such as GAMESS, NWChem and possibly VASP, at some point, so > obviously should do this in a style that is consistent with the rest of > cclib. Sure. We try to stick to the PEP whatever for nice Python, and we try to make it easier for others to read the code. We don't generally worry about speed, but I note that line.find("whatever") is slower than line[1:27] == "whatever". > On another matter, I noticed a broken link of the main page: in the opening > sentence "cclib is an open source library, written in Python" the Python > link is broken. :-) Will do. If you're going to be doing a lot more hacking on cclib we'll get you set up with SVN, wiki access and so on. Let us know when you want this. > In any case, thanks for a great library - very useful! > > Cheers > Hugh > > > > Noel O'Boyle wrote: >> >> Hello Hugh, >> >> I've been testing the patch, and looking at the output of other comp >> chem programs. I was thinking it might be better if you could extract >> the section giving the forces in terms of cartesian coordinates, e.g. >> ------------------------------------------------------------------- >> Center Atomic Forces (Hartrees/Bohr) >> Number Number X Y Z >> ------------------------------------------------------------------- >> 1 1 -0.012534744 -0.021754635 -0.008346094 >> 2 6 0.018984731 0.032948887 -0.038003451 >> 3 1 -0.002133484 -0.006226040 0.023174772 >> 4 1 -0.004316502 -0.004968213 0.023174772 >> ------------------------------------------------------------------- >> >> Firstly, this seems to be available in the other comp chem log files I >> looked at. Secondly, cclib has no concept of what the variables >> describing the internal coordinates refer to. It might be possible to >> also extract this information from the Gaussian log file, but that >> opens up a lot of issues in relation to other software and all the >> various types of internal coordinates. >> >> What do you think? >> >> - Noel >> >> 2009/5/29 Hugh Chaffey-Millar <hug...@ch...>: >> >>> >>> Dear Noel >>> >>> I've implemented the feature in the Gaussian parser. Please find attached >>> the >>> updated files and z-matrix and cartesian log files that it works for. >>> >>> The code creates two attributes grads and gradvars. The first is an >>> ndarray of >>> the gradients, the second is the names of the variables as a list of >>> strings. >>> >>> Cheers >>> Hugh >>> >>> >>> -- >>> _______________________________ >>> Hugh Chaffey-Millar, Dr. >>> Alexander von Humboldt Fellow >>> >>> Technische Universität München >>> Fachgebiet Molekulare Katalyse >>> Department Chemie >>> >>> Lichtenbergstr. 4 >>> 85747 Garching b. München >>> >>> Tel: +49 (0)89 289 13072 >>> hug...@ch... >>> >>> >> >> >> > > > -- > _______________________________ > Hugh Chaffey-Millar, Dr. > Alexander von Humboldt Fellow > > Technische Universität München > Fachgebiet Molekulare Katalyse > Department Chemie > > Lichtenbergstr. 4 > 85747 Garching b. München > > Tel: +49 (0)89 289 13182 > hug...@ch... > > > |