Skip to content

Commit 181a009

Browse files
authored
Develop (qmlcode#38)
* option to calculate only subset of atoms in local representations (qmlcode#26) * option to calculate only subset of atoms in local representations * added reference calculation of representations * finalized reference testing * fixed error in test * Atomic kernels memory (qmlcode#27) * Added local kernels and tests for local kernels * Slatm (qmlcode#28) * Updated SLATM, removed ASE, updated docs, updated SLATM tests case * Added F90 version of get_sbot in SLATM * Added F2py implementation of get_sbop in slatm * Fixed remaining issues with f90-slatm, works for global and local now. * Added testcases for local SLATM * Removed dead code from slatm.py * Linear kernel (qmlcode#29) * Added linear kernel and test * Updated documentation for kernels and removed compiler warning (from frepresentations) * Added global ARAD kernel and test * Linalg (qmlcode#30) * Added MKL discovery * Updated cho_solve and cho_invert, so input is conserved * Added busch-kaufman factorization solver and inversion (DSYTRS) * Linear kernel (qmlcode#31) * Added linear kernel and test * Updated documentation for kernels and removed compiler warning (from frepresentations) * Added global ARAD and linear global kernel * Corrected ARAD global kernel to L2 distance * Bob bug (qmlcode#33) * Fixed ordering in Bob, added integration test * Tightened threshold in Bob integration test to 2.8 kcal/mol * Fchl main (qmlcode#37) * Added ARAS->FCHL code * updated fchl kernels code * Cleaned up FCHL code, parallelized weight ksi functions * Factor 4 speed in three-body term * Updated alchemy and speed * Added global FCHL kernel * Fixed initialization bug in FCHL global kernel * Fixed clearing of self-dotprodicts, and removed excessive OMP memory use * More parallelization issues fixed in FCHL * Fixed 3-body parallelization, added atomic kernels, added option for no alchemy * Fixed parallelization memory, added force kernels to FCHL * Added two- and three-body exponenets as parameters * Added alchemy module, added custom alchemy vectors. * Updated parallelization etc. * Fchl module (qmlcode#34) * Updated to module and added screening function * Fixed bug in cut-off function. * Removed debug output from cut-off function. * Added FCHL to develop branch * Updated clang->gcc in macos installation instructions, hattip geoff hutchison * Updated autodeployment to GH pages and PyPI
1 parent d5e0497 commit 181a009

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+7487
-706
lines changed

.travis.yml

+38-41
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
language: python
2-
32
sudo: required
43
dist: trusty
5-
64
group: edge
7-
85
deploy:
9-
provider: pages
6+
- provider: pypi
7+
user: andersx
8+
password:
9+
secure: mXeDkazSavPo2Cx3Drhap9VkT42pK0XCDx2vK8IVsu/3i+fNLg/RtqT/Yg1hhMNWZQ76rg8TfzGWNEDvEa7JNNVpyTrA8CtWkS5KR3Oj/bkP+n7xcQKC2npjsmrReS97mBq4Sp3fEogcsYH9jCzhhMLnlfpoVlWEFDExcqeKwvXxTqvyv2ymdx6QLu1KkOQWCzsBoa6wIqH9kbzUSjqTVKIWgNZh3UHhDDv8X5rJZUUUulnwmbsRHZSTKFRVaB4gqv3s6gqgMZzmFjHdii3O059quEu+JrpisGNJ3EHSyaDZ1hk9DWqBqXK6LhNVjtwDPgHmABXLrZCKJVudm/7fuwI7GdTSghWjhtLDlaZYSVTBD9vD/aabuM397ZLt6ci8d7AD2AoCDWtc/8EjRVjdErVYL0dO0moJAu7mtxnvPKaT0ZWWPwfUQQlPt/vh17gFWOQhF/YT226J8K/nnnBHmhgHMIR7jBr3ve/YuQGLPUcURhTUnqfUS4O4UTkbXG23rOHPRPs45+F42dNlPb0d1d67C2NOtGhuqe14sQ47rip13FtXCq6HG09WJ6tOY7TvBEu+43DzVPam4qSlS5PoVbC2DwZQKEl8YVbXLCOAzaymk+1BAIofZ201wu4M7Y4HbRIdTLM4F2maKxo52c4Dn2flRA8iX5/OTR1osDIo4qg=
10+
on:
11+
branch: master
12+
condition: ${TRAVIS_PYTHON_VERSION} = "2.7"
13+
- provider: pages
1014
local_dir: ${TRAVIS_BUILD_DIR}/docs/build/html
1115
skip_cleanup: true
1216
repo: qmlcode/qmlcode.github.io
@@ -15,47 +19,40 @@ deploy:
1519
on:
1620
branch: master
1721
condition: ${TRAVIS_PYTHON_VERSION} = "2.7"
18-
1922
python:
20-
- "2.7"
21-
- "3.5"
22-
- "3.6"
23-
23+
- '2.7'
24+
- '3.5'
25+
- '3.6'
2426
before_install:
25-
- sudo apt-get update -qq
26-
27+
- sudo apt-get update -qq
2728
install:
28-
- sudo apt-get install -qq gcc gfortran libblas-dev liblapack-dev
29-
- sudo apt-get install -qq gcc-4.8 gfortran-4.8
30-
- |
31-
if [ ${TRAVIS_PYTHON_VERSION:0:1} = 3 ]; then
32-
sudo apt-get install python3-numpy
33-
pip3 install scipy
34-
python3 setup.py build
35-
python3 setup.py install
36-
pip3 install sphinx
37-
pip3 install sphinx-rtd-theme
38-
cd ${TRAVIS_BUILD_DIR}/docs
39-
make html
40-
elif [ ${TRAVIS_PYTHON_VERSION} = "2.7" ]; then
41-
sudo apt-get install python-numpy
42-
pip2 install scipy
43-
python2 setup.py build
44-
python2 setup.py install
45-
pip2 install sphinx
46-
pip2 install sphinx-rtd-theme
47-
cd ${TRAVIS_BUILD_DIR}/docs
48-
make html
49-
else
50-
echo "ERROR: Unknown Python version."
51-
fi
52-
53-
29+
- sudo apt-get install -qq gcc gfortran libblas-dev liblapack-dev
30+
- sudo apt-get install -qq gcc-4.8 gfortran-4.8
31+
- |
32+
if [ ${TRAVIS_PYTHON_VERSION:0:1} = 3 ]; then
33+
sudo apt-get install python3-numpy
34+
pip3 install scipy
35+
python3 setup.py build
36+
python3 setup.py install
37+
pip3 install sphinx
38+
pip3 install sphinx-rtd-theme
39+
cd ${TRAVIS_BUILD_DIR}/docs
40+
make html
41+
elif [ ${TRAVIS_PYTHON_VERSION} = "2.7" ]; then
42+
sudo apt-get install python-numpy
43+
pip2 install scipy
44+
python2 setup.py build
45+
python2 setup.py install
46+
pip2 install sphinx
47+
pip2 install sphinx-rtd-theme
48+
cd ${TRAVIS_BUILD_DIR}/docs
49+
make html
50+
else
51+
echo "ERROR: Unknown Python version."
52+
fi
5453
before_script:
55-
- cd ${TRAVIS_BUILD_DIR}/tests/
56-
54+
- cd ${TRAVIS_BUILD_DIR}/tests/
5755
script:
58-
- nosetests -v
59-
56+
- nosetests -v
6057
notifications:
6158
email: false

docs/source/examples.rst

+9-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Examples
1+
xamples
22
--------
33

44
Generating representations using the ``Compound`` class
@@ -106,19 +106,25 @@ The easiest way to calculate the kernel matrix using an explicit, local represen
106106
.. code:: python
107107
108108
import numpy as np
109-
from qml.wrappers import get_atomic_kernels_gaussian
109+
from qml.kernels import get_local_kernels_gaussian
110110
111111
# Assume the QM7 dataset is loaded into a list of Compound()
112112
for compound in qm7:
113113
114114
# Generate the desired representation for each compound
115115
compound.generate_atomic_coulomb_matrix(size=23, sort="row-norm")
116116
117+
# Make a big array with all the atomic representations
118+
X = np.concatenate([mol.representation for mol in qm7])
119+
120+
# Make an array with the number of atoms in each compound
121+
N = np.array([mol.natoms for mol in qm7])
122+
117123
# List of kernel-widths
118124
sigmas = [50.0, 100.0, 200.0]
119125
120126
# Calculate the kernel-matrix
121-
K = get_atomic_kernels_gaussian(qm7, qm7, sigmas)
127+
K = get_local_kernels_gaussian(X, X, N, N, sigmas)
122128
123129
print(K.shape)
124130

docs/source/installation.rst

+1-2
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,7 @@ using ``brew``:
7070
# Install GCC
7171
brew install gcc
7272
73-
Note the Clang Fortran compiler from brew unfortunately does not support
74-
OpenMP.
73+
Note the Fortran compiler from brew (gfortran) unfortunately does not support OpenMP.
7574
Therefore parallelism via OpenMP is disabled as default for MacOS systems.
7675

7776
Additionally, we found that some users have multiple version of the ``as`` assembler - this might happen if you have GCC from e.g. brew and macports at the same time. Look for the following error:

docs/source/qml.rst

+7
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,13 @@ qml\.arad module
5252
:members:
5353
:show-inheritance:
5454

55+
qml\.fchl module
56+
----------------
57+
58+
.. automodule:: qml.fchl
59+
:members:
60+
:show-inheritance:
61+
5562

5663
qml\.wrappers module
5764
--------------------

mkldiscover.py

+86
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
#!/usr/bin/env python
2+
# MIT License
3+
#
4+
# Copyright (c) 2017 Anders Steen Christensen
5+
#
6+
# Permission is hereby granted, free of charge, to any person obtaining a copy
7+
# of this software and associated documentation files (the "Software"), to deal
8+
# in the Software without restriction, including without limitation the rights
9+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
# copies of the Software, and to permit persons to whom the Software is
11+
# furnished to do so, subject to the following conditions:
12+
#
13+
# The above copyright notice and this permission notice shall be included in all
14+
# copies or substantial portions of the Software.
15+
#
16+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
# SOFTWARE.
23+
24+
from __future__ import print_function
25+
26+
import os
27+
28+
def mkl_exists(verbose=False):
29+
30+
# Get environment variables
31+
__MKLROOT__ = os.environ.get('MKLROOT')
32+
__LD_LIBRARY_PATH__ = os.environ.get('LD_LIBRARY_PATH')
33+
34+
# Check if $MKLROOT is set
35+
36+
if __MKLROOT__ is None:
37+
38+
if verbose:
39+
print("MKL-discover: MKLROOT was not set")
40+
41+
return False
42+
43+
else:
44+
45+
if verbose:
46+
print("MKL-discover: MKLROOT was set to")
47+
print(__MKLROOT__)
48+
49+
# Check if path exists
50+
mklroot_exists = os.path.isdir(__MKLROOT__)
51+
52+
if not mklroot_exists:
53+
if verbose:
54+
print("MKL-discover: MKLROOT path does not exist")
55+
56+
return False
57+
58+
found_libmkl_rt = False
59+
60+
# Check if libmkl_rt.so exists below $MKLROOT
61+
for dirpath, dirnames, filenames in os.walk(__MKLROOT__, followlinks=True):
62+
63+
if "libmkl_rt.so" in filenames:
64+
65+
if verbose:
66+
print("MKL-discover: Found libmkl_rt.so at ", dirpath)
67+
68+
# Check that the dirpath where libmkl_rt.so is in $LD_LIBRARY_PATH
69+
if dirpath in __LD_LIBRARY_PATH__:
70+
71+
if verbose:
72+
print("MKL-discover: Found %s in $LD_LIBRARY_PATH" % dirpath)
73+
print("MKL-discover: Concluding that MKL can be used.")
74+
found_libmkl_rt = True
75+
76+
77+
return found_libmkl_rt
78+
79+
if __name__ == "__main__":
80+
81+
mkl_present = mkl_exists(verbose=False)
82+
83+
if mkl_present:
84+
print("MKL could be found")
85+
else:
86+
print("MKL could NOT be found")

0 commit comments

Comments
 (0)