Skip to main content

Quantum-chemistry quadrature package

Project description

qc-quad

Quantum-chemistry quadrature package.

This package makes easy to set up so-called Lebedev-Laikov and Gaussian-Legendre grids. These grids are suitable for numerical integration in quantum chemistry applications.

Lebedev-Laikov grids provide coordinates and weights for an optimal integration over a surface of unit sphere. These grids are Golden standard in quantum chemistry because of their accuracy and the minimal number of the integrand-function evaluations. The implementation of the grids is derived from a Matlab implementation by John Burkardt https://people.sc.fsu.edu/~jburkardt/m_src/sphere_lebedev_rule/sphere_lebedev_rule.html

Gauss-Legendre grids provide coordinates and weights for an optimal integration in one dimension, over a finite segment. The Gauss-Legendre grids are suitable for generic functions. This is in contrast to the behavior of wave-functions along radial distance. However, I provide these grids here in order to organize an integration of generic functions over spherical volumes. This integration maintains a nearly constant density of integration points over a ball volume. This integration was useful in computing atomic contributed volumes https://www.tandfonline.com/doi/abs/10.1080/00268979100100941 in my first-principle tools https://first-principle-tools.ew.r.appspot.com .

A motivation for composing this package instead of using several packages out there in the open-source community would be "doing things right", in a testable, malleable, maintainable, cross-platform and parsimonious way.

There are several open-source implementations of Lebedev-Laikov grids. The quantum-chemistry package Horton is using a Python binding to a C++ module implementing the grids https://github.com/theochem/horton. A sub-repository grid of theochem repositories offers the Lebedev-Laikov grids stored in .npy files. There is an exhaustive set of quadratures in repository https://github.com/sigma-py/quadpy . However, the code of quadpy is obfuscated. The repository https://github.com/Rufflewind/lebedev_laikov provides the grids via a Python binding to a source code in C language. Similarly, https://github.com/dftlibs/numgrid provides the grids through a binding to a Fortran source. There is a pure Python implementation of Lebedev-Laikov grids https://github.com/gabrielelanaro/pyquante/ . However, it provides the grids for the first 11 (6, 14, 26, 38, 50, 74, 86, 110, 146, 170, 194) out of 32 grids implemented by Dmitri Laikov. Finally, there is an issue in SciPy with a feature request of Lebedev grids https://github.com/scipy/scipy/issues/11929

Current package qc-quad is open source. It provides Lebedev-Laikov grids for 32 grids published by Dmitri Laikov. It is a pure Python package. This makes this implementation easily testable (pytest), extendable and usable.

References:

Axel Becke, "A multicenter numerical integration scheme for polyatomic molecules",
Journal of Chemical Physics,
Volume 88, Number 4, 15 February 1988, pages 2547-2553. 

Vyacheslav Lebedev, Dmitri Laikov, "A quadrature formula for the sphere of the 131st
algebraic order of accuracy", Russian Academy of Sciences Doklady Mathematics,
Volume 59, Number 3, 1999, pages 477-481.

Lawrence R. Dodd & Doros N. Theodorou, "Analytical treatment of the volume and surface area
of molecules formed by an arbitrary collection of unequal spheres intersected by planes",
Molecular Physics, 72:6, 1991, pages 1313-1345, DOI: 10.1080/00268979100100941

Installation

pip install qc-quad

Developer installation

Installation could be done with poetry = "^1.3.1"

poetry install

Usage

This is a part of some quantum-chemistry software. Some use cases can be seen in the tests.

Roadmap

Let's see what does the community thinks, but here are two points worth nothing.

Note, that to become truly quantum-chemical quadrature this package needs a smooth separation of space which depends on the geometry of the molecule. Please, see works by Axel Becke and onwards. Perhaps, a one-dimensional grid suitable for integrating exponentially decaying functions, together with a pruning scheme for Lebedev-Laikov grids would be suitable in this package. This should be easy to bolt in later for somebody who needs it.

The major difficulty in setting up of the Lebedev-Laikov grids is the absence of their definition for a given number of points. The grids are provided for minimum of 6 and maximum of 5810 points: 6, 14, 26, 38, 50, 74, 86, 110, 146, 170, 194, 230, 266, 302, 350, 434, 590, 770, 974, 1202, 1454, 1730, 2030, 2354, 2702, 3074, 3470, 3890, 4334, 4802, 5294 and 5810, 32 grids in total. Each of the 32 grids, is composed of a set of 6 kinds of grids composed of 6, 12, 8, 24, 24 and 48 points. To the best of my knowledge, no implementation out in the open-source offers any generalizations. For example, a construction of grids with more points by attaching the 48-point grids together or construction of a 36-point grid by using three of the 12-point grids is not implemented although this should be feasible.

Contributing

  • PEP8 code formatting is mandatory.
  • The bug fixes are welcome.
  • Small improvements are welcome.
  • Definition of the hard-coded coefficients is especially welcome.

Authors and acknowledgment

James Talman https://www.sciencedirect.com/science/article/abs/pii/0010465583901261 drew my attention to Lebedev-Laikov grids.

License

MIT license: no guarantee, free to use anywhere.

Project status

Initial release is done.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qc_quad-0.1.1.tar.gz (77.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

qc_quad-0.1.1-py3-none-any.whl (42.8 kB view details)

Uploaded Python 3

File details

Details for the file qc_quad-0.1.1.tar.gz.

File metadata

  • Download URL: qc_quad-0.1.1.tar.gz
  • Upload date:
  • Size: 77.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.1 CPython/3.9.15 Linux/5.10.0-20-amd64

File hashes

Hashes for qc_quad-0.1.1.tar.gz
Algorithm Hash digest
SHA256 c7b80236b0180fa6e1f85768cd1cd9375d36048aef034d8a4af9403d3937f018
MD5 50e1e5de5a2b426bcae2986ed46796df
BLAKE2b-256 d0d53779a838c73bc97c2dd4f1bce33fe65a2f12b5fe79e303946bb7bd957a5d

See more details on using hashes here.

File details

Details for the file qc_quad-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: qc_quad-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 42.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.1 CPython/3.9.15 Linux/5.10.0-20-amd64

File hashes

Hashes for qc_quad-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0b54c77e344609f078d311236fe8276c616e5d9ec66226d7803dee65ca831552
MD5 f0edf334c0d7822b3a7db21c155b5bb8
BLAKE2b-256 cc3f9366e998eda7b6835a4451d470175cbf3aaa84da80183e1af14ad0f3bd27

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page