def test_bks(self, dtype): LATCON = 3.5660930663857577e+01 displacement, shift = space.periodic(LATCON) dist_fun = space.metric(displacement) species = np.tile(np.array([0, 1, 1]), 1000) R_f = test_util.load_silica_data() energy_fn = energy.bks_silica_pair(dist_fun, species=species) self.assertAllClose(-857939.528386092, energy_fn(R_f))
def test_bks(self, dtype): LATCON = 3.5660930663857577e+01 displacement, shift = space.periodic(LATCON) dist_fun = space.metric(displacement) species = np.tile(np.array([0, 1, 1]), 1000) current_dir = os.getcwd() filename = os.path.join(current_dir, 'tests/data/silica_positions.npy') with open(filename, 'rb') as f: R_f = np.array(np.load(f)) energy_fn = energy.bks_silica_pair(dist_fun, species=species) self.assertAllClose(-857939.528386092, energy_fn(R_f))