All Projects → dgasmith → gau2grid

dgasmith / gau2grid

Licence: BSD-3-Clause license
Fast computation of a gaussian and its derivative on a grid.

Programming Languages

python
139335 projects - #7 most used programming language
CMake
9771 projects
shell
77523 projects

Projects that are alternatives of or similar to gau2grid

seapy
State Estimation and Analysis in Python
Stars: ✭ 25 (+8.7%)
Mutual labels:  grid, numpy
datasets
🤗 The largest hub of ready-to-use datasets for ML models with fast, easy-to-use and efficient data manipulation tools
Stars: ✭ 13,870 (+60204.35%)
Mutual labels:  numpy
saddle
SADDLE: Scala Data Library
Stars: ✭ 23 (+0%)
Mutual labels:  numpy
slickgrid-es6
SlickGrid fork rewrites for ES6 for use under npm and Babel / Rollup builds
Stars: ✭ 100 (+334.78%)
Mutual labels:  grid
flutter examples
Random flutter examples
Stars: ✭ 18 (-21.74%)
Mutual labels:  grid
natural-neighbor-interpolation
Fast, discrete natural neighbor interpolation in 3D on the CPU.
Stars: ✭ 63 (+173.91%)
Mutual labels:  numpy
craft-grid
A field that lets you content manage CSS Grid in Craft CMS.
Stars: ✭ 18 (-21.74%)
Mutual labels:  grid
audiophile
Audio fingerprinting and recognition
Stars: ✭ 17 (-26.09%)
Mutual labels:  numpy
pyrocms-cheatsheet
Pyro CMS - Cheat Sheet
Stars: ✭ 17 (-26.09%)
Mutual labels:  grid
NothingButNumPy
This repo is part of a series of blog post titled "Nothing but NumPy"
Stars: ✭ 43 (+86.96%)
Mutual labels:  numpy
bootstrap-grid-ms
Missing grid range in Bootstrap 3, micro-small from 480-767px.
Stars: ✭ 34 (+47.83%)
Mutual labels:  grid
onelinerhub
2.5k code solutions with clear explanation @ onelinerhub.com
Stars: ✭ 645 (+2704.35%)
Mutual labels:  numpy
lidar-buster
Collection of Python snippets for processing LiDAR point cloud.
Stars: ✭ 15 (-34.78%)
Mutual labels:  numpy
grid-trade-helper
📜A tool for generating grid trade data table.
Stars: ✭ 13 (-43.48%)
Mutual labels:  grid
python demo
一些简单有趣的Python小Demo
Stars: ✭ 109 (+373.91%)
Mutual labels:  numpy
NiftyGrid
DataGrid for Nette Framework
Stars: ✭ 34 (+47.83%)
Mutual labels:  grid
hagrid
📏 Hagrid is a mixin library for responsive websites and web applications.
Stars: ✭ 30 (+30.43%)
Mutual labels:  grid
Poke-Pi-Dex
Our deep learning for computer vision related project for nostalgic poke weebs (Sistemi digitali, Unibo).
Stars: ✭ 18 (-21.74%)
Mutual labels:  numpy
npbench
NPBench - A Benchmarking Suite for High-Performance NumPy
Stars: ✭ 40 (+73.91%)
Mutual labels:  numpy
NDScala
N-dimensional arrays in Scala 3. Think NumPy ndarray, but type-safe over shapes, array/axis labels & numeric data types
Stars: ✭ 37 (+60.87%)
Mutual labels:  numpy

Travis CI Appveyor Codecov Documentation Status

gau2grid

A collocation code for computing gaussians on a grid of the form:

out_Lp = x^l y^m z^n \sum_i coeff_i e^(exponent_i * (|center - p|)^2)

Where the returned matrix dimension are the angular momentum (L) by number of requested points (p).

import gau2grid
import numpy as np

# Build coordinates along the Z axis
>>> xyz = np.zeros((3, 5))
>>> xyz[2] = np.arange(5)

# Compute a 's' gaussian with a scaling and exponent of one at the origin
>>> ret = gau2grid.collocation(xyz, 0, [1], [1], [0, 0, 0])
>>> print(ret["PHI"])
[[  1.00000e+00   3.67879e-01   1.83156e-02   1.23409e-04   1.12535e-07]]

# Compute a 'p' gaussian with a scaling and exponent of one at the origin
>>> ret = gau2grid.collocation(xyz, 1, [1], [1], [0, 0, 0], spherical=False)
>>> print(ret["PHI"])
[[  0.00000e+00   0.00000e+00   0.00000e+00   0.00000e+00   0.00000e+00]
 [  0.00000e+00   0.00000e+00   0.00000e+00   0.00000e+00   0.00000e+00]
 [  0.00000e+00   3.67879e-01   3.66312e-02   3.70229e-04   4.50140e-07]]

# Note that the X and Y components are zero as they are orthogonal to our Z vector.

The returned matrix can be in either cartesian or regular solid harmonics. There are currently three algorithms in which to compute these collocation matrices:

  • Optimize C: A autogenerated C library that optimizes for cache, vectorization, and sparsity. Fastest, requires compilation, found at gau2grid.collocation.
  • Optimized/Generated NumPy: A exploratory tool to examine the sparsity in the gaussians. No compilation required, found at gau2grid.np_gen.collocation.
  • NumPy Reference: A simple NumPy-based loop code. No compilation required, found at gau2grid.ref.collocation.

See the documentation for more information!

Building Gau2Grid

The C library is built with CMake and has C no required dependancies other than the standard library. A CMake and build example can found below:

cmake -H. -Bobjdir
cd objdir; make -j2

Several common CMake options are as follow:

  • -DPYTHON_EXECUTABLE - Path to the desired Python executable
  • -DMAX_AM - Maximum angular momentum to compile to, default 6
  • -DCMAKE_INSTALL_PREFIX - Installation directory

Python installation

The gau2grid program (without the optimized C library) can be installed using the canonical setup.py script,

python setup.py install

Authors

This code was inspired by a number of folks and quite a few provided excellent advice.

  • Daniel G. A. Smith - Code author
  • Rob M. Parrish - Author of the Psi4 section which contains the original equations
  • Lori A. Burns - CMake, building, and library linking
  • Andy C. Simmonett - RSH coefficients
  • Ben Pritchard - Generator and vectorization recommendations
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].