From: Hugh Chaffey-M. <hug...@ch...> - 2009-06-06 14:38:43
|
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. 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. If you want I can add code to extract the cartesians as well. Just let me know. 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. 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. 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. :-) 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... |