ChemTools: Python tools for Computational Chemistry

Chemtools is a set of modules that is intended to help with more advanced computations using common electronic structure methods/ programs. Currently the is some limited support for Gamess-US and MolPro program packages but other codes can be easily interfaced.

Current Modules

  • basisopt: module for optimizing one electron basis function exponents
  • basisset: module for handling basis set in different formats and obtaining exponents from series like: even tempered, well tempered, Legendre expansion,
  • molecule: general purpose module intorducing molecule class for handling molecules

Tutorials

A series of short tutorials is avaiable as Jupyter (former IPython notebook) notebooks

Download and Installation

Depenedencies

  • Python version 2.7.3 or later
  • numpy
  • scipy verison 0.11 or later
  • setuptools if you want to install via python setup.py install or easy_install

Installation

Using pip

If you don’t have pip you should probably me your life easier and get it, the installation instructions can be found here. chemtools is NOT hosted on pypi yet but in can be installed by pip from the bibbucket repository with:

$ [sudo] pip install https://bitbucket.org/lukaszmentel/chemtools/get/tip.tar.gz

Using setup.py

The code is hosted via public bitbucket repository named chemtools and a source distibution can be downloaded from there as a zip, gz or bz2 bundle.

Or from CLI:

wget https://bitbucket.org/lukaszmentel/chemtools/get/tip.tar.gz

First we have to unpack the tarball by:

$ tar xzvf tip.tar.gz

go to the the main directory:

$ cd lukaszmentel-chemtools-xxxxxxxxxxxx

and install the package by:

$ [sudo] python setup.py install

Using easy_install

To install chemtools using easy_install just type:

$ [sudo] easy_install https://bitbucket.org/lukaszmentel/chemtools/get/tip.tar.gz

Help

If you have some questions, remarks or requests email me at <lmmentel@gmail.com>.

Similar projects

cclib, pygamess

License

The MIT License (MIT)

Copyright (c) 2014 Lukasz Mentel

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66

import os
from chemtools.calculators.dalton import Dalton
from chemtools.molecule import Molecule
from chemtools.basisopt import BSOptimizer
import pytest


@pytest.mark.skipif(os.getenv('DALTON_EXE') is None,
                    reason="<DALTON_EXE> undefined")
def test_optimize(tmpdir):

    tmpdir.chdir()

    moltemplate = '''INTGRL
basis set optimization
test dalton calculator
Atomtypes=1 Integrals=1.0D-20
%basis
'''

    hftemplate = '''**DALTON INPUT
.RUN WAVE FUNCTIONS
**WAVE FUNCTION
.HF
**END OF DALTON INPUT
'''

    daltemplate = '''**DALTON INPUT
.RUN WAVE FUNCTIONS
**WAVE FUNCTIONS
.HF
.GASCI
*LUCITA
.INIWFC
HF_SCF
.CITYPE
GASCI
.SYMMET
1
.MULTIP
1
.INACTIVE
%core
.GAS SHELLS
1
0 2 / 39   30   30   20   30   20   20   14
.NROOTS
1
**END OF DALTON INPUT
'''

    dalton = Dalton(exevar='DALTON_EXE',
                    runopts=['-nobackup', '-noarch', '-d'])

    fname = {'dal': 'hf.dal', 'mol': 'He_5s.mol'}
    template = {'mol': moltemplate, 'dal': hftemplate}
    fsopt = {'He': [('s', 'et', 5, (0.5, 2.0))]}
    he = Molecule(name='He', atoms=[('He', )])
    bso = BSOptimizer(objective='hf total energy', template=template,
                      verbose=False, code=dalton, mol=he, fsopt=fsopt,
                      fname=fname)

    bso.run()
    energy = -2.8586246608170001
    assert abs(bso.result.fun - energy) < 1.0e-8, 'wrong objective'

Indices and tables