Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion _sources/contents.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ Table of Contents
:maxdepth: 2

index
tutorial
how_to_install
how_to_parse
data
data_notes
methods
Expand Down
128 changes: 65 additions & 63 deletions _sources/coverage_dev.txt

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions _sources/development.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ Development
Basic instructions
===========================

The default cclib files distributed with a release, as described in the `tutorial`_, do not include any unit tests and logfiles necessary to run those tests. This section covers how to download the full source along with all test data and scripts, and how to use these for development and testing.
The default cclib files distributed with a release, as described in `How to install`_, do not include any unit tests and logfiles necessary to run those tests. This section covers how to download the full source along with all test data and scripts, and how to use these for development and testing.

.. _`tutorial`: tutorial.html
.. _`How to install`: how_to_install.html

Cloning cclib from GitHub
~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
4 changes: 2 additions & 2 deletions _sources/tutorial.txt → _sources/how_to_install.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Tutorial
========
How to install
==============

This page describes how to download, install and use the basic functionality of cclib.

Expand Down
201 changes: 201 additions & 0 deletions _sources/how_to_parse.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,201 @@
How to parse and write
======================

The cclib package provides three scripts to parse and write data i.e. ``ccget``, ``ccwrite``, and ``cda``

1. **ccget** is used to parse attribute data from output files.
2. **ccwrite** has the ability to list out all valid attribute data that can be parsed from an output format. It has the added feature of writing the output file into four different formats i.e. ``json``, ``cjson``, ``cml``, ``xyz``.
3. **cda** is used for the chemical decomposition analysis of output files.

This page describes how to use the ccget and ccwrite scripts to obtain data from output files.

ccget
-----

The data types that can be parsed from the output file depends on the type of computation being conducted. The name of the output file used to show example usage is ``Benzeneselenol.out``.

Data type can be parsed from the output file by following this format

.. code-block:: bash

ccget <attribute> [<attribute>] <CompChemLogFile> [<CompChemLogFile>]

where attribute can be any one of the attribute names available `here`_

.. _`here`: data_dev.html

1. Atomic Charges
The atomic charges are obtained by using the ``atomcharges`` attribute with ``ccget``

.. code-block:: bash

$ ccget atomcharges Benzeneselenol.out
Attempting to read Benzeneselenol.out
atomcharges:
{'mulliken': array([-0.49915 , 0.056965, 0.172161, 0.349794, -0.153072, 0.094583,
0.016487, 0.050249, 0.002149, 0.01161 , 0.053777, -0.173671,
0.018118])}

2. Electronic Energies
The molecular electronic energies after SCF (DFT) optimization of the input molecule is obtained by using the ``scfenergies`` attribute with ``ccget``

.. code-block:: bash

$ ccget scfenergies Benzeneselenol.out
Attempting to read Benzeneselenol.out
scfenergies:
[-71671.43702915 -71671.4524142 -71671.4534768 -71671.45447492
-71671.4556548 -71671.45605671 -71671.43194906 -71671.45761021
-71671.45850275 -71671.39630296 -71671.45915119 -71671.45935854
-71671.4594614 -71671.45947338 -71671.45948807 -71671.4594946
-71671.4594946 ]


3. Geometry Targets
The targets for convergence of geometry optimization can be obtained by using the ``geotargets`` attribute with ``ccget``

.. code-block:: bash

$ ccget geotargets Benzeneselenol.out
Attempting to read Benzeneselenol.out
geotargets:
[ 0.00045 0.0003 0.0018 0.0012 ]

**Chaining of attributes**

ccget provides the user with the option to chain attributes to obtain more than one type of data with a command call. The attributes can be chained in any particular order. A few chained examples are provided below.

1. Molecular Orbitals and Multiplicity
The number of molecular orbitals and the number of basis functions used to optimize the molecule can be obtained by running the following command

.. code-block:: bash

$ ccget nmo nbasis Benzeneselenol.out
Attempting to read Benzeneselenol.out
nmo:
405
nbasis:
407

2. Enthalpy and Vibrational Frequency
The enthalpy and the vibrational frequencies of the optimized molecule is conducted is obtained below:

.. code-block:: bash

$ ccget enthalpy vibfreqs Benzeneselenol.out
Attempting to read Benzeneselenol.out
enthalpy:
-2633.77264
vibfreqs:
[ 129.5512 170.6681 231.4278 304.8614 407.8299 472.5026
629.9087 679.9032 693.2509 746.7694 812.5113 850.2578
915.8742 987.1252 988.1785 1002.8922 1038.1073 1091.4005
1102.3417 1183.3857 1209.2727 1311.3497 1355.6441 1471.4447
1510.1919 1611.9088 1619.0156 2391.2487 3165.1596 3171.3909
3182.0753 3188.5786 3198.0359]

ccwrite
-------

The same Benzeneselenol.out file used in the previous examples will be used as the input file for ccwrite. When the ccwrite script is used with a valid input, it prints out the valid attributes that can be parsed from the file.

Command line format:

.. code-block:: bash

ccwrite <OutputFileFormat> <CompChemLogFile> [<CompChemLogFile>]

The valid output file formats are ``json``, ``cjson``, ``cml``, ``xyz``

1. CML

.. code-block:: bash

$ ccwrite cml Benzeneselenol.out
Attempting to parse Benzeneselenol.out
cclib can parse the following attributes from Benzeneselenol.out:
atomcharges
atomcoords
atomnos
charge
coreelectrons
enthalpy
geotargets
geovalues
grads
homos
moenergies
mosyms
mult
natom
nbasis
nmo
optdone
optstatus
scfenergies
scftargets
temperature
vibdisps
vibfreqs
vibirs
vibsyms

A *Benzeneselenol.cml* output file is generated in the same directory as the Benzeneselenol.out file.

.. code-block:: bash

<?xml version='1.0' encoding='utf-8'?>
<molecule id="Benzeneselenol.out" xmlns="http://www.xml-cml.org/schema">
<atomArray>
<atom elementType="C" id="a1" x3="-2.8947620000" y3="-0.0136420000" z3="-0.0015280000" />
<atom elementType="C" id="a2" x3="-2.2062510000" y3="1.1938510000" z3="-0.0025210000" />
<atom elementType="C" id="a3" x3="-0.8164260000" y3="1.2153020000" z3="-0.0022010000" />
<atom elementType="C" id="a4" x3="-0.1033520000" y3="0.0183920000" z3="0.0031060000" />
<atom elementType="C" id="a5" x3="-0.7906630000" y3="-1.1943840000" z3="0.0058500000" />
<atom elementType="C" id="a6" x3="-2.1799570000" y3="-1.2059710000" z3="0.0017890000" />
<atom elementType="H" id="a7" x3="-3.9758430000" y3="-0.0253010000" z3="-0.0029040000" />
<atom elementType="H" id="a8" x3="-2.7502340000" y3="2.1291370000" z3="-0.0052760000" />
<atom elementType="H" id="a9" x3="-0.2961840000" y3="2.1630180000" z3="-0.0073260000" />
<atom elementType="H" id="a10" x3="-0.2474670000" y3="-2.1302310000" z3="0.0132260000" />
<atom elementType="H" id="a11" x3="-2.7028960000" y3="-2.1530750000" z3="0.0036640000" />
<atom elementType="Se" id="a12" x3="1.8210800000" y3="-0.0433780000" z3="-0.0038760000" />
<atom elementType="H" id="a13" x3="2.0043580000" y3="1.4100070000" z3="0.1034490000" />
</atomArray>
<bondArray>
<bond atomRefs2="a9 a3" order="1" />
<bond atomRefs2="a8 a2" order="1" />
<bond atomRefs2="a12 a4" order="1" />
<bond atomRefs2="a12 a13" order="1" />
<bond atomRefs2="a7 a1" order="1" />
<bond atomRefs2="a2 a3" order="2" />
<bond atomRefs2="a2 a1" order="1" />
<bond atomRefs2="a3 a4" order="1" />
<bond atomRefs2="a1 a6" order="2" />
<bond atomRefs2="a6 a11" order="1" />
<bond atomRefs2="a6 a5" order="1" />
<bond atomRefs2="a4 a5" order="2" />
<bond atomRefs2="a5 a10" order="1" />
</bondArray>
</molecule>

2. xyz

Using ``xyz`` as the <OutputFileFormat> with Benzeneselenol.out, we obtain the following *Benzeneselenol.xyz* file

.. code-block:: bash

13
Benzeneselenol.out: Geometry 17
C -2.8947620000 -0.0136420000 -0.0015280000
C -2.2062510000 1.1938510000 -0.0025210000
C -0.8164260000 1.2153020000 -0.0022010000
C -0.1033520000 0.0183920000 0.0031060000
C -0.7906630000 -1.1943840000 0.0058500000
C -2.1799570000 -1.2059710000 0.0017890000
H -3.9758430000 -0.0253010000 -0.0029040000
H -2.7502340000 2.1291370000 -0.0052760000
H -0.2961840000 2.1630180000 -0.0073260000
H -0.2474670000 -2.1302310000 0.0132260000
H -2.7028960000 -2.1530750000 0.0036640000
Se 1.8210800000 -0.0433780000 -0.0038760000
H 2.0043580000 1.4100070000 0.1034490000
4 changes: 2 additions & 2 deletions _sources/index.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Many types of output data are parsed by cclib, including atom coordinates, orbit
How to use cclib
----------------

You can download the `source package for cclib 1.5`_ or the `current development version`_ (from the `GitHub repository`_). For information on packages available in various Linux distributions, installing the source code and requirements, as well as basic usage, the tutorial_ is a good place to start.
You can download the `source package for cclib 1.5`_ or the `current development version`_ (from the `GitHub repository`_). For information on packages available in various Linux distributions, installing the source code and requirements, as well as basic usage, the `How to install`_ is a good place to start.

If you need further help, find a bug, need new features or have any question, please send email to the `mailing list`_ or submit an issue to the `tracker`_.

Expand All @@ -56,7 +56,7 @@ A record for the latest release is also available on Zenodo_.
.. _`extracted data`: data.html
.. _`calculation methods`: methods.html
.. _`installation page`: installation.html
.. _tutorial: tutorial.html
.. _`How to install`: how_to_install.html
.. _development: development.html

.. _ADF: https://www.scm.com/product/adf/
Expand Down
Loading