Skip to content

High performance CUDA/Python Library For Computing Quantum Chemistry Density-Based Descriptors For Larger Systems Using GPUs

License

Notifications You must be signed in to change notification settings

Ali-Tehrani/ChemToolsCUDA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

90 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python Version GPLv3 License GitHub contributors

About

ChemToolsCUDA is a free, and open-source C++/CUDA and Python library for computing various quantities efficiently using NVIDIA GPU's in quantum chemistry. It is highly-optimized and vectorized, making it useful for cases where efficiency matters. ChemToolsCUDA utilizes meta-programming (code generation and template) and GPU techniques, making it highly optimized and vectorized for cases where efficiency matters.

It depends on reading Gaussian format check-point files (.fchk) using IOData and supports up-to g-type orbitals. The user can use IOData to convert various file-types to fchk format.

To report any issues or ask questions, either open an issue or email qcdevs@gmail.com.

Features

ChemToolsCUDA can compute the following quantities over any size of grid-points:

  • Molecular orbitals
  • Electron density
  • Gradient of electron density
  • Laplacian of electron density
  • Electrostatic potential
  • Compute density-based descriptors:
    • Reduced density gradient
    • Shannon information density
    • Norm of gradient
  • Compute various kinetic energy densities:
    • Positive definite kinetic energy density
    • General kinetic energy density
    • Von Weizsacker kinetic Energy Density
    • Thomas-Fermi kinetic energy density.
    • General gradient expansion approximation of kinetic energy density

Requirements

For testing the following are required to be installed on the Python system:

Installation

git clone https://github.com/qtchem/chemtoolscuda

# Get the dependencies in ./libs/ folder
git submodule update --init --recursive

In-order to install it need to use:

pip install -v . 

The -v is needed in order to debug by looking at the output of CMake. If CMake can't find NVCC or C++ compiler, then CMakeLists.txt needs to be modified to find them.

In order to test do

pytest ./tests/*.py -v 

In order to build without the python bindings, useful for debugging purposes,

cmake -S . -B ./out/build/  
make -C ./out/build/
./out/build/tests/tests  # Run the C++/CUDA tests

Installation problems

The following can help with compiling this package

  1. If CUBLAS, CURAND are not found, add the following flag to the correct path. See here for more information on how to modify CMake.
# If pip:
CUDATOOLkit_ROOT=/some/path pip install -v .
# If cmake:
cmake -S . -B ./out/build/ -DCUDAToolkit_ROOT=/some/path 
  1. If NVCC compiler is not found, add the following flag to correct path
# If pip:
CUDACXX=/some/path/bin/nvcc pip install -v .
# If cmake:
cmake -S . -B ./out/build/ -DCUDACXX=/some/path/bin/nvcc
  1. If Eigen is not found, add the following flag to the path containing the Eigen3*.cmake files. See here for more information.
# if pip:
CMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH:/opt/eigen/3.3" pip install -v .
# if cmake:
cmake -S . -B ./out/build/ -DEigen3_DIR=/some/path/share/eigen3/cmake/
  1. If you need to set the correct GPU architecture (e.g. compute capability 6.0), then add the following Not setting the correct GPU architecture will result in an error using the constant memory. Note that if cmake is greater than 3.24, then if it isn't provided by the user, then CMake will automatically find the correct CUDA architecture.
# if pip:
CMAKE_CUDA_ARCHITECTURES=60 pip install -v .
# if cmake:
cmake -S . -B ./out/build/ -DCMAKE_CUDA_ARCHITECTURES=60

How To Use

import chemtools_cuda

mol = chemtools_cuda.Molecule( FCHK FILE PATH HERE)
mol.basis_set_to_constant_memory(False)

density =  mol.compute_electron_density_on_cubic_grid( CUBIC INFO HERE)
density = mol.compute_electron_density( POINTS )
gradient = mol.compute_electron_density_gradient( POINTS )
laplacian = mol.compute_laplacian_electron_density( POINTS )
kinetic_dens = mol.compute_positive_definite_kinetic_energy_density( POINTS )
general_kin = mol.compute_general_kinetic_energy_density(POINTS, alpha)
shannon_info = mol.compute_shannon_information_density(POINTS)
reduced_dens = mol.compute_reduced_density_gradient(POINTS)

# Parameter True needs to be set to use ESP, this will hold true for any integrals
mol.basis_set_to_constant_memory(True)
esp = mol.compute_electrostatic_potential( POINTS )

About

High performance CUDA/Python Library For Computing Quantum Chemistry Density-Based Descriptors For Larger Systems Using GPUs

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published