GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing cclib.github.io — Calculation methods — cclib 1.8.1 documentation Calculation methodsThe following methods in cclib allow further analysis of calculation output. C squared population analysis (CSPA)CSPA can be used to determine and interpret the electron density of a molecule. The contribution of the a-th atomic orbital to the i-th molecular orbital can be written in terms of the molecular orbital coefficients:
\[\Phi_{ai} = \frac{c^2_{ai}}{\sum_k c^2_{ki}}\]
The CSPA class available from cclib.method performs C-squared population analysis and can be used as follows: from cclib.io import ccread from cclib.method import CSPA data = ccread("mycalc.out") m = CSPA(data) m.calculate() After the
Custom fragmentsCalling the calculate method without an argument treats each atom as a fragment in the population analysis. An optional argument can be passed - a list of lists - containing the atomic orbital numbers to be included in each fragment. Calling with this additional argument is useful if one is more interested in the contributions of certain orbitals, such as metal d, to the molecular orbitals. For example: from cclib.io import ccread from cclib.method import CSPA data = ccread("mycalc.out") m = CSPA(data) m.calculate([[0, 1, 2, 3, 4], [5, 6], [7, 8, 9]]) # fragment one is made from basis functions 0 - 4 # fragment two is made from basis functions 5 & 6 # fragment three is made from basis functions 7 - 9 Custom progressThe CSPA class also can take a progress class as an argument so that the progress of the calculation can be monitored: from cclib.method import CSPA from cclib.parser import Gaussian from cclib.progress import TextProgress import logging progress = TextProgress() p = Gaussian("mycalc.out", logging.ERROR) d = p.parse(progress) m = CSPA(d, progress, logging.ERROR) m.calculate() Mulliken population analysis (MPA)MPA can be used to determine and interpret the electron density of a molecule. The contribution of the a-th atomic orbital to the i-th molecular orbital in this method is written in terms of the molecular orbital coefficients, c, and the overlap matrix, S:
\[\Phi_{ai} = \sum_b c_{ai} c_{bi} S_{ab}\]
The MPA class available from cclib.method performs Mulliken population analysis and can be used as follows: import sys from cclib.method import MPA from cclib.parser import ccopen d = ccopen(sys.argv[1]).parse() m = MPA(d) m.calculate() After the calculate() method is called, the following attributes are available:
Custom fragmentsThe calculate method chooses atoms as the fragments by default, and optionally accepts a list of lists containing the atomic orbital numbers (e.g. Custom progressThe Mulliken class also can take a progress class as an argument so that the progress of the calculation can be monitored: from cclib.method import MPA from cclib.parser import ccopen from cclib.progress import TextProgress import logging progress = TextProgress() d = ccopen("mycalc.out", logging.ERROR).parse(progress) m = MPA(d, progress, logging.ERROR) m.calculate() Löwdin Population AnalysisThe LPA class available from cclib.method performs Löwdin population analysis and can be used as follows: import sys from cclib.method import LPA from cclib.parser import ccopen d = ccopen(sys.argv[1]).parse() m = LPA(d) m.calculate() Bickelhaupt Population AnalysisThe Bickelhaupt class available from cclib.method performs Bickelhaupt population analysis that has been proposed in Organometallics 1996, 15, 13, 2923–2931. doi:10.1021/om950966x The contribution of the a-th atomic orbital to the i-th molecular orbital in this method is written in terms of the molecular orbital coefficients, c, and the overlap matrix, S:
\[\Phi_{ai,\alpha} = \sum_b w_{ab,\alpha} c_{ai,\alpha} c_{bi,\alpha} S_{ab}\]
where the weights \(w_{ab}\) that are applied on the Mulliken atomic orbital contributions are defined as following when the coefficients of the molecular orbitals are substituted into equation 11 in the original article.
\[w_{ab,\alpha} = 2 \frac{\sum_k c_{ak,\alpha}^2}{\sum_i c_{ai,\alpha}^2 + \sum_j c_{bj,\alpha}^2}\]
In case of unrestricted calculations, \(\alpha\) charges and \(\beta\) charges are each determined to obtain total charge. In restricted calculations, \(\alpha\) subscript can be ignored since the coefficients are equivalent for both spin orbitals. The weights are introduced to replace the somewhat arbitrary partitioning of off-diagonal charges in the Mulliken population analysis, which divides the off-diagonal charges identically to both atoms. Bickelhaupt population analysis instead divides the off-diagonal elements based on the relative magnitude of diagonal elements. import sys from cclib.method import Bickelhaupt from cclib.parser import ccopen d = ccopen(sys.argv[1]).parse() m = Bickelhaupt(d) m.calculate() After the calculate() method is called, the following attributes are available:
Custom fragmentsThe calculate method chooses atoms as the fragments by default, and optionally accepts a list of lists containing the atomic orbital numbers (e.g. Custom progressThe Bickelhaupt class also can take a progress class as an argument so that the progress of the calculation can be monitored: from cclib.method import Bickelhaupt from cclib.parser import ccopen from cclib.progress import TextProgress import logging progress = TextProgress() d = ccopen("mycalc.out", logging.ERROR).parse(progress) m = Bickelhaupt(d, progress, logging.ERROR) m.calculate() Density Matrix calculationThe Density class from cclib.method can be used to calculate the density matrix: from cclib.parser import ccopen from cclib.method import Density parser = ccopen("myfile.out") data = parser.parse() d = Density(data) d.calculate() After Mayer’s Bond OrdersThis method calculates the Mayer’s bond orders for a given molecule: import sys from cclib.parser import ccopen from cclib.method import MBO parser = ccopen(sys.argv[1]) data = parser.parse() d = MBO(data) d.calculate() After Charge Decomposition AnalysisThe Charge Decomposition Analysis (CDA) as developed by Gernot Frenking et al. is used to study the donor-acceptor interactions of a molecule in terms of two user-specified fragments. The CDA class available from cclib.method performs this analysis: from cclib.io import ccopen from cclib.method import CDA molecule = ccopen("molecule.log") frag1 = ccopen("fragment1.log") frag2 = ccopen("fragment2.log") # if using CDA from an interactive session, it's best # to parse the files at the same time in case they aren't # parsed immediately---go get a drink! m = molecule.parse() f1 = frag1.parse() f2 = frag2.parse() cda = CDA(m) cda.calculate([f1, f2]) After There is also a script provided by cclib that performs the CDA from a command-line: $ cda molecule.log fragment1.log fragment2.log Charge decomposition analysis of molecule.log MO# d b r ----------------------------- 1: -0.000 -0.000 -0.000 2: -0.000 0.002 0.000 3: -0.001 -0.000 0.000 4: -0.001 -0.026 -0.006 5: -0.006 0.082 0.230 6: -0.040 0.075 0.214 7: 0.001 -0.001 0.022 8: 0.001 -0.001 0.022 9: 0.054 0.342 -0.740 10: 0.087 -0.001 -0.039 11: 0.087 -0.001 -0.039 ------ HOMO - LUMO gap ------ 12: 0.000 0.000 0.000 13: 0.000 0.000 0.000 ...... Notes
Bader’s QTAIMBader’s QTAIM charges define the border between the atoms in the molecule as a surface where each point on the surface has zero flux. In other words, the points on the surface of the Bader spaces satisfy the equation \(\nabla \rho (r) \cdot n(r) = 0\). In cclib, numerical calculation of QTAIM charges through the algorithm proposed in [Henkelman2006] is implemented. Calculating the Bader’s QTAIM charges in cclib follow similar steps as other population analysis methods. The following code provides an example of how QTAIM charges can be obtained. from cclib.method import Bader from cclib.method import Volume from cclib.parser import ccopen from cclib.progress import TextProgress import logging progress = TextProgress() d = ccopen("mycalc.out", logging.ERROR).parse(progress) # Inputs for Volume object below are origin, top corner, and spacing # represented in Cartesian coordinates and in angstroms. vol = Volume((-3, -3, -3), (3, 3, 3), (.1, .1, .1)) m = Bader(d, vol) m.calculate() After the calculate() method is called, the following attributes are available:
Since some computational chemistry packages support writing out charge densities as cube files during calculations, it is highly recommended to do so especially for larger systems.
To calculate Bader charges from a cube file, a from cclib.method import volume from cclib.method import Bader from cclib.parser import ccopen from cclib.progress import TextProgress import logging progress = TextProgress() d = ccopen("mycalc.out", logging.ERROR).parse(progress) # Read in from cube file vol = volume.read_from_cube("mycalc.cube") m = Bader(d, vol) m.calculate() DDEC6DDEC6 is a Stockholder-like charge partitioning method introduced in [Manz2016]. Proatom densities should be provided for DDEC6 method. Proatom densities generated [1] using horton can be passed on as an argument for the constructor of the DDEC6 object. The DDEC6 algorithm requires many numerical integrations so a fine grid is necessary to obtain accurate results. Calculating the electron density on a fine grid using a Volume object is slow, therefore we recommend that electron densities are imported from cube files. Because a lot of numerical integrations are present in DDEC6 algorithm, fine grid is necessary to obtain satisfying results. from cclib.method import DDEC6 from cclib.method import Volume from cclib.parser import ccopen from cclib.progress import TextProgress import logging progress = TextProgress() d = ccopen("mycalc.out", logging.ERROR).parse(progress) # Inputs for Volume object below are origin, top corner, and spacing # represented in Cartesian coordinates and in angstroms. vol = Volume((-3, -3, -3), (3, 3, 3), (.1, .1, .1)) # Alternatively, read in from cube file vol = volume.read_from_cube("mycalc.cube") m = DDEC6(d, vol, '/path/to/horton_proatom_density_directory') m.calculate() Third argument to the constructor of DDEC6 object points to the directory proatom densities are stored. The proatom densities can be generated by using horton . Follow the steps described in horton documentation for its After the calculate() method is called, the following attributes are available:
Hirshfeld Population AnalysisHirshfeld Population Analysis is the most basic charge partitioning method among stockholder-type methods and was introduced initially in [Hirshfeld1977]. In Hirshfeld method, proatom densities, which are charge densities of neutral atoms that comprise the given molecule, are used to calculate the weights that will be applied to partition charge densities on each grid point. Proatom densities can be generated [1] using horton and can be passed on as an argument for the constructor of the Hirshfeld object. For Hirshfeld calculations, it is recommended that electron densities are imported from cube files. from cclib.method import Hirshfeld from cclib.method import Volume from cclib.parser import ccopen from cclib.progress import TextProgress import logging progress = TextProgress() d = ccopen("mycalc.out", logging.ERROR).parse(progress) # Inputs for Volume object below are origin, top corner, and spacing # represented in Cartesian coordinates and in angstroms. vol = Volume((-3, -3, -3), (3, 3, 3), (.1, .1, .1)) # Alternatively, read in from cube file vol = volume.read_from_cube("mycalc.cube") m = Hirshfeld(d, vol, '/path/to/horton_proatom_density_directory') m.calculate() Third argument to the constructor of Hirshfeld object points to the directory proatom densities are stored. The proatom densities can be generated by using horton . Follow the steps described in horton documentation for its After the calculate() method is called, the following attributes are available:
Nuclear PropertiesThis method calculates various properties of nuclei based on the parsed data. Calculate the nuclear repulsion energy using the snippet below: import cclib from cclib.method import Nuclear parser = cclib.io.ccopen("test.log") data = parser.parse() nuclear = Nuclear(data) nre = nuclear.repulsion_energy() print(nre) Accessing additional methods through bridgeSome other population analyses methods including Hirshfeld partial charges and Iterative Stockholder charges can be calculated using bridge functions implemented in cclib. For more information, refer to bridge section of the documentation. Footnotes |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |