PyQuante - Python Quantum Chemistry

Rick Muller v1.5.0

What is PyQuante?

PyQuante (Download Site User Guide) is an open-source suite of programs for developing quantum chemistry methods. The program is written in the Python programming language, but has many “rate-determining” modules also written in C for speed. The resulting code is not nearly as fast as Jaguar, NWChem, Gaussian, or GAMESS, but the resulting code is much easier to understand and modify.

The goal of this software is not necessarily to provide a working quantum chemistry program (although it will hopefully do that), but rather to provide a well-engineered set of tools so that scientists can construct their own quantum chemistry programs without going through the tedium of having to write every low-level routine. More information, including links to the download page, is available at the PyQuante Home Page.

Here is an example of what closed-shell Hartree-Fock scripts look like:

def rhf(atoms,**opts):
    "General wrapper for restricted closed-shell hartree fock"
    ConvCriteria = opts.get('ConvCriteria',1e-5)
    MaxIter = opts.get('MaxIter',20)
    basis = opts.get('basis',None)
    bfs = getbasis(atoms,basis)
    S,h,Ints = getints(bfs,atoms)
    orbs = get_guess(h,S)
    nel = atoms.get_nel()
    enuke = atoms.get_enuke()
    nclosed,nopen = divmod(nel,2)
    eold = 0.
    for i in range(MaxIter):
        D = mkdens(evecs,0,nocc)
        G = get2JmK(Ints,D)
        F = h+G
        evals,evecs = GHeigenvectors(F,S)
        energy = get_energy(h,F,D,enuke)
        print energy
        if abs(energy-eold) < ConvCriteria: break
        eold = energy
    return energy

Even without knowing any Python, it is easy to see what the various steps in the program are doing.

Current features

Upcoming release road map (your suggestions are welcome: Email Me):

Programming Philosophy

I always strive for simplicity over speed. Data structures change more often than functions. My aim here is to be more rigid about functional interfaces than data interfaces. Which means that I only program functions in C, not data structures themselves, which I keep in python so I can change them as the needs of the code evolve. I believe that the first mistake people make in object-oriented programming is to make a very rigid object structure that cannot evolve with the code.

Currently the only C routines are the integral code and the NumPy routines. This may change out of necessity if there appear to be huge bottlenecks keeping some of this in python, but I’d rather keep as much code in python and only put routines in C if I really, really need to.

License

The software is released under the modified BSD license, which means that everyone is free to download, use, and modify the code without charge.

Obtaining the Code

The program is available in tarball form from the PyQuante Download Page. The CVS archive for the program is also at Sourceforge, and is recommended for anyone wanting to stay on the bleeding edge; information on how to access the CVS archive is available here.

Building the Code

Much of the code is written in python, and thus is platform independent. The rest of the code now uses the python distutils procedures for building the C modules. Type

% sudo python setup.py install

and the code should build and install properly. I’ve tested this on Linux, Windows/Cygwin, and Macintosh OS X.

Getting Started

There is a User Guide and other documentation in the Doc subdirectory, and tests in the Tests subdirectory. Subscription to the mailing list is highly recommended for further support. Email me if you need additional help.

Contributors

Changelog