Skip to content

Instantly share code, notes, and snippets.

View andersx's full-sized avatar
🤓
LFG

Anders Steen Christensen andersx

🤓
LFG
View GitHub Profile
@andersx
andersx / searchtest.f90
Last active January 31, 2020 13:16
searchsorted and quicksort in f90
module searchtools
implicit none
contains
function searchsorted(all_values, sorted) result(cdf_idx)
implicit none
@andersx
andersx / matchups.py
Created December 9, 2019 11:46
Determine matchups
#!/usr/bin/env python3
import numpy as np
RACES = ["T", "Z", "P"]
MAPS = ["Ephemeron LE",
"Eternal Empire LE",
"Nightshade LE",
"Simulacrum LE",
"Triton LE",
@andersx
andersx / output.txt
Last active December 5, 2019 12:08
Output to prove that QML kernels are positive definite.
andersx@beauty:~/projects/definite$ ./test_fchl_acsf_forces.py ethanol 4
['./test_fchl_acsf_forces.py', 'ethanol', '4']
Max atoms: 9
Elements: [1, 6, 8]
FCHL19 representations: 4it [00:00, 513.03it/s]
KRR Kernel
[3.73448002e-02 5.42538018e-02 1.44732447e-01 1.46094006e+02]
GDML Kernel
[9.99942283e-11 9.99946682e-11 9.99962908e-11 9.99965466e-11
9.99970303e-11 9.99970583e-11 9.99977671e-11 9.99980227e-11
@andersx
andersx / test_definite.py
Last active December 5, 2019 12:08
Test to verify that kernel matrices for FCHL19 are positive-definite.
#!/usr/bin/env python3
#
# Data must be downloaded from from http://quantum-machine.org/gdml/#datasets
#
import sys
import numpy as np
import qml
@andersx
andersx / svd.py
Created November 27, 2019 12:03
SVD example
101
102 eigen_vecs, eigen_vals, Vh = \
103 np.linalg.svd(X.T, full_matrices=False, compute_uv=True)
104
105 print("svd done")
106
107 print(eigen_vals.shape)
108 print(eigen_vecs.shape)
109
110 NPCA = 5000
@andersx
andersx / normal_mode_sampling.py
Last active January 2, 2024 06:53
Normal-mode sampling with cclib filereader, requires normal modes and their force constatns
#!/usr/bin/env python3
from __future__ import print_function
import sys
import numpy as np
from copy import deepcopy
import cclib
@andersx
andersx / run_me.f90
Last active June 22, 2019 06:26
ifort bug example
! ifort run_me.f90 -o run_me
! gfortran run_me.f90 -o run_me
program run_me
implicit none
double precision, allocatable, dimension(:,:) :: M
integer :: icol, irow
@andersx
andersx / test_c20.py
Created May 17, 2019 14:22
Atomic distances between atom in different C20 molecules,, QML/develop branch
#!/usr/bin/env python3
import numpy as np
# The development version of QML
import qml
from qml.fchl import generate_representation
from qml.fchl import get_atomic_kernels
from qml.fchl import get_global_symmetric_kernels
@andersx
andersx / force_test.csv
Created May 14, 2019 07:51
geometries for force/energy learning test
We can't make this file beautiful and searchable because it's too large.
19;-280.05583376008747;['N', 'H', 'H', 'H'];[[0.003307, -0.015454, 0.269143], [-0.592333, -0.75357, 0.034791], [-0.450534, 0.927106, -0.066531], [0.968291, 0.044598, 0.027173]];[-0.0225, 0.1137, -1.4418];[[-30.179832378182425, 119.21288616397149, 13.273038525713448], [-5.014689003668097, -35.81959256089992, -20.934660363507824], [25.750091112429118, -61.751582693687325, 20.869291977985142], [9.444430269421401, -21.64171090938423, -13.20766895436972]];1;mc_amon00002_001_020;[7, 1, 1, 1];4;N;-35464.403757255415
30;-472.55002308936736;['C', 'O', 'H', 'H', 'H', 'H'];[[-0.422687, -0.01798, 0.02638], [1.039025, -0.125511, 0.461788], [-0.546909, 0.978538, -0.089906], [-0.516063, -0.382591, -1.081261], [-1.026289, -0.385546, 0.891491], [1.46647, -0.585292, -0.533452]];[-1.0492, -0.3431, -1.835];[[67.58856744804648, -59.6210986443744, -6.422883520758094], [-2.2825822007991974, -58.89970203540405, -132.55308722246014], [-21.180661312504643, 83.19333571390375, -0.7882128819982093], [-12.283906053673794, -7.6618424005101
@andersx
andersx / test_asymmetric.py
Created May 14, 2019 07:50
Test-case for asymmetric FCHL
from __future__ import print_function
import os
import ast
import csv
from scipy.linalg import lstsq
import qml