Skip to content

Instantly share code, notes, and snippets.

View rlaplaza's full-sized avatar

Rubén Laplaza rlaplaza

View GitHub Profile
#!/usr/bin/env python3
import os
import sys
import numpy as np
import ase
# New official implementation
from tblite.ase import TBLite as XTB3
#!/usr/bin/env python
# coding: utf-8
# In[3]:
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
def shift_bit_length(n):
return 1 << (n - 1).bit_length()
def sample_one_sphere(coords, radius, n, sobol=True):
if sobol:
m = int(np.log2(shift_bit_length(n)))
x = norm.ppf(qmc.Sobol(d=3, scramble=True).random_base2(m))
else:
x = np.random.normal(size=(n, 3))
ssq = np.sum(x**2, axis=1)