This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
export BOOST_ROOT_DIR=/home/lab/opt/boost-1.58_gcc-1.61 | |
export BOOST_ROOT=$BOOST_ROOT_DIR | |
export LD_LIBRARY_PATH=$BOOST_ROOT_DIR/lib #:/usr/lib64:$LD_LIBRARY_PATH | |
export CC=gcc-6; export CXX=g++-6 | |
mkdir $1 | |
cd $1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def dice_example_l(): | |
""" | |
Example with a biased dice with a previously observed mean | |
The lagrange multiplier l is optimized rather than p | |
""" | |
def entropy(l, *args): | |
""" | |
Entropy of p | |
""" | |
p = analytical(l) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if metric == 'rmse': | |
metric_fun = lambda x: np.std(x, axis=1) | |
elif metric == 'mae': | |
metric_fun = lambda x: np.mean(abs(x), axis=1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tokens = line.split() | |
try: | |
atom = tokens[0].upper() | |
numbers = np.asarray(tokens[1:4], dtype=float) | |
except: | |
exit("Reading the .xyz file failed in line {0}. Please check the format.".format(lines_read + 2)) | |
V.append(numbers) | |
atoms.append(atom) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scipy.stats | |
import matplotlib.pyplot as plt | |
import sklearn.model_selection | |
import sklearn.neighbors | |
def kde_scipy(x, x_grid): | |
""" | |
Using heuristic for bandwidth | |
""" | |
kde = scipy.stats.gaussian_kde(x) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 | |
N -0.1805406906 1.4242349529 -0.0108675046 | |
C 0.0495047193 0.0416229792 0.0372221139 | |
N -1.0209269792 -0.7454454085 0.1001912635 | |
H -1.9045501495 -0.2501680795 0.1747475728 | |
C -1.1035482774 -2.0851342296 0.0629959263 | |
C -2.1858877347 -2.9591823159 0.1129706520 | |
N -1.7728257655 -4.2139610664 0.0327337682 | |
C -0.3907063555 -4.1580119412 -0.069503388 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sklearn.neighbors | |
import sklearn.ensemble | |
import itertools | |
def create_lookup_table(angles, cs, lookup_table_filename, granularity_degree=20): | |
""" | |
Creates lookup tables for procs15 | |
""" | |
# convert everything to numpy arrays |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
if __name__ == "__main__": | |
# parse angles to get an array like | |
x = [ | |
[160, 90], | |
[80, 120] | |
] | |
# save the parsed data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for i in range(100000): | |
# get 6 random angles | |
ang1, ang2, ang3, ang4, ang5, ang6 = np.random.randint(0,360,size=6) | |
# set angles here | |
# write gaussian constrained optimization (PM6) where all the angles are part of the filename |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import matplotlib.pyplot as plt | |
if __name__ == "__main__": | |
w = 0.41 | |
N2 = 2.4 | |
x = np.linspace(0.5,6,1000) | |
s2 = np.log(1+w/x**2) | |
s = np.sqrt(s2) | |
mu = np.log(x/np.sqrt(1+w/x**2)) |
NewerOlder