From 57ad4710dfed8d3f143fd900d02e9bbf4125b414 Mon Sep 17 00:00:00 2001 From: serfg Date: Sat, 18 May 2024 13:51:23 +0200 Subject: [PATCH 01/41] neighbors convert cpp extension --- setup.py | 13 ++- src/neighbors_convert.cpp | 169 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 180 insertions(+), 2 deletions(-) create mode 100644 src/neighbors_convert.cpp diff --git a/setup.py b/setup.py index 69e1e04..5da33b9 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,5 @@ from setuptools import setup - +from torch.utils.cpp_extension import BuildExtension, CppExtension with open("requirements.txt") as f: requirements = f.read().splitlines() @@ -18,4 +18,13 @@ ], }, install_requires=requirements, -) + ext_modules=[ + CppExtension( + name="neighbors_convert", + sources=["src/neighbors_convert.cpp"], + ), + ], + cmdclass={ + "build_ext": BuildExtension + }, +) \ No newline at end of file diff --git a/src/neighbors_convert.cpp b/src/neighbors_convert.cpp new file mode 100644 index 0000000..ddc173a --- /dev/null +++ b/src/neighbors_convert.cpp @@ -0,0 +1,169 @@ +#include +#include +#include // For std::fill +#include // For c10::optional + +// Template function to process the neighbors +template +std::vector> process_neighbors(at::Tensor i_list, at::Tensor j_list, at::Tensor S_list, at::Tensor D_list, + int64_t max_size, int64_t n_atoms, at::Tensor species, c10::optional scalar_attributes) { + // Ensure the tensors are on the CPU and are contiguous + TORCH_CHECK(i_list.device().is_cpu(), "i_list must be on CPU"); + TORCH_CHECK(j_list.device().is_cpu(), "j_list must be on CPU"); + TORCH_CHECK(S_list.device().is_cpu(), "S_list must be on CPU"); + TORCH_CHECK(D_list.device().is_cpu(), "D_list must be on CPU"); + TORCH_CHECK(species.device().is_cpu(), "species must be on CPU"); + + TORCH_CHECK(i_list.is_contiguous(), "i_list must be contiguous"); + TORCH_CHECK(j_list.is_contiguous(), "j_list must be contiguous"); + TORCH_CHECK(S_list.is_contiguous(), "S_list must be contiguous"); + TORCH_CHECK(D_list.is_contiguous(), "D_list must be contiguous"); + TORCH_CHECK(species.is_contiguous(), "species must be contiguous"); + + // Ensure the sizes match + TORCH_CHECK(i_list.sizes() == j_list.sizes(), "i_list and j_list must have the same size"); + TORCH_CHECK(i_list.size(0) == S_list.size(0) && S_list.size(1) == 3, "S_list must have the shape [N, 3]"); + TORCH_CHECK(i_list.size(0) == D_list.size(0) && D_list.sizes() == S_list.sizes(), "D_list must have the same shape as S_list"); + TORCH_CHECK(i_list.sizes() == species.sizes(), "i_list and species must have the same size"); + + // Initialize tensors with zeros + auto options_int = torch::TensorOptions().dtype(i_list.dtype()).device(torch::kCPU); + auto options_float = torch::TensorOptions().dtype(D_list.dtype()).device(torch::kCPU); + auto options_bool = torch::TensorOptions().dtype(at::kBool).device(torch::kCPU); + + at::Tensor neighbors_index = torch::zeros({n_atoms, max_size}, options_int); + at::Tensor neighbors_shift = torch::zeros({n_atoms, max_size, 3}, options_int); + at::Tensor relative_positions = torch::zeros({n_atoms, max_size, 3}, options_float); + at::Tensor nums = torch::zeros({n_atoms}, options_int); // Tensor to store the count of elements + at::Tensor mask = torch::zeros({n_atoms, max_size}, options_bool); // Tensor to store the mask + at::Tensor neighbor_species = torch::zeros({n_atoms, max_size}, options_int); + + c10::optional neighbor_scalar_attributes; + int64_t scalar_attr_dim = 0; + + if (scalar_attributes.has_value()) { + TORCH_CHECK(scalar_attributes->device().is_cpu(), "scalar_attributes must be on CPU"); + TORCH_CHECK(scalar_attributes->is_contiguous(), "scalar_attributes must be contiguous"); + TORCH_CHECK(scalar_attributes->size(0) == D_list.size(0), "scalar_attributes must have the same size as D_list in the first dimension"); + + scalar_attr_dim = scalar_attributes->size(1); + neighbor_scalar_attributes = torch::zeros({n_atoms, max_size, scalar_attr_dim}, options_float); + } + + // Temporary array to track the current population index + int_t* current_index = new int_t[n_atoms]; + std::fill(current_index, current_index + n_atoms, 0); // Fill the array with zeros + + // Get raw data pointers + int_t* i_list_ptr = i_list.data_ptr(); + int_t* j_list_ptr = j_list.data_ptr(); + int_t* S_list_ptr = S_list.data_ptr(); + float_t* D_list_ptr = D_list.data_ptr(); + int_t* species_ptr = species.data_ptr(); + + int_t* neighbors_index_ptr = neighbors_index.data_ptr(); + int_t* neighbors_shift_ptr = neighbors_shift.data_ptr(); + float_t* relative_positions_ptr = relative_positions.data_ptr(); + int_t* nums_ptr = nums.data_ptr(); + bool* mask_ptr = mask.data_ptr(); + int_t* neighbor_species_ptr = neighbor_species.data_ptr(); + + float_t* scalar_attributes_ptr = nullptr; + float_t* neighbor_scalar_attributes_ptr = nullptr; + if (scalar_attributes.has_value()) { + scalar_attributes_ptr = scalar_attributes->data_ptr(); + neighbor_scalar_attributes_ptr = neighbor_scalar_attributes->data_ptr(); + } + + // Populate the neighbors_index, neighbors_shift, relative_positions, neighbor_species, and neighbor_scalar_attributes tensors + for (int64_t k = 0; k < i_list.size(0); ++k) { + int_t i = i_list_ptr[k]; + int_t j = j_list_ptr[k]; + int_t idx = current_index[i]; + + if (idx < max_size) { + neighbors_index_ptr[i * max_size + idx] = j; + neighbor_species_ptr[i * max_size + idx] = species_ptr[k]; + + // Unroll the loop for better computational efficiency + neighbors_shift_ptr[(i * max_size + idx) * 3 + 0] = S_list_ptr[k * 3 + 0]; + neighbors_shift_ptr[(i * max_size + idx) * 3 + 1] = S_list_ptr[k * 3 + 1]; + neighbors_shift_ptr[(i * max_size + idx) * 3 + 2] = S_list_ptr[k * 3 + 2]; + + relative_positions_ptr[(i * max_size + idx) * 3 + 0] = D_list_ptr[k * 3 + 0]; + relative_positions_ptr[(i * max_size + idx) * 3 + 1] = D_list_ptr[k * 3 + 1]; + relative_positions_ptr[(i * max_size + idx) * 3 + 2] = D_list_ptr[k * 3 + 2]; + + mask_ptr[i * max_size + idx] = true; + + if (scalar_attributes.has_value()) { + for (int64_t d = 0; d < scalar_attr_dim; ++d) { + neighbor_scalar_attributes_ptr[(i * max_size + idx) * scalar_attr_dim + d] = scalar_attributes_ptr[k * scalar_attr_dim + d]; + } + } + + current_index[i]++; + } + } + + // Copy current_index to nums + for (int64_t i = 0; i < n_atoms; ++i) { + nums_ptr[i] = current_index[i]; + } + + at::Tensor neighbors_pos = torch::zeros({n_atoms, max_size}, options_int); + int_t* neighbors_pos_ptr = neighbors_pos.data_ptr(); + + // Temporary array to track the current population index + int_t* current_index_two = new int_t[n_atoms]; + std::fill(current_index_two, current_index_two + n_atoms, 0); // Fill the array with zeros + + for (int64_t k = 0; k < i_list.size(0); ++k) { + int_t i = i_list_ptr[k]; + int_t j = j_list_ptr[k]; + for (int64_t q = 0; q < current_index[j]; ++q) { + if (neighbors_index_ptr[j * max_size + q] == i && neighbors_shift_ptr[(j * max_size + q) * 3 + 0] == -S_list_ptr[k * 3 + 0] && neighbors_shift_ptr[(j * max_size + q) * 3 + 1] == -S_list_ptr[k * 3 + 1] && neighbors_shift_ptr[(j * max_size + q) * 3 + 2] == -S_list_ptr[k * 3 + 2]) { + neighbors_pos_ptr[i * max_size + current_index_two[i]] = q; + current_index_two[i]++; + } + } + } + + // Clean up temporary memory + delete[] current_index; + delete[] current_index_two; + + // Return the results as a vector of tensors + if (scalar_attributes.has_value()) { + return {neighbors_index, neighbors_shift, relative_positions, neighbor_scalar_attributes, nums, mask, neighbor_species, neighbors_pos}; + } else { + return {neighbors_index, neighbors_shift, relative_positions, c10::nullopt, nums, mask, neighbor_species, neighbors_pos}; + } +} + +// Dispatch function based on tensor types +std::vector> process_dispatch(at::Tensor i_list, at::Tensor j_list, at::Tensor S_list, at::Tensor D_list, + int64_t max_size, int64_t n_atoms, at::Tensor species, c10::optional scalar_attributes) { + if (i_list.scalar_type() == at::ScalarType::Int && j_list.scalar_type() == at::ScalarType::Int && + S_list.scalar_type() == at::ScalarType::Int && D_list.scalar_type() == at::ScalarType::Float) { + return process_neighbors(i_list, j_list, S_list, D_list, max_size, n_atoms, species, scalar_attributes); + } else if (i_list.scalar_type() == at::ScalarType::Int && j_list.scalar_type() == at::ScalarType::Int && + S_list.scalar_type() == at::ScalarType::Int && D_list.scalar_type() == at::ScalarType::Double) { + return process_neighbors(i_list, j_list, S_list, D_list, max_size, n_atoms, species, scalar_attributes); + } else if (i_list.scalar_type() == at::ScalarType::Long && j_list.scalar_type() == at::ScalarType::Long && + S_list.scalar_type() == at::ScalarType::Long && D_list.scalar_type() == at::ScalarType::Float) { + return process_neighbors(i_list, j_list, S_list, D_list, max_size, n_atoms, species, scalar_attributes); + } else if (i_list.scalar_type() == at::ScalarType::Long && j_list.scalar_type() == at::ScalarType::Long && + S_list.scalar_type() == at::ScalarType::Long && D_list.scalar_type() == at::ScalarType::Double) { + return process_neighbors(i_list, j_list, S_list, D_list, max_size, n_atoms, species, scalar_attributes); + } else { + throw std::runtime_error("Unsupported tensor types"); + } +} + +// Register the function as a JIT operator +static auto registry = torch::RegisterOperators("neighbors_convert::process", &process_dispatch); + +PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) { + m.def("process", &process_dispatch, "Process neighbors and return tensors, including optional scalar attributes, count tensor, mask, and neighbor_species"); +} From 6c01337e2200142c3b6afdc18fbd4f0737b30230 Mon Sep 17 00:00:00 2001 From: serfg Date: Sat, 18 May 2024 15:39:11 +0200 Subject: [PATCH 02/41] fix --- src/neighbors_convert.cpp | 39 +++++++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/src/neighbors_convert.cpp b/src/neighbors_convert.cpp index ddc173a..967c39f 100644 --- a/src/neighbors_convert.cpp +++ b/src/neighbors_convert.cpp @@ -6,25 +6,28 @@ // Template function to process the neighbors template std::vector> process_neighbors(at::Tensor i_list, at::Tensor j_list, at::Tensor S_list, at::Tensor D_list, - int64_t max_size, int64_t n_atoms, at::Tensor species, c10::optional scalar_attributes) { + int64_t max_size, int64_t n_atoms, at::Tensor species, + c10::optional scalar_attributes, + at::Tensor all_species) { // Ensure the tensors are on the CPU and are contiguous TORCH_CHECK(i_list.device().is_cpu(), "i_list must be on CPU"); TORCH_CHECK(j_list.device().is_cpu(), "j_list must be on CPU"); TORCH_CHECK(S_list.device().is_cpu(), "S_list must be on CPU"); TORCH_CHECK(D_list.device().is_cpu(), "D_list must be on CPU"); TORCH_CHECK(species.device().is_cpu(), "species must be on CPU"); + TORCH_CHECK(all_species.device().is_cpu(), "all_species must be on CPU"); TORCH_CHECK(i_list.is_contiguous(), "i_list must be contiguous"); TORCH_CHECK(j_list.is_contiguous(), "j_list must be contiguous"); TORCH_CHECK(S_list.is_contiguous(), "S_list must be contiguous"); TORCH_CHECK(D_list.is_contiguous(), "D_list must be contiguous"); TORCH_CHECK(species.is_contiguous(), "species must be contiguous"); + TORCH_CHECK(all_species.is_contiguous(), "all_species must be contiguous"); // Ensure the sizes match TORCH_CHECK(i_list.sizes() == j_list.sizes(), "i_list and j_list must have the same size"); TORCH_CHECK(i_list.size(0) == S_list.size(0) && S_list.size(1) == 3, "S_list must have the shape [N, 3]"); TORCH_CHECK(i_list.size(0) == D_list.size(0) && D_list.sizes() == S_list.sizes(), "D_list must have the same shape as S_list"); - TORCH_CHECK(i_list.sizes() == species.sizes(), "i_list and species must have the same size"); // Initialize tensors with zeros auto options_int = torch::TensorOptions().dtype(i_list.dtype()).device(torch::kCPU); @@ -35,8 +38,8 @@ std::vector> process_neighbors(at::Tensor i_list, at:: at::Tensor neighbors_shift = torch::zeros({n_atoms, max_size, 3}, options_int); at::Tensor relative_positions = torch::zeros({n_atoms, max_size, 3}, options_float); at::Tensor nums = torch::zeros({n_atoms}, options_int); // Tensor to store the count of elements - at::Tensor mask = torch::zeros({n_atoms, max_size}, options_bool); // Tensor to store the mask - at::Tensor neighbor_species = torch::zeros({n_atoms, max_size}, options_int); + at::Tensor mask = torch::ones({n_atoms, max_size}, options_bool); // Tensor to store the mask + at::Tensor neighbor_species = all_species.size(0) * torch::ones({n_atoms, max_size}, options_int); c10::optional neighbor_scalar_attributes; int64_t scalar_attr_dim = 0; @@ -60,6 +63,7 @@ std::vector> process_neighbors(at::Tensor i_list, at:: int_t* S_list_ptr = S_list.data_ptr(); float_t* D_list_ptr = D_list.data_ptr(); int_t* species_ptr = species.data_ptr(); + int_t* all_species_ptr = all_species.data_ptr(); int_t* neighbors_index_ptr = neighbors_index.data_ptr(); int_t* neighbors_shift_ptr = neighbors_shift.data_ptr(); @@ -75,6 +79,7 @@ std::vector> process_neighbors(at::Tensor i_list, at:: neighbor_scalar_attributes_ptr = neighbor_scalar_attributes->data_ptr(); } + int64_t all_species_size = all_species.size(0); // Populate the neighbors_index, neighbors_shift, relative_positions, neighbor_species, and neighbor_scalar_attributes tensors for (int64_t k = 0; k < i_list.size(0); ++k) { int_t i = i_list_ptr[k]; @@ -83,8 +88,13 @@ std::vector> process_neighbors(at::Tensor i_list, at:: if (idx < max_size) { neighbors_index_ptr[i * max_size + idx] = j; - neighbor_species_ptr[i * max_size + idx] = species_ptr[k]; - + for (int64_t q = 0; q < all_species_size; ++q) { + if (all_species_ptr[q] == species_ptr[j]) { + neighbor_species_ptr[i * max_size + idx] = q; + break; + } + } + // Unroll the loop for better computational efficiency neighbors_shift_ptr[(i * max_size + idx) * 3 + 0] = S_list_ptr[k * 3 + 0]; neighbors_shift_ptr[(i * max_size + idx) * 3 + 1] = S_list_ptr[k * 3 + 1]; @@ -94,7 +104,7 @@ std::vector> process_neighbors(at::Tensor i_list, at:: relative_positions_ptr[(i * max_size + idx) * 3 + 1] = D_list_ptr[k * 3 + 1]; relative_positions_ptr[(i * max_size + idx) * 3 + 2] = D_list_ptr[k * 3 + 2]; - mask_ptr[i * max_size + idx] = true; + mask_ptr[i * max_size + idx] = false; if (scalar_attributes.has_value()) { for (int64_t d = 0; d < scalar_attr_dim; ++d) { @@ -135,27 +145,28 @@ std::vector> process_neighbors(at::Tensor i_list, at:: // Return the results as a vector of tensors if (scalar_attributes.has_value()) { - return {neighbors_index, neighbors_shift, relative_positions, neighbor_scalar_attributes, nums, mask, neighbor_species, neighbors_pos}; + return {neighbors_index, relative_positions, neighbor_scalar_attributes, nums, mask, neighbor_species, neighbors_pos}; } else { - return {neighbors_index, neighbors_shift, relative_positions, c10::nullopt, nums, mask, neighbor_species, neighbors_pos}; + return {neighbors_index, relative_positions, c10::nullopt, nums, mask, neighbor_species, neighbors_pos}; } } // Dispatch function based on tensor types std::vector> process_dispatch(at::Tensor i_list, at::Tensor j_list, at::Tensor S_list, at::Tensor D_list, - int64_t max_size, int64_t n_atoms, at::Tensor species, c10::optional scalar_attributes) { + int64_t max_size, int64_t n_atoms, at::Tensor species, c10::optional scalar_attributes, + at::Tensor all_species) { if (i_list.scalar_type() == at::ScalarType::Int && j_list.scalar_type() == at::ScalarType::Int && S_list.scalar_type() == at::ScalarType::Int && D_list.scalar_type() == at::ScalarType::Float) { - return process_neighbors(i_list, j_list, S_list, D_list, max_size, n_atoms, species, scalar_attributes); + return process_neighbors(i_list, j_list, S_list, D_list, max_size, n_atoms, species, scalar_attributes, all_species); } else if (i_list.scalar_type() == at::ScalarType::Int && j_list.scalar_type() == at::ScalarType::Int && S_list.scalar_type() == at::ScalarType::Int && D_list.scalar_type() == at::ScalarType::Double) { - return process_neighbors(i_list, j_list, S_list, D_list, max_size, n_atoms, species, scalar_attributes); + return process_neighbors(i_list, j_list, S_list, D_list, max_size, n_atoms, species, scalar_attributes, all_species); } else if (i_list.scalar_type() == at::ScalarType::Long && j_list.scalar_type() == at::ScalarType::Long && S_list.scalar_type() == at::ScalarType::Long && D_list.scalar_type() == at::ScalarType::Float) { - return process_neighbors(i_list, j_list, S_list, D_list, max_size, n_atoms, species, scalar_attributes); + return process_neighbors(i_list, j_list, S_list, D_list, max_size, n_atoms, species, scalar_attributes, all_species); } else if (i_list.scalar_type() == at::ScalarType::Long && j_list.scalar_type() == at::ScalarType::Long && S_list.scalar_type() == at::ScalarType::Long && D_list.scalar_type() == at::ScalarType::Double) { - return process_neighbors(i_list, j_list, S_list, D_list, max_size, n_atoms, species, scalar_attributes); + return process_neighbors(i_list, j_list, S_list, D_list, max_size, n_atoms, species, scalar_attributes, all_species); } else { throw std::runtime_error("Unsupported tensor types"); } From 4d663b0c2aa1844728db3d191e3dfef07056a646 Mon Sep 17 00:00:00 2001 From: serfg Date: Wed, 22 May 2024 17:33:45 +0200 Subject: [PATCH 03/41] blending cpp extension --- requirements.txt | 3 +- src/molecule.py | 71 ++++++++++++++++++++++++++++++++- src/single_struct_calculator.py | 10 +++-- 3 files changed, 79 insertions(+), 5 deletions(-) diff --git a/requirements.txt b/requirements.txt index 7a19e64..d0e126a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,4 +5,5 @@ pathos jupyter scikit-learn torch -torch_geometric \ No newline at end of file +torch_geometric +matscipy \ No newline at end of file diff --git a/src/molecule.py b/src/molecule.py index 4b2136b..382f715 100644 --- a/src/molecule.py +++ b/src/molecule.py @@ -3,7 +3,8 @@ import numpy as np from torch_geometric.data import Data from .long_range import get_reciprocal, get_all_k, get_volume - +import neighbors_convert +from matscipy.neighbours import neighbour_list as neighbor_list class Molecule: def __init__( @@ -188,6 +189,74 @@ def get_graph(self, max_num, all_species, max_num_k): return result +class MoleculeCPP: + def __init__( + self, atoms, r_cut, use_additional_scalar_attributes, use_long_range, k_cut + ): + + self.use_additional_scalar_attributes = use_additional_scalar_attributes + self.atoms = atoms + self.r_cut = r_cut + self.use_long_range = use_long_range + self.k_cut = k_cut + + if self.use_long_range: + raise NotImplementedError("Long range is not implemented in cpp") + if self.use_additional_scalar_attributes: + raise NotImplementedError("Additional scalar attributes are not implemented in cpp") + + def is_3d_crystal(atoms): + pbc = atoms.get_pbc() + if isinstance(pbc, bool): + return pbc + return all(pbc) + + if is_3d_crystal(atoms): + i_list, j_list, D_list, S_list = neighbor_list('ijDS', atoms, r_cut) + else: + i_list, j_list, D_list, S_list = ase.neighborlist.neighbor_list( + "ijDS", atoms, r_cut + ) + + self.i_list = torch.tensor(i_list, dtype=torch.int64).contiguous() + self.j_list = torch.tensor(j_list, dtype=torch.int64).contiguous() + self.D_list = torch.tensor(D_list, dtype=torch.get_default_dtype()).contiguous() + self.S_list = torch.tensor(S_list, dtype=torch.int64).contiguous() + self.species = torch.tensor(atoms.get_atomic_numbers(), dtype=torch.int64).contiguous() + self.max_num = torch.max(torch.bincount(self.i_list)) + + def get_num_k(self): + raise NotImplementedError("Long range is not implemented in cpp") + + def get_max_num(self): + return self.max_num + + def get_graph(self, max_num, all_species, max_num_k): + n_atoms = len(self.atoms.get_atomic_numbers()) + all_species = torch.tensor(all_species, dtype=torch.int64).contiguous() + + # torch.ops.my_extension.process(i_list, j_list, S_list, D_list, max_size, n_atoms, species, None) + neighbors_index, relative_positions, _, nums, mask, neighbor_species, neighbors_pos = torch.ops.neighbors_convert.process(self.i_list, self.j_list, self.S_list, self.D_list, max_num, n_atoms, self.species, None, all_species) + + mapping = torch.zeros(all_species.max() + 1, dtype=torch.long) + mapping[all_species] = torch.arange(all_species.size(0)) + species_mapped = mapping[self.species] + + kwargs = { + "central_species": species_mapped, + "x": relative_positions, + "neighbor_species": neighbor_species, + "neighbors_pos": neighbors_pos, + "neighbors_index": neighbors_index.transpose(0, 1), + "nums": nums, + "mask": mask, + "n_atoms": len(self.atoms.positions), + } + + result = Data(**kwargs) + + return result + def batch_to_dict(batch): batch_dict = { "x": batch.x, diff --git a/src/single_struct_calculator.py b/src/single_struct_calculator.py index 963ea44..b54f0e8 100644 --- a/src/single_struct_calculator.py +++ b/src/single_struct_calculator.py @@ -3,7 +3,7 @@ from torch_geometric.nn import DataParallel from .data_preparation import get_compositional_features -from .molecule import Molecule +from .molecule import Molecule, MoleculeCPP from .hypers import load_hypers_from_file from .pet import PET, PETMLIPWrapper, PETUtilityWrapper @@ -52,16 +52,20 @@ def __init__( self.device = device def forward(self, structure): - molecule = Molecule( + molecule = MoleculeCPP( structure, self.architectural_hypers.R_CUT, self.architectural_hypers.USE_ADDITIONAL_SCALAR_ATTRIBUTES, self.architectural_hypers.USE_LONG_RANGE, self.architectural_hypers.K_CUT, ) + if self.architectural_hypers.USE_LONG_RANGE: + raise NotImplementedError( + "Long range interactions are not supported in the SingleStructCalculator" + ) graph = molecule.get_graph( - molecule.get_max_num(), self.all_species, molecule.get_num_k() + molecule.get_max_num(), self.all_species, None ) graph.batch = torch.zeros( graph.num_nodes, dtype=torch.long, device=graph.x.device From df98a14600e4acc20fae3b280d37171eaca461f4 Mon Sep 17 00:00:00 2001 From: serfg Date: Thu, 23 May 2024 16:02:14 +0200 Subject: [PATCH 04/41] better mapping --- src/molecule.py | 6 +---- src/neighbors_convert.cpp | 46 +++++++++++++++++++++++++++++++++------ 2 files changed, 40 insertions(+), 12 deletions(-) diff --git a/src/molecule.py b/src/molecule.py index 382f715..78b4fcd 100644 --- a/src/molecule.py +++ b/src/molecule.py @@ -236,11 +236,7 @@ def get_graph(self, max_num, all_species, max_num_k): all_species = torch.tensor(all_species, dtype=torch.int64).contiguous() # torch.ops.my_extension.process(i_list, j_list, S_list, D_list, max_size, n_atoms, species, None) - neighbors_index, relative_positions, _, nums, mask, neighbor_species, neighbors_pos = torch.ops.neighbors_convert.process(self.i_list, self.j_list, self.S_list, self.D_list, max_num, n_atoms, self.species, None, all_species) - - mapping = torch.zeros(all_species.max() + 1, dtype=torch.long) - mapping[all_species] = torch.arange(all_species.size(0)) - species_mapped = mapping[self.species] + neighbors_index, relative_positions, _, nums, mask, neighbor_species, neighbors_pos, species_mapped = torch.ops.neighbors_convert.process(self.i_list, self.j_list, self.S_list, self.D_list, max_num, n_atoms, self.species, None, all_species) kwargs = { "central_species": species_mapped, diff --git a/src/neighbors_convert.cpp b/src/neighbors_convert.cpp index 967c39f..32c0c55 100644 --- a/src/neighbors_convert.cpp +++ b/src/neighbors_convert.cpp @@ -78,8 +78,23 @@ std::vector> process_neighbors(at::Tensor i_list, at:: scalar_attributes_ptr = scalar_attributes->data_ptr(); neighbor_scalar_attributes_ptr = neighbor_scalar_attributes->data_ptr(); } - + int64_t all_species_size = all_species.size(0); + + int_t all_species_maximum = -1; + for (int64_t k = 0; k < all_species_size; ++k) { + if (all_species_ptr[k] > all_species_maximum) { + all_species_maximum = all_species_ptr[k]; + } + } + + int_t* mapping = new int_t[all_species_maximum + 1]; + for (int64_t k = 0; k < all_species_size; ++k) { + mapping[all_species_ptr[k]] = k; + } + + + // Populate the neighbors_index, neighbors_shift, relative_positions, neighbor_species, and neighbor_scalar_attributes tensors for (int64_t k = 0; k < i_list.size(0); ++k) { int_t i = i_list_ptr[k]; @@ -87,13 +102,14 @@ std::vector> process_neighbors(at::Tensor i_list, at:: int_t idx = current_index[i]; if (idx < max_size) { - neighbors_index_ptr[i * max_size + idx] = j; - for (int64_t q = 0; q < all_species_size; ++q) { + // neighbors_index_ptr[i * max_size + idx] = j; + neighbor_species_ptr[i * max_size + idx] = mapping[species_ptr[j]]; + /*for (int64_t q = 0; q < all_species_size; ++q) { if (all_species_ptr[q] == species_ptr[j]) { neighbor_species_ptr[i * max_size + idx] = q; break; } - } + }*/ // Unroll the loop for better computational efficiency neighbors_shift_ptr[(i * max_size + idx) * 3 + 0] = S_list_ptr[k * 3 + 0]; @@ -142,12 +158,28 @@ std::vector> process_neighbors(at::Tensor i_list, at:: // Clean up temporary memory delete[] current_index; delete[] current_index_two; - + + at::Tensor species_mapped = torch::zeros({n_atoms}, options_int); + int_t* species_mapped_ptr = species_mapped.data_ptr(); + for (int64_t k = 0; k < n_atoms; ++k) { + species_mapped_ptr[k] = mapping[species_ptr[k]]; + } + + /*for (int64_t k = 0; k < n_atoms; ++k) { + for (int64_t q = 0; q < all_species_size; ++q) { + if (all_species_ptr[q] == species_ptr[k]) { + species_mapped_ptr[k] = q; + break; + } + } + }*/ + + delete[] mapping; // Return the results as a vector of tensors if (scalar_attributes.has_value()) { - return {neighbors_index, relative_positions, neighbor_scalar_attributes, nums, mask, neighbor_species, neighbors_pos}; + return {neighbors_index, relative_positions, neighbor_scalar_attributes, nums, mask, neighbor_species, neighbors_pos, species_mapped}; } else { - return {neighbors_index, relative_positions, c10::nullopt, nums, mask, neighbor_species, neighbors_pos}; + return {neighbors_index, relative_positions, c10::nullopt, nums, mask, neighbor_species, neighbors_pos, species_mapped}; } } From b691195b39b6e6b8989fc4882a0645dad887139f Mon Sep 17 00:00:00 2001 From: serfg Date: Thu, 23 May 2024 18:55:11 +0200 Subject: [PATCH 05/41] fix --- src/neighbors_convert.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/neighbors_convert.cpp b/src/neighbors_convert.cpp index 32c0c55..942dfc5 100644 --- a/src/neighbors_convert.cpp +++ b/src/neighbors_convert.cpp @@ -102,7 +102,7 @@ std::vector> process_neighbors(at::Tensor i_list, at:: int_t idx = current_index[i]; if (idx < max_size) { - // neighbors_index_ptr[i * max_size + idx] = j; + neighbors_index_ptr[i * max_size + idx] = j; neighbor_species_ptr[i * max_size + idx] = mapping[species_ptr[j]]; /*for (int64_t q = 0; q < all_species_size; ++q) { if (all_species_ptr[q] == species_ptr[j]) { From e780eba4eca498f20331530eb4b8d1b7fdff920f Mon Sep 17 00:00:00 2001 From: serfg Date: Thu, 23 May 2024 19:12:33 +0200 Subject: [PATCH 06/41] fix --- src/neighbors_convert.cpp | 43 +++++++++++++++++++++++---------------- 1 file changed, 25 insertions(+), 18 deletions(-) diff --git a/src/neighbors_convert.cpp b/src/neighbors_convert.cpp index 942dfc5..070eca0 100644 --- a/src/neighbors_convert.cpp +++ b/src/neighbors_convert.cpp @@ -96,14 +96,18 @@ std::vector> process_neighbors(at::Tensor i_list, at:: // Populate the neighbors_index, neighbors_shift, relative_positions, neighbor_species, and neighbor_scalar_attributes tensors + + int64_t shift_i; + int_t i, j, idx; for (int64_t k = 0; k < i_list.size(0); ++k) { - int_t i = i_list_ptr[k]; - int_t j = j_list_ptr[k]; - int_t idx = current_index[i]; - + i = i_list_ptr[k]; + j = j_list_ptr[k]; + idx = current_index[i]; + + shift_i = i * max_size; if (idx < max_size) { - neighbors_index_ptr[i * max_size + idx] = j; - neighbor_species_ptr[i * max_size + idx] = mapping[species_ptr[j]]; + neighbors_index_ptr[shift_i + idx] = j; + neighbor_species_ptr[shift_i + idx] = mapping[species_ptr[j]]; /*for (int64_t q = 0; q < all_species_size; ++q) { if (all_species_ptr[q] == species_ptr[j]) { neighbor_species_ptr[i * max_size + idx] = q; @@ -112,19 +116,19 @@ std::vector> process_neighbors(at::Tensor i_list, at:: }*/ // Unroll the loop for better computational efficiency - neighbors_shift_ptr[(i * max_size + idx) * 3 + 0] = S_list_ptr[k * 3 + 0]; - neighbors_shift_ptr[(i * max_size + idx) * 3 + 1] = S_list_ptr[k * 3 + 1]; - neighbors_shift_ptr[(i * max_size + idx) * 3 + 2] = S_list_ptr[k * 3 + 2]; + neighbors_shift_ptr[(shift_i + idx) * 3 + 0] = S_list_ptr[k * 3 + 0]; + neighbors_shift_ptr[(shift_i + idx) * 3 + 1] = S_list_ptr[k * 3 + 1]; + neighbors_shift_ptr[(shift_i + idx) * 3 + 2] = S_list_ptr[k * 3 + 2]; - relative_positions_ptr[(i * max_size + idx) * 3 + 0] = D_list_ptr[k * 3 + 0]; - relative_positions_ptr[(i * max_size + idx) * 3 + 1] = D_list_ptr[k * 3 + 1]; - relative_positions_ptr[(i * max_size + idx) * 3 + 2] = D_list_ptr[k * 3 + 2]; + relative_positions_ptr[(shift_i + idx) * 3 + 0] = D_list_ptr[k * 3 + 0]; + relative_positions_ptr[(shift_i + idx) * 3 + 1] = D_list_ptr[k * 3 + 1]; + relative_positions_ptr[(shift_i + idx) * 3 + 2] = D_list_ptr[k * 3 + 2]; - mask_ptr[i * max_size + idx] = false; + mask_ptr[shift_i + idx] = false; if (scalar_attributes.has_value()) { for (int64_t d = 0; d < scalar_attr_dim; ++d) { - neighbor_scalar_attributes_ptr[(i * max_size + idx) * scalar_attr_dim + d] = scalar_attributes_ptr[k * scalar_attr_dim + d]; + neighbor_scalar_attributes_ptr[(shift_i + idx) * scalar_attr_dim + d] = scalar_attributes_ptr[k * scalar_attr_dim + d]; } } @@ -143,14 +147,17 @@ std::vector> process_neighbors(at::Tensor i_list, at:: // Temporary array to track the current population index int_t* current_index_two = new int_t[n_atoms]; std::fill(current_index_two, current_index_two + n_atoms, 0); // Fill the array with zeros - + + int64_t shift_j; for (int64_t k = 0; k < i_list.size(0); ++k) { - int_t i = i_list_ptr[k]; - int_t j = j_list_ptr[k]; + i = i_list_ptr[k]; + j = j_list_ptr[k]; + shift_j = j * max_size; for (int64_t q = 0; q < current_index[j]; ++q) { - if (neighbors_index_ptr[j * max_size + q] == i && neighbors_shift_ptr[(j * max_size + q) * 3 + 0] == -S_list_ptr[k * 3 + 0] && neighbors_shift_ptr[(j * max_size + q) * 3 + 1] == -S_list_ptr[k * 3 + 1] && neighbors_shift_ptr[(j * max_size + q) * 3 + 2] == -S_list_ptr[k * 3 + 2]) { + if (neighbors_index_ptr[shift_j + q] == i && neighbors_shift_ptr[(shift_j + q) * 3 + 0] == -S_list_ptr[k * 3 + 0] && neighbors_shift_ptr[(shift_j + q) * 3 + 1] == -S_list_ptr[k * 3 + 1] && neighbors_shift_ptr[(shift_j + q) * 3 + 2] == -S_list_ptr[k * 3 + 2]) { neighbors_pos_ptr[i * max_size + current_index_two[i]] = q; current_index_two[i]++; + break; } } } From 2d854b87eeb1ac1618a2bacc12d8f642b4fe9094 Mon Sep 17 00:00:00 2001 From: serfg Date: Thu, 23 May 2024 20:16:24 +0200 Subject: [PATCH 07/41] preliminary tests --- tests/bulk.xyz | 1538 ++++++++++++++++++++++++++++++++++ tests/test_cpp_float32.ipynb | 309 +++++++ tests/water_single.xyz | 194 +++++ 3 files changed, 2041 insertions(+) create mode 100644 tests/bulk.xyz create mode 100644 tests/test_cpp_float32.ipynb create mode 100644 tests/water_single.xyz diff --git a/tests/bulk.xyz b/tests/bulk.xyz new file mode 100644 index 0000000..5f453c0 --- /dev/null +++ b/tests/bulk.xyz @@ -0,0 +1,1538 @@ +1536 +Lattice="24.861165999999997 0.0 0.0 0.0 24.861165999999997 0.0 0.0 0.0 24.861165999999997" Properties=species:S:1:pos:R:3 ipi_comment="Step: 200000 Bead: 0 positions{angstrom} cell{angstrom}" pbc="T T T" +O -2.89770838 6.76492149 25.78733892 +H -3.22693259 6.92327461 24.89600383 +H -3.73951469 6.82619967 26.21403556 +O 14.14055383 24.29643051 -3.20001086 +H 14.07438235 24.08626251 -4.11558478 +H 13.61617305 25.06489222 -3.10655103 +O -3.80387023 7.50534051 23.20647996 +H -4.32702965 6.79366991 22.91044971 +H -2.93633337 7.37711136 22.81086066 +O 10.10851674 9.95504169 37.52918951 +H 10.72513061 9.67505561 38.19072005 +H 10.10864677 10.90933099 37.79461274 +O 12.88472036 17.74854415 14.83955161 +H 13.65348508 17.32401078 14.47727108 +H 13.15938675 18.66283973 14.78421994 +O 23.27416153 17.28121925 10.39065520 +H 22.65222395 16.86672843 10.97211909 +H 23.97301209 17.50036781 10.96243160 +O 28.82916621 15.24193736 -3.53797364 +H 28.38533301 15.35426383 -4.37080367 +H 28.10799208 15.01400529 -2.92257296 +O 36.91419288 12.97258442 19.53548293 +H 36.34830761 13.58612620 19.98311684 +H 36.52139599 12.12326676 19.73067789 +O 11.98440021 13.19881081 16.68764620 +H 12.18844073 13.18309433 17.63085901 +H 11.92410272 12.28698658 16.43978129 +O 25.06857639 13.20745748 7.56852949 +H 25.32922900 12.38549309 8.03655019 +H 25.90709421 13.50763834 7.13281253 +O 26.04968879 -1.19143628 11.97368355 +H 26.56010316 -1.61519452 12.70387999 +H 26.64322428 -0.98829550 11.24431443 +O 12.62953507 5.53312570 -3.86554044 +H 12.22170511 5.57266846 -4.75519884 +H 13.36403930 6.07627704 -3.90633355 +O 7.21011110 14.23653715 11.64574225 +H 7.16040632 15.17644010 11.87876587 +H 8.00894171 14.13231429 11.11102381 +O 5.75686137 3.23450333 6.11025129 +H 5.47861979 3.92984330 6.70729624 +H 6.36394695 3.53757750 5.33770110 +O -5.30137956 16.78008117 7.87578064 +H -4.39528301 16.56383047 7.66270214 +H -5.25947464 17.01528003 8.83460527 +O 20.70901653 21.88727563 8.22712883 +H 21.21160184 21.72322472 7.46085033 +H 20.81450566 21.12522498 8.74632812 +O 6.65954915 9.24157072 6.86238273 +H 7.40725991 9.76709105 6.63255479 +H 5.84560307 9.75202263 6.91003018 +O 10.53731445 2.31171306 20.25583235 +H 9.96401205 1.61292527 19.97591921 +H 10.86218529 2.68864878 19.45364981 +O 21.65600333 6.39874163 14.21793413 +H 21.39784311 6.85560380 13.38201217 +H 22.63049097 6.62894914 14.23124420 +O 9.00042426 21.56430159 6.05210955 +H 8.98590878 21.85462469 5.13288219 +H 8.20891345 21.02488106 6.20393886 +O 12.66446786 8.58938864 -2.94784209 +H 13.44409217 9.05503938 -2.55875168 +H 12.26682023 8.05868258 -2.20368212 +O -3.32493687 14.05221857 8.22966294 +H -3.88867326 13.71396908 7.52280192 +H -2.75500906 13.26741732 8.45694143 +O 10.81420326 28.97499501 27.79811194 +H 10.08823397 29.23216638 27.21213180 +H 11.52963690 29.13592238 27.22324693 +O 11.59868215 2.70950463 -1.07115883 +H 12.26941158 3.00874568 -0.49142643 +H 11.92657137 2.28368144 -1.85362480 +O 13.77014968 15.76876936 26.65977008 +H 13.91517300 14.95642463 26.27052180 +H 14.58574632 15.87541375 27.23538471 +O 24.22457182 7.25666899 15.06905183 +H 24.11454843 7.92140274 15.72248945 +H 24.73920510 7.64182582 14.35039351 +O 24.44912046 0.44525823 13.69350101 +H 25.04516977 0.88904928 14.26921102 +H 25.03177628 0.04096515 13.08458450 +O 4.01663700 20.82026519 0.18837690 +H 4.77152889 20.62290738 -0.35944431 +H 3.77311230 19.97469040 0.57065169 +O 11.32046927 16.94478232 25.70848478 +H 11.26693165 17.84816683 25.19280827 +H 12.17045082 16.93954159 26.08221117 +O 9.32194731 9.74990619 3.24607960 +H 9.41189674 9.69283582 4.26906724 +H 8.45049084 10.03144194 3.10364815 +O 7.00320794 22.61468125 -13.81410530 +H 6.39651083 23.24052397 -14.26398405 +H 7.30170968 22.11596702 -14.53814742 +O 25.84912363 19.39882890 -2.16279376 +H 25.85221498 19.52674493 -1.25095641 +H 26.79959027 19.50432712 -2.35292774 +O 7.33213268 12.47457400 -2.23568490 +H 7.02882400 11.83206698 -2.87320605 +H 7.89130215 13.07677426 -2.70000103 +O 24.55538510 5.08626929 6.74175793 +H 24.85494209 5.02118876 7.68136713 +H 24.59508902 4.12226488 6.59239830 +O -0.61155940 29.16848750 22.56046408 +H -0.02572937 29.44818483 23.25177091 +H -1.24770071 28.57986760 22.99507587 +O 19.88682434 11.74727823 28.84408800 +H 20.09359411 12.65190562 28.58064121 +H 19.47430982 11.41271964 28.03343047 +O 10.64755854 -8.82036751 13.28612827 +H 10.52124545 -9.19404408 14.13524036 +H 11.21670116 -8.07091621 13.54967833 +O 8.91313336 4.62168315 -8.69513572 +H 8.28613995 5.06287781 -8.17890961 +H 9.72937275 5.10037720 -8.51167579 +O 15.55374461 7.46735833 6.45718193 +H 14.68585850 7.14188592 6.57936378 +H 15.70012111 8.19185483 7.09306424 +O 10.54177814 10.34250031 -0.65166731 +H 11.05329133 9.53809064 -0.49160634 +H 10.73660622 10.56230957 -1.64269164 +O 16.25670607 18.05727870 22.23242528 +H 15.66009614 18.63879470 22.74233617 +H 15.77022419 18.01750778 21.33032196 +O 13.73131662 20.31775021 15.38334215 +H 14.58016469 19.85712830 15.24991612 +H 13.89245733 20.85586872 16.20152002 +O 12.66587815 11.97664627 30.50098037 +H 12.66972079 11.09480138 30.88296518 +H 12.01619711 11.83000702 29.79187953 +O 21.77028960 3.75314832 6.95437609 +H 20.91119303 3.82772567 7.32448115 +H 22.32977073 4.37708885 7.40874369 +O 8.29948984 21.07772845 14.33722564 +H 8.19078280 21.92099502 14.82665257 +H 7.38815168 20.81003562 14.28396462 +O 22.27332948 12.51514341 14.44556817 +H 21.38628662 12.85202029 14.75601992 +H 22.75759436 12.46548318 15.27830660 +O 7.71159321 -9.74385743 15.40813016 +H 7.17996316 -9.12894601 15.92520874 +H 7.57509436 -9.52804250 14.49798596 +O 4.13173996 8.46288491 16.75435660 +H 3.78333997 9.18097299 16.21553565 +H 5.08993504 8.70227534 16.76665500 +O 9.04858811 7.57123321 22.23046018 +H 9.65488075 6.86108876 22.31114611 +H 9.31052396 7.97074192 21.40684396 +O 8.54425128 0.02477205 21.68180777 +H 8.56919793 -0.03300520 20.73915565 +H 8.62683109 0.94345757 21.91893037 +O 20.57495215 14.20095638 3.22031526 +H 21.19587236 14.64940224 3.77132448 +H 21.16177824 13.70308856 2.63978615 +O 19.01374287 15.03620557 13.38946113 +H 19.80737228 14.70655566 12.98595969 +H 19.21055629 15.87549961 13.86927384 +O 10.62945330 5.50341201 -1.97832114 +H 10.65137995 4.67222416 -1.51483998 +H 11.35129744 5.45645389 -2.63024432 +O 12.34959323 -13.56711082 26.00051935 +H 11.59280811 -13.59755523 25.41527855 +H 12.81465250 -12.74213222 25.76920275 +O 12.21920864 20.14261392 19.03592664 +H 12.81265400 20.17105059 19.86938921 +H 12.22838147 19.19205618 18.74141902 +O 8.02326951 11.84159862 14.05288440 +H 8.58622721 12.41540070 13.54395065 +H 7.26245788 11.87991318 13.44763572 +O 24.81482023 10.48732088 19.78301622 +H 25.31661231 9.71709999 19.76500596 +H 24.28627623 10.35875771 20.61210940 +O 0.46321145 2.53537814 6.97548970 +H 1.21197736 2.48828505 6.38073595 +H -0.19336899 1.89571994 6.76531550 +O 27.84195446 1.27689112 12.51024675 +H 27.21986692 0.63554546 12.24689757 +H 28.75667919 0.89307731 12.59721100 +O 16.94813125 12.84355544 7.26019626 +H 17.09154757 13.78141179 7.57453216 +H 17.81369850 12.62633689 6.97858238 +O 16.19205697 20.84037309 -5.35617857 +H 15.81769705 20.18470993 -4.78670346 +H 16.57096362 20.34147754 -6.10848456 +O 6.20741387 6.71811990 24.11315834 +H 7.06416141 6.88335058 24.46442398 +H 5.85908983 7.55163551 23.87078861 +O 18.62657175 23.81308093 25.15411542 +H 17.71476955 23.87475456 25.39877648 +H 18.77051421 24.67210683 24.79723063 +O 10.83068910 1.29797510 27.51552810 +H 10.94823245 2.19405113 27.81954893 +H 10.27208711 1.37363076 26.73272683 +O 19.68360451 22.04615425 19.91898616 +H 19.47971484 21.21662652 20.38255028 +H 20.44824936 21.88052873 19.36663204 +O 0.16952313 26.05796339 21.20169673 +H 0.77511745 25.50836967 21.65137072 +H -0.17295022 26.76917114 21.75506764 +O 25.52811140 0.51118357 4.28856687 +H 25.03272357 1.24370665 3.90868117 +H 25.12752836 0.15229314 5.08405072 +O -6.53283029 25.87812241 12.56642605 +H -6.25299179 26.76978242 12.79116733 +H -5.78656108 25.46329128 12.08591849 +O 14.48866077 9.71116048 25.78714296 +H 13.56717910 10.10556857 25.84092287 +H 14.85965287 10.19090390 26.50772877 +O 4.79399332 15.86332842 6.11913641 +H 4.85021157 15.67733454 5.18609772 +H 3.89644163 15.48240758 6.37431942 +O 15.82053556 30.26718532 15.12294149 +H 15.15086823 29.67104781 15.25257434 +H 16.57755699 29.70955365 14.76354641 +O 24.77058260 2.97413839 10.87324010 +H 24.10106825 2.37102151 10.63555659 +H 24.46672645 3.35443349 11.74181302 +O 12.80879258 22.15985189 -1.95252586 +H 11.87687983 22.30028425 -1.95200335 +H 13.10508128 23.03913507 -2.26130268 +O 7.93701939 17.03783289 -12.42606059 +H 8.82319643 16.97163028 -12.02250778 +H 8.05235600 17.77279552 -12.98878504 +O -0.59162804 32.30926293 -13.84532951 +H -0.93540794 32.90631537 -14.55937504 +H 0.12254371 31.78828343 -14.21462040 +O 1.17807410 -2.37784150 7.45412029 +H 1.81935697 -2.62299191 6.78359379 +H 0.57884079 -3.09877776 7.44858855 +O 1.46845185 12.76659220 20.52552964 +H 1.59173967 13.08845292 21.42433185 +H 0.94020413 11.96329141 20.43898761 +O 3.72213273 6.14181973 25.35963406 +H 4.16134939 5.91859959 26.19354745 +H 4.53731459 5.97356040 24.83291408 +O 11.91736567 18.24737705 -2.62292442 +H 11.19884858 17.62376124 -2.83575332 +H 11.60225912 18.72302848 -1.94186463 +O -4.83572687 5.48852168 9.02938458 +H -4.38656670 5.73248784 8.23693921 +H -4.18193713 5.35360023 9.65154037 +O 0.83430289 33.07451342 13.15521172 +H 1.24179231 32.15369144 13.22332799 +H 0.19718231 33.05063078 12.39976887 +O 0.14571008 21.68539959 2.88989074 +H -0.08188242 22.52379537 2.53175763 +H 1.07890264 21.79641825 2.77269048 +O 18.17848652 21.15672017 6.67912044 +H 18.42779279 22.05121570 6.39601519 +H 18.87523902 20.55584783 6.44914605 +O 1.57173140 26.81259443 14.87551516 +H 2.17713047 26.85384843 14.15477199 +H 2.14751423 26.71806174 15.59778695 +O -2.31230195 20.35827427 2.02602772 +H -2.60259650 20.57183284 1.13877156 +H -1.62469588 20.91203191 2.38881344 +O 15.92957773 5.78891764 17.98490381 +H 15.22824599 6.45604483 17.97696899 +H 16.37941738 6.05828466 17.19203722 +O 13.23631200 15.88052484 21.35314156 +H 12.89479739 16.73302831 21.46845304 +H 13.00164592 15.32921708 22.07465933 +O 21.23771995 17.47315126 21.65997387 +H 20.97665653 16.68348752 21.12408861 +H 20.44378302 17.97310323 21.65176294 +O 11.00653665 22.68571634 13.59383511 +H 10.28711264 22.97012059 12.97818505 +H 10.56517429 22.47511658 14.40255483 +O 25.16895898 20.84651379 17.38878415 +H 24.63663608 21.04398087 16.64671648 +H 24.94005029 21.32990155 18.15366792 +O 17.59726799 18.42933242 10.41335829 +H 17.91002584 19.22119426 10.02317343 +H 16.76032874 18.46886444 9.97110300 +O 25.84587041 10.18922819 28.49896868 +H 26.60470145 10.58885243 28.17917165 +H 25.16473873 10.77948735 28.19698416 +O -4.60604803 15.26161714 -4.40106911 +H -4.47415270 14.75291422 -3.59732763 +H -3.93697056 14.80145819 -4.94979308 +O -6.11349422 11.09056730 -12.90890524 +H -6.21648489 10.13372970 -12.93066673 +H -6.26834950 11.54967981 -13.75086723 +O 3.37077549 20.97917574 9.65270725 +H 3.20669957 20.04076345 9.60001608 +H 4.01248012 21.09807385 10.33610045 +O 20.22808109 -0.53130220 11.33999138 +H 19.71334970 -0.40408952 10.51179362 +H 20.37620442 -1.49528024 11.34835500 +O 17.71463318 -7.04440910 29.78316508 +H 17.09435556 -6.47243853 30.28835702 +H 18.39019502 -7.18307356 30.41882710 +O 19.43676484 -3.42740561 23.63476102 +H 19.14667376 -2.68237025 24.17539757 +H 20.33890837 -3.57377531 23.91297211 +O 4.36370765 24.30268832 17.93306987 +H 3.81688045 25.10799435 17.87320984 +H 4.70614920 24.29821489 18.80880447 +O 22.16024906 13.15845191 26.18761971 +H 22.59351390 14.02261285 26.13731802 +H 22.73050290 12.68175965 26.80602866 +O 5.15451585 17.17715120 2.36137598 +H 4.25024529 17.28149224 2.63187978 +H 5.19261586 16.26239499 2.50629952 +O 20.03934776 12.49114697 6.74189677 +H 20.29707165 12.08449790 5.93376195 +H 19.97464697 11.73818225 7.38695029 +O 14.73029242 19.41842192 12.23123464 +H 13.78893381 19.68214924 12.19813063 +H 15.19998705 20.20818898 12.13773028 +O 15.01805131 19.24738103 8.94712471 +H 14.23448752 18.58619581 8.99875966 +H 14.88508385 19.83912867 9.66136735 +O 23.44284631 9.18621354 9.08795552 +H 23.07379345 9.23025590 8.20084310 +H 24.30837963 9.61379611 8.86490477 +O 8.45265966 16.85448254 6.88727836 +H 8.26080750 16.65842539 5.93109060 +H 9.39754049 16.77105197 6.86734364 +O 17.09588565 23.53769818 18.11192059 +H 17.42318823 22.84332588 18.64754286 +H 16.15176986 23.45745783 18.05824155 +O 24.25922068 3.16457162 28.06901076 +H 25.22640998 3.30307997 28.06274156 +H 24.00978926 3.86475520 27.42322699 +O -11.17054167 26.06739052 11.58838373 +H -11.57594669 25.90676892 10.67082670 +H -10.35010101 25.62278685 11.52460822 +O 0.83077508 10.63869691 8.78565200 +H 1.34067147 10.41333198 7.95359810 +H 1.52169022 10.48543399 9.44571133 +O 17.84687877 1.13555683 30.43751982 +H 17.75520332 1.51262973 29.54960592 +H 18.63592045 0.60520296 30.58801852 +O 24.45531147 20.38455514 7.77608617 +H 24.50237595 19.46390382 7.63700891 +H 23.68932904 20.34973724 8.36471413 +O 19.71576611 26.09171400 23.84805500 +H 20.04462554 25.42889420 23.23117282 +H 19.06391838 26.62675408 23.35983966 +O 8.42224060 -0.70524092 14.74662180 +H 7.70245486 -0.88480645 15.39847717 +H 9.00683162 -0.14220806 15.29159286 +O -1.46067361 -4.08394726 5.16179230 +H -0.89348893 -4.28733278 5.90050322 +H -1.00522641 -3.48433153 4.60279217 +O 5.58908986 25.37305761 13.74416724 +H 6.09992901 25.41607084 12.91005955 +H 6.05699694 25.95909682 14.42123747 +O 8.22025605 2.96416613 -2.85576445 +H 8.99125760 3.29906144 -3.29246818 +H 7.65190866 2.79539165 -3.61839601 +O 4.92874480 -4.04387020 12.18283229 +H 5.48154479 -3.39179573 11.78218703 +H 5.12121562 -4.93168376 11.77542907 +O 0.09968963 14.15272829 18.38521338 +H 0.46722719 13.52409453 18.99708159 +H -0.76223060 14.43753452 18.65427643 +O 15.05153798 14.99407119 19.47154208 +H 15.84088292 14.72311702 19.93034945 +H 14.37651556 15.29904248 20.11572427 +O 19.37186713 5.24140501 4.80032610 +H 20.08161356 5.77720554 5.13761669 +H 19.74289083 4.59433091 4.24108851 +O 15.18777975 0.02438326 14.87565929 +H 15.24077905 0.80715297 14.23976737 +H 14.70574148 -0.67025450 14.40955804 +O 28.33588606 7.21993404 4.52850770 +H 28.82377741 7.98669062 4.21734456 +H 28.11352050 7.38222131 5.44747799 +O 16.31003951 9.07788986 8.68330102 +H 17.03272557 8.47430354 8.84135106 +H 15.73243621 8.85333349 9.42684945 +O 18.58063001 -3.02365671 28.00803305 +H 18.36141868 -3.95810343 27.87943450 +H 18.66969280 -2.64090680 27.12799695 +O 3.17862603 16.90655907 13.03965205 +H 3.27926714 17.37080293 13.87107995 +H 3.20534325 15.99255781 13.29133721 +O 8.04063177 -10.75153640 18.30496445 +H 7.59143913 -10.14236263 17.70946059 +H 8.16666548 -11.53753596 17.78853935 +O 21.94554157 0.88304657 13.07433046 +H 21.60072938 0.24002467 12.44938958 +H 22.89426102 0.80229462 13.06877186 +O 18.81381829 8.01657747 9.53467464 +H 19.30230101 7.24833205 9.50479416 +H 18.87616698 8.33478389 10.41940043 +O 5.60295142 -0.77876161 20.50223020 +H 5.37388106 -0.64931366 21.40308194 +H 5.99875314 0.00401851 20.23471378 +O 37.61953875 1.63563502 33.92994425 +H 36.87773479 1.00524994 34.23661530 +H 37.55602020 2.53310163 34.22916776 +O -3.77148053 7.63484583 11.95220491 +H -3.20328393 8.36253725 11.95044585 +H -3.39033612 7.03972881 11.28767464 +O 28.33812437 8.07487801 -3.32988453 +H 28.70276885 8.73434754 -3.90967663 +H 29.04673402 7.46330323 -3.22689149 +O -5.39703046 23.84011354 6.49556100 +H -4.58242928 24.17860821 6.07979364 +H -4.98482974 23.14914285 7.06697713 +O 14.42171528 11.70539041 -4.81865679 +H 14.00359573 12.57797951 -4.79655628 +H 15.28660781 11.83840626 -4.36164613 +O 24.65061275 16.51281168 13.65156033 +H 24.91899614 16.29841888 14.57955237 +H 25.15015636 16.00545125 13.07584038 +O 20.29012290 2.42135344 9.17412882 +H 20.37252254 2.74702767 10.02569744 +H 19.73010899 1.65933642 9.27876671 +O 15.09315326 31.79331421 21.16000758 +H 15.16613480 32.75671399 21.28569189 +H 15.99889152 31.54921833 20.88615102 +O 8.83780194 7.38091314 25.37443040 +H 9.23124493 7.32403879 24.52969555 +H 9.56068485 7.51027127 25.94828202 +O 10.90848800 16.74058813 5.79417368 +H 11.42655903 16.14121012 5.20822401 +H 10.93102231 17.52114787 5.27388687 +O -3.07447078 11.64754515 -5.53218002 +H -3.01754311 11.06822517 -6.30434361 +H -3.91952096 11.41792143 -5.14300167 +O -2.49835753 -8.34203950 7.64959056 +H -2.93225221 -9.27769592 7.75648633 +H -2.17269313 -8.08080993 8.50432451 +O 6.83972974 8.60858347 16.34209544 +H 7.57201780 8.92284701 16.92873228 +H 7.05154748 8.71331135 15.43125839 +O 9.15532899 -0.61256646 7.52317289 +H 9.08150830 -1.48671740 7.04362265 +H 9.44210973 -0.00350503 6.86479119 +O 8.37896610 2.45749061 -17.95630125 +H 8.96760726 3.17953883 -18.19932327 +H 7.52671842 2.91185188 -17.94412325 +O -0.73211613 22.32721382 19.60633338 +H -0.87019919 21.69624419 20.32834561 +H -1.57247609 22.50821437 19.25555944 +O 24.05992294 7.59436689 30.84251174 +H 24.35224949 6.66414541 31.10846855 +H 24.37075582 7.65689202 29.93854202 +O 16.16335030 -1.52884518 1.45608276 +H 15.46114387 -1.28434023 0.78992262 +H 16.21223289 -0.77324133 2.03233150 +O 10.39188890 4.14506938 30.78924033 +H 10.38777966 4.37165715 29.86762707 +H 11.22255434 3.66990043 31.00982007 +O 30.18461978 -0.53321620 9.67759328 +H 30.37138173 -0.52975917 8.74858716 +H 29.29413125 -0.78634032 9.70181004 +O 21.23319017 6.78212711 6.23336670 +H 20.60687780 7.50839460 6.04610477 +H 22.12199634 7.13955470 6.14855500 +O 3.87593991 15.60508483 16.53055128 +H 4.66598741 15.96545795 16.91329475 +H 4.04872465 14.81689462 15.90859266 +O 26.98665893 6.16442184 19.67530621 +H 27.33539646 6.65814328 20.44763074 +H 26.03946689 6.44991215 19.63897384 +O 25.98245301 19.73226796 0.43630351 +H 25.98793693 20.41154796 1.08249719 +H 26.29399135 18.90084144 0.88144094 +O 8.66673586 5.88272725 13.48293356 +H 8.80840921 5.42421341 12.65198203 +H 8.97501194 5.39335584 14.22261270 +O 6.24794558 15.02851335 32.92531552 +H 5.72966395 15.19180617 32.12426704 +H 7.06721646 15.39906054 32.69808844 +O 21.05284793 3.42678956 25.14925845 +H 20.68993073 4.26234965 24.72945606 +H 20.43029391 2.77452881 24.80346608 +O 2.94925941 9.99534624 10.36451004 +H 3.75916337 10.48837534 10.13144418 +H 2.58218943 10.42086520 11.16692492 +O 15.23950967 20.84394674 23.95789379 +H 15.77323849 21.22527702 23.21627787 +H 14.34691038 20.94674971 23.72978255 +O 16.26032670 2.95316191 7.47890026 +H 16.80042773 2.25652558 7.05071418 +H 16.32970812 3.67233500 6.81031153 +O 12.41887820 15.09450128 28.94673101 +H 11.85334176 14.36638669 28.77720531 +H 12.94766136 15.26368291 28.13433861 +O 10.82327546 12.04726100 3.26114300 +H 10.20664636 11.28113290 3.41162308 +H 11.43691472 11.73057449 2.57556078 +O 9.18152959 14.21710183 -3.94355423 +H 9.09248375 15.07714100 -3.57153560 +H 8.57544248 14.28563242 -4.66919939 +O 3.39685278 7.41839603 11.12463543 +H 3.86637999 7.64928472 11.94971255 +H 3.11973547 8.28606106 10.71038753 +O 36.06409235 -8.82383612 18.65023256 +H 35.49817760 -8.77894608 17.80432180 +H 35.47609118 -9.30690970 19.22935195 +O 3.34160083 23.94233003 4.36936018 +H 4.10298734 24.55702742 4.60952777 +H 2.53293434 24.39498205 4.43130375 +O 19.09836973 5.23574121 23.77582535 +H 18.31873509 4.72042314 23.54715930 +H 18.66818076 5.87054616 24.30363255 +O 19.22333413 34.57267563 23.22371913 +H 19.95481181 35.09649736 23.57661753 +H 19.65586187 33.73750810 23.18208707 +O 18.90313329 5.59406852 14.52373924 +H 18.58915820 5.93899961 15.43728526 +H 19.86680290 5.72330085 14.47861520 +O 30.53591536 0.65760248 5.05500720 +H 30.84238176 0.05859556 5.70577598 +H 30.72067346 1.47765690 5.55322468 +O 15.71297809 -0.63508755 6.49390972 +H 16.45994650 -0.20473225 6.12949656 +H 15.81780944 -0.71762497 7.43649687 +O -4.13530862 17.76031974 4.55811641 +H -3.51070969 17.85812112 3.81024182 +H -4.90508180 17.43935607 4.13160450 +O 2.89180967 -2.80082505 17.46633013 +H 2.02861557 -2.52741348 17.33116268 +H 3.33639605 -1.97040176 17.62356514 +O 24.46411163 5.65856751 1.48971293 +H 24.80597998 6.24302126 2.13961674 +H 23.63845051 6.07408352 1.33713710 +O 19.79407346 16.80851497 15.30531485 +H 19.15081004 16.89084791 16.02666321 +H 20.01741288 17.73465868 15.14414135 +O 22.01141440 19.38965255 8.69384661 +H 22.31963295 18.95279685 9.51529832 +H 21.72817895 18.61429403 8.16323042 +O 25.27713068 23.28847760 23.95859188 +H 24.31438037 23.48641394 23.91888377 +H 25.60181145 23.61308287 24.79444252 +O 9.15154753 10.15883821 5.93353925 +H 8.79075388 10.94104565 6.33693494 +H 9.74941498 9.78234583 6.62690160 +O 4.55529530 13.20613490 23.27868361 +H 4.61485202 13.65978103 22.39785298 +H 5.48820763 13.02562522 23.50722498 +O 23.92073948 12.43784458 5.40989653 +H 24.55502279 12.56453516 4.73071955 +H 24.34804517 12.67928986 6.26752916 +O -2.86671114 15.83868325 16.62357697 +H -2.34642495 16.63245523 16.57277923 +H -3.60317027 15.97919248 16.03388838 +O 8.58374629 11.23744767 9.61351757 +H 8.33185110 11.42985874 8.70187593 +H 9.20508936 10.56565315 9.48496560 +O 7.13418638 6.56896604 5.99938526 +H 6.97978045 6.06266433 6.85326796 +H 6.84092277 7.44885276 6.15633160 +O 25.20878898 12.35971201 23.78719717 +H 25.78393613 11.60357248 23.79429917 +H 24.48549372 12.02888544 23.22937788 +O 17.46133247 31.43545041 19.97311264 +H 17.60499179 32.34224515 19.60372787 +H 17.12313485 30.91450903 19.28316255 +O -0.09857674 17.89355089 29.65425658 +H -0.03079954 17.79206568 30.65672143 +H -0.97748770 18.23477602 29.47469025 +O 22.61842875 -0.72967264 -0.94131703 +H 22.12139733 -0.57111450 -0.07035734 +H 21.96731968 -0.77900817 -1.64017627 +O 30.06497599 -3.43588626 7.89892789 +H 30.57484905 -4.19082533 7.71540135 +H 29.33691797 -3.71353849 8.49247043 +O 17.68482202 26.80032614 21.97538654 +H 17.20024468 26.01740239 22.19983541 +H 17.46833209 27.03081676 21.02874076 +O -1.05745417 1.51108573 16.65399370 +H -0.55177643 0.92413649 17.30315865 +H -1.17109017 0.89270050 15.93428645 +O 2.66033503 18.20676860 8.77146900 +H 3.15280516 17.40601482 9.12243022 +H 3.09178108 18.35002044 7.94987370 +O 8.24217811 23.93233029 24.26982025 +H 7.56519811 24.48708739 24.65688847 +H 7.94487887 23.75367781 23.41442729 +O 25.69673603 -9.14324654 28.11565410 +H 24.90002062 -9.30571515 27.59967147 +H 25.44262581 -8.35254845 28.65258407 +O 6.89067140 29.94173891 -4.89105073 +H 6.79080604 30.27058437 -5.79953689 +H 6.19957636 30.33382182 -4.35491083 +O 31.59028215 16.63383982 17.59335163 +H 31.66979626 16.68882960 18.54038679 +H 31.50662122 17.56265002 17.38328620 +O 15.48235553 -4.16283415 26.72866493 +H 15.78780775 -3.27396973 27.07712863 +H 15.63601179 -4.09559338 25.77032823 +O 10.48636420 9.45827585 8.46423202 +H 11.32293062 9.92130180 8.56751468 +H 10.46268708 8.68838216 9.06701974 +O 12.68439680 1.67083205 21.67316934 +H 11.93332638 1.61409720 21.02771747 +H 13.32269902 2.36977881 21.32389002 +O 27.49109771 6.27878929 16.07931294 +H 28.03234406 7.03638515 16.33043583 +H 27.19067563 5.84072626 16.85394410 +O 13.72457049 -4.80801168 -3.52358017 +H 13.23290788 -3.97505631 -3.25772744 +H 13.21416198 -5.59847131 -3.31302757 +O 11.31588817 5.48821255 18.06346814 +H 11.71865639 4.59093155 18.00301212 +H 10.74709088 5.33759982 18.87427323 +O 30.53100557 12.74285116 20.20969917 +H 29.76267399 12.66150156 19.65107304 +H 30.94114817 13.52624454 19.97862257 +O 9.16655671 4.93747961 10.89916884 +H 9.19423358 4.17855902 10.34488863 +H 9.71704213 5.58855156 10.50685623 +O 7.87435964 20.31452931 27.22141046 +H 7.23319696 20.01138881 27.91503782 +H 8.40100736 21.00516974 27.66630992 +O 10.49617848 25.11629495 9.82929313 +H 10.09161726 24.69078032 9.07862627 +H 9.98554751 24.75359113 10.54640882 +O -0.40063641 7.42864970 19.83501912 +H -0.83277954 7.08526740 20.57431615 +H -1.05679799 7.12533825 19.19319553 +O 8.31376415 5.00788534 26.60498156 +H 8.51448023 5.89636315 26.29076401 +H 7.93471327 4.45206043 25.83933659 +O -0.09654493 16.82285583 -2.80002998 +H 0.38254759 17.64429979 -2.75481298 +H -0.28551725 16.73625101 -3.77746548 +O 19.10142165 19.36283154 21.65671007 +H 18.17771398 19.12953653 21.68339380 +H 19.13628937 20.07694151 22.33786306 +O 21.51778351 3.48876683 12.32788136 +H 22.27575878 3.86451868 12.77832709 +H 21.64666953 2.58397349 12.52361780 +O 5.27198347 -4.38244332 14.98075188 +H 5.08147662 -4.08771573 14.05129325 +H 5.32604366 -3.47078502 15.43677403 +O -13.79986262 10.58825359 17.01000181 +H -13.49936321 10.18938773 16.20263258 +H -13.04616362 10.35988885 17.68020631 +O 16.64666854 11.53724305 -3.01971506 +H 17.45240005 12.02870286 -3.21095362 +H 16.34457009 11.93455990 -2.18338239 +O -1.54961968 2.24170901 24.37335049 +H -1.85551246 1.34851354 24.31277838 +H -2.36310011 2.64158665 24.79843481 +O 13.42715468 25.64419692 16.89516625 +H 12.60697190 25.16969483 16.65856613 +H 14.00756493 25.45177805 16.12704304 +O 3.67654240 15.87447672 24.71771179 +H 4.49529279 16.14996651 24.45270696 +H 3.39821456 15.33547157 23.99729875 +O 20.91457169 -6.19904614 13.00429406 +H 21.65796068 -5.64449187 13.28653135 +H 21.10166034 -6.49037521 12.10391748 +O 10.63203232 25.05931090 16.49554458 +H 10.19459863 25.80070928 16.06521407 +H 10.42294159 25.07763505 17.45660093 +O 15.22804472 12.83530695 5.12861821 +H 14.28968211 12.83451274 5.35225303 +H 15.76557122 12.86342889 5.90852308 +O 12.30460715 -11.43421205 22.81308179 +H 12.07771942 -12.02565657 22.08711887 +H 11.49845567 -11.06330947 23.22776541 +O 2.55450134 23.72166458 -4.21362710 +H 1.67972242 23.68157041 -4.60999009 +H 2.68561406 22.99975127 -3.63092840 +O -4.05580452 7.83757843 16.52337921 +H -3.50428415 7.26674405 17.09038906 +H -3.73364404 7.61001222 15.63218857 +O 6.50715404 27.30854406 -4.93771806 +H 5.54147434 27.20953410 -4.87221681 +H 6.59210971 28.27268371 -4.95757306 +O 11.91720190 31.09521627 12.50245689 +H 12.77251370 30.73374648 12.35034290 +H 11.39770907 30.24916914 12.64145729 +O 32.81569845 13.83219678 0.17349148 +H 32.36508107 14.63824107 -0.13525356 +H 32.56124839 13.18050156 -0.51139670 +O 19.76320428 10.60849012 8.75377690 +H 19.66475515 9.65360702 8.81595337 +H 18.84887484 10.82531463 9.01502084 +O -10.59884818 -5.59229243 4.14966533 +H -9.94987415 -5.37381130 4.81833701 +H -10.19106074 -5.32948283 3.34175723 +O 4.32973894 16.23531279 9.85842552 +H 5.16106544 16.02877911 9.46465688 +H 4.52580652 16.87648112 10.57483972 +O 21.71700575 19.99178958 -7.24659937 +H 21.96251967 20.95176699 -7.31323854 +H 22.15442380 19.76610015 -6.37365787 +O 25.63586688 20.46393999 11.13806777 +H 25.69866450 19.48075952 11.13354409 +H 26.01968601 20.81226073 10.33822863 +O 13.33566865 29.17379255 9.50522057 +H 14.05826864 28.63595526 9.21456226 +H 13.59006827 29.27412413 10.42039239 +O 24.61849775 11.80297429 1.65952223 +H 25.00709100 12.25284476 0.90239701 +H 24.22176058 10.96983604 1.30199353 +O 6.61207850 19.43192731 17.36467914 +H 5.61652288 19.56884635 17.48949032 +H 6.80805723 19.79797549 16.52094420 +O 23.65198500 -1.04835001 10.81883949 +H 24.61172495 -1.02819172 11.02927336 +H 23.47925356 -0.20908998 10.33036500 +O -16.80615788 13.66177065 2.85527414 +H -15.90187158 13.44484412 2.86089400 +H -17.07208861 13.60090751 1.91950470 +O 17.45213611 -5.87142908 27.29995151 +H 16.68284510 -5.32359078 27.20848580 +H 17.40528304 -6.21852573 28.19373652 +O 10.33918719 13.85945396 31.76456132 +H 11.05307720 13.36323932 31.45152428 +H 10.53132671 14.78861097 31.62778346 +O 4.00579237 4.03658020 12.80189361 +H 4.75817217 4.28318381 12.26482080 +H 3.82681368 3.11863033 12.72982709 +O 1.94629324 1.81600353 9.37596015 +H 1.59820002 2.03870763 8.48984697 +H 1.37840359 2.30141665 9.98437258 +O 11.82204356 20.97985103 6.11728120 +H 10.95462246 21.28087166 5.90683653 +H 11.97030461 20.27000814 5.50129816 +O 24.27067607 4.04890298 38.20565169 +H 25.00894355 4.68457381 38.02786063 +H 24.69738433 3.42749867 38.83601133 +O 14.56264151 1.99636001 25.56348068 +H 14.26368596 1.09065752 25.43656666 +H 15.32329253 1.79970210 26.06772859 +O 14.17091374 -0.84583592 18.89499164 +H 14.06472000 -0.29724142 18.14471813 +H 14.37596996 -1.69248474 18.49533869 +O 15.29914637 12.49438474 11.19960559 +H 15.75541782 11.82617005 10.70201740 +H 15.97120160 13.12897792 11.34803041 +O 9.28579516 -2.16391133 3.62942599 +H 8.59853706 -1.44952923 3.50425409 +H 10.13876509 -1.71715378 3.41055052 +O -2.58119721 14.28375317 19.02885602 +H -2.80682023 14.57718184 18.11137208 +H -2.69643395 13.30764621 19.07325407 +O 6.39903944 23.83188329 7.27533450 +H 7.39473822 23.96152218 7.48553844 +H 6.17617664 22.91820193 7.52128031 +O 17.68702543 14.39857038 20.72986006 +H 18.51728297 14.80664458 20.47011272 +H 17.59815051 14.74658350 21.60751493 +O 25.68191487 24.59258493 1.48744548 +H 25.62719984 25.40321339 0.97858830 +H 25.72994975 24.83440933 2.40766475 +O 29.27206774 9.43104108 19.47237048 +H 29.23740359 8.89360726 18.67312737 +H 30.12566955 9.78075141 19.35572945 +O 16.03656592 18.95939790 -9.70817758 +H 16.69937216 18.76167677 -10.39394509 +H 15.61490456 18.11126335 -9.58122637 +O -3.33541878 10.74844175 12.41939452 +H -4.10862087 11.15001428 12.15551889 +H -3.21182319 11.05904638 13.28302395 +O 11.42795261 6.52112228 40.07893573 +H 10.92506342 7.31821469 39.95814910 +H 11.83306070 6.47595347 39.17645697 +O 7.00953578 11.02892684 2.67743929 +H 7.17249059 10.58471286 1.77108768 +H 7.48634406 11.87686781 2.78408958 +O 10.36940545 14.92533615 -0.80089326 +H 9.51635909 14.51269518 -0.48823449 +H 10.63975622 15.55788441 -0.16006724 +O 25.87833722 20.33223597 13.74447076 +H 25.82960674 20.55949904 12.84510527 +H 26.77838847 20.01706873 13.92504166 +O 14.03699676 8.90045475 10.07359944 +H 13.79203792 8.09248673 9.60891608 +H 13.53110010 9.54913858 9.61472436 +O 12.95766135 17.71941603 8.88439168 +H 12.78098479 17.27932716 9.70708285 +H 13.45345074 17.15086577 8.24184922 +O 0.16143092 17.70406241 7.63340374 +H 1.06993225 17.65747001 7.92464193 +H -0.34559189 16.90519341 7.87452462 +O 12.24051578 20.67471003 11.51310275 +H 11.95147965 20.37767422 10.63636579 +H 11.75015183 21.50105087 11.73620321 +O 25.94129427 27.02197097 25.35509204 +H 25.06976520 27.30162512 24.95106985 +H 26.58913419 27.10676327 24.68794797 +O -2.71217131 27.35370185 4.67117208 +H -2.00273588 27.66911542 4.06631980 +H -2.67734146 27.91104385 5.46829040 +O 26.79368902 11.06489345 12.74546318 +H 26.40505867 11.81589915 13.18178405 +H 26.23539672 10.27522251 12.87135617 +O 2.14128761 22.70259195 14.33218442 +H 1.67864564 21.87074293 14.22933773 +H 2.74803814 22.64459679 15.05685119 +O -6.44196243 2.86030026 14.82193743 +H -6.12239584 3.74301554 14.69141879 +H -5.69199416 2.34658570 15.02685871 +O 20.07153132 28.13586733 27.75940937 +H 20.31898595 28.27569266 26.84904747 +H 20.82860252 27.79893820 28.19484726 +O 18.03592672 16.37407738 23.18705121 +H 17.37415597 16.98291544 22.79514155 +H 18.59641356 16.99862819 23.63909175 +O 8.20773015 16.04434722 4.29110588 +H 8.27113464 15.23113534 3.80885503 +H 8.15008588 16.61392477 3.54768932 +O 22.13652717 5.50680388 10.65445594 +H 21.78435872 4.92877723 11.37750711 +H 23.03829847 5.73393748 10.87753890 +O 2.23137002 3.40076262 3.27801940 +H 3.00131284 3.88464402 3.64838381 +H 2.51769860 3.24321181 2.38924901 +O 11.72936765 7.74274851 -0.67127162 +H 12.23780695 7.52509383 0.13171183 +H 11.35129719 6.92383473 -0.99336534 +O 32.92556423 20.10208837 -5.11263113 +H 32.47047971 20.12500998 -5.98178965 +H 33.67510824 20.54838792 -5.38374299 +O 21.21694349 22.56498445 2.97395569 +H 20.22762403 22.39850915 3.17267612 +H 21.63514227 21.70796797 2.81856629 +O 17.46347580 8.71366443 12.39052445 +H 17.45861743 7.79186180 12.16478448 +H 16.52937393 8.91896814 12.43128865 +O 28.53927736 19.75851091 -3.17954155 +H 28.98564741 20.59566587 -3.46465897 +H 29.00152652 19.09993621 -3.74319272 +O 13.80286892 7.16054963 0.97367493 +H 14.18162874 7.06246332 0.09390363 +H 14.04971696 8.07447406 1.13138058 +O 11.17901692 -5.23326204 24.45254248 +H 11.80750998 -4.64635207 24.79629227 +H 10.34364983 -4.72064726 24.31247230 +O 6.73361873 2.33764949 15.26049111 +H 7.57668079 2.14213295 14.86205706 +H 6.64211196 3.28232211 15.32844408 +O 3.45631968 1.88171210 -1.31450632 +H 3.70975009 2.34060945 -2.11151555 +H 3.72969239 2.43057970 -0.57038948 +O 22.69590925 -9.65171866 5.06742102 +H 22.55221851 -9.03609561 5.75162154 +H 22.91260932 -10.45034562 5.46075828 +O 22.93975666 4.14052276 16.69043238 +H 23.49194717 3.35778026 16.37511418 +H 22.95223934 4.62763312 15.84199847 +O 14.89884695 9.59152380 37.63906807 +H 14.89502018 10.48923224 37.89799422 +H 14.29639098 9.57945105 36.88888115 +O -3.57115693 28.51178554 19.95500474 +H -4.15838208 29.18283851 20.40526889 +H -4.08021595 28.29787962 19.17241150 +O 14.66687768 3.29273321 -5.89361060 +H 15.19095029 4.08636608 -6.01024603 +H 15.20328380 2.48750256 -5.98963178 +O 23.30039230 13.12107658 11.75874638 +H 23.17553048 12.44763991 11.07791340 +H 22.77533284 12.90002794 12.56426372 +O 20.41341153 14.71775826 10.68835360 +H 21.20105516 14.93714366 11.19885627 +H 20.77380015 14.43887175 9.86257595 +O -3.24695730 24.72440809 5.12557959 +H -3.14823231 25.71900225 4.90178824 +H -3.45384404 24.14847685 4.31141361 +O 12.35389904 16.00744384 11.10805199 +H 12.81037484 15.23802462 10.68616881 +H 11.72125830 15.77537524 11.81993484 +O 31.91375794 5.84883743 -7.49424233 +H 31.82965680 6.78718774 -7.81060742 +H 31.05483254 5.53102885 -7.80499662 +O 19.57788879 10.70319434 20.70672362 +H 19.42901510 10.47204854 21.61274763 +H 19.04833028 10.08648377 20.19739827 +O -8.59431789 21.92509818 4.50041612 +H -8.59022656 22.57743859 5.25330715 +H -7.72731209 22.04104113 4.11711500 +O 13.03886928 17.82901690 17.81410257 +H 12.89957851 17.70340738 16.87406690 +H 12.32462012 17.23006201 18.17476617 +O 17.62758139 23.69124947 15.37714467 +H 17.40894073 23.52165455 16.28996364 +H 16.99833183 24.31439232 15.02792808 +O 12.10259106 2.12956880 6.40407434 +H 11.58930540 1.39125646 6.01053206 +H 12.45066694 1.76886581 7.22540151 +O 1.83073052 28.39749101 19.19057682 +H 0.87662281 28.45826613 19.35563000 +H 2.03934679 29.32417861 19.26890743 +O 17.78169371 12.19160338 26.90566096 +H 17.07982622 11.73593689 27.48734302 +H 17.59315763 13.10865219 27.16524375 +O 26.71951894 9.51182405 6.49863869 +H 26.19502228 9.62242863 5.67987154 +H 26.97418332 8.58880653 6.52487944 +O -4.94166961 30.35591817 21.10797253 +H -5.34622714 30.15790059 21.98275559 +H -5.66128338 30.62608449 20.61731588 +O 21.19493798 11.39647987 24.06237562 +H 21.53263406 11.61190823 24.90404149 +H 20.97942129 12.29659910 23.76726898 +O 3.38414914 21.77704464 5.86929372 +H 3.41356793 22.61390432 5.42984865 +H 3.92629488 21.81470949 6.61202763 +O 6.40062729 20.35812882 23.68490372 +H 6.18473183 20.77695129 22.85506354 +H 7.20296435 20.64549840 23.97723493 +O 27.82233328 22.01370712 27.36542261 +H 28.15600503 22.74366562 27.87893620 +H 28.36856733 21.80883141 26.59963810 +O 26.47411281 14.68272526 22.92845527 +H 25.92252657 13.98792996 23.34299906 +H 25.82797344 15.35660774 22.69965977 +O 11.00895413 20.48441398 8.91325538 +H 11.23091106 21.08083790 8.26384138 +H 11.66272597 19.82596905 8.68927324 +O 4.77310946 9.82658725 3.96635157 +H 5.67572825 10.00065725 3.60699098 +H 4.78529352 10.01100943 4.91943690 +O 0.72772334 7.48601879 3.43755053 +H 1.08294694 8.33517090 3.43093493 +H 1.56745314 6.97658324 3.49589108 +O 9.79180060 0.84155723 30.22101523 +H 10.10260822 1.09420306 29.33270037 +H 9.30990170 1.60717838 30.59588549 +O 18.72379954 0.21341349 33.90399349 +H 17.79437273 -0.04545454 33.89383489 +H 19.00814116 -0.01572544 33.04824548 +O 22.47671824 24.79234934 20.29135242 +H 22.41349545 25.09003796 19.42925672 +H 23.22162271 25.30993661 20.60878037 +O 3.50941277 1.58912329 20.62254937 +H 2.80109708 2.10742813 20.29789744 +H 3.16775776 0.70409479 20.61003824 +O 16.20401409 24.42903399 11.91757207 +H 17.11856502 24.82284953 12.00692281 +H 16.37047408 23.51317324 12.01910256 +O -6.47026312 15.17494280 1.98726049 +H -7.27266545 15.19495404 2.59241364 +H -5.61355287 14.95073447 2.51958382 +O 6.36921562 5.11461232 33.15846211 +H 5.96414697 6.00465271 33.26341440 +H 6.39301165 4.67204180 34.00579799 +O 6.12443977 -3.19763202 -3.56154345 +H 6.70606686 -3.63106990 -4.14604553 +H 6.06075675 -2.28250508 -3.77305284 +O 5.32629840 6.29339480 -3.11899367 +H 4.68909608 5.62693833 -2.81424240 +H 5.80130393 6.51652639 -2.26485229 +O -4.69858319 9.13657437 5.59078117 +H -4.88722781 9.78533289 4.88717431 +H -3.81043684 9.28160238 5.93297950 +O 14.64937312 4.82863825 12.17837999 +H 15.49891537 5.31931819 12.28668419 +H 14.79555782 4.03059534 12.63771207 +O 23.93522228 9.15518957 0.89086042 +H 23.44803644 8.37011701 1.19774408 +H 24.89737579 9.02578357 0.99505245 +O 16.74199462 4.78695042 30.30870879 +H 16.56061210 5.69153635 30.47586574 +H 17.69969161 4.68098901 30.29918996 +O 25.46024590 5.06938170 9.39424180 +H 26.41731467 5.02629551 9.35332411 +H 25.21330311 4.27347546 9.98357201 +O 11.58504565 18.95548897 3.98201992 +H 12.57569219 18.91709518 3.89453278 +H 11.24755862 19.80249040 3.66092170 +O 2.75663071 22.31873652 23.12421874 +H 2.97362068 21.90845485 24.00277417 +H 1.87928277 22.53584296 23.29152111 +O 3.61700573 12.10343927 2.86215638 +H 4.22240799 11.46372320 3.28577555 +H 3.57404189 11.81424510 1.93348047 +O 8.08248923 9.92053306 0.36026520 +H 8.96039741 10.09734303 -0.13417838 +H 8.19067398 9.02193528 0.59144069 +O -11.81445125 31.97669850 28.69674063 +H -11.72416039 31.01729371 28.97131009 +H -11.31680642 31.91473175 27.88277250 +O 4.80227846 9.26082582 -1.14189727 +H 4.26812048 9.00861923 -1.91152135 +H 5.60549136 9.63869683 -1.48578017 +O 16.31333266 26.26280055 27.68895653 +H 15.59086243 26.44020853 28.27344092 +H 16.78098386 27.10043665 27.58554870 +O 22.93562091 19.01544863 19.95069329 +H 23.75828096 18.67421649 19.60391172 +H 22.49429372 18.41079871 20.55133473 +O 12.63888796 9.62933955 18.95409282 +H 13.00165696 8.77661874 18.78327755 +H 13.39326266 10.05637464 19.39860876 +O 31.48091150 1.24297942 36.01246492 +H 30.97957041 0.79326686 35.29667277 +H 32.27352802 1.42764920 35.52419159 +O 5.78773812 -1.74307203 15.67177515 +H 5.41524943 -1.00145438 15.19083337 +H 5.67001822 -1.46368579 16.58879949 +O -7.58494667 8.69523417 15.04861237 +H -8.26671878 9.35941780 14.96325265 +H -7.23616902 8.62680038 14.19345073 +O 8.80107730 2.58518715 9.51971481 +H 9.38634304 1.86460364 9.69443639 +H 8.51846073 2.44490513 8.54621333 +O 2.30873086 17.60741671 1.66139101 +H 2.94373998 17.10011404 1.18184970 +H 1.73497621 17.02379815 2.15531578 +O 1.50177853 17.86626436 11.33134108 +H 1.88415677 17.64765782 10.51584239 +H 2.15177747 17.73423219 11.98637351 +O 21.98874155 21.05026671 24.22934792 +H 22.51729020 20.91955551 23.40781097 +H 22.28165192 21.87258151 24.54238960 +O 7.54607827 24.64600106 3.14381782 +H 7.17083262 25.04399261 2.33564025 +H 7.01301629 24.94524194 3.86967951 +O 16.77811765 8.85368977 29.29720518 +H 17.65500963 8.88381899 29.62033325 +H 16.29423152 8.33880414 29.97644161 +O 9.65863199 27.01679365 15.01239750 +H 10.39017600 27.14100432 14.32372333 +H 9.46399459 27.94797348 15.21709929 +O 13.42608843 11.83112579 13.24957354 +H 13.08671743 12.56048317 13.78411043 +H 13.95325216 12.21049939 12.55865846 +O 1.78508237 18.27449488 17.36100476 +H 1.26182971 19.10467370 17.39773895 +H 1.27830219 17.59207776 16.90147723 +O 2.64069171 -5.58278985 4.75095702 +H 2.68728258 -4.70876244 5.19207995 +H 1.76375126 -5.81711915 4.65015073 +O 17.29952270 28.53821219 26.88912525 +H 18.17572798 28.24679438 27.17856507 +H 17.01499645 29.34996087 27.26419698 +O 10.71869642 7.95786719 10.72158983 +H 11.17658450 7.46774323 11.37481904 +H 10.52417012 8.76201250 11.18942577 +O 16.69548412 1.33395658 19.23752890 +H 16.94467607 0.42065090 18.96946358 +H 17.16813932 1.92608799 18.63373218 +O 8.58140492 17.47571458 1.92045388 +H 8.29954409 18.36114184 2.17921502 +H 9.54459658 17.50184657 1.93376015 +O 20.32094912 24.34413089 17.93758180 +H 19.47184665 24.12224241 18.21117427 +H 20.16577010 24.51679064 17.01303600 +O -2.01483737 9.85792613 6.43538302 +H -1.42187148 9.16927350 6.18296107 +H -1.75669077 10.59300822 5.96323877 +O 16.25991850 21.76687084 12.46169528 +H 17.10002928 21.60531678 12.96380574 +H 15.59015078 22.13719797 13.02708392 +O 27.05405836 33.57707724 25.63361452 +H 27.39966512 34.42619769 25.29608468 +H 27.71793655 32.91665366 25.51608543 +O 13.76438624 13.45115930 25.28181581 +H 14.50662387 12.89658752 24.98882955 +H 13.33551474 13.86064415 24.51977845 +O 15.29987966 16.28439309 14.56432608 +H 15.67396727 16.40375051 13.65642916 +H 15.80691149 15.58339971 14.96752165 +O 13.33547065 14.19880419 14.36842104 +H 12.87273371 14.33712087 15.20560236 +H 13.92286740 14.95520553 14.46872144 +O 4.35017247 10.38690152 7.03663564 +H 4.11908624 11.26283552 7.30076566 +H 3.53696677 9.95652204 6.71704766 +O -0.89622130 29.07102925 19.74140273 +H -0.77784987 29.16113089 20.70649514 +H -1.82611914 28.86940373 19.60543114 +O 9.18680910 24.00356383 12.09499195 +H 8.87579643 24.29888614 12.97336999 +H 8.47500387 23.39875644 11.77924776 +O 9.75807060 5.08386775 20.20193491 +H 9.74655379 5.20013903 21.12485670 +H 8.82489274 5.12596872 19.85497287 +O 4.30643682 -6.43022045 6.57762616 +H 4.41395370 -7.32557420 6.28673078 +H 3.82254840 -5.97593308 5.85519984 +O 12.06306107 25.48662156 38.56503437 +H 11.80702201 24.57209626 38.46533339 +H 12.79017644 25.45660700 37.92182461 +O 5.95025913 19.46881191 28.74944712 +H 5.13141186 19.92171308 28.72182918 +H 5.84826194 18.65908542 28.24643845 +O 5.56725031 7.57009601 9.13160820 +H 5.93430550 8.40554600 8.81802057 +H 4.89454661 7.80690482 9.74497887 +O 10.08834829 12.94053418 12.45337277 +H 10.38496024 13.77289147 12.77626662 +H 10.05430459 12.98546869 11.52414131 +O 21.10798360 10.50300426 16.95162943 +H 20.58317998 11.05076445 16.36398985 +H 20.94228498 9.57204281 16.79894248 +O 0.13791740 0.00951178 18.64705733 +H -0.09104176 -0.89776884 18.78864414 +H 0.15433085 0.41067450 19.52060325 +O 1.76254692 5.61279548 13.49522171 +H 2.54536642 5.20031615 13.22891835 +H 1.89345492 5.84243328 14.45960368 +O 16.43027890 24.59807599 22.93196647 +H 16.77135649 23.71302301 22.78274952 +H 15.61955220 24.49428391 22.37673325 +O 19.87868834 17.28515531 10.75107162 +H 18.93867365 17.60410912 10.71382121 +H 19.95698689 16.35211457 10.85516006 +O 7.94595654 20.82700538 9.32809653 +H 7.63442656 20.09800588 8.75247305 +H 8.88968457 20.90139698 9.19501349 +O 2.64414918 23.90300896 9.77592749 +H 2.27221888 24.83312145 9.67425213 +H 2.03593058 23.30758968 9.31142305 +O 16.01371418 3.64205698 23.51776997 +H 15.57695693 3.13159271 24.22228888 +H 16.49153715 2.97817742 22.96475812 +O 24.19281109 24.58402802 6.49093227 +H 23.31779610 24.40830357 6.00399673 +H 24.69503763 23.81300354 6.72890558 +O 3.80064439 13.18390007 8.28783023 +H 4.59835770 13.66627883 8.11489755 +H 3.64281645 13.24747861 9.22590496 +O 15.74697003 27.39438280 13.53825072 +H 15.91891611 26.90839112 12.76290898 +H 16.62360352 27.37838381 13.97931641 +O 23.12721509 11.23291899 22.01173392 +H 22.64681432 11.10277397 22.82318713 +H 22.56712256 11.50130970 21.33697885 +O 5.78041155 10.90595021 10.33080526 +H 5.66949885 11.36895722 11.14449371 +H 6.67948443 11.02048356 10.03845464 +O 4.87901977 12.45038737 12.75418774 +H 4.12257555 12.60985553 12.18908104 +H 5.32951546 13.29349507 12.62243945 +O 17.33653062 19.62941561 -7.36450396 +H 16.80196087 19.40230280 -8.12326610 +H 17.58433137 18.74705466 -7.05605448 +O 4.78134102 12.76245571 -8.85692309 +H 4.75834685 12.56690952 -7.90299485 +H 5.70016935 12.84579912 -9.13644515 +O 7.32419982 9.60151275 -2.08281876 +H 7.69006530 9.88595764 -1.15668402 +H 7.92321399 8.90814220 -2.40049359 +O 0.00066880 17.13375073 -5.67649997 +H 0.78790243 17.66018672 -5.96128553 +H -0.44029484 16.97326127 -6.49185609 +O 11.89885131 -1.07357818 2.76461006 +H 12.41090333 -1.15317397 3.51273793 +H 11.60629597 -0.14395668 2.76004010 +O 12.96957673 23.15478162 5.11873350 +H 13.94926053 23.07152528 5.10561958 +H 12.62500257 22.42583672 5.60595098 +O 22.01990583 17.85401519 2.28517944 +H 21.43711950 17.66436646 1.57357802 +H 22.32415781 18.73149006 2.20851345 +O 22.50586166 11.72886925 -15.39036454 +H 21.58920490 11.54097485 -15.54322051 +H 22.88873165 10.81933752 -15.34785018 +O -6.62898340 17.16048141 -7.11942221 +H -6.24853544 16.83068801 -6.32859269 +H -7.35781609 16.57284274 -7.39062007 +O 27.17844144 26.33424765 17.47003661 +H 26.33153908 26.01278309 17.72491463 +H 27.16886569 27.10066291 18.00189915 +O 12.74327360 11.02286725 8.73877689 +H 12.75660754 11.83150244 9.18636064 +H 13.55615003 11.10198953 8.19024928 +O 26.34271627 13.12777433 4.27515641 +H 27.10592945 12.71971431 3.81192445 +H 26.06492530 13.93967914 3.71536578 +O 17.09471442 21.90545792 -2.79654178 +H 17.07359107 21.68818548 -3.76412190 +H 18.03179834 21.81613349 -2.54147311 +O 21.30402089 -0.24232355 26.20929013 +H 21.33918794 -0.96617959 26.84968113 +H 20.40768769 -0.27436836 25.90170746 +O 33.42572503 19.04187117 -2.45911288 +H 32.98542743 19.26323695 -3.22215479 +H 32.72081839 19.33003961 -1.88733195 +O 2.99630268 11.18675975 -0.34183388 +H 3.70549063 10.73133923 -0.73167379 +H 3.31010796 12.03123186 -0.54463336 +O -1.97395419 21.35843895 11.66730626 +H -1.11260289 20.92650936 11.54463619 +H -1.76215247 22.19823746 11.23577163 +O 19.49345049 -7.42911699 25.82102599 +H 19.09954505 -8.16214343 26.26650213 +H 18.86340527 -6.70458426 26.03332195 +O 8.35768318 11.43676055 16.91101311 +H 8.09051686 11.60577431 16.02081565 +H 9.27654455 11.17256604 16.91757748 +O 23.66923535 -2.16162196 14.89837439 +H 24.21524651 -1.47325042 14.51074900 +H 23.36495041 -2.56734704 14.12201244 +O 30.91681788 25.31225672 0.48444737 +H 30.70969364 26.23990678 0.54408394 +H 30.29037064 24.97051145 -0.16173608 +O -1.21809697 -5.94323459 13.98507886 +H -0.37758552 -5.45520674 13.99036387 +H -0.86392682 -6.81598254 13.80027226 +O 17.33350795 7.10793519 0.27498653 +H 16.52788790 6.80227842 -0.25774731 +H 17.15915294 8.07170182 0.40800428 +O 14.42300652 32.67843532 15.09845891 +H 14.69986011 33.03323608 14.27718985 +H 14.78194957 31.79317697 14.98482000 +O 17.97937822 12.60581795 13.98042071 +H 18.33999352 12.14780629 13.22956494 +H 18.37592522 13.50932142 13.75152148 +O 20.26197536 25.33475891 15.23644911 +H 20.90803992 25.19103090 14.45648913 +H 19.49103654 24.79876502 15.08174492 +O 27.38996737 15.84053299 -5.92002950 +H 26.56187332 15.34369724 -5.93940782 +H 27.72442274 15.90485911 -6.81133852 +O 3.41972362 30.10054843 9.46656177 +H 3.30982088 30.83748312 10.08139658 +H 4.23795342 29.64017758 9.66011319 +O -2.25062204 15.91479162 -1.12356499 +H -2.60028069 16.69759663 -1.54095833 +H -1.40199567 15.95831824 -1.57838883 +O 19.94599622 12.98532423 15.78790553 +H 19.40196333 13.16893307 16.57493538 +H 19.22151340 12.83146562 15.10889303 +O 13.36224252 -0.84573806 25.51938843 +H 12.97832282 -0.95202414 26.37145448 +H 12.98988210 -1.62602179 25.03306770 +O -6.61587484 6.91051284 16.80794839 +H -6.87670438 7.56029323 16.15709531 +H -5.70360422 7.24051577 16.96116848 +O 28.44654152 10.46643142 15.15012670 +H 27.89755972 10.57886512 14.35798755 +H 28.90014506 11.31095611 15.31348547 +O 14.94858806 16.71735240 11.85727633 +H 14.96253430 17.71240391 11.83189319 +H 14.01901105 16.56655810 11.88710414 +O 15.88544391 11.92555509 -0.39222541 +H 16.29048926 11.24240633 0.13157428 +H 16.51177320 12.66994451 -0.15112823 +O 8.31522528 19.52637161 11.69660723 +H 8.23597511 19.96329200 10.83055444 +H 8.70286444 20.21467649 12.23380518 +O 10.84247456 7.65508868 27.07641246 +H 10.40812947 8.35496868 27.53052526 +H 11.61606642 7.50994722 27.63128914 +O 18.01678191 13.17137000 18.00275004 +H 18.07030681 13.71113259 18.79134992 +H 17.38599959 12.45541615 18.10487312 +O 13.15063229 31.70267753 33.35654260 +H 12.27422550 32.13424500 33.48986026 +H 13.05518521 30.77289276 33.63072841 +O 18.37059520 21.18062507 14.11766637 +H 18.80579794 20.63372141 14.77189878 +H 18.27749933 22.07902169 14.56894137 +O 23.03108583 25.79722028 9.03478515 +H 22.30343043 26.41019931 8.85766535 +H 23.37732801 25.61420050 8.16958301 +O 34.26163915 1.53539449 25.22236243 +H 33.95124699 0.73511996 24.72398472 +H 35.03468353 1.80400755 24.76281177 +O 6.92485616 19.28782762 7.03423368 +H 6.07677548 18.98092375 6.80321386 +H 7.54084718 18.58506703 6.76926160 +O 17.60340438 34.65596006 25.42267594 +H 17.93230695 35.46083012 25.80155364 +H 18.17515430 34.63135903 24.61870164 +O 12.18048480 2.87379198 17.94954109 +H 12.36605624 2.06894365 17.47324429 +H 13.03481962 3.00280031 18.36516925 +O 0.40016638 14.56616253 10.07545637 +H 0.14667385 14.17932242 9.24824871 +H -0.28590793 14.46646652 10.70447843 +O 4.00919733 19.43690904 18.23784822 +H 3.64925146 20.30180956 18.24983572 +H 3.30189447 18.84421235 18.18044790 +O 13.07177037 4.31582356 15.41794757 +H 12.48691133 5.00120453 15.58953056 +H 12.80864132 3.63038291 16.04548696 +O 19.55962323 -3.36396501 11.39207336 +H 19.11751254 -3.44322391 12.27752847 +H 20.44480773 -3.76755246 11.24658218 +O 17.75773969 33.89092291 18.97256337 +H 17.96676426 33.64945254 18.08825585 +H 17.12043674 34.57076603 18.84367207 +O 6.98141614 0.60011294 17.48605934 +H 6.05739832 0.46434616 17.53851374 +H 7.09680914 1.45714456 17.05721984 +O 16.12293559 11.33340001 17.71477317 +H 15.80957799 11.04434874 16.86483894 +H 15.39125825 11.54817078 18.27434402 +O 9.89215123 32.95247695 17.69026114 +H 10.30592400 33.82043745 17.55213725 +H 10.62215703 32.27422512 17.61742230 +O 9.07212521 9.25778002 20.06486819 +H 9.47023546 8.87412893 19.24971548 +H 8.17791153 9.50362165 19.83686500 +O 16.78214383 14.84794948 11.50737347 +H 17.46634449 15.11756113 12.14211442 +H 16.03627064 15.50853128 11.59958950 +O 12.16960360 9.46525895 -10.34321752 +H 12.65271403 10.01163518 -10.95211690 +H 12.77221807 8.73452357 -10.24977187 +O 25.95896527 8.19232946 -1.71717092 +H 26.30584473 8.31628165 -0.85202176 +H 26.65755320 7.81047831 -2.22113896 +O 5.18137716 18.12485417 11.49053723 +H 4.65916389 17.82226033 12.26400116 +H 5.96757170 18.19644014 11.98244581 +O 17.39173485 15.10100613 8.78697835 +H 18.22035632 15.59357404 8.69382102 +H 17.43562838 14.82617785 9.70409836 +O 5.03924117 29.89627277 15.79330531 +H 5.08396685 30.19809216 14.92431180 +H 4.10572124 30.06660971 15.98326455 +O 17.23227735 6.00372723 12.17579658 +H 17.84155392 5.79003505 12.88809193 +H 17.52369597 5.41641202 11.46106235 +O 16.34244139 23.60234295 9.14932035 +H 16.05748223 23.91754840 9.98952323 +H 16.63623227 22.69449159 9.30874127 +O 11.81669837 3.34536901 13.30528056 +H 12.52054610 3.73899115 13.83559899 +H 12.01646809 2.42303672 13.35367993 +O 18.18088912 3.23308629 -7.02780623 +H 19.06139274 3.06147659 -7.23298554 +H 17.91750994 3.99184331 -7.51955013 +O 28.14677807 7.23266965 7.33279972 +H 28.91912207 7.17057648 7.86379543 +H 27.63660324 6.40009718 7.42773073 +O 19.62771918 19.44367644 16.03084953 +H 18.83613546 19.56295641 16.57374734 +H 20.33906868 19.67688516 16.62874015 +O 7.77050672 12.57440948 7.14202163 +H 8.42316672 13.21121444 6.98573502 +H 7.04479620 13.06065413 7.47718120 +O 12.50554405 8.81186763 6.27800761 +H 11.82150524 8.46339723 6.85555014 +H 12.50497104 8.27665761 5.48624903 +O 6.77791736 10.68663253 -5.79802511 +H 6.39429327 11.53507583 -5.56674031 +H 7.39764970 10.95781010 -6.48290860 +O 15.78302908 11.30749585 14.93412364 +H 15.13798564 12.00219379 14.79334643 +H 16.55569880 11.64263759 14.47559145 +O -1.23729546 6.92372378 22.52819773 +H -0.95637185 5.95618207 22.50174412 +H -0.48507452 7.42973563 22.93576811 +O 20.58857301 14.06900413 23.06615536 +H 19.72861992 14.41593893 23.43352146 +H 21.26935182 14.73832426 23.26837067 +O 7.13148578 4.53023913 4.21266885 +H 7.71568743 4.55802291 3.43434856 +H 7.35088274 5.33140667 4.77950031 +O 8.93828080 21.51227307 -0.01270266 +H 8.56023253 22.47643895 -0.08869531 +H 8.52112351 21.23077232 0.82278777 +O 31.59249801 16.46132370 -4.49850489 +H 32.23734953 17.08800979 -4.16415579 +H 30.78003366 16.52610906 -3.97554272 +O 22.35739979 -2.31375581 17.40199423 +H 21.68953869 -1.67393282 17.51763224 +H 22.61963476 -2.16493950 16.49523535 +O 23.47970186 -9.26795540 26.36995724 +H 23.25078358 -9.08541822 25.44953424 +H 23.03532869 -8.63155472 26.88232108 +O 10.59197415 6.67662966 32.13458849 +H 9.68358984 6.65970420 31.86172146 +H 10.87756734 5.82236721 31.83582318 +O 14.26703003 16.70843813 5.21459534 +H 14.17858516 17.52426869 4.70033472 +H 13.40268723 16.34086832 5.28562619 +O -2.81768224 15.98831302 12.47235055 +H -3.25412720 16.66412075 12.98497148 +H -1.90303263 15.95966629 12.80848499 +O 14.61564071 15.85589231 7.76365100 +H 14.89723220 15.78739811 6.85075347 +H 15.46997107 15.84704755 8.15057377 +O -1.02332713 9.61413172 17.31988865 +H -1.76013540 10.14366090 17.18918010 +H -0.72057334 9.57901983 18.24780701 +O 10.99538795 10.62888423 21.60714906 +H 10.38375990 10.28162078 20.97039195 +H 11.68500183 9.95060635 21.68064261 +O 14.12210941 4.57491311 4.32989482 +H 13.78384358 3.67104180 4.50801195 +H 15.09694221 4.70186941 4.49325709 +O 30.07302834 3.09020902 0.90501502 +H 30.21452624 3.37335195 1.77489180 +H 30.80000326 3.35472571 0.27898627 +O 9.75522227 16.62805417 -2.75758169 +H 9.92116650 16.04621742 -1.98716068 +H 9.26306227 17.44852998 -2.63676072 +O 10.12861213 22.06677670 19.54423546 +H 10.10159631 21.86979006 20.48289808 +H 10.85163623 21.51273046 19.28084188 +O 16.55928179 15.24680626 16.90540332 +H 15.70680573 15.34106718 17.39226821 +H 17.07338905 14.40294735 17.25189466 +O 0.68920871 13.10065863 14.04670463 +H -0.01919202 12.92986930 13.44819396 +H 0.47652959 12.92424017 14.94746708 +O 3.09256279 13.84166795 10.84301852 +H 2.15002389 13.94907067 10.54255792 +H 3.42977538 14.71248779 10.52115692 +O 4.44419930 7.65597601 13.44868424 +H 4.23855055 8.28880294 14.15140686 +H 5.38553139 7.89197246 13.41313620 +O 27.95000479 14.37384422 14.00300287 +H 28.52353581 13.60985697 13.77632546 +H 27.02117557 14.13267241 14.11713945 +O 28.17500931 4.41987074 22.29032350 +H 27.53554183 4.19558220 21.60806204 +H 27.76319409 4.75161063 23.07270178 +O 3.23081189 -6.17740365 15.04850269 +H 2.76783693 -6.15370317 15.87137328 +H 3.94535593 -5.56743914 15.07325414 +O -4.29575676 20.36270606 5.22060940 +H -4.23947261 19.40799930 5.01144355 +H -3.36906767 20.58412780 5.21452308 +O 9.82825603 38.36658149 9.94154847 +H 9.26574482 37.57131102 9.77177228 +H 10.24887910 38.82162461 9.14673633 +O 14.14266530 21.58020442 17.76689928 +H 13.27178894 21.24382708 18.07949755 +H 14.69547339 21.29980869 18.43549287 +O -11.46318301 14.00476614 9.58671598 +H -10.74220273 13.62606784 10.10376017 +H -11.02144146 14.66957647 9.05917884 +O 15.05993643 9.48618149 22.64589878 +H 15.04272615 9.75526511 23.55290869 +H 15.58945303 10.22418053 22.24821847 +O 14.88037919 31.11231500 23.64577066 +H 14.91639520 31.56455039 22.78249090 +H 15.31512706 30.18194568 23.56565952 +O 2.38032520 14.48447524 6.50493425 +H 2.21654392 14.05607881 5.58594208 +H 2.80805375 13.85771839 7.11145934 +O 6.19753461 28.80397531 10.88100367 +H 6.92244304 29.22969669 11.25641694 +H 6.41052493 27.89930498 11.07405643 +O 13.83695116 -2.37462956 13.70108405 +H 13.84079279 -3.04911983 14.35652565 +H 12.91357448 -2.27946488 13.35903588 +O 20.62307420 24.18592731 21.94399951 +H 20.04016937 23.62684648 21.40331365 +H 21.23944805 24.52028171 21.30520467 +O 7.59202935 28.14844645 -0.24331789 +H 8.27991997 27.49996456 0.06993422 +H 7.74969079 28.08585191 -1.22837848 +O 18.02218002 3.96382611 35.26400369 +H 17.58907151 3.51167981 34.54230342 +H 18.80275524 4.20265430 34.80868715 +O 26.28569770 4.78624179 -0.26782661 +H 25.67795967 4.72388890 0.47313847 +H 27.11895847 5.16263894 0.06760255 +O 16.01149151 19.41205667 6.32532577 +H 16.53946848 20.19640786 6.33204739 +H 15.50554173 19.37517380 7.11811322 +O -8.31885155 6.46405654 2.89327912 +H -8.27580289 7.16909395 3.55203362 +H -8.33615059 6.77499682 1.97636861 +O 15.27100393 17.87783210 19.58908299 +H 15.28220694 16.94327393 19.54396405 +H 14.58386728 18.14706472 19.03165087 +O 17.45611111 -3.77694615 9.47038191 +H 17.66521784 -3.93614740 8.56042763 +H 18.23605415 -3.56845328 10.04391159 +O 9.16626560 24.80350280 19.01837275 +H 8.34313310 25.05403385 18.60056580 +H 9.35235331 23.80915635 19.14644040 +O 22.41483568 6.34883805 18.15725488 +H 23.01265304 5.67417824 17.73602401 +H 22.10508702 5.87471822 18.91245095 +O 17.36245069 11.44872238 9.46111214 +H 16.83818075 10.71888391 9.12904562 +H 17.33801407 12.08558872 8.74991491 +O 12.70955748 -3.49265843 1.41927646 +H 12.45750300 -2.80213150 1.98755594 +H 13.67431176 -3.61394865 1.65644832 +O -1.30176486 -6.76827153 -8.33007525 +H -1.13105651 -6.37453444 -9.21771918 +H -1.99987119 -6.22950292 -7.94113383 +O 3.61184628 12.12964778 18.67769223 +H 2.93646894 12.46779253 19.24439525 +H 3.72533034 11.19293359 18.95657425 +O 24.43428036 12.15218556 16.44271175 +H 24.54163367 11.26257170 16.77435643 +H 24.55217197 12.83040971 17.07503024 +O -7.08033347 18.09768495 13.22095269 +H -7.30223440 18.02588406 12.27865375 +H -6.14107771 18.20921900 13.18667126 +O -4.06174025 27.50134908 17.51218996 +H -3.25917240 27.82397897 17.02201352 +H -3.90826232 26.54612852 17.61439459 +O 13.57046479 7.32541926 17.58730100 +H 13.92995754 7.46879531 16.75108594 +H 12.85345668 6.67490707 17.53165429 +O 19.60462101 6.78662781 2.23905359 +H 18.87107518 7.04502207 1.72737330 +H 19.34804522 6.66184251 3.17785137 +O 4.77707776 -0.46027157 23.17635561 +H 4.18322379 -1.16620807 23.15078711 +H 4.24464913 0.36097189 23.12586688 +O 16.14874564 -9.84575748 28.31203676 +H 15.68115118 -10.59883441 28.72064038 +H 15.96482150 -9.11323270 28.86390666 +O -10.50371550 1.77285958 29.81391244 +H -9.86825138 1.21322399 30.33470038 +H -11.31643674 2.00344686 30.36741210 +O 17.83518460 13.94760763 24.25922740 +H 17.96845386 14.24426311 25.15166975 +H 17.77855167 14.78931685 23.81028386 +O 15.50081563 10.85236219 28.06563888 +H 15.19634823 11.53803067 28.69914273 +H 15.86388644 10.05179372 28.53330729 +O 31.53456946 16.32983368 0.13465344 +H 31.12076165 16.59426467 0.96827853 +H 32.32634611 16.85431924 0.25511515 +O 5.11103327 14.42965486 3.50024675 +H 4.60533314 13.72097587 3.12369601 +H 6.00883722 14.15246980 3.56831006 +O 13.10273230 4.28666999 25.80546634 +H 13.84930443 4.90635407 25.90705049 +H 13.59957956 3.48418501 25.77430214 +O -1.42057867 20.63513061 -2.81388666 +H -1.79541206 20.09982960 -3.46747125 +H -0.71604081 20.03484120 -2.61789623 +O 10.21254986 22.58704237 22.59045516 +H 9.86417487 23.46461403 22.57700809 +H 9.68643311 21.96377329 23.08882203 +O 10.46875156 15.32461044 16.03727888 +H 9.55108956 15.20323041 16.07475740 +H 10.85623681 14.51917738 16.31723644 +O 7.27125680 8.55736588 13.64879631 +H 7.70271684 7.72289220 13.49393904 +H 7.81152823 9.33210201 13.48186678 +O 29.36932942 4.95937888 28.20983539 +H 30.24951541 4.64699029 28.56303120 +H 29.15401097 5.69393417 28.78227743 +O 25.92349456 15.86300318 16.17810930 +H 26.80504209 15.54068779 16.01143198 +H 25.49261199 15.21142822 16.74955792 diff --git a/tests/test_cpp_float32.ipynb b/tests/test_cpp_float32.ipynb new file mode 100644 index 0000000..39ad427 --- /dev/null +++ b/tests/test_cpp_float32.ipynb @@ -0,0 +1,309 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [], + "source": [ + "import ase.io\n", + "from pet.hypers import load_hypers_from_file\n", + "from pet.data_preparation import get_all_species\n", + "from pet.pet import PET, PETUtilityWrapper, PETMLIPWrapper\n", + "import torch\n", + "from pet.molecule import MoleculeCPP, Molecule\n", + "from matscipy.neighbours import neighbour_list as neighbor_list\n", + "torch.set_default_dtype(torch.float32)" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [], + "source": [ + "device = torch.device(\"cuda:0\" if torch.cuda.is_available() else \"cpu\")\n", + "def prepare_test(stucture_path, r_cut, n_gnn, n_trans, hypers_path = \"../default_hypers/default_hypers.yaml\"):\n", + " structure = ase.io.read(stucture_path, index=0)\n", + " hypers = load_hypers_from_file(hypers_path)\n", + " \n", + "\n", + " MLIP_SETTINGS = hypers.MLIP_SETTINGS\n", + " ARCHITECTURAL_HYPERS = hypers.ARCHITECTURAL_HYPERS\n", + " FITTING_SCHEME = hypers.FITTING_SCHEME\n", + "\n", + " ARCHITECTURAL_HYPERS.D_OUTPUT = 1 # energy is a single scalar\n", + " ARCHITECTURAL_HYPERS.TARGET_TYPE = \"structural\" # energy is structural property\n", + " ARCHITECTURAL_HYPERS.TARGET_AGGREGATION = (\n", + " \"sum\" # energy is a sum of atomic energies\n", + " )\n", + " ARCHITECTURAL_HYPERS.R_CUT = r_cut\n", + " ARCHITECTURAL_HYPERS.N_TRANS_LAYERS = n_trans\n", + " ARCHITECTURAL_HYPERS.N_GNN_LAYERS = n_gnn\n", + " all_species = get_all_species([structure])\n", + "\n", + "\n", + " model = PET(ARCHITECTURAL_HYPERS, 0.0, len(all_species)).to(device)\n", + " model = PETUtilityWrapper(model, FITTING_SCHEME.GLOBAL_AUG)\n", + "\n", + " model = PETMLIPWrapper(\n", + " model, MLIP_SETTINGS.USE_ENERGIES, MLIP_SETTINGS.USE_FORCES\n", + " )\n", + " return model, structure, all_species, ARCHITECTURAL_HYPERS\n", + "\n", + "\n", + "\n" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [], + "source": [ + "def get_predictions_old_python(model, structure, all_species, ARCHITECTURAL_HYPERS):\n", + " \n", + " molecule = Molecule(\n", + " structure,\n", + " ARCHITECTURAL_HYPERS.R_CUT,\n", + " ARCHITECTURAL_HYPERS.USE_ADDITIONAL_SCALAR_ATTRIBUTES,\n", + " ARCHITECTURAL_HYPERS.USE_LONG_RANGE,\n", + " ARCHITECTURAL_HYPERS.K_CUT,\n", + " )\n", + " if ARCHITECTURAL_HYPERS.USE_LONG_RANGE:\n", + " raise NotImplementedError(\n", + " \"Long range interactions are not supported in the SingleStructCalculator\"\n", + " )\n", + "\n", + " graph = molecule.get_graph(\n", + " molecule.get_max_num(), all_species, None\n", + " )\n", + " graph.batch = torch.zeros(\n", + " graph.num_nodes, dtype=torch.long, device=graph.x.device\n", + " )\n", + " graph = graph.to(device)\n", + " prediction_energy, prediction_forces = model(\n", + " graph, augmentation=False, create_graph=False\n", + " )\n", + "\n", + " return prediction_energy, prediction_forces, graph\n", + "\n", + "def get_predictions_cpp(model, structure, all_species, ARCHITECTURAL_HYPERS):\n", + " \n", + " molecule = MoleculeCPP(\n", + " structure,\n", + " ARCHITECTURAL_HYPERS.R_CUT,\n", + " ARCHITECTURAL_HYPERS.USE_ADDITIONAL_SCALAR_ATTRIBUTES,\n", + " ARCHITECTURAL_HYPERS.USE_LONG_RANGE,\n", + " ARCHITECTURAL_HYPERS.K_CUT,\n", + " )\n", + " if ARCHITECTURAL_HYPERS.USE_LONG_RANGE:\n", + " raise NotImplementedError(\n", + " \"Long range interactions are not supported in the SingleStructCalculator\"\n", + " )\n", + "\n", + " graph = molecule.get_graph(\n", + " molecule.get_max_num(), all_species, None\n", + " )\n", + " graph.batch = torch.zeros(\n", + " graph.num_nodes, dtype=torch.long, device=graph.x.device\n", + " )\n", + " graph = graph.to(device)\n", + " prediction_energy, prediction_forces = model(\n", + " graph, augmentation=False, create_graph=False\n", + " )\n", + "\n", + " return prediction_energy, prediction_forces, graph" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Energy difference: tensor([0.], grad_fn=)\n", + "Forces difference: tensor(0.)\n" + ] + } + ], + "source": [ + "model, structure, all_species, ARCHITECTURAL_HYPERS = prepare_test(\"../example/methane_train.xyz\", 10.0, 2, 2)\n", + "python_energy, python_forces, python_graph = get_predictions_old_python(model, structure, all_species, ARCHITECTURAL_HYPERS)\n", + "cpp_energy, cpp_forces, cpp_graph = get_predictions_cpp(model, structure, all_species, ARCHITECTURAL_HYPERS)\n", + "\n", + "print(\"Energy difference: \", torch.abs(python_energy - cpp_energy))\n", + "print(\"Forces difference: \", torch.abs(python_forces - cpp_forces).max())" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Energy difference: tensor([0.0002], grad_fn=)\n", + "Forces difference: tensor(1.9222e-06)\n", + "Forces spread: tensor(3.6096)\n" + ] + } + ], + "source": [ + "model, structure, all_species, ARCHITECTURAL_HYPERS = prepare_test(\"bulk.xyz\", 4.0, 2, 2)\n", + "python_energy, python_forces, python_graph = get_predictions_old_python(model, structure, all_species, ARCHITECTURAL_HYPERS)\n", + "cpp_energy, cpp_forces, cpp_graph = get_predictions_cpp(model, structure, all_species, ARCHITECTURAL_HYPERS)\n", + "\n", + "print(\"Energy difference: \", torch.abs(python_energy - cpp_energy))\n", + "print(\"Forces difference: \", torch.abs(python_forces - cpp_forces).max())\n", + "\n", + "print(\"Forces spread: \", torch.abs(python_forces).max())" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2.53 s ± 218 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)\n" + ] + } + ], + "source": [ + "%timeit get_predictions_old_python(model, structure, all_species, ARCHITECTURAL_HYPERS)" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2.16 s ± 128 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)\n" + ] + } + ], + "source": [ + "%timeit get_predictions_cpp(model, structure, all_species, ARCHITECTURAL_HYPERS)" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "5.42 ms ± 21.4 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)\n" + ] + } + ], + "source": [ + "%timeit i_list, j_list, D_list, S_list = neighbor_list('ijDS', structure, 4.0)" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "91.1 ms ± 20.9 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)\n" + ] + } + ], + "source": [ + "%timeit i_list, j_list, D_list, S_list = ase.neighborlist.neighbor_list(\"ijDS\", structure, 4.0)" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "True\n" + ] + } + ], + "source": [ + " def is_3d_crystal(atoms):\n", + " pbc = atoms.get_pbc()\n", + " if isinstance(pbc, bool):\n", + " return pbc\n", + " return all(pbc)\n", + "\n", + "print(is_3d_crystal(structure))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.6" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/tests/water_single.xyz b/tests/water_single.xyz new file mode 100644 index 0000000..6a7e03a --- /dev/null +++ b/tests/water_single.xyz @@ -0,0 +1,194 @@ +192 +Lattice="11.74456431055329 0.0 0.0 -5.29177210903e-07 11.74456431055329 0.0 -5.29177210903e-07 -5.29177210903e-07 11.74456431055329" Properties=species:S:1:pos:R:3:forces:R:3 cutoff=-1.0 nneightol=1.2 energy=-30010.461001933934 pbc="T T T" +O 5.73416426 3.02709473 1.80318722 -0.80332611 -1.21376692 0.20230786 +H 5.56943139 2.10076473 1.36991809 0.50217575 1.53231646 1.34795286 +H 5.56662675 2.96533975 2.79956970 0.54751666 -0.28190205 -1.62430029 +O 1.78772996 10.85151956 1.15475463 -2.83291472 2.12456520 -0.92718649 +H 1.27361313 11.62702876 0.64046847 1.81789416 -2.16291579 1.69135469 +H 2.16766332 10.15956744 0.55739294 -0.13023518 0.45973042 -0.26124271 +O 7.52468827 9.97186828 10.15051851 -1.51298176 3.37316030 2.50257924 +H 8.17832796 9.32362620 10.34398569 0.48150767 -0.47552780 0.31697757 +H 7.43679193 10.62175081 11.03466779 1.05936697 -2.82762853 -2.99742426 +O 7.91178140 4.58707211 0.75474958 1.34499609 1.23814613 -2.36786880 +H 8.06085062 4.79654691 1.63976672 0.38014497 0.68880399 2.57828797 +H 7.13320297 4.09945648 0.81464715 -2.16483898 -1.83566563 0.07202743 +O 8.92351531 5.17808368 9.14508181 2.09709552 -3.02514590 -0.30432053 +H 8.62775816 5.97546907 9.42279401 -2.76871939 4.09653535 0.85838888 +H 9.79237137 5.33770469 9.55709918 0.94460315 -1.16752304 -0.52726150 +O 11.39392620 4.75242940 10.31763267 -1.23014486 0.11996567 -0.73341779 +H 11.04689178 4.60206370 11.18738833 -0.18260446 -0.43417416 1.22912156 +H 0.40332564 5.30748867 10.49062070 1.23808957 1.01266029 -0.11816898 +O 0.06869249 6.49660278 7.03350598 -8.74972508 3.31707423 -1.29926643 +H 11.62972756 7.37731241 6.49459191 0.80802095 -2.94173414 0.93328515 +H 0.92074189 6.41346904 7.01763066 7.99459174 -0.50270591 0.52857277 +O 2.58803640 5.05946331 5.42406641 -2.78970988 -0.38920966 -3.53642028 +H 2.09149884 4.27517506 5.74982790 0.69823994 0.18291556 0.51624689 +H 2.05534545 5.27435689 4.54993445 1.81884547 -0.35324094 2.29502427 +O 3.93554913 4.81396213 0.78823062 -4.93885484 -11.15967257 12.97271248 +H 4.29762276 5.26709128 0.27274428 7.51580070 11.72099606 -13.81315506 +H 4.79081063 4.49826559 1.22479124 -1.65517925 -0.69692353 0.36172507 +O 4.09431817 7.33063898 3.19968059 -1.06004574 -1.11637349 -0.28933974 +H 3.38943825 6.58815044 3.16480781 1.14148290 1.68970918 -0.61438594 +H 4.19910055 7.70582563 2.28520416 0.06644145 -0.21912545 1.05279008 +O 4.01414782 0.34585435 10.69001467 0.27125870 -3.90565143 1.86140239 +H 3.97934383 11.01133108 10.83765511 -0.38882553 3.49365767 0.06856364 +H 3.76050260 0.40037812 9.77321516 -0.24997767 0.45197288 -1.37139619 +O 9.40067440 2.29813725 7.12410112 -2.25397402 -0.18400931 -3.24547412 +H 8.77407566 2.12047129 7.78176256 -1.42089509 -0.29561015 1.47685774 +H 10.18867218 2.35986048 7.56548783 3.33147756 0.45038600 1.81095218 +O 10.91142242 11.36201681 9.39247215 0.01736164 0.75490194 5.37813315 +H 10.21386102 0.09946732 9.94308104 1.27966947 -0.25601514 -1.75074206 +H 10.90565439 11.26390736 8.49001334 -1.04485051 0.02427020 -3.42446926 +O 9.59271281 7.85595320 8.22637725 1.68824880 -3.33631637 -2.48706005 +H 10.24471205 7.11245922 7.84028956 -2.08559754 2.31028120 1.60193682 +H 10.10252213 8.20510433 8.96706659 0.16744728 0.53774132 0.59653734 +O 8.17668751 11.46557679 0.59883281 -0.66836885 3.34592202 -5.23775086 +H 7.40086080 0.24360726 0.81692790 -0.70252854 0.12888586 -0.06194922 +H 8.35316811 11.04541009 1.33745836 1.62912882 -3.53077414 5.68080355 +O 0.94004098 10.15162978 3.54788449 -1.08457407 -1.07225848 -2.11326262 +H 0.69010529 9.19133189 3.77189578 0.19180130 1.74153750 -0.34616217 +H 0.93777081 10.30122818 2.50966526 1.29074064 -1.02193169 1.68592452 +O 2.27424490 5.50915811 2.47661814 3.42542057 -4.02492496 3.71742602 +H 2.87039478 5.20416153 1.76153568 0.28323491 -0.31793299 0.44400092 +H 1.75867813 6.03341397 2.01906506 -5.01572057 4.50292924 -3.15397366 +O 8.94351821 9.24398503 5.88873692 -1.92119599 -4.43389509 -2.57106317 +H 9.09221700 8.40449830 6.46427006 -0.54337204 2.43464552 -0.54531580 +H 8.36787924 8.80270415 5.00977887 2.04375025 1.37647669 3.10278297 +O 2.82171577 2.69312570 11.50923391 0.69614192 -0.37589905 1.50967018 +H 3.43897452 3.14968922 0.41529298 -1.06053939 -1.03034434 -1.56750974 +H 2.93838347 1.70842217 11.51627197 0.70775303 1.01310766 -0.29180954 +O 8.16112970 2.63468866 9.79782190 -1.27590023 2.29413467 1.11429604 +H 8.54928118 3.61930224 9.73373854 -1.52802272 -2.32642774 -0.06867111 +H 7.16627654 2.73929112 10.09193859 2.77315197 0.05309382 -1.14957673 +O 1.59972917 8.97754430 9.43268962 -4.27687261 0.84039630 2.26111141 +H 1.59251119 9.12142758 8.50784661 0.80233881 0.43452331 -2.11537093 +H 0.58284107 9.31288390 9.64240255 3.61139368 -1.36863482 0.04291019 +O 5.26826606 3.30655851 9.49391542 -0.84340449 0.50978314 1.64621124 +H 4.78704289 2.59503212 9.98054679 0.22770831 1.03334739 -0.67504858 +H 4.89323288 4.20901733 9.82787916 0.44176714 -1.60587061 -1.14998811 +O 7.36117251 0.04299829 7.68322976 -0.43534967 -0.03071647 3.23220208 +H 7.04043820 0.88966860 7.30592641 -0.03364444 -0.06154709 0.77135186 +H 7.21231496 0.07133097 8.74782847 0.53084562 -0.30424906 -4.25693627 +O 4.18004487 0.62351363 4.09110077 -1.56364280 2.67147508 0.69047006 +H 4.80862273 1.37200834 4.08969845 0.44022654 -0.29248317 0.30456530 +H 3.28940788 1.15635275 4.10035608 1.67807237 -2.07241806 -0.35558115 +O 2.70842422 6.37716749 7.53125007 2.06494643 5.11524802 -0.69604422 +H 2.64632527 5.94334801 6.65921894 0.39734926 -0.66881108 -0.10087985 +H 3.09797273 7.37493112 7.16849909 -1.55386232 -3.75355518 1.65329206 +O 6.41182859 2.43882960 7.01329141 -4.92870926 2.02800480 0.61801120 +H 5.72035273 2.64918283 6.21809682 2.70379386 -1.03493633 1.32465351 +H 5.74453613 2.77554505 7.76408804 2.33632649 -1.16785214 -1.14451680 +O 10.57301359 4.37816353 1.12879320 4.89504836 -1.30601815 2.06174798 +H 10.93983923 3.52935799 1.61142928 -2.07324081 1.97823337 -1.66711946 +H 9.71802197 4.32374295 0.82312457 -3.01427013 -1.27858446 -0.62062344 +O 4.08049606 10.52136590 2.32719437 0.42891316 2.23963240 1.86107843 +H 3.15932554 10.71626186 1.93731777 1.63434302 0.18014648 1.02641569 +H 4.27975774 11.25147169 3.16363304 -1.47402439 -2.26965261 -2.92434833 +O 1.84757461 2.91355447 6.97180392 -2.90159406 -1.25619014 -2.57119687 +H 1.40897666 2.99356607 7.80562845 -0.14525659 0.44582177 1.66832274 +H 0.95316987 2.61135724 6.50289999 2.62214073 0.34147968 0.65385239 +O 5.97425196 7.07160674 6.51708194 -1.32986257 4.64477707 0.74215954 +H 6.45172856 6.31562418 6.45929579 1.62818266 -4.29121937 -0.25735983 +H 5.04161946 6.94539798 6.38552849 -0.03046759 -0.33969019 -0.12541847 +O 3.26609762 9.55064322 11.51695990 -2.28802058 2.61571811 -1.59542165 +H 2.90240471 9.12894190 10.76187694 -0.52591939 -0.96484803 -1.23090590 +H 3.99413434 9.15122026 0.17271762 2.46309222 -2.04713382 1.18471344 +O 10.53697662 4.56069792 5.76512112 1.37467177 5.21414812 -0.75573497 +H 10.35298171 3.68800003 5.75575469 -0.26204901 -4.34917206 0.71721469 +H 11.27576093 4.91570703 6.31964592 -1.20071085 -0.75218685 -0.31628954 +O 4.63525899 10.81807556 6.19613596 6.71521024 -1.10373908 4.35700365 +H 4.35573171 11.34174933 5.54381921 -2.37777269 3.55238684 -4.56307766 +H 5.67410264 11.23263298 6.27461294 -3.69088709 -2.18111407 -0.04988097 +O 0.14165280 7.33720078 1.35500587 -5.25636565 -0.09894072 6.15964602 +H 0.43427986 7.46266870 0.56089609 3.84631548 0.76780374 -7.44962047 +H 10.92671564 7.65920512 1.13098929 2.25378890 -0.78840343 1.73881728 +O 10.27603934 2.10768108 2.86506067 1.27164762 -1.00033441 0.95626568 +H 11.01111940 2.17232008 3.54679438 -1.62994129 0.20511087 -0.66830200 +H 10.25354931 1.09798979 2.87938021 -0.22944278 0.78903592 -0.44897292 +O 5.69627517 0.40138197 0.90041090 2.59900079 0.43527099 4.94188874 +H 5.24481822 0.44575031 0.13631182 -2.71563637 0.20740533 -4.72132913 +H 5.15967360 11.54675258 1.48204016 -0.21494998 -0.23595898 -0.06999420 +O 6.15025630 7.53315510 9.28182120 3.37681641 -8.71825476 -0.73325838 +H 5.88831358 8.32623299 9.17037648 -3.12216395 9.38792459 -0.76454872 +H 6.54803881 7.35413445 8.40211700 -0.57476523 -0.20697287 0.55008777 +O 11.51516070 7.99909564 4.70859766 -1.85752516 -3.33904174 -2.28857594 +H 10.55803788 8.11683757 4.90491182 0.94879405 0.68445368 -0.18751835 +H 11.33058369 7.11780391 3.97989418 0.73715617 2.85156037 2.24620414 +O 4.32177970 9.39263090 8.51430257 10.95624679 -10.19283450 -11.15278201 +H 4.15839623 9.72273165 7.58681367 0.74426271 -1.00007216 1.44278033 +H 3.83315863 9.85920645 8.89837939 -11.80157447 10.92359377 9.90425375 +O 7.32079629 7.68735734 4.30241710 11.26303096 2.57085748 -17.99639319 +H 7.49129719 6.77442082 3.96804590 0.55662866 -0.25286348 0.13183903 +H 6.92412505 7.59215836 4.94862185 -11.68489776 -2.23415081 18.08807877 +O 10.60936807 5.82587067 3.33454140 -3.62983878 8.74340016 19.17817558 +H 10.85887512 5.24453775 3.99905568 0.76538690 -2.26595537 2.00967797 +H 10.70514914 5.60689714 2.61041531 3.34908448 -6.50093440 -20.65116124 +O 8.16710940 1.89280867 4.64662571 -2.78388890 -0.72861497 -4.24536116 +H 8.53457006 2.07518431 5.44433390 2.39779131 1.05826653 3.94904653 +H 8.71888248 2.16570536 3.89810984 0.79682122 0.07677472 0.24100195 +O 7.35476947 9.37220466 2.30818103 -1.57494023 0.21925041 2.66969073 +H 7.02816129 10.06029379 3.00869524 1.12488899 -1.41697158 -1.75353428 +H 7.24983362 8.55541964 2.92457723 0.16987646 1.65735955 -1.30613127 +O 7.59850849 4.79108580 6.60704207 -0.18279832 -1.17206875 0.89977338 +H 7.35064188 3.91050317 7.03265930 -0.45973248 0.75343126 -1.50952619 +H 8.26643596 4.99101424 7.26121093 0.89534594 0.76599882 -0.01246266 +O 10.40399439 11.10430751 6.79294202 2.81111175 -0.62073657 -1.02525355 +H 9.63001980 11.47674243 7.07319427 -3.06936890 2.63521222 1.66147846 +H 9.93990598 10.35631552 6.42130087 0.40481317 -1.41940385 -0.75827008 +O 3.49465984 8.56023515 5.57334730 4.08231201 1.30895435 -3.78476839 +H 4.21974904 9.43364214 5.51672534 -2.68191376 -2.97917456 0.99539275 +H 3.65141801 8.24495137 4.57004848 -0.61115664 0.20748555 2.30058300 +O 10.64836843 8.95923477 10.32953916 -2.39696341 0.22372670 2.32516276 +H 10.35155293 9.90349858 10.16999223 0.96258032 -1.01845041 -0.24083020 +H 10.06870771 8.69586327 11.18304908 2.34525851 0.93941467 -2.29535337 +O 11.45213569 2.78041878 8.81582775 0.13917079 0.55494715 -5.11691409 +H 11.40535643 3.52377517 9.35537683 -0.02186930 2.41838071 2.07431039 +H 11.49658658 2.03804136 9.30441706 0.27983642 -3.85064522 2.72189444 +O 5.72252236 2.78391664 4.58865435 2.00202122 0.11734314 -0.87511135 +H 5.58377209 3.78623649 4.59301477 0.76167423 -0.88388396 -0.15393664 +H 6.80527185 2.57167953 4.53785334 -2.41439550 0.27077174 0.34678438 +O 3.49103498 0.47779834 8.23103401 1.10622791 -0.34709034 -2.37964446 +H 4.13096898 -0.02426013 7.57813517 -2.14205385 1.52066936 1.47370043 +H 2.91503088 1.07665866 7.70577271 0.67948116 -0.68213454 0.43600941 +O 4.20392664 5.85068908 9.77697231 -3.57610785 -0.45028264 -2.74477212 +H 3.54920743 6.04214539 8.83884695 1.55419656 -1.34864705 2.76174141 +H 4.72216576 6.61011129 9.59234238 1.78331795 1.13481345 0.09583637 +O 1.45781442 6.56317328 10.70033363 2.20226397 0.63186945 -0.26552977 +H 2.44013666 6.43590616 10.96735645 -2.54561438 0.39446191 -1.41605113 +H 1.41492990 7.19966763 9.90556238 0.60172068 -0.81249982 1.68488579 +O 7.98681873 5.23825113 3.84425018 3.13433042 -1.45225227 2.74527092 +H 9.01755010 5.30341401 3.65056603 -2.77410842 0.24112279 0.40572437 +H 8.05524134 4.91626267 4.90003810 -0.71303407 1.02736700 -3.07754501 +O 10.04494765 1.29552636 11.26724117 1.73607648 6.18659119 -7.11522264 +H 9.25266353 1.89236946 10.78695994 2.14781312 -1.66582877 1.26821777 +H 9.64420175 0.85762163 0.14036796 -3.95195702 -4.15348017 5.70846863 +O 1.65347770 0.84323330 3.65143388 1.42823302 18.52259540 -1.58570801 +H 1.30082871 1.18126641 2.78746213 0.06763907 -0.72436750 0.47733529 +H 1.56093519 11.80917156 3.71966599 -1.83660666 -17.48993707 1.07095236 +O 9.54164721 8.40767336 0.89833123 11.90981796 -1.53191537 -0.18516168 +H 9.00596112 8.92785456 1.26700370 -5.91832217 7.89755826 6.08966056 +H 8.94113691 7.98808875 0.49614438 -7.23364771 -6.68636245 -5.64295689 +O 5.09521982 8.37512896 0.81392218 4.28942474 -0.28139245 -0.78329207 +H 5.86312474 9.13169362 1.08096087 -2.32849491 -3.31964533 -0.61849971 +H 5.54545966 7.65089703 0.19278931 -0.77571760 2.85232141 2.11019787 +O 7.30703768 11.10160871 4.63375612 -0.88771490 -3.55613037 3.03358941 +H 7.63533922 10.74907085 5.55297398 -0.86701751 0.61395914 -2.54795409 +H 7.79843164 0.12321944 4.54375366 1.37331423 2.81788919 -0.43847047 +O 10.24857504 11.03916580 3.08253663 2.08557697 -0.83679675 1.42397013 +H 11.34180224 10.69340141 3.15046182 -3.53841546 0.81605308 0.79711433 +H 9.89365589 10.83162249 3.99602350 0.78547751 0.29104335 -1.77379458 +O 11.39159782 1.59286574 5.25942351 10.18846363 14.10111874 -9.35825404 +H 11.14796463 0.93367498 5.59827155 -6.44107909 -15.49337173 8.38653088 +H 0.63682773 1.17983234 4.75863136 -3.26021169 1.80275036 1.16045250 +O 7.51865565 7.18246937 11.26967539 2.85097416 -4.61661833 5.64131139 +H 7.03461725 7.13050416 10.50220968 -1.92595253 0.25077060 -3.35841759 +H 7.61030914 6.12718417 11.64062861 -0.25806174 3.92457476 -1.28720280 +O 1.75378853 9.68542466 6.78468686 -3.15344401 -0.46783763 0.39065667 +H 2.25816320 9.04199808 6.22910370 -0.18277466 0.61772838 -0.22779213 +H 0.77725020 9.49312166 6.62916167 2.16249413 0.72466575 0.07833126 +O 0.79380286 1.53270887 1.01780886 -0.44967946 0.87239112 -0.65009858 +H -0.05250973 1.65674801 0.40803849 2.46039770 0.24974010 1.38686909 +H 1.63024682 2.14220989 0.87222163 -2.73532074 -0.92775214 -1.05769575 +O 5.12024461 5.20156327 4.72964303 16.37304935 -0.02624223 3.03762604 +H 5.10836987 5.84100514 4.17073135 0.04007426 6.65016130 -5.75084043 +H 4.40036251 4.91235205 4.83038250 -16.81327383 -5.96156814 2.63335074 From 5054c8142df2a0ce9e3e642acee671b3b29015bc Mon Sep 17 00:00:00 2001 From: serfg Date: Thu, 23 May 2024 20:39:50 +0200 Subject: [PATCH 08/41] run gpu --- tests/test_cpp_float32.ipynb | 22 ++-- tests/test_cpp_float64.ipynb | 218 +++++++++++++++++++++++++++++++++++ 2 files changed, 229 insertions(+), 11 deletions(-) create mode 100644 tests/test_cpp_float64.ipynb diff --git a/tests/test_cpp_float32.ipynb b/tests/test_cpp_float32.ipynb index 39ad427..083e4f0 100644 --- a/tests/test_cpp_float32.ipynb +++ b/tests/test_cpp_float32.ipynb @@ -125,8 +125,8 @@ "name": "stdout", "output_type": "stream", "text": [ - "Energy difference: tensor([0.], grad_fn=)\n", - "Forces difference: tensor(0.)\n" + "Energy difference: tensor([0.], device='cuda:0', grad_fn=)\n", + "Forces difference: tensor(0., device='cuda:0')\n" ] } ], @@ -148,9 +148,9 @@ "name": "stdout", "output_type": "stream", "text": [ - "Energy difference: tensor([0.0002], grad_fn=)\n", - "Forces difference: tensor(1.9222e-06)\n", - "Forces spread: tensor(3.6096)\n" + "Energy difference: tensor([0.0002], device='cuda:0', grad_fn=)\n", + "Forces difference: tensor(1.7285e-06, device='cuda:0')\n", + "Forces spread: tensor(2.4026, device='cuda:0')\n" ] } ], @@ -174,7 +174,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "2.53 s ± 218 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)\n" + "341 ms ± 2.11 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)\n" ] } ], @@ -191,7 +191,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "2.16 s ± 128 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)\n" + "76.3 ms ± 457 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)\n" ] } ], @@ -208,7 +208,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "5.42 ms ± 21.4 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)\n" + "6.27 ms ± 7.34 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)\n" ] } ], @@ -225,7 +225,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "91.1 ms ± 20.9 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)\n" + "83.9 ms ± 1.09 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)\n" ] } ], @@ -287,7 +287,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -301,7 +301,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.6" + "version": "3.10.12" } }, "nbformat": 4, diff --git a/tests/test_cpp_float64.ipynb b/tests/test_cpp_float64.ipynb new file mode 100644 index 0000000..5fa1aa9 --- /dev/null +++ b/tests/test_cpp_float64.ipynb @@ -0,0 +1,218 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [], + "source": [ + "import ase.io\n", + "from pet.hypers import load_hypers_from_file\n", + "from pet.data_preparation import get_all_species\n", + "from pet.pet import PET, PETUtilityWrapper, PETMLIPWrapper\n", + "import torch\n", + "from pet.molecule import MoleculeCPP, Molecule\n", + "from matscipy.neighbours import neighbour_list as neighbor_list\n", + "torch.set_default_dtype(torch.float64)" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [], + "source": [ + "device = torch.device(\"cuda:0\" if torch.cuda.is_available() else \"cpu\")\n", + "def prepare_test(stucture_path, r_cut, n_gnn, n_trans, hypers_path = \"../default_hypers/default_hypers.yaml\"):\n", + " structure = ase.io.read(stucture_path, index=0)\n", + " hypers = load_hypers_from_file(hypers_path)\n", + " \n", + "\n", + " MLIP_SETTINGS = hypers.MLIP_SETTINGS\n", + " ARCHITECTURAL_HYPERS = hypers.ARCHITECTURAL_HYPERS\n", + " FITTING_SCHEME = hypers.FITTING_SCHEME\n", + "\n", + " ARCHITECTURAL_HYPERS.D_OUTPUT = 1 # energy is a single scalar\n", + " ARCHITECTURAL_HYPERS.TARGET_TYPE = \"structural\" # energy is structural property\n", + " ARCHITECTURAL_HYPERS.TARGET_AGGREGATION = (\n", + " \"sum\" # energy is a sum of atomic energies\n", + " )\n", + " ARCHITECTURAL_HYPERS.R_CUT = r_cut\n", + " ARCHITECTURAL_HYPERS.N_TRANS_LAYERS = n_trans\n", + " ARCHITECTURAL_HYPERS.N_GNN_LAYERS = n_gnn\n", + " all_species = get_all_species([structure])\n", + "\n", + "\n", + " model = PET(ARCHITECTURAL_HYPERS, 0.0, len(all_species)).to(device)\n", + " model = PETUtilityWrapper(model, FITTING_SCHEME.GLOBAL_AUG)\n", + "\n", + " model = PETMLIPWrapper(\n", + " model, MLIP_SETTINGS.USE_ENERGIES, MLIP_SETTINGS.USE_FORCES\n", + " )\n", + " return model, structure, all_species, ARCHITECTURAL_HYPERS\n", + "\n", + "\n", + "\n" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [], + "source": [ + "def get_predictions_old_python(model, structure, all_species, ARCHITECTURAL_HYPERS):\n", + " \n", + " molecule = Molecule(\n", + " structure,\n", + " ARCHITECTURAL_HYPERS.R_CUT,\n", + " ARCHITECTURAL_HYPERS.USE_ADDITIONAL_SCALAR_ATTRIBUTES,\n", + " ARCHITECTURAL_HYPERS.USE_LONG_RANGE,\n", + " ARCHITECTURAL_HYPERS.K_CUT,\n", + " )\n", + " if ARCHITECTURAL_HYPERS.USE_LONG_RANGE:\n", + " raise NotImplementedError(\n", + " \"Long range interactions are not supported in the SingleStructCalculator\"\n", + " )\n", + "\n", + " graph = molecule.get_graph(\n", + " molecule.get_max_num(), all_species, None\n", + " )\n", + " graph.batch = torch.zeros(\n", + " graph.num_nodes, dtype=torch.long, device=graph.x.device\n", + " )\n", + " graph = graph.to(device)\n", + " prediction_energy, prediction_forces = model(\n", + " graph, augmentation=False, create_graph=False\n", + " )\n", + "\n", + " return prediction_energy, prediction_forces, graph\n", + "\n", + "def get_predictions_cpp(model, structure, all_species, ARCHITECTURAL_HYPERS):\n", + " \n", + " molecule = MoleculeCPP(\n", + " structure,\n", + " ARCHITECTURAL_HYPERS.R_CUT,\n", + " ARCHITECTURAL_HYPERS.USE_ADDITIONAL_SCALAR_ATTRIBUTES,\n", + " ARCHITECTURAL_HYPERS.USE_LONG_RANGE,\n", + " ARCHITECTURAL_HYPERS.K_CUT,\n", + " )\n", + " if ARCHITECTURAL_HYPERS.USE_LONG_RANGE:\n", + " raise NotImplementedError(\n", + " \"Long range interactions are not supported in the SingleStructCalculator\"\n", + " )\n", + "\n", + " graph = molecule.get_graph(\n", + " molecule.get_max_num(), all_species, None\n", + " )\n", + " graph.batch = torch.zeros(\n", + " graph.num_nodes, dtype=torch.long, device=graph.x.device\n", + " )\n", + " graph = graph.to(device)\n", + " prediction_energy, prediction_forces = model(\n", + " graph, augmentation=False, create_graph=False\n", + " )\n", + "\n", + " return prediction_energy, prediction_forces, graph" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Energy difference: tensor([0.], device='cuda:0', grad_fn=)\n", + "Forces difference: tensor(0., device='cuda:0')\n" + ] + } + ], + "source": [ + "model, structure, all_species, ARCHITECTURAL_HYPERS = prepare_test(\"../example/methane_train.xyz\", 10.0, 2, 2)\n", + "python_energy, python_forces, python_graph = get_predictions_old_python(model, structure, all_species, ARCHITECTURAL_HYPERS)\n", + "cpp_energy, cpp_forces, cpp_graph = get_predictions_cpp(model, structure, all_species, ARCHITECTURAL_HYPERS)\n", + "\n", + "print(\"Energy difference: \", torch.abs(python_energy - cpp_energy))\n", + "print(\"Forces difference: \", torch.abs(python_forces - cpp_forces).max())" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Energy difference: tensor([1.1369e-13], device='cuda:0', grad_fn=)\n", + "Forces difference: tensor(4.3097e-14, device='cuda:0')\n", + "Forces spread: tensor(1.2995, device='cuda:0')\n" + ] + } + ], + "source": [ + "model, structure, all_species, ARCHITECTURAL_HYPERS = prepare_test(\"bulk.xyz\", 4.0, 2, 2)\n", + "python_energy, python_forces, python_graph = get_predictions_old_python(model, structure, all_species, ARCHITECTURAL_HYPERS)\n", + "cpp_energy, cpp_forces, cpp_graph = get_predictions_cpp(model, structure, all_species, ARCHITECTURAL_HYPERS)\n", + "\n", + "print(\"Energy difference: \", torch.abs(python_energy - cpp_energy))\n", + "print(\"Forces difference: \", torch.abs(python_forces - cpp_forces).max())\n", + "\n", + "print(\"Forces spread: \", torch.abs(python_forces).max())" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.10.12" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} From 531b1207d0698eae19da5faab64c63d5421c7ef9 Mon Sep 17 00:00:00 2001 From: serfg Date: Fri, 24 May 2024 14:46:49 +0200 Subject: [PATCH 09/41] gpu handling --- src/neighbors_convert.cpp | 44 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/src/neighbors_convert.cpp b/src/neighbors_convert.cpp index 070eca0..4af32cb 100644 --- a/src/neighbors_convert.cpp +++ b/src/neighbors_convert.cpp @@ -5,7 +5,7 @@ // Template function to process the neighbors template -std::vector> process_neighbors(at::Tensor i_list, at::Tensor j_list, at::Tensor S_list, at::Tensor D_list, +std::vector> process_neighbors_cpu(at::Tensor i_list, at::Tensor j_list, at::Tensor S_list, at::Tensor D_list, int64_t max_size, int64_t n_atoms, at::Tensor species, c10::optional scalar_attributes, at::Tensor all_species) { @@ -190,6 +190,48 @@ std::vector> process_neighbors(at::Tensor i_list, at:: } } + +template +std::vector> process_neighbors(at::Tensor i_list, at::Tensor j_list, at::Tensor S_list, at::Tensor D_list, + int64_t max_size, int64_t n_atoms, at::Tensor species, + c10::optional scalar_attributes, + at::Tensor all_species) { + // Ensure all tensors are on the same device + auto device = i_list.device(); + TORCH_CHECK(j_list.device() == device, "j_list must be on the same device as i_list"); + TORCH_CHECK(S_list.device() == device, "S_list must be on the same device as i_list"); + TORCH_CHECK(D_list.device() == device, "D_list must be on the same device as i_list"); + TORCH_CHECK(species.device() == device, "species must be on the same device as i_list"); + TORCH_CHECK(all_species.device() == device, "all_species must be on the same device as i_list"); + if (scalar_attributes.has_value()) { + TORCH_CHECK(scalar_attributes.value().device() == device, "scalar_attributes must be on the same device as i_list"); + } + + // Move all tensors to CPU + auto i_list_cpu = i_list.cpu(); + auto j_list_cpu = j_list.cpu(); + auto S_list_cpu = S_list.cpu(); + auto D_list_cpu = D_list.cpu(); + auto species_cpu = species.cpu(); + auto all_species_cpu = all_species.cpu(); + c10::optional scalar_attributes_cpu = c10::nullopt; + if (scalar_attributes.has_value()) { + scalar_attributes_cpu = scalar_attributes.value().cpu(); + } + + // Invoke the CPU version of the function + auto result = process_neighbors_cpu(i_list_cpu, j_list_cpu, S_list_cpu, D_list_cpu, max_size, n_atoms, species_cpu, scalar_attributes_cpu, all_species_cpu); + + // Move the output tensors back to the initial device + for (auto& tensor_opt : result) { + if (tensor_opt.has_value()) { + tensor_opt = tensor_opt.value().to(device); + } + } + + return result; +} + // Dispatch function based on tensor types std::vector> process_dispatch(at::Tensor i_list, at::Tensor j_list, at::Tensor S_list, at::Tensor D_list, int64_t max_size, int64_t n_atoms, at::Tensor species, c10::optional scalar_attributes, From f608f5e420cf465c0faaac3c286ba8423a478825 Mon Sep 17 00:00:00 2001 From: serfg Date: Tue, 28 May 2024 16:16:07 +0200 Subject: [PATCH 10/41] backward for cpp operation --- src/neighbors_convert.cpp | 73 +++++++++++++++++++++++++++++++++++++-- src/neighbors_convert.py | 27 +++++++++++++++ 2 files changed, 98 insertions(+), 2 deletions(-) create mode 100644 src/neighbors_convert.py diff --git a/src/neighbors_convert.cpp b/src/neighbors_convert.cpp index 4af32cb..6748034 100644 --- a/src/neighbors_convert.cpp +++ b/src/neighbors_convert.cpp @@ -190,6 +190,72 @@ std::vector> process_neighbors_cpu(at::Tensor i_list, } } +// Template function for backward pass +template +at::Tensor process_neighbors_cpu_backward(at::Tensor grad_output, at::Tensor i_list, int64_t max_size, int64_t n_atoms) { + // Ensure the tensors are on the CPU and are contiguous + TORCH_CHECK(grad_output.device().is_cpu(), "grad_output must be on CPU"); + TORCH_CHECK(i_list.device().is_cpu(), "i_list must be on CPU"); + + TORCH_CHECK(grad_output.is_contiguous(), "grad_output must be contiguous"); + TORCH_CHECK(i_list.is_contiguous(), "i_list must be contiguous"); + + // Initialize gradient tensor for D_list with zeros + auto options_float = torch::TensorOptions().dtype(grad_output.dtype()).device(torch::kCPU); + at::Tensor grad_D_list = torch::zeros({n_atoms, max_size, 3}, options_float); + + int_t* current_index = new int_t[n_atoms]; + std::fill(current_index, current_index + n_atoms, 0); // Fill the array with zeros + + float_t* grad_D_list_ptr = grad_D_list.data_ptr(); + float_t* grad_output_ptr = grad_output.data_ptr(); + int_t* i_list_ptr = i_list.data_ptr(); + int_t i, idx; + + for (int64_t k = 0; k < i_list.size(0); ++k) { + i = i_list_ptr[k]; + idx = current_index[i]; + grad_D_list_ptr[(i * max_size + idx) * 3 + 0] = grad_output_ptr[k * 3 + 0]; + grad_D_list_ptr[(i * max_size + idx) * 3 + 1] = grad_output_ptr[k * 3 + 1]; + grad_D_list_ptr[(i * max_size + idx) * 3 + 2] = grad_output_ptr[k * 3 + 2]; + current_index[i]++; + } + + delete[] current_index; + return grad_D_list; +} + +template +at::Tensor process_neighbors_backward(at::Tensor grad_output, at::Tensor i_list, int64_t max_size, int64_t n_atoms) { + // Ensure all tensors are on the same device + auto device = grad_output.device(); + TORCH_CHECK(i_list.device() == device, "i_list must be on the same device as grad_output"); + + // Move all tensors to CPU + auto grad_output_cpu = grad_output.cpu(); + auto i_list_cpu = i_list.cpu(); + + // Invoke the CPU version of the function + auto grad_D_list_cpu = process_neighbors_cpu_backward(grad_output_cpu, i_list_cpu, max_size, n_atoms); + + // Move the gradient tensor back to the initial device + return grad_D_list_cpu.to(device); +} + +// Dispatch function based on tensor types for backward +at::Tensor process_dispatch_backward(at::Tensor grad_output, at::Tensor i_list, int64_t max_size, int64_t n_atoms) { + if (i_list.scalar_type() == at::ScalarType::Int && grad_output.scalar_type() == at::ScalarType::Float) { + return process_neighbors_backward(grad_output, i_list, max_size, n_atoms); + } else if (i_list.scalar_type() == at::ScalarType::Int && grad_output.scalar_type() == at::ScalarType::Double) { + return process_neighbors_backward(grad_output, i_list, max_size, n_atoms); + } else if (i_list.scalar_type() == at::ScalarType::Long && grad_output.scalar_type() == at::ScalarType::Float) { + return process_neighbors_backward(grad_output, i_list, max_size, n_atoms); + } else if (i_list.scalar_type() == at::ScalarType::Long && grad_output.scalar_type() == at::ScalarType::Double) { + return process_neighbors_backward(grad_output, i_list, max_size, n_atoms); + } else { + throw std::runtime_error("Unsupported tensor types"); + } +} template std::vector> process_neighbors(at::Tensor i_list, at::Tensor j_list, at::Tensor S_list, at::Tensor D_list, @@ -253,9 +319,12 @@ std::vector> process_dispatch(at::Tensor i_list, at::T } } -// Register the function as a JIT operator -static auto registry = torch::RegisterOperators("neighbors_convert::process", &process_dispatch); +// Register the functions as JIT operators +static auto registry = torch::RegisterOperators() + .op("neighbors_convert::process", &process_dispatch) + .op("neighbors_convert::process_backward", &process_dispatch_backward); PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) { m.def("process", &process_dispatch, "Process neighbors and return tensors, including optional scalar attributes, count tensor, mask, and neighbor_species"); + m.def("process_backward", &process_dispatch_backward, "Backward pass for process neighbors to compute gradients w.r.t D_list"); } diff --git a/src/neighbors_convert.py b/src/neighbors_convert.py new file mode 100644 index 0000000..15eb709 --- /dev/null +++ b/src/neighbors_convert.py @@ -0,0 +1,27 @@ +import torch +from torch.autograd import Function + +class ProcessNeighborsFunction(Function): + @staticmethod + def forward(ctx, i_list, j_list, S_list, D_list, max_size, n_atoms, species, scalar_attributes, all_species): + outputs = torch.ops.neighbors_convert.process( + i_list, j_list, S_list, D_list, max_size, n_atoms, species, scalar_attributes, all_species + ) + ctx.save_for_backward(i_list) + ctx.max_size = max_size + ctx.n_atoms = n_atoms + return outputs + + @staticmethod + def backward(ctx, *grad_outputs): + grad_relative_positions = grad_outputs[1] # Assuming this is the gradient w.r.t relative_positions tensor + i_list, = ctx.saved_tensors + grad_D_list = torch.ops.neighbors_convert.process_backward( + grad_relative_positions, i_list, ctx.max_size, ctx.n_atoms + ) + # Return gradients for inputs + return None, None, None, grad_D_list, None, None, None, None, None + +# Utility function to use the custom autograd function +def process_neighbors(i_list, j_list, S_list, D_list, max_size, n_atoms, species, scalar_attributes, all_species): + return ProcessNeighborsFunction.apply(i_list, j_list, S_list, D_list, max_size, n_atoms, species, scalar_attributes, all_species) From 3fa13d3e1a82518bc3dc4cc9823ed98855b248ff Mon Sep 17 00:00:00 2001 From: serfg Date: Tue, 28 May 2024 20:12:32 +0200 Subject: [PATCH 11/41] fix backward --- src/neighbors_convert.cpp | 10 +++++----- src/neighbors_convert.py | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/neighbors_convert.cpp b/src/neighbors_convert.cpp index 6748034..1b5ab30 100644 --- a/src/neighbors_convert.cpp +++ b/src/neighbors_convert.cpp @@ -202,7 +202,7 @@ at::Tensor process_neighbors_cpu_backward(at::Tensor grad_output, at::Tensor i_l // Initialize gradient tensor for D_list with zeros auto options_float = torch::TensorOptions().dtype(grad_output.dtype()).device(torch::kCPU); - at::Tensor grad_D_list = torch::zeros({n_atoms, max_size, 3}, options_float); + at::Tensor grad_D_list = torch::zeros({i_list.size(0), 3}, options_float); int_t* current_index = new int_t[n_atoms]; std::fill(current_index, current_index + n_atoms, 0); // Fill the array with zeros @@ -215,9 +215,9 @@ at::Tensor process_neighbors_cpu_backward(at::Tensor grad_output, at::Tensor i_l for (int64_t k = 0; k < i_list.size(0); ++k) { i = i_list_ptr[k]; idx = current_index[i]; - grad_D_list_ptr[(i * max_size + idx) * 3 + 0] = grad_output_ptr[k * 3 + 0]; - grad_D_list_ptr[(i * max_size + idx) * 3 + 1] = grad_output_ptr[k * 3 + 1]; - grad_D_list_ptr[(i * max_size + idx) * 3 + 2] = grad_output_ptr[k * 3 + 2]; + grad_D_list_ptr[k * 3 + 0] = grad_output_ptr[(i * max_size + idx) * 3 + 0]; + grad_D_list_ptr[k * 3 + 1] = grad_output_ptr[(i * max_size + idx) * 3 + 1]; + grad_D_list_ptr[k * 3 + 2] = grad_output_ptr[(i * max_size + idx) * 3 + 2]; current_index[i]++; } @@ -327,4 +327,4 @@ static auto registry = torch::RegisterOperators() PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) { m.def("process", &process_dispatch, "Process neighbors and return tensors, including optional scalar attributes, count tensor, mask, and neighbor_species"); m.def("process_backward", &process_dispatch_backward, "Backward pass for process neighbors to compute gradients w.r.t D_list"); -} +} \ No newline at end of file diff --git a/src/neighbors_convert.py b/src/neighbors_convert.py index 15eb709..5c78e91 100644 --- a/src/neighbors_convert.py +++ b/src/neighbors_convert.py @@ -10,7 +10,7 @@ def forward(ctx, i_list, j_list, S_list, D_list, max_size, n_atoms, species, sca ctx.save_for_backward(i_list) ctx.max_size = max_size ctx.n_atoms = n_atoms - return outputs + return tuple(outputs) @staticmethod def backward(ctx, *grad_outputs): @@ -24,4 +24,4 @@ def backward(ctx, *grad_outputs): # Utility function to use the custom autograd function def process_neighbors(i_list, j_list, S_list, D_list, max_size, n_atoms, species, scalar_attributes, all_species): - return ProcessNeighborsFunction.apply(i_list, j_list, S_list, D_list, max_size, n_atoms, species, scalar_attributes, all_species) + return ProcessNeighborsFunction.apply(i_list, j_list, S_list, D_list, max_size, n_atoms, species, scalar_attributes, all_species) \ No newline at end of file From 100eb59be6a4eb6050a9193f8d9ba6fdaebf51b9 Mon Sep 17 00:00:00 2001 From: spozdn Date: Wed, 29 May 2024 17:24:11 +0200 Subject: [PATCH 12/41] fix --- src/molecule.py | 2 +- src/neighbors_convert.cpp | 116 +++++++++++++++++++------------------- src/neighbors_convert.py | 27 --------- 3 files changed, 59 insertions(+), 86 deletions(-) delete mode 100644 src/neighbors_convert.py diff --git a/src/molecule.py b/src/molecule.py index 78b4fcd..befe918 100644 --- a/src/molecule.py +++ b/src/molecule.py @@ -236,7 +236,7 @@ def get_graph(self, max_num, all_species, max_num_k): all_species = torch.tensor(all_species, dtype=torch.int64).contiguous() # torch.ops.my_extension.process(i_list, j_list, S_list, D_list, max_size, n_atoms, species, None) - neighbors_index, relative_positions, _, nums, mask, neighbor_species, neighbors_pos, species_mapped = torch.ops.neighbors_convert.process(self.i_list, self.j_list, self.S_list, self.D_list, max_num, n_atoms, self.species, None, all_species) + neighbors_index, relative_positions, nums, mask, neighbor_species, neighbors_pos, species_mapped = torch.ops.neighbors_convert.process(self.i_list, self.j_list, self.S_list, self.D_list, max_num, n_atoms, self.species, all_species) kwargs = { "central_species": species_mapped, diff --git a/src/neighbors_convert.cpp b/src/neighbors_convert.cpp index 1b5ab30..92e4ea3 100644 --- a/src/neighbors_convert.cpp +++ b/src/neighbors_convert.cpp @@ -2,12 +2,13 @@ #include #include // For std::fill #include // For c10::optional +#include +#include // Template function to process the neighbors template -std::vector> process_neighbors_cpu(at::Tensor i_list, at::Tensor j_list, at::Tensor S_list, at::Tensor D_list, +std::vector process_neighbors_cpu(at::Tensor i_list, at::Tensor j_list, at::Tensor S_list, at::Tensor D_list, int64_t max_size, int64_t n_atoms, at::Tensor species, - c10::optional scalar_attributes, at::Tensor all_species) { // Ensure the tensors are on the CPU and are contiguous TORCH_CHECK(i_list.device().is_cpu(), "i_list must be on CPU"); @@ -41,18 +42,8 @@ std::vector> process_neighbors_cpu(at::Tensor i_list, at::Tensor mask = torch::ones({n_atoms, max_size}, options_bool); // Tensor to store the mask at::Tensor neighbor_species = all_species.size(0) * torch::ones({n_atoms, max_size}, options_int); - c10::optional neighbor_scalar_attributes; int64_t scalar_attr_dim = 0; - if (scalar_attributes.has_value()) { - TORCH_CHECK(scalar_attributes->device().is_cpu(), "scalar_attributes must be on CPU"); - TORCH_CHECK(scalar_attributes->is_contiguous(), "scalar_attributes must be contiguous"); - TORCH_CHECK(scalar_attributes->size(0) == D_list.size(0), "scalar_attributes must have the same size as D_list in the first dimension"); - - scalar_attr_dim = scalar_attributes->size(1); - neighbor_scalar_attributes = torch::zeros({n_atoms, max_size, scalar_attr_dim}, options_float); - } - // Temporary array to track the current population index int_t* current_index = new int_t[n_atoms]; std::fill(current_index, current_index + n_atoms, 0); // Fill the array with zeros @@ -71,13 +62,6 @@ std::vector> process_neighbors_cpu(at::Tensor i_list, int_t* nums_ptr = nums.data_ptr(); bool* mask_ptr = mask.data_ptr(); int_t* neighbor_species_ptr = neighbor_species.data_ptr(); - - float_t* scalar_attributes_ptr = nullptr; - float_t* neighbor_scalar_attributes_ptr = nullptr; - if (scalar_attributes.has_value()) { - scalar_attributes_ptr = scalar_attributes->data_ptr(); - neighbor_scalar_attributes_ptr = neighbor_scalar_attributes->data_ptr(); - } int64_t all_species_size = all_species.size(0); @@ -126,12 +110,6 @@ std::vector> process_neighbors_cpu(at::Tensor i_list, mask_ptr[shift_i + idx] = false; - if (scalar_attributes.has_value()) { - for (int64_t d = 0; d < scalar_attr_dim; ++d) { - neighbor_scalar_attributes_ptr[(shift_i + idx) * scalar_attr_dim + d] = scalar_attributes_ptr[k * scalar_attr_dim + d]; - } - } - current_index[i]++; } } @@ -182,12 +160,8 @@ std::vector> process_neighbors_cpu(at::Tensor i_list, }*/ delete[] mapping; - // Return the results as a vector of tensors - if (scalar_attributes.has_value()) { - return {neighbors_index, relative_positions, neighbor_scalar_attributes, nums, mask, neighbor_species, neighbors_pos, species_mapped}; - } else { - return {neighbors_index, relative_positions, c10::nullopt, nums, mask, neighbor_species, neighbors_pos, species_mapped}; - } + + return {neighbors_index, relative_positions, nums, mask, neighbor_species, neighbors_pos, species_mapped}; } // Template function for backward pass @@ -197,8 +171,11 @@ at::Tensor process_neighbors_cpu_backward(at::Tensor grad_output, at::Tensor i_l TORCH_CHECK(grad_output.device().is_cpu(), "grad_output must be on CPU"); TORCH_CHECK(i_list.device().is_cpu(), "i_list must be on CPU"); - TORCH_CHECK(grad_output.is_contiguous(), "grad_output must be contiguous"); - TORCH_CHECK(i_list.is_contiguous(), "i_list must be contiguous"); + grad_output = grad_output.contiguous(); + i_list = i_list.contiguous(); + + // TORCH_CHECK(grad_output.is_contiguous(), "grad_output must be contiguous"); + // TORCH_CHECK(i_list.is_contiguous(), "i_list must be contiguous"); // Initialize gradient tensor for D_list with zeros auto options_float = torch::TensorOptions().dtype(grad_output.dtype()).device(torch::kCPU); @@ -258,9 +235,8 @@ at::Tensor process_dispatch_backward(at::Tensor grad_output, at::Tensor i_list, } template -std::vector> process_neighbors(at::Tensor i_list, at::Tensor j_list, at::Tensor S_list, at::Tensor D_list, +std::vector process_neighbors(at::Tensor i_list, at::Tensor j_list, at::Tensor S_list, at::Tensor D_list, int64_t max_size, int64_t n_atoms, at::Tensor species, - c10::optional scalar_attributes, at::Tensor all_species) { // Ensure all tensors are on the same device auto device = i_list.device(); @@ -269,10 +245,7 @@ std::vector> process_neighbors(at::Tensor i_list, at:: TORCH_CHECK(D_list.device() == device, "D_list must be on the same device as i_list"); TORCH_CHECK(species.device() == device, "species must be on the same device as i_list"); TORCH_CHECK(all_species.device() == device, "all_species must be on the same device as i_list"); - if (scalar_attributes.has_value()) { - TORCH_CHECK(scalar_attributes.value().device() == device, "scalar_attributes must be on the same device as i_list"); - } - + // Move all tensors to CPU auto i_list_cpu = i_list.cpu(); auto j_list_cpu = j_list.cpu(); @@ -280,51 +253,78 @@ std::vector> process_neighbors(at::Tensor i_list, at:: auto D_list_cpu = D_list.cpu(); auto species_cpu = species.cpu(); auto all_species_cpu = all_species.cpu(); - c10::optional scalar_attributes_cpu = c10::nullopt; - if (scalar_attributes.has_value()) { - scalar_attributes_cpu = scalar_attributes.value().cpu(); - } // Invoke the CPU version of the function - auto result = process_neighbors_cpu(i_list_cpu, j_list_cpu, S_list_cpu, D_list_cpu, max_size, n_atoms, species_cpu, scalar_attributes_cpu, all_species_cpu); + auto result = process_neighbors_cpu(i_list_cpu, j_list_cpu, S_list_cpu, D_list_cpu, max_size, n_atoms, species_cpu, all_species_cpu); // Move the output tensors back to the initial device for (auto& tensor_opt : result) { - if (tensor_opt.has_value()) { - tensor_opt = tensor_opt.value().to(device); - } + tensor_opt = tensor_opt.to(device); } return result; } // Dispatch function based on tensor types -std::vector> process_dispatch(at::Tensor i_list, at::Tensor j_list, at::Tensor S_list, at::Tensor D_list, - int64_t max_size, int64_t n_atoms, at::Tensor species, c10::optional scalar_attributes, +std::vector process_dispatch(at::Tensor i_list, at::Tensor j_list, at::Tensor S_list, at::Tensor D_list, + int64_t max_size, int64_t n_atoms, at::Tensor species, at::Tensor all_species) { if (i_list.scalar_type() == at::ScalarType::Int && j_list.scalar_type() == at::ScalarType::Int && S_list.scalar_type() == at::ScalarType::Int && D_list.scalar_type() == at::ScalarType::Float) { - return process_neighbors(i_list, j_list, S_list, D_list, max_size, n_atoms, species, scalar_attributes, all_species); + return process_neighbors(i_list, j_list, S_list, D_list, max_size, n_atoms, species, all_species); } else if (i_list.scalar_type() == at::ScalarType::Int && j_list.scalar_type() == at::ScalarType::Int && S_list.scalar_type() == at::ScalarType::Int && D_list.scalar_type() == at::ScalarType::Double) { - return process_neighbors(i_list, j_list, S_list, D_list, max_size, n_atoms, species, scalar_attributes, all_species); + return process_neighbors(i_list, j_list, S_list, D_list, max_size, n_atoms, species, all_species); } else if (i_list.scalar_type() == at::ScalarType::Long && j_list.scalar_type() == at::ScalarType::Long && S_list.scalar_type() == at::ScalarType::Long && D_list.scalar_type() == at::ScalarType::Float) { - return process_neighbors(i_list, j_list, S_list, D_list, max_size, n_atoms, species, scalar_attributes, all_species); + return process_neighbors(i_list, j_list, S_list, D_list, max_size, n_atoms, species, all_species); } else if (i_list.scalar_type() == at::ScalarType::Long && j_list.scalar_type() == at::ScalarType::Long && S_list.scalar_type() == at::ScalarType::Long && D_list.scalar_type() == at::ScalarType::Double) { - return process_neighbors(i_list, j_list, S_list, D_list, max_size, n_atoms, species, scalar_attributes, all_species); + return process_neighbors(i_list, j_list, S_list, D_list, max_size, n_atoms, species, all_species); } else { throw std::runtime_error("Unsupported tensor types"); } } -// Register the functions as JIT operators +class ProcessNeighborsFunction : public torch::autograd::Function { +public: + static std::vector forward(torch::autograd::AutogradContext *ctx, at::Tensor i_list, at::Tensor j_list, + at::Tensor S_list, at::Tensor D_list, int64_t max_size, int64_t n_atoms, + at::Tensor species, at::Tensor all_species) { + auto outputs = process_dispatch(i_list, j_list, S_list, D_list, max_size, n_atoms, species, all_species); + ctx->save_for_backward({i_list}); + ctx->saved_data["max_size"] = max_size; + ctx->saved_data["n_atoms"] = n_atoms; + return outputs; + } + + static std::vector backward(torch::autograd::AutogradContext *ctx, std::vector grad_outputs) { + auto i_list = ctx->get_saved_variables()[0]; + auto max_size = ctx->saved_data["max_size"].toInt(); + auto n_atoms = ctx->saved_data["n_atoms"].toInt(); + + auto grad_relative_positions = grad_outputs[1]; // Assuming this is the gradient w.r.t relative_positions tensor + auto grad_D_list = process_dispatch_backward(grad_relative_positions, i_list, max_size, n_atoms); + + return {at::Tensor(), at::Tensor(), at::Tensor(), grad_D_list, at::Tensor(), at::Tensor(), at::Tensor(), at::Tensor()}; + } +}; + +// Wrapper function to call apply +std::vector process_neighbors_apply(at::Tensor i_list, at::Tensor j_list, at::Tensor S_list, at::Tensor D_list, + int64_t max_size, int64_t n_atoms, at::Tensor species, at::Tensor all_species) { + return ProcessNeighborsFunction::apply(i_list, j_list, S_list, D_list, max_size, n_atoms, species, all_species); +} + static auto registry = torch::RegisterOperators() - .op("neighbors_convert::process", &process_dispatch) - .op("neighbors_convert::process_backward", &process_dispatch_backward); + .op("neighbors_convert::process(Tensor i_list, Tensor j_list, Tensor S_list, Tensor D_list, int max_size, int n_atoms, Tensor species, Tensor all_species) -> Tensor[]", &process_neighbors_apply); + +PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) { + m.def("process_neighbors", &process_neighbors_apply, "Process neighbors and return tensors, including count tensor, mask, and neighbor_species"); + +/*static auto registry = torch::RegisterOperators() + .op("neighbors_convert::process(Tensor i_list, Tensor j_list, Tensor S_list, Tensor D_list, int max_size, int n_atoms, Tensor species, Tensor all_species) -> Tensor[]", &process_neighbors_apply); PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) { - m.def("process", &process_dispatch, "Process neighbors and return tensors, including optional scalar attributes, count tensor, mask, and neighbor_species"); - m.def("process_backward", &process_dispatch_backward, "Backward pass for process neighbors to compute gradients w.r.t D_list"); + m.def("process_neighbors(Tensor i_list, Tensor j_list, Tensor S_list, Tensor D_list, int max_size, int n_atoms, Tensor species, Tensor all_species) -> Tensor[]", &process_neighbors_apply, "Process neighbors and return tensors, including count tensor, mask, and neighbor_species");*/ } \ No newline at end of file diff --git a/src/neighbors_convert.py b/src/neighbors_convert.py deleted file mode 100644 index 5c78e91..0000000 --- a/src/neighbors_convert.py +++ /dev/null @@ -1,27 +0,0 @@ -import torch -from torch.autograd import Function - -class ProcessNeighborsFunction(Function): - @staticmethod - def forward(ctx, i_list, j_list, S_list, D_list, max_size, n_atoms, species, scalar_attributes, all_species): - outputs = torch.ops.neighbors_convert.process( - i_list, j_list, S_list, D_list, max_size, n_atoms, species, scalar_attributes, all_species - ) - ctx.save_for_backward(i_list) - ctx.max_size = max_size - ctx.n_atoms = n_atoms - return tuple(outputs) - - @staticmethod - def backward(ctx, *grad_outputs): - grad_relative_positions = grad_outputs[1] # Assuming this is the gradient w.r.t relative_positions tensor - i_list, = ctx.saved_tensors - grad_D_list = torch.ops.neighbors_convert.process_backward( - grad_relative_positions, i_list, ctx.max_size, ctx.n_atoms - ) - # Return gradients for inputs - return None, None, None, grad_D_list, None, None, None, None, None - -# Utility function to use the custom autograd function -def process_neighbors(i_list, j_list, S_list, D_list, max_size, n_atoms, species, scalar_attributes, all_species): - return ProcessNeighborsFunction.apply(i_list, j_list, S_list, D_list, max_size, n_atoms, species, scalar_attributes, all_species) \ No newline at end of file From bacece9a6ec64bb3a34e09ad54a2cba52227cbdd Mon Sep 17 00:00:00 2001 From: spozdn Date: Wed, 29 May 2024 19:35:24 +0200 Subject: [PATCH 13/41] better link --- setup.py | 2 +- src/molecule.py | 1 - src/neighbors_convert.cpp | 28 ++++++++++++++++++++++------ 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/setup.py b/setup.py index 5da33b9..8de8e99 100644 --- a/setup.py +++ b/setup.py @@ -25,6 +25,6 @@ ), ], cmdclass={ - "build_ext": BuildExtension + "build_ext": BuildExtension.with_options(no_python_abi_suffix=True) }, ) \ No newline at end of file diff --git a/src/molecule.py b/src/molecule.py index befe918..c7b68e3 100644 --- a/src/molecule.py +++ b/src/molecule.py @@ -3,7 +3,6 @@ import numpy as np from torch_geometric.data import Data from .long_range import get_reciprocal, get_all_k, get_volume -import neighbors_convert from matscipy.neighbours import neighbour_list as neighbor_list class Molecule: diff --git a/src/neighbors_convert.cpp b/src/neighbors_convert.cpp index 92e4ea3..3fa4fa7 100644 --- a/src/neighbors_convert.cpp +++ b/src/neighbors_convert.cpp @@ -316,15 +316,31 @@ std::vector process_neighbors_apply(at::Tensor i_list, at::Tensor j_ return ProcessNeighborsFunction::apply(i_list, j_list, S_list, D_list, max_size, n_atoms, species, all_species); } -static auto registry = torch::RegisterOperators() - .op("neighbors_convert::process(Tensor i_list, Tensor j_list, Tensor S_list, Tensor D_list, int max_size, int n_atoms, Tensor species, Tensor all_species) -> Tensor[]", &process_neighbors_apply); +/*TORCH_LIBRARY(neighbors_convert, m) { + m.def( + "convert_neighbors(Tensor i_list, Tensor j_list, Tensor S_list, Tensor D_list, int max_size, int n_atoms, Tensor species, Tensor all_species) -> Tensor[]", + &process_neighbors_apply + ); +}*/ + +TORCH_LIBRARY(neighbors_convert, m) { + m.def( + "process", + &process_neighbors_apply + ); +} PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) { - m.def("process_neighbors", &process_neighbors_apply, "Process neighbors and return tensors, including count tensor, mask, and neighbor_species"); + m.def("process_neighbors(Tensor i_list, Tensor j_list, Tensor S_list, Tensor D_list, int max_size, int n_atoms, Tensor species, Tensor all_species) -> Tensor[]", &process_neighbors_apply, "Process neighbors and return tensors, including count tensor, mask, and neighbor_species"); +} + +/*static auto registry = torch::RegisterOperators() + .op("neighbors_convert::process(Tensor i_list, Tensor j_list, Tensor S_list, Tensor D_list, int max_size, int n_atoms, Tensor species, Tensor all_species) -> Tensor[]", &process_neighbors_apply);*/ + +/*PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) { + m.def("process_neighbors", &process_neighbors_apply, "Process neighbors and return tensors, including count tensor, mask, and neighbor_species");*/ /*static auto registry = torch::RegisterOperators() .op("neighbors_convert::process(Tensor i_list, Tensor j_list, Tensor S_list, Tensor D_list, int max_size, int n_atoms, Tensor species, Tensor all_species) -> Tensor[]", &process_neighbors_apply); -PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) { - m.def("process_neighbors(Tensor i_list, Tensor j_list, Tensor S_list, Tensor D_list, int max_size, int n_atoms, Tensor species, Tensor all_species) -> Tensor[]", &process_neighbors_apply, "Process neighbors and return tensors, including count tensor, mask, and neighbor_species");*/ -} \ No newline at end of file +*/ \ No newline at end of file From 4acc8c06229e1f5aaa5dc53154d6ea29382e3fda Mon Sep 17 00:00:00 2001 From: spozdn Date: Wed, 29 May 2024 20:57:10 +0200 Subject: [PATCH 14/41] proper install --- setup.py | 8 ++++++-- src/__init__.py | 14 ++++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 8de8e99..f78a8ed 100644 --- a/setup.py +++ b/setup.py @@ -20,11 +20,15 @@ install_requires=requirements, ext_modules=[ CppExtension( - name="neighbors_convert", + name="pet.neighbors_convert", # Ensure this matches the package structure sources=["src/neighbors_convert.cpp"], ), ], cmdclass={ "build_ext": BuildExtension.with_options(no_python_abi_suffix=True) }, -) \ No newline at end of file + package_data={ + 'pet': ['neighbors_convert.so'], # Ensure the shared object file is included + }, + include_package_data=True, +) diff --git a/src/__init__.py b/src/__init__.py index 6014564..aca95e8 100644 --- a/src/__init__.py +++ b/src/__init__.py @@ -1 +1,15 @@ from .single_struct_calculator import SingleStructCalculator + +import torch +import importlib.resources as pkg_resources + +def load_neighbors_convert(): + try: + # Locate the shared object file in the package + lib_path = pkg_resources.path(__name__, 'neighbors_convert.so') + # Load the shared object file + torch.ops.load_library(str(lib_path)) + except Exception as e: + print(f"Failed to load neighbors_convert.so: {e}") + +load_neighbors_convert() From 38e592dfccaa7a28dc9dc3ea34a1f983d48b0007 Mon Sep 17 00:00:00 2001 From: spozdn Date: Fri, 31 May 2024 16:00:27 +0200 Subject: [PATCH 15/41] tests cpp extension --- src/molecule.py | 5 +- tests_extensive/bulk.xyz | 194 +++++++++++++++++++++++ tests_extensive/bulk_small_unit_cell.xyz | 46 ++++++ tests_extensive/readme.txt | 1 + tests_extensive/test_cpp_extension.py | 139 ++++++++++++++++ 5 files changed, 384 insertions(+), 1 deletion(-) create mode 100644 tests_extensive/bulk.xyz create mode 100644 tests_extensive/bulk_small_unit_cell.xyz create mode 100644 tests_extensive/readme.txt create mode 100644 tests_extensive/test_cpp_extension.py diff --git a/src/molecule.py b/src/molecule.py index c7b68e3..36dffac 100644 --- a/src/molecule.py +++ b/src/molecule.py @@ -222,7 +222,10 @@ def is_3d_crystal(atoms): self.D_list = torch.tensor(D_list, dtype=torch.get_default_dtype()).contiguous() self.S_list = torch.tensor(S_list, dtype=torch.int64).contiguous() self.species = torch.tensor(atoms.get_atomic_numbers(), dtype=torch.int64).contiguous() - self.max_num = torch.max(torch.bincount(self.i_list)) + if len(self.i_list) == 0: + self.max_num = 0 + else: + self.max_num = torch.max(torch.bincount(self.i_list)) def get_num_k(self): raise NotImplementedError("Long range is not implemented in cpp") diff --git a/tests_extensive/bulk.xyz b/tests_extensive/bulk.xyz new file mode 100644 index 0000000..6a7e03a --- /dev/null +++ b/tests_extensive/bulk.xyz @@ -0,0 +1,194 @@ +192 +Lattice="11.74456431055329 0.0 0.0 -5.29177210903e-07 11.74456431055329 0.0 -5.29177210903e-07 -5.29177210903e-07 11.74456431055329" Properties=species:S:1:pos:R:3:forces:R:3 cutoff=-1.0 nneightol=1.2 energy=-30010.461001933934 pbc="T T T" +O 5.73416426 3.02709473 1.80318722 -0.80332611 -1.21376692 0.20230786 +H 5.56943139 2.10076473 1.36991809 0.50217575 1.53231646 1.34795286 +H 5.56662675 2.96533975 2.79956970 0.54751666 -0.28190205 -1.62430029 +O 1.78772996 10.85151956 1.15475463 -2.83291472 2.12456520 -0.92718649 +H 1.27361313 11.62702876 0.64046847 1.81789416 -2.16291579 1.69135469 +H 2.16766332 10.15956744 0.55739294 -0.13023518 0.45973042 -0.26124271 +O 7.52468827 9.97186828 10.15051851 -1.51298176 3.37316030 2.50257924 +H 8.17832796 9.32362620 10.34398569 0.48150767 -0.47552780 0.31697757 +H 7.43679193 10.62175081 11.03466779 1.05936697 -2.82762853 -2.99742426 +O 7.91178140 4.58707211 0.75474958 1.34499609 1.23814613 -2.36786880 +H 8.06085062 4.79654691 1.63976672 0.38014497 0.68880399 2.57828797 +H 7.13320297 4.09945648 0.81464715 -2.16483898 -1.83566563 0.07202743 +O 8.92351531 5.17808368 9.14508181 2.09709552 -3.02514590 -0.30432053 +H 8.62775816 5.97546907 9.42279401 -2.76871939 4.09653535 0.85838888 +H 9.79237137 5.33770469 9.55709918 0.94460315 -1.16752304 -0.52726150 +O 11.39392620 4.75242940 10.31763267 -1.23014486 0.11996567 -0.73341779 +H 11.04689178 4.60206370 11.18738833 -0.18260446 -0.43417416 1.22912156 +H 0.40332564 5.30748867 10.49062070 1.23808957 1.01266029 -0.11816898 +O 0.06869249 6.49660278 7.03350598 -8.74972508 3.31707423 -1.29926643 +H 11.62972756 7.37731241 6.49459191 0.80802095 -2.94173414 0.93328515 +H 0.92074189 6.41346904 7.01763066 7.99459174 -0.50270591 0.52857277 +O 2.58803640 5.05946331 5.42406641 -2.78970988 -0.38920966 -3.53642028 +H 2.09149884 4.27517506 5.74982790 0.69823994 0.18291556 0.51624689 +H 2.05534545 5.27435689 4.54993445 1.81884547 -0.35324094 2.29502427 +O 3.93554913 4.81396213 0.78823062 -4.93885484 -11.15967257 12.97271248 +H 4.29762276 5.26709128 0.27274428 7.51580070 11.72099606 -13.81315506 +H 4.79081063 4.49826559 1.22479124 -1.65517925 -0.69692353 0.36172507 +O 4.09431817 7.33063898 3.19968059 -1.06004574 -1.11637349 -0.28933974 +H 3.38943825 6.58815044 3.16480781 1.14148290 1.68970918 -0.61438594 +H 4.19910055 7.70582563 2.28520416 0.06644145 -0.21912545 1.05279008 +O 4.01414782 0.34585435 10.69001467 0.27125870 -3.90565143 1.86140239 +H 3.97934383 11.01133108 10.83765511 -0.38882553 3.49365767 0.06856364 +H 3.76050260 0.40037812 9.77321516 -0.24997767 0.45197288 -1.37139619 +O 9.40067440 2.29813725 7.12410112 -2.25397402 -0.18400931 -3.24547412 +H 8.77407566 2.12047129 7.78176256 -1.42089509 -0.29561015 1.47685774 +H 10.18867218 2.35986048 7.56548783 3.33147756 0.45038600 1.81095218 +O 10.91142242 11.36201681 9.39247215 0.01736164 0.75490194 5.37813315 +H 10.21386102 0.09946732 9.94308104 1.27966947 -0.25601514 -1.75074206 +H 10.90565439 11.26390736 8.49001334 -1.04485051 0.02427020 -3.42446926 +O 9.59271281 7.85595320 8.22637725 1.68824880 -3.33631637 -2.48706005 +H 10.24471205 7.11245922 7.84028956 -2.08559754 2.31028120 1.60193682 +H 10.10252213 8.20510433 8.96706659 0.16744728 0.53774132 0.59653734 +O 8.17668751 11.46557679 0.59883281 -0.66836885 3.34592202 -5.23775086 +H 7.40086080 0.24360726 0.81692790 -0.70252854 0.12888586 -0.06194922 +H 8.35316811 11.04541009 1.33745836 1.62912882 -3.53077414 5.68080355 +O 0.94004098 10.15162978 3.54788449 -1.08457407 -1.07225848 -2.11326262 +H 0.69010529 9.19133189 3.77189578 0.19180130 1.74153750 -0.34616217 +H 0.93777081 10.30122818 2.50966526 1.29074064 -1.02193169 1.68592452 +O 2.27424490 5.50915811 2.47661814 3.42542057 -4.02492496 3.71742602 +H 2.87039478 5.20416153 1.76153568 0.28323491 -0.31793299 0.44400092 +H 1.75867813 6.03341397 2.01906506 -5.01572057 4.50292924 -3.15397366 +O 8.94351821 9.24398503 5.88873692 -1.92119599 -4.43389509 -2.57106317 +H 9.09221700 8.40449830 6.46427006 -0.54337204 2.43464552 -0.54531580 +H 8.36787924 8.80270415 5.00977887 2.04375025 1.37647669 3.10278297 +O 2.82171577 2.69312570 11.50923391 0.69614192 -0.37589905 1.50967018 +H 3.43897452 3.14968922 0.41529298 -1.06053939 -1.03034434 -1.56750974 +H 2.93838347 1.70842217 11.51627197 0.70775303 1.01310766 -0.29180954 +O 8.16112970 2.63468866 9.79782190 -1.27590023 2.29413467 1.11429604 +H 8.54928118 3.61930224 9.73373854 -1.52802272 -2.32642774 -0.06867111 +H 7.16627654 2.73929112 10.09193859 2.77315197 0.05309382 -1.14957673 +O 1.59972917 8.97754430 9.43268962 -4.27687261 0.84039630 2.26111141 +H 1.59251119 9.12142758 8.50784661 0.80233881 0.43452331 -2.11537093 +H 0.58284107 9.31288390 9.64240255 3.61139368 -1.36863482 0.04291019 +O 5.26826606 3.30655851 9.49391542 -0.84340449 0.50978314 1.64621124 +H 4.78704289 2.59503212 9.98054679 0.22770831 1.03334739 -0.67504858 +H 4.89323288 4.20901733 9.82787916 0.44176714 -1.60587061 -1.14998811 +O 7.36117251 0.04299829 7.68322976 -0.43534967 -0.03071647 3.23220208 +H 7.04043820 0.88966860 7.30592641 -0.03364444 -0.06154709 0.77135186 +H 7.21231496 0.07133097 8.74782847 0.53084562 -0.30424906 -4.25693627 +O 4.18004487 0.62351363 4.09110077 -1.56364280 2.67147508 0.69047006 +H 4.80862273 1.37200834 4.08969845 0.44022654 -0.29248317 0.30456530 +H 3.28940788 1.15635275 4.10035608 1.67807237 -2.07241806 -0.35558115 +O 2.70842422 6.37716749 7.53125007 2.06494643 5.11524802 -0.69604422 +H 2.64632527 5.94334801 6.65921894 0.39734926 -0.66881108 -0.10087985 +H 3.09797273 7.37493112 7.16849909 -1.55386232 -3.75355518 1.65329206 +O 6.41182859 2.43882960 7.01329141 -4.92870926 2.02800480 0.61801120 +H 5.72035273 2.64918283 6.21809682 2.70379386 -1.03493633 1.32465351 +H 5.74453613 2.77554505 7.76408804 2.33632649 -1.16785214 -1.14451680 +O 10.57301359 4.37816353 1.12879320 4.89504836 -1.30601815 2.06174798 +H 10.93983923 3.52935799 1.61142928 -2.07324081 1.97823337 -1.66711946 +H 9.71802197 4.32374295 0.82312457 -3.01427013 -1.27858446 -0.62062344 +O 4.08049606 10.52136590 2.32719437 0.42891316 2.23963240 1.86107843 +H 3.15932554 10.71626186 1.93731777 1.63434302 0.18014648 1.02641569 +H 4.27975774 11.25147169 3.16363304 -1.47402439 -2.26965261 -2.92434833 +O 1.84757461 2.91355447 6.97180392 -2.90159406 -1.25619014 -2.57119687 +H 1.40897666 2.99356607 7.80562845 -0.14525659 0.44582177 1.66832274 +H 0.95316987 2.61135724 6.50289999 2.62214073 0.34147968 0.65385239 +O 5.97425196 7.07160674 6.51708194 -1.32986257 4.64477707 0.74215954 +H 6.45172856 6.31562418 6.45929579 1.62818266 -4.29121937 -0.25735983 +H 5.04161946 6.94539798 6.38552849 -0.03046759 -0.33969019 -0.12541847 +O 3.26609762 9.55064322 11.51695990 -2.28802058 2.61571811 -1.59542165 +H 2.90240471 9.12894190 10.76187694 -0.52591939 -0.96484803 -1.23090590 +H 3.99413434 9.15122026 0.17271762 2.46309222 -2.04713382 1.18471344 +O 10.53697662 4.56069792 5.76512112 1.37467177 5.21414812 -0.75573497 +H 10.35298171 3.68800003 5.75575469 -0.26204901 -4.34917206 0.71721469 +H 11.27576093 4.91570703 6.31964592 -1.20071085 -0.75218685 -0.31628954 +O 4.63525899 10.81807556 6.19613596 6.71521024 -1.10373908 4.35700365 +H 4.35573171 11.34174933 5.54381921 -2.37777269 3.55238684 -4.56307766 +H 5.67410264 11.23263298 6.27461294 -3.69088709 -2.18111407 -0.04988097 +O 0.14165280 7.33720078 1.35500587 -5.25636565 -0.09894072 6.15964602 +H 0.43427986 7.46266870 0.56089609 3.84631548 0.76780374 -7.44962047 +H 10.92671564 7.65920512 1.13098929 2.25378890 -0.78840343 1.73881728 +O 10.27603934 2.10768108 2.86506067 1.27164762 -1.00033441 0.95626568 +H 11.01111940 2.17232008 3.54679438 -1.62994129 0.20511087 -0.66830200 +H 10.25354931 1.09798979 2.87938021 -0.22944278 0.78903592 -0.44897292 +O 5.69627517 0.40138197 0.90041090 2.59900079 0.43527099 4.94188874 +H 5.24481822 0.44575031 0.13631182 -2.71563637 0.20740533 -4.72132913 +H 5.15967360 11.54675258 1.48204016 -0.21494998 -0.23595898 -0.06999420 +O 6.15025630 7.53315510 9.28182120 3.37681641 -8.71825476 -0.73325838 +H 5.88831358 8.32623299 9.17037648 -3.12216395 9.38792459 -0.76454872 +H 6.54803881 7.35413445 8.40211700 -0.57476523 -0.20697287 0.55008777 +O 11.51516070 7.99909564 4.70859766 -1.85752516 -3.33904174 -2.28857594 +H 10.55803788 8.11683757 4.90491182 0.94879405 0.68445368 -0.18751835 +H 11.33058369 7.11780391 3.97989418 0.73715617 2.85156037 2.24620414 +O 4.32177970 9.39263090 8.51430257 10.95624679 -10.19283450 -11.15278201 +H 4.15839623 9.72273165 7.58681367 0.74426271 -1.00007216 1.44278033 +H 3.83315863 9.85920645 8.89837939 -11.80157447 10.92359377 9.90425375 +O 7.32079629 7.68735734 4.30241710 11.26303096 2.57085748 -17.99639319 +H 7.49129719 6.77442082 3.96804590 0.55662866 -0.25286348 0.13183903 +H 6.92412505 7.59215836 4.94862185 -11.68489776 -2.23415081 18.08807877 +O 10.60936807 5.82587067 3.33454140 -3.62983878 8.74340016 19.17817558 +H 10.85887512 5.24453775 3.99905568 0.76538690 -2.26595537 2.00967797 +H 10.70514914 5.60689714 2.61041531 3.34908448 -6.50093440 -20.65116124 +O 8.16710940 1.89280867 4.64662571 -2.78388890 -0.72861497 -4.24536116 +H 8.53457006 2.07518431 5.44433390 2.39779131 1.05826653 3.94904653 +H 8.71888248 2.16570536 3.89810984 0.79682122 0.07677472 0.24100195 +O 7.35476947 9.37220466 2.30818103 -1.57494023 0.21925041 2.66969073 +H 7.02816129 10.06029379 3.00869524 1.12488899 -1.41697158 -1.75353428 +H 7.24983362 8.55541964 2.92457723 0.16987646 1.65735955 -1.30613127 +O 7.59850849 4.79108580 6.60704207 -0.18279832 -1.17206875 0.89977338 +H 7.35064188 3.91050317 7.03265930 -0.45973248 0.75343126 -1.50952619 +H 8.26643596 4.99101424 7.26121093 0.89534594 0.76599882 -0.01246266 +O 10.40399439 11.10430751 6.79294202 2.81111175 -0.62073657 -1.02525355 +H 9.63001980 11.47674243 7.07319427 -3.06936890 2.63521222 1.66147846 +H 9.93990598 10.35631552 6.42130087 0.40481317 -1.41940385 -0.75827008 +O 3.49465984 8.56023515 5.57334730 4.08231201 1.30895435 -3.78476839 +H 4.21974904 9.43364214 5.51672534 -2.68191376 -2.97917456 0.99539275 +H 3.65141801 8.24495137 4.57004848 -0.61115664 0.20748555 2.30058300 +O 10.64836843 8.95923477 10.32953916 -2.39696341 0.22372670 2.32516276 +H 10.35155293 9.90349858 10.16999223 0.96258032 -1.01845041 -0.24083020 +H 10.06870771 8.69586327 11.18304908 2.34525851 0.93941467 -2.29535337 +O 11.45213569 2.78041878 8.81582775 0.13917079 0.55494715 -5.11691409 +H 11.40535643 3.52377517 9.35537683 -0.02186930 2.41838071 2.07431039 +H 11.49658658 2.03804136 9.30441706 0.27983642 -3.85064522 2.72189444 +O 5.72252236 2.78391664 4.58865435 2.00202122 0.11734314 -0.87511135 +H 5.58377209 3.78623649 4.59301477 0.76167423 -0.88388396 -0.15393664 +H 6.80527185 2.57167953 4.53785334 -2.41439550 0.27077174 0.34678438 +O 3.49103498 0.47779834 8.23103401 1.10622791 -0.34709034 -2.37964446 +H 4.13096898 -0.02426013 7.57813517 -2.14205385 1.52066936 1.47370043 +H 2.91503088 1.07665866 7.70577271 0.67948116 -0.68213454 0.43600941 +O 4.20392664 5.85068908 9.77697231 -3.57610785 -0.45028264 -2.74477212 +H 3.54920743 6.04214539 8.83884695 1.55419656 -1.34864705 2.76174141 +H 4.72216576 6.61011129 9.59234238 1.78331795 1.13481345 0.09583637 +O 1.45781442 6.56317328 10.70033363 2.20226397 0.63186945 -0.26552977 +H 2.44013666 6.43590616 10.96735645 -2.54561438 0.39446191 -1.41605113 +H 1.41492990 7.19966763 9.90556238 0.60172068 -0.81249982 1.68488579 +O 7.98681873 5.23825113 3.84425018 3.13433042 -1.45225227 2.74527092 +H 9.01755010 5.30341401 3.65056603 -2.77410842 0.24112279 0.40572437 +H 8.05524134 4.91626267 4.90003810 -0.71303407 1.02736700 -3.07754501 +O 10.04494765 1.29552636 11.26724117 1.73607648 6.18659119 -7.11522264 +H 9.25266353 1.89236946 10.78695994 2.14781312 -1.66582877 1.26821777 +H 9.64420175 0.85762163 0.14036796 -3.95195702 -4.15348017 5.70846863 +O 1.65347770 0.84323330 3.65143388 1.42823302 18.52259540 -1.58570801 +H 1.30082871 1.18126641 2.78746213 0.06763907 -0.72436750 0.47733529 +H 1.56093519 11.80917156 3.71966599 -1.83660666 -17.48993707 1.07095236 +O 9.54164721 8.40767336 0.89833123 11.90981796 -1.53191537 -0.18516168 +H 9.00596112 8.92785456 1.26700370 -5.91832217 7.89755826 6.08966056 +H 8.94113691 7.98808875 0.49614438 -7.23364771 -6.68636245 -5.64295689 +O 5.09521982 8.37512896 0.81392218 4.28942474 -0.28139245 -0.78329207 +H 5.86312474 9.13169362 1.08096087 -2.32849491 -3.31964533 -0.61849971 +H 5.54545966 7.65089703 0.19278931 -0.77571760 2.85232141 2.11019787 +O 7.30703768 11.10160871 4.63375612 -0.88771490 -3.55613037 3.03358941 +H 7.63533922 10.74907085 5.55297398 -0.86701751 0.61395914 -2.54795409 +H 7.79843164 0.12321944 4.54375366 1.37331423 2.81788919 -0.43847047 +O 10.24857504 11.03916580 3.08253663 2.08557697 -0.83679675 1.42397013 +H 11.34180224 10.69340141 3.15046182 -3.53841546 0.81605308 0.79711433 +H 9.89365589 10.83162249 3.99602350 0.78547751 0.29104335 -1.77379458 +O 11.39159782 1.59286574 5.25942351 10.18846363 14.10111874 -9.35825404 +H 11.14796463 0.93367498 5.59827155 -6.44107909 -15.49337173 8.38653088 +H 0.63682773 1.17983234 4.75863136 -3.26021169 1.80275036 1.16045250 +O 7.51865565 7.18246937 11.26967539 2.85097416 -4.61661833 5.64131139 +H 7.03461725 7.13050416 10.50220968 -1.92595253 0.25077060 -3.35841759 +H 7.61030914 6.12718417 11.64062861 -0.25806174 3.92457476 -1.28720280 +O 1.75378853 9.68542466 6.78468686 -3.15344401 -0.46783763 0.39065667 +H 2.25816320 9.04199808 6.22910370 -0.18277466 0.61772838 -0.22779213 +H 0.77725020 9.49312166 6.62916167 2.16249413 0.72466575 0.07833126 +O 0.79380286 1.53270887 1.01780886 -0.44967946 0.87239112 -0.65009858 +H -0.05250973 1.65674801 0.40803849 2.46039770 0.24974010 1.38686909 +H 1.63024682 2.14220989 0.87222163 -2.73532074 -0.92775214 -1.05769575 +O 5.12024461 5.20156327 4.72964303 16.37304935 -0.02624223 3.03762604 +H 5.10836987 5.84100514 4.17073135 0.04007426 6.65016130 -5.75084043 +H 4.40036251 4.91235205 4.83038250 -16.81327383 -5.96156814 2.63335074 diff --git a/tests_extensive/bulk_small_unit_cell.xyz b/tests_extensive/bulk_small_unit_cell.xyz new file mode 100644 index 0000000..621602a --- /dev/null +++ b/tests_extensive/bulk_small_unit_cell.xyz @@ -0,0 +1,46 @@ +4 +Lattice="5 0 0 0 5 0 0 0 5" +Ga 0.028814 -0.044917 0.285450 +Ga 2.706516 2.379548 0.037928 +Ga 2.440308 0.049296 2.573117 +Ga -0.172131 2.582749 2.413305 +1 +Lattice="4 0 0 0 4 0 0 0 4" +N 1.768999 0.270888 1.705446 +2 +Lattice="4 0 0 0 4 0 0 0 4" +N 0.102312 -0.203830 0.256609 +Ga 2.233827 2.074812 2.061545 +4 +Lattice="5 0 0 0 5 0 0 0 5" +N -0.003714 -0.021372 0.191142 +Ga 2.245528 2.312564 0.005043 +Ga 2.733145 -0.138738 2.287960 +Ga 0.146076 2.257762 2.784547 +8 +Lattice="8 0 0 0 8 0 0 0 8" +N 0.295604 0.207245 0.262794 +Ga 1.857919 1.959535 1.919910 +N 3.752949 4.287860 -0.220102 +Ga 5.778130 5.751785 2.179060 +N 4.282583 0.068382 4.181446 +Ga 6.039969 1.705196 6.001205 +N 0.060032 4.273156 3.784467 +Ga 1.813436 5.838242 6.201837 +2 +Lattice="4 0 0 0 4 0 0 0 4" +Ga 0.295633 0.142376 -0.096602 +Ga 1.873007 2.083859 2.029016 +2 +Lattice="2 2 0 2 -2 0 0 0 4" +N -0.015750 -0.265133 0.017505 +N 2.280493 -0.126946 2.195588 +1 +Lattice="2 2 0 2 0 2 0 2 2" +N 0.254564 -0.039968 -0.290847 +4 +Lattice="4 0 0 0 4 0 0 0 4" +N 0.013750 0.199993 0.031294 +N 2.227114 2.069536 -0.026844 +N 2.064534 0.292672 1.906420 +N -0.131838 1.735252 2.009850 \ No newline at end of file diff --git a/tests_extensive/readme.txt b/tests_extensive/readme.txt new file mode 100644 index 0000000..ed4b2e6 --- /dev/null +++ b/tests_extensive/readme.txt @@ -0,0 +1 @@ +A bunch of tests that might be too heavy to be run on each commit to main \ No newline at end of file diff --git a/tests_extensive/test_cpp_extension.py b/tests_extensive/test_cpp_extension.py new file mode 100644 index 0000000..727ab4d --- /dev/null +++ b/tests_extensive/test_cpp_extension.py @@ -0,0 +1,139 @@ +import pytest +from itertools import product + +import ase.io +from pet.hypers import load_hypers_from_file +from pet.data_preparation import get_all_species +from pet.pet import PET, PETUtilityWrapper, PETMLIPWrapper +import torch +from pet.molecule import MoleculeCPP, Molecule +from matscipy.neighbours import neighbour_list as neighbor_list + +def prepare_test(stucture_path, r_cut, n_gnn, n_trans, structure_index, hypers_path = "../default_hypers/default_hypers.yaml"): + device = 'cpu' + structure = ase.io.read(stucture_path, index=structure_index) + hypers = load_hypers_from_file(hypers_path) + + + MLIP_SETTINGS = hypers.MLIP_SETTINGS + ARCHITECTURAL_HYPERS = hypers.ARCHITECTURAL_HYPERS + FITTING_SCHEME = hypers.FITTING_SCHEME + + ARCHITECTURAL_HYPERS.D_OUTPUT = 1 # energy is a single scalar + ARCHITECTURAL_HYPERS.TARGET_TYPE = "structural" # energy is structural property + ARCHITECTURAL_HYPERS.TARGET_AGGREGATION = ( + "sum" # energy is a sum of atomic energies + ) + ARCHITECTURAL_HYPERS.R_CUT = r_cut + ARCHITECTURAL_HYPERS.N_TRANS_LAYERS = n_trans + ARCHITECTURAL_HYPERS.N_GNN_LAYERS = n_gnn + all_species = get_all_species([structure]) + + + model = PET(ARCHITECTURAL_HYPERS, 0.0, len(all_species)).to(device) + model = PETUtilityWrapper(model, FITTING_SCHEME.GLOBAL_AUG) + + model = PETMLIPWrapper( + model, MLIP_SETTINGS.USE_ENERGIES, MLIP_SETTINGS.USE_FORCES + ) + return model, structure, all_species, ARCHITECTURAL_HYPERS + +def get_predictions_old_python(model, structure, all_species, ARCHITECTURAL_HYPERS): + device = 'cpu' + molecule = Molecule( + structure, + ARCHITECTURAL_HYPERS.R_CUT, + ARCHITECTURAL_HYPERS.USE_ADDITIONAL_SCALAR_ATTRIBUTES, + ARCHITECTURAL_HYPERS.USE_LONG_RANGE, + ARCHITECTURAL_HYPERS.K_CUT, + ) + if ARCHITECTURAL_HYPERS.USE_LONG_RANGE: + raise NotImplementedError( + "Long range interactions are not supported in the SingleStructCalculator" + ) + + graph = molecule.get_graph( + molecule.get_max_num(), all_species, None + ) + graph.batch = torch.zeros( + graph.num_nodes, dtype=torch.long, device=graph.x.device + ) + graph = graph.to(device) + prediction_energy, prediction_forces = model( + graph, augmentation=False, create_graph=False + ) + + return prediction_energy, prediction_forces, graph + +def get_predictions_cpp(model, structure, all_species, ARCHITECTURAL_HYPERS): + device = 'cpu' + molecule = MoleculeCPP( + structure, + ARCHITECTURAL_HYPERS.R_CUT, + ARCHITECTURAL_HYPERS.USE_ADDITIONAL_SCALAR_ATTRIBUTES, + ARCHITECTURAL_HYPERS.USE_LONG_RANGE, + ARCHITECTURAL_HYPERS.K_CUT, + ) + if ARCHITECTURAL_HYPERS.USE_LONG_RANGE: + raise NotImplementedError( + "Long range interactions are not supported in the SingleStructCalculator" + ) + + graph = molecule.get_graph( + molecule.get_max_num(), all_species, None + ) + graph.batch = torch.zeros( + graph.num_nodes, dtype=torch.long, device=graph.x.device + ) + graph = graph.to(device) + prediction_energy, prediction_forces = model( + graph, augmentation=False, create_graph=False + ) + + return prediction_energy, prediction_forces, graph + +class Float64DtypeContext: + def __enter__(self): + # Save the current default dtype + self.original_dtype = torch.get_default_dtype() + # Set the default dtype to float64 + torch.set_default_dtype(torch.float64) + return self + + def __exit__(self, exc_type, exc_value, traceback): + # Restore the original default dtype + torch.set_default_dtype(self.original_dtype) + + +def do_single_test(stucture_path, r_cut, n_gnn, n_trans, structure_index, epsilon): + model, structure, all_species, ARCHITECTURAL_HYPERS = prepare_test(stucture_path, r_cut, n_gnn, n_trans, structure_index) + python_energy, python_forces, python_graph = get_predictions_old_python(model, structure, all_species, ARCHITECTURAL_HYPERS) + cpp_energy, cpp_forces, cpp_graph = get_predictions_cpp(model, structure, all_species, ARCHITECTURAL_HYPERS) + # print(f"energy difference: {torch.abs(python_energy - cpp_energy)}") + # print(f"forces difference: {torch.abs(python_forces - cpp_forces).max()}") + assert torch.abs(python_energy - cpp_energy) < epsilon, f"Energy difference is {torch.abs(python_energy - cpp_energy)}" + assert torch.abs(python_forces - cpp_forces).max() < epsilon, f"Max force difference is {torch.abs(python_forces - cpp_forces).max()}" + + + +# Define the parameters for each case +case1_params = ("../example/methane_train.xyz", 0, [1.0, 2.0, 3.0, 4.0, 5.0, 10.0]) +case2_params = ("bulk.xyz", 0, [1.0, 2.0, 3.0, 4.0, 5.0, 6.0]) +case3_params = ("bulk_small_unit_cell.xyz", list(range(9)), [2.0, 3.0, 5.0, 10.0, 15.0, 20.0]) + +# Generate the expanded lists using product +expanded_case1 = list(product([case1_params[0]], [case1_params[1]], case1_params[2])) +expanded_case2 = list(product([case2_params[0]], [case2_params[1]], case2_params[2])) +expanded_case3 = list(product([case3_params[0]], case3_params[1], case3_params[2])) + +# Combine all cases into one list +all_cases = expanded_case1 + expanded_case2 + expanded_case3 + +@pytest.mark.parametrize("structures_path, structure_index, r_cut", all_cases) +def test_do_single(structures_path, structure_index, r_cut): + n_gnn = 2 + n_trans = 2 + epsilon = 1e-10 + with Float64DtypeContext(): + do_single_test(structures_path, r_cut, n_gnn, n_trans, structure_index, epsilon) + #do_single_test(structures_path, r_cut, n_gnn, n_trans, structure_index, epsilon) \ No newline at end of file From c47f06fa051a6cf9a93013573a4d50ac5887b3b3 Mon Sep 17 00:00:00 2001 From: spozdn Date: Fri, 31 May 2024 17:07:13 +0200 Subject: [PATCH 16/41] quadrature to single struc calculator --- src/single_struct_calculator.py | 41 ++++++++++++++++++++++----- tests/test_pet_runs_without_errors.py | 2 ++ 2 files changed, 36 insertions(+), 7 deletions(-) diff --git a/src/single_struct_calculator.py b/src/single_struct_calculator.py index b54f0e8..00405d4 100644 --- a/src/single_struct_calculator.py +++ b/src/single_struct_calculator.py @@ -6,7 +6,7 @@ from .molecule import Molecule, MoleculeCPP from .hypers import load_hypers_from_file from .pet import PET, PETMLIPWrapper, PETUtilityWrapper - +from .utilities import get_quadrature, string2dtype class SingleStructCalculator: def __init__( @@ -51,7 +51,7 @@ def __init__( self.all_species = all_species self.device = device - def forward(self, structure): + def forward(self, structure, quadrature_order = None): molecule = MoleculeCPP( structure, self.architectural_hypers.R_CUT, @@ -71,9 +71,36 @@ def forward(self, structure): graph.num_nodes, dtype=torch.long, device=graph.x.device ) graph = graph.to(self.device) - prediction_energy, prediction_forces = self.model( - graph, augmentation=False, create_graph=False - ) + if quadrature_order is None: + prediction_energy, prediction_forces = self.model( + graph, augmentation=False, create_graph=False + ) + prediction_energy_final = prediction_energy.data.cpu().numpy() + prediction_forces_final = prediction_forces.data.cpu().numpy() + else: + x_initial = graph.x.clone() + all_energies, all_forces = [], [] + rotations, weights = get_quadrature(2) + for rotation in rotations: + rotation = torch.tensor(rotation, device = self.device, + dtype = string2dtype(self.architectural_hypers.DTYPE)) + batch_rotations = rotation[None, :].repeat(graph.num_nodes, 1, 1) + graph.x = torch.bmm(x_initial, batch_rotations) + prediction_energy, prediction_forces = self.model( + graph, augmentation=False, create_graph=False + ) + all_energies.append(prediction_energy.data.cpu().numpy()) + all_forces.append(prediction_forces.data.cpu().numpy()) + + energy_mean, forces_mean, total_weight = 0.0, 0.0, 0.0 + for energy, forces, weight in zip(all_energies, all_forces, weights): + energy_mean += energy * weight + forces_mean += forces * weight + total_weight += weight + energy_mean /= total_weight + forces_mean /= total_weight + prediction_energy_final = energy_mean + prediction_forces_final = forces_mean compositional_features = get_compositional_features( [structure], self.all_species @@ -81,5 +108,5 @@ def forward(self, structure): self_contributions_energy = np.dot( compositional_features, self.self_contributions ) - energy_total = prediction_energy.data.cpu().numpy() + self_contributions_energy - return energy_total, prediction_forces.data.cpu().numpy() + energy_total = prediction_energy_final + self_contributions_energy + return energy_total, prediction_forces_final diff --git a/tests/test_pet_runs_without_errors.py b/tests/test_pet_runs_without_errors.py index 861d158..1197a9a 100644 --- a/tests/test_pet_runs_without_errors.py +++ b/tests/test_pet_runs_without_errors.py @@ -123,7 +123,9 @@ def test_single_struct_calculator(prepare_model): ) structure = ase.io.read("../example/methane_test.xyz", index=0) energy, forces = single_struct_calculator.forward(structure) + assert forces.shape == (5, 3), "single_struct_calculator failed" + energy, forces = single_struct_calculator.forward(structure, quadrature_order = 2) assert forces.shape == (5, 3), "single_struct_calculator failed" From cff5e6d4be073c87d9d905a9116e4dbd8d8931d8 Mon Sep 17 00:00:00 2001 From: spozdn Date: Fri, 31 May 2024 17:26:55 +0200 Subject: [PATCH 17/41] fix --- src/single_struct_calculator.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/single_struct_calculator.py b/src/single_struct_calculator.py index 00405d4..e829533 100644 --- a/src/single_struct_calculator.py +++ b/src/single_struct_calculator.py @@ -71,6 +71,7 @@ def forward(self, structure, quadrature_order = None): graph.num_nodes, dtype=torch.long, device=graph.x.device ) graph = graph.to(self.device) + if quadrature_order is None: prediction_energy, prediction_forces = self.model( graph, augmentation=False, create_graph=False @@ -80,7 +81,7 @@ def forward(self, structure, quadrature_order = None): else: x_initial = graph.x.clone() all_energies, all_forces = [], [] - rotations, weights = get_quadrature(2) + rotations, weights = get_quadrature(quadrature_order) for rotation in rotations: rotation = torch.tensor(rotation, device = self.device, dtype = string2dtype(self.architectural_hypers.DTYPE)) From 52b71f22bb62ce2bb7aaa53eac84e7fe58b8a706 Mon Sep 17 00:00:00 2001 From: spozdn Date: Fri, 31 May 2024 17:32:38 +0200 Subject: [PATCH 18/41] moving quadrature prediction logic to utilities --- src/single_struct_calculator.py | 30 +++++------------------------- src/utilities.py | 23 +++++++++++++++++++++++ 2 files changed, 28 insertions(+), 25 deletions(-) diff --git a/src/single_struct_calculator.py b/src/single_struct_calculator.py index e829533..f715f6a 100644 --- a/src/single_struct_calculator.py +++ b/src/single_struct_calculator.py @@ -6,7 +6,7 @@ from .molecule import Molecule, MoleculeCPP from .hypers import load_hypers_from_file from .pet import PET, PETMLIPWrapper, PETUtilityWrapper -from .utilities import get_quadrature, string2dtype +from .utilities import string2dtype, get_quadrature_predictions class SingleStructCalculator: def __init__( @@ -71,7 +71,7 @@ def forward(self, structure, quadrature_order = None): graph.num_nodes, dtype=torch.long, device=graph.x.device ) graph = graph.to(self.device) - + if quadrature_order is None: prediction_energy, prediction_forces = self.model( graph, augmentation=False, create_graph=False @@ -79,29 +79,9 @@ def forward(self, structure, quadrature_order = None): prediction_energy_final = prediction_energy.data.cpu().numpy() prediction_forces_final = prediction_forces.data.cpu().numpy() else: - x_initial = graph.x.clone() - all_energies, all_forces = [], [] - rotations, weights = get_quadrature(quadrature_order) - for rotation in rotations: - rotation = torch.tensor(rotation, device = self.device, - dtype = string2dtype(self.architectural_hypers.DTYPE)) - batch_rotations = rotation[None, :].repeat(graph.num_nodes, 1, 1) - graph.x = torch.bmm(x_initial, batch_rotations) - prediction_energy, prediction_forces = self.model( - graph, augmentation=False, create_graph=False - ) - all_energies.append(prediction_energy.data.cpu().numpy()) - all_forces.append(prediction_forces.data.cpu().numpy()) - - energy_mean, forces_mean, total_weight = 0.0, 0.0, 0.0 - for energy, forces, weight in zip(all_energies, all_forces, weights): - energy_mean += energy * weight - forces_mean += forces * weight - total_weight += weight - energy_mean /= total_weight - forces_mean /= total_weight - prediction_energy_final = energy_mean - prediction_forces_final = forces_mean + prediction_energy_final, prediction_forces_final = get_quadrature_predictions( + graph, self.model, quadrature_order, string2dtype(self.architectural_hypers.DTYPE) + ) compositional_features = get_compositional_features( [structure], self.all_species diff --git a/src/utilities.py b/src/utilities.py index 271fc99..aab27b2 100644 --- a/src/utilities.py +++ b/src/utilities.py @@ -473,3 +473,26 @@ def string2dtype(string): return torch.bfloat16 raise ValueError("unknown dtype") + +def get_quadrature_predictions(batch, model, quadrature_order, dtype): + x_initial = batch.x.clone() + all_energies, all_forces = [], [] + rotations, weights = get_quadrature(quadrature_order) + for rotation in rotations: + rotation = torch.tensor(rotation, device = batch.x.device, dtype = dtype) + batch_rotations = rotation[None, :].repeat(batch.num_nodes, 1, 1) + batch.x = torch.bmm(x_initial, batch_rotations) + prediction_energy, prediction_forces = model( + batch, augmentation=False, create_graph=False + ) + all_energies.append(prediction_energy.data.cpu().numpy()) + all_forces.append(prediction_forces.data.cpu().numpy()) + + energy_mean, forces_mean, total_weight = 0.0, 0.0, 0.0 + for energy, forces, weight in zip(all_energies, all_forces, weights): + energy_mean += energy * weight + forces_mean += forces * weight + total_weight += weight + energy_mean /= total_weight + forces_mean /= total_weight + return energy_mean, forces_mean \ No newline at end of file From e6e83c45516a3d0c9e3fe4a0ef8e3591d087cb5c Mon Sep 17 00:00:00 2001 From: spozdn Date: Fri, 31 May 2024 18:09:50 +0200 Subject: [PATCH 19/41] uniting tests again --- tests/bulk.xyz | 1732 ++--------------- .../bulk_small_unit_cell.xyz | 0 .../test_cpp_extension.py | 0 tests_extensive/bulk.xyz | 194 -- tests_extensive/readme.txt | 1 - 5 files changed, 194 insertions(+), 1733 deletions(-) rename {tests_extensive => tests}/bulk_small_unit_cell.xyz (100%) rename {tests_extensive => tests}/test_cpp_extension.py (100%) delete mode 100644 tests_extensive/bulk.xyz delete mode 100644 tests_extensive/readme.txt diff --git a/tests/bulk.xyz b/tests/bulk.xyz index 5f453c0..6a7e03a 100644 --- a/tests/bulk.xyz +++ b/tests/bulk.xyz @@ -1,1538 +1,194 @@ -1536 -Lattice="24.861165999999997 0.0 0.0 0.0 24.861165999999997 0.0 0.0 0.0 24.861165999999997" Properties=species:S:1:pos:R:3 ipi_comment="Step: 200000 Bead: 0 positions{angstrom} cell{angstrom}" pbc="T T T" -O -2.89770838 6.76492149 25.78733892 -H -3.22693259 6.92327461 24.89600383 -H -3.73951469 6.82619967 26.21403556 -O 14.14055383 24.29643051 -3.20001086 -H 14.07438235 24.08626251 -4.11558478 -H 13.61617305 25.06489222 -3.10655103 -O -3.80387023 7.50534051 23.20647996 -H -4.32702965 6.79366991 22.91044971 -H -2.93633337 7.37711136 22.81086066 -O 10.10851674 9.95504169 37.52918951 -H 10.72513061 9.67505561 38.19072005 -H 10.10864677 10.90933099 37.79461274 -O 12.88472036 17.74854415 14.83955161 -H 13.65348508 17.32401078 14.47727108 -H 13.15938675 18.66283973 14.78421994 -O 23.27416153 17.28121925 10.39065520 -H 22.65222395 16.86672843 10.97211909 -H 23.97301209 17.50036781 10.96243160 -O 28.82916621 15.24193736 -3.53797364 -H 28.38533301 15.35426383 -4.37080367 -H 28.10799208 15.01400529 -2.92257296 -O 36.91419288 12.97258442 19.53548293 -H 36.34830761 13.58612620 19.98311684 -H 36.52139599 12.12326676 19.73067789 -O 11.98440021 13.19881081 16.68764620 -H 12.18844073 13.18309433 17.63085901 -H 11.92410272 12.28698658 16.43978129 -O 25.06857639 13.20745748 7.56852949 -H 25.32922900 12.38549309 8.03655019 -H 25.90709421 13.50763834 7.13281253 -O 26.04968879 -1.19143628 11.97368355 -H 26.56010316 -1.61519452 12.70387999 -H 26.64322428 -0.98829550 11.24431443 -O 12.62953507 5.53312570 -3.86554044 -H 12.22170511 5.57266846 -4.75519884 -H 13.36403930 6.07627704 -3.90633355 -O 7.21011110 14.23653715 11.64574225 -H 7.16040632 15.17644010 11.87876587 -H 8.00894171 14.13231429 11.11102381 -O 5.75686137 3.23450333 6.11025129 -H 5.47861979 3.92984330 6.70729624 -H 6.36394695 3.53757750 5.33770110 -O -5.30137956 16.78008117 7.87578064 -H -4.39528301 16.56383047 7.66270214 -H -5.25947464 17.01528003 8.83460527 -O 20.70901653 21.88727563 8.22712883 -H 21.21160184 21.72322472 7.46085033 -H 20.81450566 21.12522498 8.74632812 -O 6.65954915 9.24157072 6.86238273 -H 7.40725991 9.76709105 6.63255479 -H 5.84560307 9.75202263 6.91003018 -O 10.53731445 2.31171306 20.25583235 -H 9.96401205 1.61292527 19.97591921 -H 10.86218529 2.68864878 19.45364981 -O 21.65600333 6.39874163 14.21793413 -H 21.39784311 6.85560380 13.38201217 -H 22.63049097 6.62894914 14.23124420 -O 9.00042426 21.56430159 6.05210955 -H 8.98590878 21.85462469 5.13288219 -H 8.20891345 21.02488106 6.20393886 -O 12.66446786 8.58938864 -2.94784209 -H 13.44409217 9.05503938 -2.55875168 -H 12.26682023 8.05868258 -2.20368212 -O -3.32493687 14.05221857 8.22966294 -H -3.88867326 13.71396908 7.52280192 -H -2.75500906 13.26741732 8.45694143 -O 10.81420326 28.97499501 27.79811194 -H 10.08823397 29.23216638 27.21213180 -H 11.52963690 29.13592238 27.22324693 -O 11.59868215 2.70950463 -1.07115883 -H 12.26941158 3.00874568 -0.49142643 -H 11.92657137 2.28368144 -1.85362480 -O 13.77014968 15.76876936 26.65977008 -H 13.91517300 14.95642463 26.27052180 -H 14.58574632 15.87541375 27.23538471 -O 24.22457182 7.25666899 15.06905183 -H 24.11454843 7.92140274 15.72248945 -H 24.73920510 7.64182582 14.35039351 -O 24.44912046 0.44525823 13.69350101 -H 25.04516977 0.88904928 14.26921102 -H 25.03177628 0.04096515 13.08458450 -O 4.01663700 20.82026519 0.18837690 -H 4.77152889 20.62290738 -0.35944431 -H 3.77311230 19.97469040 0.57065169 -O 11.32046927 16.94478232 25.70848478 -H 11.26693165 17.84816683 25.19280827 -H 12.17045082 16.93954159 26.08221117 -O 9.32194731 9.74990619 3.24607960 -H 9.41189674 9.69283582 4.26906724 -H 8.45049084 10.03144194 3.10364815 -O 7.00320794 22.61468125 -13.81410530 -H 6.39651083 23.24052397 -14.26398405 -H 7.30170968 22.11596702 -14.53814742 -O 25.84912363 19.39882890 -2.16279376 -H 25.85221498 19.52674493 -1.25095641 -H 26.79959027 19.50432712 -2.35292774 -O 7.33213268 12.47457400 -2.23568490 -H 7.02882400 11.83206698 -2.87320605 -H 7.89130215 13.07677426 -2.70000103 -O 24.55538510 5.08626929 6.74175793 -H 24.85494209 5.02118876 7.68136713 -H 24.59508902 4.12226488 6.59239830 -O -0.61155940 29.16848750 22.56046408 -H -0.02572937 29.44818483 23.25177091 -H -1.24770071 28.57986760 22.99507587 -O 19.88682434 11.74727823 28.84408800 -H 20.09359411 12.65190562 28.58064121 -H 19.47430982 11.41271964 28.03343047 -O 10.64755854 -8.82036751 13.28612827 -H 10.52124545 -9.19404408 14.13524036 -H 11.21670116 -8.07091621 13.54967833 -O 8.91313336 4.62168315 -8.69513572 -H 8.28613995 5.06287781 -8.17890961 -H 9.72937275 5.10037720 -8.51167579 -O 15.55374461 7.46735833 6.45718193 -H 14.68585850 7.14188592 6.57936378 -H 15.70012111 8.19185483 7.09306424 -O 10.54177814 10.34250031 -0.65166731 -H 11.05329133 9.53809064 -0.49160634 -H 10.73660622 10.56230957 -1.64269164 -O 16.25670607 18.05727870 22.23242528 -H 15.66009614 18.63879470 22.74233617 -H 15.77022419 18.01750778 21.33032196 -O 13.73131662 20.31775021 15.38334215 -H 14.58016469 19.85712830 15.24991612 -H 13.89245733 20.85586872 16.20152002 -O 12.66587815 11.97664627 30.50098037 -H 12.66972079 11.09480138 30.88296518 -H 12.01619711 11.83000702 29.79187953 -O 21.77028960 3.75314832 6.95437609 -H 20.91119303 3.82772567 7.32448115 -H 22.32977073 4.37708885 7.40874369 -O 8.29948984 21.07772845 14.33722564 -H 8.19078280 21.92099502 14.82665257 -H 7.38815168 20.81003562 14.28396462 -O 22.27332948 12.51514341 14.44556817 -H 21.38628662 12.85202029 14.75601992 -H 22.75759436 12.46548318 15.27830660 -O 7.71159321 -9.74385743 15.40813016 -H 7.17996316 -9.12894601 15.92520874 -H 7.57509436 -9.52804250 14.49798596 -O 4.13173996 8.46288491 16.75435660 -H 3.78333997 9.18097299 16.21553565 -H 5.08993504 8.70227534 16.76665500 -O 9.04858811 7.57123321 22.23046018 -H 9.65488075 6.86108876 22.31114611 -H 9.31052396 7.97074192 21.40684396 -O 8.54425128 0.02477205 21.68180777 -H 8.56919793 -0.03300520 20.73915565 -H 8.62683109 0.94345757 21.91893037 -O 20.57495215 14.20095638 3.22031526 -H 21.19587236 14.64940224 3.77132448 -H 21.16177824 13.70308856 2.63978615 -O 19.01374287 15.03620557 13.38946113 -H 19.80737228 14.70655566 12.98595969 -H 19.21055629 15.87549961 13.86927384 -O 10.62945330 5.50341201 -1.97832114 -H 10.65137995 4.67222416 -1.51483998 -H 11.35129744 5.45645389 -2.63024432 -O 12.34959323 -13.56711082 26.00051935 -H 11.59280811 -13.59755523 25.41527855 -H 12.81465250 -12.74213222 25.76920275 -O 12.21920864 20.14261392 19.03592664 -H 12.81265400 20.17105059 19.86938921 -H 12.22838147 19.19205618 18.74141902 -O 8.02326951 11.84159862 14.05288440 -H 8.58622721 12.41540070 13.54395065 -H 7.26245788 11.87991318 13.44763572 -O 24.81482023 10.48732088 19.78301622 -H 25.31661231 9.71709999 19.76500596 -H 24.28627623 10.35875771 20.61210940 -O 0.46321145 2.53537814 6.97548970 -H 1.21197736 2.48828505 6.38073595 -H -0.19336899 1.89571994 6.76531550 -O 27.84195446 1.27689112 12.51024675 -H 27.21986692 0.63554546 12.24689757 -H 28.75667919 0.89307731 12.59721100 -O 16.94813125 12.84355544 7.26019626 -H 17.09154757 13.78141179 7.57453216 -H 17.81369850 12.62633689 6.97858238 -O 16.19205697 20.84037309 -5.35617857 -H 15.81769705 20.18470993 -4.78670346 -H 16.57096362 20.34147754 -6.10848456 -O 6.20741387 6.71811990 24.11315834 -H 7.06416141 6.88335058 24.46442398 -H 5.85908983 7.55163551 23.87078861 -O 18.62657175 23.81308093 25.15411542 -H 17.71476955 23.87475456 25.39877648 -H 18.77051421 24.67210683 24.79723063 -O 10.83068910 1.29797510 27.51552810 -H 10.94823245 2.19405113 27.81954893 -H 10.27208711 1.37363076 26.73272683 -O 19.68360451 22.04615425 19.91898616 -H 19.47971484 21.21662652 20.38255028 -H 20.44824936 21.88052873 19.36663204 -O 0.16952313 26.05796339 21.20169673 -H 0.77511745 25.50836967 21.65137072 -H -0.17295022 26.76917114 21.75506764 -O 25.52811140 0.51118357 4.28856687 -H 25.03272357 1.24370665 3.90868117 -H 25.12752836 0.15229314 5.08405072 -O -6.53283029 25.87812241 12.56642605 -H -6.25299179 26.76978242 12.79116733 -H -5.78656108 25.46329128 12.08591849 -O 14.48866077 9.71116048 25.78714296 -H 13.56717910 10.10556857 25.84092287 -H 14.85965287 10.19090390 26.50772877 -O 4.79399332 15.86332842 6.11913641 -H 4.85021157 15.67733454 5.18609772 -H 3.89644163 15.48240758 6.37431942 -O 15.82053556 30.26718532 15.12294149 -H 15.15086823 29.67104781 15.25257434 -H 16.57755699 29.70955365 14.76354641 -O 24.77058260 2.97413839 10.87324010 -H 24.10106825 2.37102151 10.63555659 -H 24.46672645 3.35443349 11.74181302 -O 12.80879258 22.15985189 -1.95252586 -H 11.87687983 22.30028425 -1.95200335 -H 13.10508128 23.03913507 -2.26130268 -O 7.93701939 17.03783289 -12.42606059 -H 8.82319643 16.97163028 -12.02250778 -H 8.05235600 17.77279552 -12.98878504 -O -0.59162804 32.30926293 -13.84532951 -H -0.93540794 32.90631537 -14.55937504 -H 0.12254371 31.78828343 -14.21462040 -O 1.17807410 -2.37784150 7.45412029 -H 1.81935697 -2.62299191 6.78359379 -H 0.57884079 -3.09877776 7.44858855 -O 1.46845185 12.76659220 20.52552964 -H 1.59173967 13.08845292 21.42433185 -H 0.94020413 11.96329141 20.43898761 -O 3.72213273 6.14181973 25.35963406 -H 4.16134939 5.91859959 26.19354745 -H 4.53731459 5.97356040 24.83291408 -O 11.91736567 18.24737705 -2.62292442 -H 11.19884858 17.62376124 -2.83575332 -H 11.60225912 18.72302848 -1.94186463 -O -4.83572687 5.48852168 9.02938458 -H -4.38656670 5.73248784 8.23693921 -H -4.18193713 5.35360023 9.65154037 -O 0.83430289 33.07451342 13.15521172 -H 1.24179231 32.15369144 13.22332799 -H 0.19718231 33.05063078 12.39976887 -O 0.14571008 21.68539959 2.88989074 -H -0.08188242 22.52379537 2.53175763 -H 1.07890264 21.79641825 2.77269048 -O 18.17848652 21.15672017 6.67912044 -H 18.42779279 22.05121570 6.39601519 -H 18.87523902 20.55584783 6.44914605 -O 1.57173140 26.81259443 14.87551516 -H 2.17713047 26.85384843 14.15477199 -H 2.14751423 26.71806174 15.59778695 -O -2.31230195 20.35827427 2.02602772 -H -2.60259650 20.57183284 1.13877156 -H -1.62469588 20.91203191 2.38881344 -O 15.92957773 5.78891764 17.98490381 -H 15.22824599 6.45604483 17.97696899 -H 16.37941738 6.05828466 17.19203722 -O 13.23631200 15.88052484 21.35314156 -H 12.89479739 16.73302831 21.46845304 -H 13.00164592 15.32921708 22.07465933 -O 21.23771995 17.47315126 21.65997387 -H 20.97665653 16.68348752 21.12408861 -H 20.44378302 17.97310323 21.65176294 -O 11.00653665 22.68571634 13.59383511 -H 10.28711264 22.97012059 12.97818505 -H 10.56517429 22.47511658 14.40255483 -O 25.16895898 20.84651379 17.38878415 -H 24.63663608 21.04398087 16.64671648 -H 24.94005029 21.32990155 18.15366792 -O 17.59726799 18.42933242 10.41335829 -H 17.91002584 19.22119426 10.02317343 -H 16.76032874 18.46886444 9.97110300 -O 25.84587041 10.18922819 28.49896868 -H 26.60470145 10.58885243 28.17917165 -H 25.16473873 10.77948735 28.19698416 -O -4.60604803 15.26161714 -4.40106911 -H -4.47415270 14.75291422 -3.59732763 -H -3.93697056 14.80145819 -4.94979308 -O -6.11349422 11.09056730 -12.90890524 -H -6.21648489 10.13372970 -12.93066673 -H -6.26834950 11.54967981 -13.75086723 -O 3.37077549 20.97917574 9.65270725 -H 3.20669957 20.04076345 9.60001608 -H 4.01248012 21.09807385 10.33610045 -O 20.22808109 -0.53130220 11.33999138 -H 19.71334970 -0.40408952 10.51179362 -H 20.37620442 -1.49528024 11.34835500 -O 17.71463318 -7.04440910 29.78316508 -H 17.09435556 -6.47243853 30.28835702 -H 18.39019502 -7.18307356 30.41882710 -O 19.43676484 -3.42740561 23.63476102 -H 19.14667376 -2.68237025 24.17539757 -H 20.33890837 -3.57377531 23.91297211 -O 4.36370765 24.30268832 17.93306987 -H 3.81688045 25.10799435 17.87320984 -H 4.70614920 24.29821489 18.80880447 -O 22.16024906 13.15845191 26.18761971 -H 22.59351390 14.02261285 26.13731802 -H 22.73050290 12.68175965 26.80602866 -O 5.15451585 17.17715120 2.36137598 -H 4.25024529 17.28149224 2.63187978 -H 5.19261586 16.26239499 2.50629952 -O 20.03934776 12.49114697 6.74189677 -H 20.29707165 12.08449790 5.93376195 -H 19.97464697 11.73818225 7.38695029 -O 14.73029242 19.41842192 12.23123464 -H 13.78893381 19.68214924 12.19813063 -H 15.19998705 20.20818898 12.13773028 -O 15.01805131 19.24738103 8.94712471 -H 14.23448752 18.58619581 8.99875966 -H 14.88508385 19.83912867 9.66136735 -O 23.44284631 9.18621354 9.08795552 -H 23.07379345 9.23025590 8.20084310 -H 24.30837963 9.61379611 8.86490477 -O 8.45265966 16.85448254 6.88727836 -H 8.26080750 16.65842539 5.93109060 -H 9.39754049 16.77105197 6.86734364 -O 17.09588565 23.53769818 18.11192059 -H 17.42318823 22.84332588 18.64754286 -H 16.15176986 23.45745783 18.05824155 -O 24.25922068 3.16457162 28.06901076 -H 25.22640998 3.30307997 28.06274156 -H 24.00978926 3.86475520 27.42322699 -O -11.17054167 26.06739052 11.58838373 -H -11.57594669 25.90676892 10.67082670 -H -10.35010101 25.62278685 11.52460822 -O 0.83077508 10.63869691 8.78565200 -H 1.34067147 10.41333198 7.95359810 -H 1.52169022 10.48543399 9.44571133 -O 17.84687877 1.13555683 30.43751982 -H 17.75520332 1.51262973 29.54960592 -H 18.63592045 0.60520296 30.58801852 -O 24.45531147 20.38455514 7.77608617 -H 24.50237595 19.46390382 7.63700891 -H 23.68932904 20.34973724 8.36471413 -O 19.71576611 26.09171400 23.84805500 -H 20.04462554 25.42889420 23.23117282 -H 19.06391838 26.62675408 23.35983966 -O 8.42224060 -0.70524092 14.74662180 -H 7.70245486 -0.88480645 15.39847717 -H 9.00683162 -0.14220806 15.29159286 -O -1.46067361 -4.08394726 5.16179230 -H -0.89348893 -4.28733278 5.90050322 -H -1.00522641 -3.48433153 4.60279217 -O 5.58908986 25.37305761 13.74416724 -H 6.09992901 25.41607084 12.91005955 -H 6.05699694 25.95909682 14.42123747 -O 8.22025605 2.96416613 -2.85576445 -H 8.99125760 3.29906144 -3.29246818 -H 7.65190866 2.79539165 -3.61839601 -O 4.92874480 -4.04387020 12.18283229 -H 5.48154479 -3.39179573 11.78218703 -H 5.12121562 -4.93168376 11.77542907 -O 0.09968963 14.15272829 18.38521338 -H 0.46722719 13.52409453 18.99708159 -H -0.76223060 14.43753452 18.65427643 -O 15.05153798 14.99407119 19.47154208 -H 15.84088292 14.72311702 19.93034945 -H 14.37651556 15.29904248 20.11572427 -O 19.37186713 5.24140501 4.80032610 -H 20.08161356 5.77720554 5.13761669 -H 19.74289083 4.59433091 4.24108851 -O 15.18777975 0.02438326 14.87565929 -H 15.24077905 0.80715297 14.23976737 -H 14.70574148 -0.67025450 14.40955804 -O 28.33588606 7.21993404 4.52850770 -H 28.82377741 7.98669062 4.21734456 -H 28.11352050 7.38222131 5.44747799 -O 16.31003951 9.07788986 8.68330102 -H 17.03272557 8.47430354 8.84135106 -H 15.73243621 8.85333349 9.42684945 -O 18.58063001 -3.02365671 28.00803305 -H 18.36141868 -3.95810343 27.87943450 -H 18.66969280 -2.64090680 27.12799695 -O 3.17862603 16.90655907 13.03965205 -H 3.27926714 17.37080293 13.87107995 -H 3.20534325 15.99255781 13.29133721 -O 8.04063177 -10.75153640 18.30496445 -H 7.59143913 -10.14236263 17.70946059 -H 8.16666548 -11.53753596 17.78853935 -O 21.94554157 0.88304657 13.07433046 -H 21.60072938 0.24002467 12.44938958 -H 22.89426102 0.80229462 13.06877186 -O 18.81381829 8.01657747 9.53467464 -H 19.30230101 7.24833205 9.50479416 -H 18.87616698 8.33478389 10.41940043 -O 5.60295142 -0.77876161 20.50223020 -H 5.37388106 -0.64931366 21.40308194 -H 5.99875314 0.00401851 20.23471378 -O 37.61953875 1.63563502 33.92994425 -H 36.87773479 1.00524994 34.23661530 -H 37.55602020 2.53310163 34.22916776 -O -3.77148053 7.63484583 11.95220491 -H -3.20328393 8.36253725 11.95044585 -H -3.39033612 7.03972881 11.28767464 -O 28.33812437 8.07487801 -3.32988453 -H 28.70276885 8.73434754 -3.90967663 -H 29.04673402 7.46330323 -3.22689149 -O -5.39703046 23.84011354 6.49556100 -H -4.58242928 24.17860821 6.07979364 -H -4.98482974 23.14914285 7.06697713 -O 14.42171528 11.70539041 -4.81865679 -H 14.00359573 12.57797951 -4.79655628 -H 15.28660781 11.83840626 -4.36164613 -O 24.65061275 16.51281168 13.65156033 -H 24.91899614 16.29841888 14.57955237 -H 25.15015636 16.00545125 13.07584038 -O 20.29012290 2.42135344 9.17412882 -H 20.37252254 2.74702767 10.02569744 -H 19.73010899 1.65933642 9.27876671 -O 15.09315326 31.79331421 21.16000758 -H 15.16613480 32.75671399 21.28569189 -H 15.99889152 31.54921833 20.88615102 -O 8.83780194 7.38091314 25.37443040 -H 9.23124493 7.32403879 24.52969555 -H 9.56068485 7.51027127 25.94828202 -O 10.90848800 16.74058813 5.79417368 -H 11.42655903 16.14121012 5.20822401 -H 10.93102231 17.52114787 5.27388687 -O -3.07447078 11.64754515 -5.53218002 -H -3.01754311 11.06822517 -6.30434361 -H -3.91952096 11.41792143 -5.14300167 -O -2.49835753 -8.34203950 7.64959056 -H -2.93225221 -9.27769592 7.75648633 -H -2.17269313 -8.08080993 8.50432451 -O 6.83972974 8.60858347 16.34209544 -H 7.57201780 8.92284701 16.92873228 -H 7.05154748 8.71331135 15.43125839 -O 9.15532899 -0.61256646 7.52317289 -H 9.08150830 -1.48671740 7.04362265 -H 9.44210973 -0.00350503 6.86479119 -O 8.37896610 2.45749061 -17.95630125 -H 8.96760726 3.17953883 -18.19932327 -H 7.52671842 2.91185188 -17.94412325 -O -0.73211613 22.32721382 19.60633338 -H -0.87019919 21.69624419 20.32834561 -H -1.57247609 22.50821437 19.25555944 -O 24.05992294 7.59436689 30.84251174 -H 24.35224949 6.66414541 31.10846855 -H 24.37075582 7.65689202 29.93854202 -O 16.16335030 -1.52884518 1.45608276 -H 15.46114387 -1.28434023 0.78992262 -H 16.21223289 -0.77324133 2.03233150 -O 10.39188890 4.14506938 30.78924033 -H 10.38777966 4.37165715 29.86762707 -H 11.22255434 3.66990043 31.00982007 -O 30.18461978 -0.53321620 9.67759328 -H 30.37138173 -0.52975917 8.74858716 -H 29.29413125 -0.78634032 9.70181004 -O 21.23319017 6.78212711 6.23336670 -H 20.60687780 7.50839460 6.04610477 -H 22.12199634 7.13955470 6.14855500 -O 3.87593991 15.60508483 16.53055128 -H 4.66598741 15.96545795 16.91329475 -H 4.04872465 14.81689462 15.90859266 -O 26.98665893 6.16442184 19.67530621 -H 27.33539646 6.65814328 20.44763074 -H 26.03946689 6.44991215 19.63897384 -O 25.98245301 19.73226796 0.43630351 -H 25.98793693 20.41154796 1.08249719 -H 26.29399135 18.90084144 0.88144094 -O 8.66673586 5.88272725 13.48293356 -H 8.80840921 5.42421341 12.65198203 -H 8.97501194 5.39335584 14.22261270 -O 6.24794558 15.02851335 32.92531552 -H 5.72966395 15.19180617 32.12426704 -H 7.06721646 15.39906054 32.69808844 -O 21.05284793 3.42678956 25.14925845 -H 20.68993073 4.26234965 24.72945606 -H 20.43029391 2.77452881 24.80346608 -O 2.94925941 9.99534624 10.36451004 -H 3.75916337 10.48837534 10.13144418 -H 2.58218943 10.42086520 11.16692492 -O 15.23950967 20.84394674 23.95789379 -H 15.77323849 21.22527702 23.21627787 -H 14.34691038 20.94674971 23.72978255 -O 16.26032670 2.95316191 7.47890026 -H 16.80042773 2.25652558 7.05071418 -H 16.32970812 3.67233500 6.81031153 -O 12.41887820 15.09450128 28.94673101 -H 11.85334176 14.36638669 28.77720531 -H 12.94766136 15.26368291 28.13433861 -O 10.82327546 12.04726100 3.26114300 -H 10.20664636 11.28113290 3.41162308 -H 11.43691472 11.73057449 2.57556078 -O 9.18152959 14.21710183 -3.94355423 -H 9.09248375 15.07714100 -3.57153560 -H 8.57544248 14.28563242 -4.66919939 -O 3.39685278 7.41839603 11.12463543 -H 3.86637999 7.64928472 11.94971255 -H 3.11973547 8.28606106 10.71038753 -O 36.06409235 -8.82383612 18.65023256 -H 35.49817760 -8.77894608 17.80432180 -H 35.47609118 -9.30690970 19.22935195 -O 3.34160083 23.94233003 4.36936018 -H 4.10298734 24.55702742 4.60952777 -H 2.53293434 24.39498205 4.43130375 -O 19.09836973 5.23574121 23.77582535 -H 18.31873509 4.72042314 23.54715930 -H 18.66818076 5.87054616 24.30363255 -O 19.22333413 34.57267563 23.22371913 -H 19.95481181 35.09649736 23.57661753 -H 19.65586187 33.73750810 23.18208707 -O 18.90313329 5.59406852 14.52373924 -H 18.58915820 5.93899961 15.43728526 -H 19.86680290 5.72330085 14.47861520 -O 30.53591536 0.65760248 5.05500720 -H 30.84238176 0.05859556 5.70577598 -H 30.72067346 1.47765690 5.55322468 -O 15.71297809 -0.63508755 6.49390972 -H 16.45994650 -0.20473225 6.12949656 -H 15.81780944 -0.71762497 7.43649687 -O -4.13530862 17.76031974 4.55811641 -H -3.51070969 17.85812112 3.81024182 -H -4.90508180 17.43935607 4.13160450 -O 2.89180967 -2.80082505 17.46633013 -H 2.02861557 -2.52741348 17.33116268 -H 3.33639605 -1.97040176 17.62356514 -O 24.46411163 5.65856751 1.48971293 -H 24.80597998 6.24302126 2.13961674 -H 23.63845051 6.07408352 1.33713710 -O 19.79407346 16.80851497 15.30531485 -H 19.15081004 16.89084791 16.02666321 -H 20.01741288 17.73465868 15.14414135 -O 22.01141440 19.38965255 8.69384661 -H 22.31963295 18.95279685 9.51529832 -H 21.72817895 18.61429403 8.16323042 -O 25.27713068 23.28847760 23.95859188 -H 24.31438037 23.48641394 23.91888377 -H 25.60181145 23.61308287 24.79444252 -O 9.15154753 10.15883821 5.93353925 -H 8.79075388 10.94104565 6.33693494 -H 9.74941498 9.78234583 6.62690160 -O 4.55529530 13.20613490 23.27868361 -H 4.61485202 13.65978103 22.39785298 -H 5.48820763 13.02562522 23.50722498 -O 23.92073948 12.43784458 5.40989653 -H 24.55502279 12.56453516 4.73071955 -H 24.34804517 12.67928986 6.26752916 -O -2.86671114 15.83868325 16.62357697 -H -2.34642495 16.63245523 16.57277923 -H -3.60317027 15.97919248 16.03388838 -O 8.58374629 11.23744767 9.61351757 -H 8.33185110 11.42985874 8.70187593 -H 9.20508936 10.56565315 9.48496560 -O 7.13418638 6.56896604 5.99938526 -H 6.97978045 6.06266433 6.85326796 -H 6.84092277 7.44885276 6.15633160 -O 25.20878898 12.35971201 23.78719717 -H 25.78393613 11.60357248 23.79429917 -H 24.48549372 12.02888544 23.22937788 -O 17.46133247 31.43545041 19.97311264 -H 17.60499179 32.34224515 19.60372787 -H 17.12313485 30.91450903 19.28316255 -O -0.09857674 17.89355089 29.65425658 -H -0.03079954 17.79206568 30.65672143 -H -0.97748770 18.23477602 29.47469025 -O 22.61842875 -0.72967264 -0.94131703 -H 22.12139733 -0.57111450 -0.07035734 -H 21.96731968 -0.77900817 -1.64017627 -O 30.06497599 -3.43588626 7.89892789 -H 30.57484905 -4.19082533 7.71540135 -H 29.33691797 -3.71353849 8.49247043 -O 17.68482202 26.80032614 21.97538654 -H 17.20024468 26.01740239 22.19983541 -H 17.46833209 27.03081676 21.02874076 -O -1.05745417 1.51108573 16.65399370 -H -0.55177643 0.92413649 17.30315865 -H -1.17109017 0.89270050 15.93428645 -O 2.66033503 18.20676860 8.77146900 -H 3.15280516 17.40601482 9.12243022 -H 3.09178108 18.35002044 7.94987370 -O 8.24217811 23.93233029 24.26982025 -H 7.56519811 24.48708739 24.65688847 -H 7.94487887 23.75367781 23.41442729 -O 25.69673603 -9.14324654 28.11565410 -H 24.90002062 -9.30571515 27.59967147 -H 25.44262581 -8.35254845 28.65258407 -O 6.89067140 29.94173891 -4.89105073 -H 6.79080604 30.27058437 -5.79953689 -H 6.19957636 30.33382182 -4.35491083 -O 31.59028215 16.63383982 17.59335163 -H 31.66979626 16.68882960 18.54038679 -H 31.50662122 17.56265002 17.38328620 -O 15.48235553 -4.16283415 26.72866493 -H 15.78780775 -3.27396973 27.07712863 -H 15.63601179 -4.09559338 25.77032823 -O 10.48636420 9.45827585 8.46423202 -H 11.32293062 9.92130180 8.56751468 -H 10.46268708 8.68838216 9.06701974 -O 12.68439680 1.67083205 21.67316934 -H 11.93332638 1.61409720 21.02771747 -H 13.32269902 2.36977881 21.32389002 -O 27.49109771 6.27878929 16.07931294 -H 28.03234406 7.03638515 16.33043583 -H 27.19067563 5.84072626 16.85394410 -O 13.72457049 -4.80801168 -3.52358017 -H 13.23290788 -3.97505631 -3.25772744 -H 13.21416198 -5.59847131 -3.31302757 -O 11.31588817 5.48821255 18.06346814 -H 11.71865639 4.59093155 18.00301212 -H 10.74709088 5.33759982 18.87427323 -O 30.53100557 12.74285116 20.20969917 -H 29.76267399 12.66150156 19.65107304 -H 30.94114817 13.52624454 19.97862257 -O 9.16655671 4.93747961 10.89916884 -H 9.19423358 4.17855902 10.34488863 -H 9.71704213 5.58855156 10.50685623 -O 7.87435964 20.31452931 27.22141046 -H 7.23319696 20.01138881 27.91503782 -H 8.40100736 21.00516974 27.66630992 -O 10.49617848 25.11629495 9.82929313 -H 10.09161726 24.69078032 9.07862627 -H 9.98554751 24.75359113 10.54640882 -O -0.40063641 7.42864970 19.83501912 -H -0.83277954 7.08526740 20.57431615 -H -1.05679799 7.12533825 19.19319553 -O 8.31376415 5.00788534 26.60498156 -H 8.51448023 5.89636315 26.29076401 -H 7.93471327 4.45206043 25.83933659 -O -0.09654493 16.82285583 -2.80002998 -H 0.38254759 17.64429979 -2.75481298 -H -0.28551725 16.73625101 -3.77746548 -O 19.10142165 19.36283154 21.65671007 -H 18.17771398 19.12953653 21.68339380 -H 19.13628937 20.07694151 22.33786306 -O 21.51778351 3.48876683 12.32788136 -H 22.27575878 3.86451868 12.77832709 -H 21.64666953 2.58397349 12.52361780 -O 5.27198347 -4.38244332 14.98075188 -H 5.08147662 -4.08771573 14.05129325 -H 5.32604366 -3.47078502 15.43677403 -O -13.79986262 10.58825359 17.01000181 -H -13.49936321 10.18938773 16.20263258 -H -13.04616362 10.35988885 17.68020631 -O 16.64666854 11.53724305 -3.01971506 -H 17.45240005 12.02870286 -3.21095362 -H 16.34457009 11.93455990 -2.18338239 -O -1.54961968 2.24170901 24.37335049 -H -1.85551246 1.34851354 24.31277838 -H -2.36310011 2.64158665 24.79843481 -O 13.42715468 25.64419692 16.89516625 -H 12.60697190 25.16969483 16.65856613 -H 14.00756493 25.45177805 16.12704304 -O 3.67654240 15.87447672 24.71771179 -H 4.49529279 16.14996651 24.45270696 -H 3.39821456 15.33547157 23.99729875 -O 20.91457169 -6.19904614 13.00429406 -H 21.65796068 -5.64449187 13.28653135 -H 21.10166034 -6.49037521 12.10391748 -O 10.63203232 25.05931090 16.49554458 -H 10.19459863 25.80070928 16.06521407 -H 10.42294159 25.07763505 17.45660093 -O 15.22804472 12.83530695 5.12861821 -H 14.28968211 12.83451274 5.35225303 -H 15.76557122 12.86342889 5.90852308 -O 12.30460715 -11.43421205 22.81308179 -H 12.07771942 -12.02565657 22.08711887 -H 11.49845567 -11.06330947 23.22776541 -O 2.55450134 23.72166458 -4.21362710 -H 1.67972242 23.68157041 -4.60999009 -H 2.68561406 22.99975127 -3.63092840 -O -4.05580452 7.83757843 16.52337921 -H -3.50428415 7.26674405 17.09038906 -H -3.73364404 7.61001222 15.63218857 -O 6.50715404 27.30854406 -4.93771806 -H 5.54147434 27.20953410 -4.87221681 -H 6.59210971 28.27268371 -4.95757306 -O 11.91720190 31.09521627 12.50245689 -H 12.77251370 30.73374648 12.35034290 -H 11.39770907 30.24916914 12.64145729 -O 32.81569845 13.83219678 0.17349148 -H 32.36508107 14.63824107 -0.13525356 -H 32.56124839 13.18050156 -0.51139670 -O 19.76320428 10.60849012 8.75377690 -H 19.66475515 9.65360702 8.81595337 -H 18.84887484 10.82531463 9.01502084 -O -10.59884818 -5.59229243 4.14966533 -H -9.94987415 -5.37381130 4.81833701 -H -10.19106074 -5.32948283 3.34175723 -O 4.32973894 16.23531279 9.85842552 -H 5.16106544 16.02877911 9.46465688 -H 4.52580652 16.87648112 10.57483972 -O 21.71700575 19.99178958 -7.24659937 -H 21.96251967 20.95176699 -7.31323854 -H 22.15442380 19.76610015 -6.37365787 -O 25.63586688 20.46393999 11.13806777 -H 25.69866450 19.48075952 11.13354409 -H 26.01968601 20.81226073 10.33822863 -O 13.33566865 29.17379255 9.50522057 -H 14.05826864 28.63595526 9.21456226 -H 13.59006827 29.27412413 10.42039239 -O 24.61849775 11.80297429 1.65952223 -H 25.00709100 12.25284476 0.90239701 -H 24.22176058 10.96983604 1.30199353 -O 6.61207850 19.43192731 17.36467914 -H 5.61652288 19.56884635 17.48949032 -H 6.80805723 19.79797549 16.52094420 -O 23.65198500 -1.04835001 10.81883949 -H 24.61172495 -1.02819172 11.02927336 -H 23.47925356 -0.20908998 10.33036500 -O -16.80615788 13.66177065 2.85527414 -H -15.90187158 13.44484412 2.86089400 -H -17.07208861 13.60090751 1.91950470 -O 17.45213611 -5.87142908 27.29995151 -H 16.68284510 -5.32359078 27.20848580 -H 17.40528304 -6.21852573 28.19373652 -O 10.33918719 13.85945396 31.76456132 -H 11.05307720 13.36323932 31.45152428 -H 10.53132671 14.78861097 31.62778346 -O 4.00579237 4.03658020 12.80189361 -H 4.75817217 4.28318381 12.26482080 -H 3.82681368 3.11863033 12.72982709 -O 1.94629324 1.81600353 9.37596015 -H 1.59820002 2.03870763 8.48984697 -H 1.37840359 2.30141665 9.98437258 -O 11.82204356 20.97985103 6.11728120 -H 10.95462246 21.28087166 5.90683653 -H 11.97030461 20.27000814 5.50129816 -O 24.27067607 4.04890298 38.20565169 -H 25.00894355 4.68457381 38.02786063 -H 24.69738433 3.42749867 38.83601133 -O 14.56264151 1.99636001 25.56348068 -H 14.26368596 1.09065752 25.43656666 -H 15.32329253 1.79970210 26.06772859 -O 14.17091374 -0.84583592 18.89499164 -H 14.06472000 -0.29724142 18.14471813 -H 14.37596996 -1.69248474 18.49533869 -O 15.29914637 12.49438474 11.19960559 -H 15.75541782 11.82617005 10.70201740 -H 15.97120160 13.12897792 11.34803041 -O 9.28579516 -2.16391133 3.62942599 -H 8.59853706 -1.44952923 3.50425409 -H 10.13876509 -1.71715378 3.41055052 -O -2.58119721 14.28375317 19.02885602 -H -2.80682023 14.57718184 18.11137208 -H -2.69643395 13.30764621 19.07325407 -O 6.39903944 23.83188329 7.27533450 -H 7.39473822 23.96152218 7.48553844 -H 6.17617664 22.91820193 7.52128031 -O 17.68702543 14.39857038 20.72986006 -H 18.51728297 14.80664458 20.47011272 -H 17.59815051 14.74658350 21.60751493 -O 25.68191487 24.59258493 1.48744548 -H 25.62719984 25.40321339 0.97858830 -H 25.72994975 24.83440933 2.40766475 -O 29.27206774 9.43104108 19.47237048 -H 29.23740359 8.89360726 18.67312737 -H 30.12566955 9.78075141 19.35572945 -O 16.03656592 18.95939790 -9.70817758 -H 16.69937216 18.76167677 -10.39394509 -H 15.61490456 18.11126335 -9.58122637 -O -3.33541878 10.74844175 12.41939452 -H -4.10862087 11.15001428 12.15551889 -H -3.21182319 11.05904638 13.28302395 -O 11.42795261 6.52112228 40.07893573 -H 10.92506342 7.31821469 39.95814910 -H 11.83306070 6.47595347 39.17645697 -O 7.00953578 11.02892684 2.67743929 -H 7.17249059 10.58471286 1.77108768 -H 7.48634406 11.87686781 2.78408958 -O 10.36940545 14.92533615 -0.80089326 -H 9.51635909 14.51269518 -0.48823449 -H 10.63975622 15.55788441 -0.16006724 -O 25.87833722 20.33223597 13.74447076 -H 25.82960674 20.55949904 12.84510527 -H 26.77838847 20.01706873 13.92504166 -O 14.03699676 8.90045475 10.07359944 -H 13.79203792 8.09248673 9.60891608 -H 13.53110010 9.54913858 9.61472436 -O 12.95766135 17.71941603 8.88439168 -H 12.78098479 17.27932716 9.70708285 -H 13.45345074 17.15086577 8.24184922 -O 0.16143092 17.70406241 7.63340374 -H 1.06993225 17.65747001 7.92464193 -H -0.34559189 16.90519341 7.87452462 -O 12.24051578 20.67471003 11.51310275 -H 11.95147965 20.37767422 10.63636579 -H 11.75015183 21.50105087 11.73620321 -O 25.94129427 27.02197097 25.35509204 -H 25.06976520 27.30162512 24.95106985 -H 26.58913419 27.10676327 24.68794797 -O -2.71217131 27.35370185 4.67117208 -H -2.00273588 27.66911542 4.06631980 -H -2.67734146 27.91104385 5.46829040 -O 26.79368902 11.06489345 12.74546318 -H 26.40505867 11.81589915 13.18178405 -H 26.23539672 10.27522251 12.87135617 -O 2.14128761 22.70259195 14.33218442 -H 1.67864564 21.87074293 14.22933773 -H 2.74803814 22.64459679 15.05685119 -O -6.44196243 2.86030026 14.82193743 -H -6.12239584 3.74301554 14.69141879 -H -5.69199416 2.34658570 15.02685871 -O 20.07153132 28.13586733 27.75940937 -H 20.31898595 28.27569266 26.84904747 -H 20.82860252 27.79893820 28.19484726 -O 18.03592672 16.37407738 23.18705121 -H 17.37415597 16.98291544 22.79514155 -H 18.59641356 16.99862819 23.63909175 -O 8.20773015 16.04434722 4.29110588 -H 8.27113464 15.23113534 3.80885503 -H 8.15008588 16.61392477 3.54768932 -O 22.13652717 5.50680388 10.65445594 -H 21.78435872 4.92877723 11.37750711 -H 23.03829847 5.73393748 10.87753890 -O 2.23137002 3.40076262 3.27801940 -H 3.00131284 3.88464402 3.64838381 -H 2.51769860 3.24321181 2.38924901 -O 11.72936765 7.74274851 -0.67127162 -H 12.23780695 7.52509383 0.13171183 -H 11.35129719 6.92383473 -0.99336534 -O 32.92556423 20.10208837 -5.11263113 -H 32.47047971 20.12500998 -5.98178965 -H 33.67510824 20.54838792 -5.38374299 -O 21.21694349 22.56498445 2.97395569 -H 20.22762403 22.39850915 3.17267612 -H 21.63514227 21.70796797 2.81856629 -O 17.46347580 8.71366443 12.39052445 -H 17.45861743 7.79186180 12.16478448 -H 16.52937393 8.91896814 12.43128865 -O 28.53927736 19.75851091 -3.17954155 -H 28.98564741 20.59566587 -3.46465897 -H 29.00152652 19.09993621 -3.74319272 -O 13.80286892 7.16054963 0.97367493 -H 14.18162874 7.06246332 0.09390363 -H 14.04971696 8.07447406 1.13138058 -O 11.17901692 -5.23326204 24.45254248 -H 11.80750998 -4.64635207 24.79629227 -H 10.34364983 -4.72064726 24.31247230 -O 6.73361873 2.33764949 15.26049111 -H 7.57668079 2.14213295 14.86205706 -H 6.64211196 3.28232211 15.32844408 -O 3.45631968 1.88171210 -1.31450632 -H 3.70975009 2.34060945 -2.11151555 -H 3.72969239 2.43057970 -0.57038948 -O 22.69590925 -9.65171866 5.06742102 -H 22.55221851 -9.03609561 5.75162154 -H 22.91260932 -10.45034562 5.46075828 -O 22.93975666 4.14052276 16.69043238 -H 23.49194717 3.35778026 16.37511418 -H 22.95223934 4.62763312 15.84199847 -O 14.89884695 9.59152380 37.63906807 -H 14.89502018 10.48923224 37.89799422 -H 14.29639098 9.57945105 36.88888115 -O -3.57115693 28.51178554 19.95500474 -H -4.15838208 29.18283851 20.40526889 -H -4.08021595 28.29787962 19.17241150 -O 14.66687768 3.29273321 -5.89361060 -H 15.19095029 4.08636608 -6.01024603 -H 15.20328380 2.48750256 -5.98963178 -O 23.30039230 13.12107658 11.75874638 -H 23.17553048 12.44763991 11.07791340 -H 22.77533284 12.90002794 12.56426372 -O 20.41341153 14.71775826 10.68835360 -H 21.20105516 14.93714366 11.19885627 -H 20.77380015 14.43887175 9.86257595 -O -3.24695730 24.72440809 5.12557959 -H -3.14823231 25.71900225 4.90178824 -H -3.45384404 24.14847685 4.31141361 -O 12.35389904 16.00744384 11.10805199 -H 12.81037484 15.23802462 10.68616881 -H 11.72125830 15.77537524 11.81993484 -O 31.91375794 5.84883743 -7.49424233 -H 31.82965680 6.78718774 -7.81060742 -H 31.05483254 5.53102885 -7.80499662 -O 19.57788879 10.70319434 20.70672362 -H 19.42901510 10.47204854 21.61274763 -H 19.04833028 10.08648377 20.19739827 -O -8.59431789 21.92509818 4.50041612 -H -8.59022656 22.57743859 5.25330715 -H -7.72731209 22.04104113 4.11711500 -O 13.03886928 17.82901690 17.81410257 -H 12.89957851 17.70340738 16.87406690 -H 12.32462012 17.23006201 18.17476617 -O 17.62758139 23.69124947 15.37714467 -H 17.40894073 23.52165455 16.28996364 -H 16.99833183 24.31439232 15.02792808 -O 12.10259106 2.12956880 6.40407434 -H 11.58930540 1.39125646 6.01053206 -H 12.45066694 1.76886581 7.22540151 -O 1.83073052 28.39749101 19.19057682 -H 0.87662281 28.45826613 19.35563000 -H 2.03934679 29.32417861 19.26890743 -O 17.78169371 12.19160338 26.90566096 -H 17.07982622 11.73593689 27.48734302 -H 17.59315763 13.10865219 27.16524375 -O 26.71951894 9.51182405 6.49863869 -H 26.19502228 9.62242863 5.67987154 -H 26.97418332 8.58880653 6.52487944 -O -4.94166961 30.35591817 21.10797253 -H -5.34622714 30.15790059 21.98275559 -H -5.66128338 30.62608449 20.61731588 -O 21.19493798 11.39647987 24.06237562 -H 21.53263406 11.61190823 24.90404149 -H 20.97942129 12.29659910 23.76726898 -O 3.38414914 21.77704464 5.86929372 -H 3.41356793 22.61390432 5.42984865 -H 3.92629488 21.81470949 6.61202763 -O 6.40062729 20.35812882 23.68490372 -H 6.18473183 20.77695129 22.85506354 -H 7.20296435 20.64549840 23.97723493 -O 27.82233328 22.01370712 27.36542261 -H 28.15600503 22.74366562 27.87893620 -H 28.36856733 21.80883141 26.59963810 -O 26.47411281 14.68272526 22.92845527 -H 25.92252657 13.98792996 23.34299906 -H 25.82797344 15.35660774 22.69965977 -O 11.00895413 20.48441398 8.91325538 -H 11.23091106 21.08083790 8.26384138 -H 11.66272597 19.82596905 8.68927324 -O 4.77310946 9.82658725 3.96635157 -H 5.67572825 10.00065725 3.60699098 -H 4.78529352 10.01100943 4.91943690 -O 0.72772334 7.48601879 3.43755053 -H 1.08294694 8.33517090 3.43093493 -H 1.56745314 6.97658324 3.49589108 -O 9.79180060 0.84155723 30.22101523 -H 10.10260822 1.09420306 29.33270037 -H 9.30990170 1.60717838 30.59588549 -O 18.72379954 0.21341349 33.90399349 -H 17.79437273 -0.04545454 33.89383489 -H 19.00814116 -0.01572544 33.04824548 -O 22.47671824 24.79234934 20.29135242 -H 22.41349545 25.09003796 19.42925672 -H 23.22162271 25.30993661 20.60878037 -O 3.50941277 1.58912329 20.62254937 -H 2.80109708 2.10742813 20.29789744 -H 3.16775776 0.70409479 20.61003824 -O 16.20401409 24.42903399 11.91757207 -H 17.11856502 24.82284953 12.00692281 -H 16.37047408 23.51317324 12.01910256 -O -6.47026312 15.17494280 1.98726049 -H -7.27266545 15.19495404 2.59241364 -H -5.61355287 14.95073447 2.51958382 -O 6.36921562 5.11461232 33.15846211 -H 5.96414697 6.00465271 33.26341440 -H 6.39301165 4.67204180 34.00579799 -O 6.12443977 -3.19763202 -3.56154345 -H 6.70606686 -3.63106990 -4.14604553 -H 6.06075675 -2.28250508 -3.77305284 -O 5.32629840 6.29339480 -3.11899367 -H 4.68909608 5.62693833 -2.81424240 -H 5.80130393 6.51652639 -2.26485229 -O -4.69858319 9.13657437 5.59078117 -H -4.88722781 9.78533289 4.88717431 -H -3.81043684 9.28160238 5.93297950 -O 14.64937312 4.82863825 12.17837999 -H 15.49891537 5.31931819 12.28668419 -H 14.79555782 4.03059534 12.63771207 -O 23.93522228 9.15518957 0.89086042 -H 23.44803644 8.37011701 1.19774408 -H 24.89737579 9.02578357 0.99505245 -O 16.74199462 4.78695042 30.30870879 -H 16.56061210 5.69153635 30.47586574 -H 17.69969161 4.68098901 30.29918996 -O 25.46024590 5.06938170 9.39424180 -H 26.41731467 5.02629551 9.35332411 -H 25.21330311 4.27347546 9.98357201 -O 11.58504565 18.95548897 3.98201992 -H 12.57569219 18.91709518 3.89453278 -H 11.24755862 19.80249040 3.66092170 -O 2.75663071 22.31873652 23.12421874 -H 2.97362068 21.90845485 24.00277417 -H 1.87928277 22.53584296 23.29152111 -O 3.61700573 12.10343927 2.86215638 -H 4.22240799 11.46372320 3.28577555 -H 3.57404189 11.81424510 1.93348047 -O 8.08248923 9.92053306 0.36026520 -H 8.96039741 10.09734303 -0.13417838 -H 8.19067398 9.02193528 0.59144069 -O -11.81445125 31.97669850 28.69674063 -H -11.72416039 31.01729371 28.97131009 -H -11.31680642 31.91473175 27.88277250 -O 4.80227846 9.26082582 -1.14189727 -H 4.26812048 9.00861923 -1.91152135 -H 5.60549136 9.63869683 -1.48578017 -O 16.31333266 26.26280055 27.68895653 -H 15.59086243 26.44020853 28.27344092 -H 16.78098386 27.10043665 27.58554870 -O 22.93562091 19.01544863 19.95069329 -H 23.75828096 18.67421649 19.60391172 -H 22.49429372 18.41079871 20.55133473 -O 12.63888796 9.62933955 18.95409282 -H 13.00165696 8.77661874 18.78327755 -H 13.39326266 10.05637464 19.39860876 -O 31.48091150 1.24297942 36.01246492 -H 30.97957041 0.79326686 35.29667277 -H 32.27352802 1.42764920 35.52419159 -O 5.78773812 -1.74307203 15.67177515 -H 5.41524943 -1.00145438 15.19083337 -H 5.67001822 -1.46368579 16.58879949 -O -7.58494667 8.69523417 15.04861237 -H -8.26671878 9.35941780 14.96325265 -H -7.23616902 8.62680038 14.19345073 -O 8.80107730 2.58518715 9.51971481 -H 9.38634304 1.86460364 9.69443639 -H 8.51846073 2.44490513 8.54621333 -O 2.30873086 17.60741671 1.66139101 -H 2.94373998 17.10011404 1.18184970 -H 1.73497621 17.02379815 2.15531578 -O 1.50177853 17.86626436 11.33134108 -H 1.88415677 17.64765782 10.51584239 -H 2.15177747 17.73423219 11.98637351 -O 21.98874155 21.05026671 24.22934792 -H 22.51729020 20.91955551 23.40781097 -H 22.28165192 21.87258151 24.54238960 -O 7.54607827 24.64600106 3.14381782 -H 7.17083262 25.04399261 2.33564025 -H 7.01301629 24.94524194 3.86967951 -O 16.77811765 8.85368977 29.29720518 -H 17.65500963 8.88381899 29.62033325 -H 16.29423152 8.33880414 29.97644161 -O 9.65863199 27.01679365 15.01239750 -H 10.39017600 27.14100432 14.32372333 -H 9.46399459 27.94797348 15.21709929 -O 13.42608843 11.83112579 13.24957354 -H 13.08671743 12.56048317 13.78411043 -H 13.95325216 12.21049939 12.55865846 -O 1.78508237 18.27449488 17.36100476 -H 1.26182971 19.10467370 17.39773895 -H 1.27830219 17.59207776 16.90147723 -O 2.64069171 -5.58278985 4.75095702 -H 2.68728258 -4.70876244 5.19207995 -H 1.76375126 -5.81711915 4.65015073 -O 17.29952270 28.53821219 26.88912525 -H 18.17572798 28.24679438 27.17856507 -H 17.01499645 29.34996087 27.26419698 -O 10.71869642 7.95786719 10.72158983 -H 11.17658450 7.46774323 11.37481904 -H 10.52417012 8.76201250 11.18942577 -O 16.69548412 1.33395658 19.23752890 -H 16.94467607 0.42065090 18.96946358 -H 17.16813932 1.92608799 18.63373218 -O 8.58140492 17.47571458 1.92045388 -H 8.29954409 18.36114184 2.17921502 -H 9.54459658 17.50184657 1.93376015 -O 20.32094912 24.34413089 17.93758180 -H 19.47184665 24.12224241 18.21117427 -H 20.16577010 24.51679064 17.01303600 -O -2.01483737 9.85792613 6.43538302 -H -1.42187148 9.16927350 6.18296107 -H -1.75669077 10.59300822 5.96323877 -O 16.25991850 21.76687084 12.46169528 -H 17.10002928 21.60531678 12.96380574 -H 15.59015078 22.13719797 13.02708392 -O 27.05405836 33.57707724 25.63361452 -H 27.39966512 34.42619769 25.29608468 -H 27.71793655 32.91665366 25.51608543 -O 13.76438624 13.45115930 25.28181581 -H 14.50662387 12.89658752 24.98882955 -H 13.33551474 13.86064415 24.51977845 -O 15.29987966 16.28439309 14.56432608 -H 15.67396727 16.40375051 13.65642916 -H 15.80691149 15.58339971 14.96752165 -O 13.33547065 14.19880419 14.36842104 -H 12.87273371 14.33712087 15.20560236 -H 13.92286740 14.95520553 14.46872144 -O 4.35017247 10.38690152 7.03663564 -H 4.11908624 11.26283552 7.30076566 -H 3.53696677 9.95652204 6.71704766 -O -0.89622130 29.07102925 19.74140273 -H -0.77784987 29.16113089 20.70649514 -H -1.82611914 28.86940373 19.60543114 -O 9.18680910 24.00356383 12.09499195 -H 8.87579643 24.29888614 12.97336999 -H 8.47500387 23.39875644 11.77924776 -O 9.75807060 5.08386775 20.20193491 -H 9.74655379 5.20013903 21.12485670 -H 8.82489274 5.12596872 19.85497287 -O 4.30643682 -6.43022045 6.57762616 -H 4.41395370 -7.32557420 6.28673078 -H 3.82254840 -5.97593308 5.85519984 -O 12.06306107 25.48662156 38.56503437 -H 11.80702201 24.57209626 38.46533339 -H 12.79017644 25.45660700 37.92182461 -O 5.95025913 19.46881191 28.74944712 -H 5.13141186 19.92171308 28.72182918 -H 5.84826194 18.65908542 28.24643845 -O 5.56725031 7.57009601 9.13160820 -H 5.93430550 8.40554600 8.81802057 -H 4.89454661 7.80690482 9.74497887 -O 10.08834829 12.94053418 12.45337277 -H 10.38496024 13.77289147 12.77626662 -H 10.05430459 12.98546869 11.52414131 -O 21.10798360 10.50300426 16.95162943 -H 20.58317998 11.05076445 16.36398985 -H 20.94228498 9.57204281 16.79894248 -O 0.13791740 0.00951178 18.64705733 -H -0.09104176 -0.89776884 18.78864414 -H 0.15433085 0.41067450 19.52060325 -O 1.76254692 5.61279548 13.49522171 -H 2.54536642 5.20031615 13.22891835 -H 1.89345492 5.84243328 14.45960368 -O 16.43027890 24.59807599 22.93196647 -H 16.77135649 23.71302301 22.78274952 -H 15.61955220 24.49428391 22.37673325 -O 19.87868834 17.28515531 10.75107162 -H 18.93867365 17.60410912 10.71382121 -H 19.95698689 16.35211457 10.85516006 -O 7.94595654 20.82700538 9.32809653 -H 7.63442656 20.09800588 8.75247305 -H 8.88968457 20.90139698 9.19501349 -O 2.64414918 23.90300896 9.77592749 -H 2.27221888 24.83312145 9.67425213 -H 2.03593058 23.30758968 9.31142305 -O 16.01371418 3.64205698 23.51776997 -H 15.57695693 3.13159271 24.22228888 -H 16.49153715 2.97817742 22.96475812 -O 24.19281109 24.58402802 6.49093227 -H 23.31779610 24.40830357 6.00399673 -H 24.69503763 23.81300354 6.72890558 -O 3.80064439 13.18390007 8.28783023 -H 4.59835770 13.66627883 8.11489755 -H 3.64281645 13.24747861 9.22590496 -O 15.74697003 27.39438280 13.53825072 -H 15.91891611 26.90839112 12.76290898 -H 16.62360352 27.37838381 13.97931641 -O 23.12721509 11.23291899 22.01173392 -H 22.64681432 11.10277397 22.82318713 -H 22.56712256 11.50130970 21.33697885 -O 5.78041155 10.90595021 10.33080526 -H 5.66949885 11.36895722 11.14449371 -H 6.67948443 11.02048356 10.03845464 -O 4.87901977 12.45038737 12.75418774 -H 4.12257555 12.60985553 12.18908104 -H 5.32951546 13.29349507 12.62243945 -O 17.33653062 19.62941561 -7.36450396 -H 16.80196087 19.40230280 -8.12326610 -H 17.58433137 18.74705466 -7.05605448 -O 4.78134102 12.76245571 -8.85692309 -H 4.75834685 12.56690952 -7.90299485 -H 5.70016935 12.84579912 -9.13644515 -O 7.32419982 9.60151275 -2.08281876 -H 7.69006530 9.88595764 -1.15668402 -H 7.92321399 8.90814220 -2.40049359 -O 0.00066880 17.13375073 -5.67649997 -H 0.78790243 17.66018672 -5.96128553 -H -0.44029484 16.97326127 -6.49185609 -O 11.89885131 -1.07357818 2.76461006 -H 12.41090333 -1.15317397 3.51273793 -H 11.60629597 -0.14395668 2.76004010 -O 12.96957673 23.15478162 5.11873350 -H 13.94926053 23.07152528 5.10561958 -H 12.62500257 22.42583672 5.60595098 -O 22.01990583 17.85401519 2.28517944 -H 21.43711950 17.66436646 1.57357802 -H 22.32415781 18.73149006 2.20851345 -O 22.50586166 11.72886925 -15.39036454 -H 21.58920490 11.54097485 -15.54322051 -H 22.88873165 10.81933752 -15.34785018 -O -6.62898340 17.16048141 -7.11942221 -H -6.24853544 16.83068801 -6.32859269 -H -7.35781609 16.57284274 -7.39062007 -O 27.17844144 26.33424765 17.47003661 -H 26.33153908 26.01278309 17.72491463 -H 27.16886569 27.10066291 18.00189915 -O 12.74327360 11.02286725 8.73877689 -H 12.75660754 11.83150244 9.18636064 -H 13.55615003 11.10198953 8.19024928 -O 26.34271627 13.12777433 4.27515641 -H 27.10592945 12.71971431 3.81192445 -H 26.06492530 13.93967914 3.71536578 -O 17.09471442 21.90545792 -2.79654178 -H 17.07359107 21.68818548 -3.76412190 -H 18.03179834 21.81613349 -2.54147311 -O 21.30402089 -0.24232355 26.20929013 -H 21.33918794 -0.96617959 26.84968113 -H 20.40768769 -0.27436836 25.90170746 -O 33.42572503 19.04187117 -2.45911288 -H 32.98542743 19.26323695 -3.22215479 -H 32.72081839 19.33003961 -1.88733195 -O 2.99630268 11.18675975 -0.34183388 -H 3.70549063 10.73133923 -0.73167379 -H 3.31010796 12.03123186 -0.54463336 -O -1.97395419 21.35843895 11.66730626 -H -1.11260289 20.92650936 11.54463619 -H -1.76215247 22.19823746 11.23577163 -O 19.49345049 -7.42911699 25.82102599 -H 19.09954505 -8.16214343 26.26650213 -H 18.86340527 -6.70458426 26.03332195 -O 8.35768318 11.43676055 16.91101311 -H 8.09051686 11.60577431 16.02081565 -H 9.27654455 11.17256604 16.91757748 -O 23.66923535 -2.16162196 14.89837439 -H 24.21524651 -1.47325042 14.51074900 -H 23.36495041 -2.56734704 14.12201244 -O 30.91681788 25.31225672 0.48444737 -H 30.70969364 26.23990678 0.54408394 -H 30.29037064 24.97051145 -0.16173608 -O -1.21809697 -5.94323459 13.98507886 -H -0.37758552 -5.45520674 13.99036387 -H -0.86392682 -6.81598254 13.80027226 -O 17.33350795 7.10793519 0.27498653 -H 16.52788790 6.80227842 -0.25774731 -H 17.15915294 8.07170182 0.40800428 -O 14.42300652 32.67843532 15.09845891 -H 14.69986011 33.03323608 14.27718985 -H 14.78194957 31.79317697 14.98482000 -O 17.97937822 12.60581795 13.98042071 -H 18.33999352 12.14780629 13.22956494 -H 18.37592522 13.50932142 13.75152148 -O 20.26197536 25.33475891 15.23644911 -H 20.90803992 25.19103090 14.45648913 -H 19.49103654 24.79876502 15.08174492 -O 27.38996737 15.84053299 -5.92002950 -H 26.56187332 15.34369724 -5.93940782 -H 27.72442274 15.90485911 -6.81133852 -O 3.41972362 30.10054843 9.46656177 -H 3.30982088 30.83748312 10.08139658 -H 4.23795342 29.64017758 9.66011319 -O -2.25062204 15.91479162 -1.12356499 -H -2.60028069 16.69759663 -1.54095833 -H -1.40199567 15.95831824 -1.57838883 -O 19.94599622 12.98532423 15.78790553 -H 19.40196333 13.16893307 16.57493538 -H 19.22151340 12.83146562 15.10889303 -O 13.36224252 -0.84573806 25.51938843 -H 12.97832282 -0.95202414 26.37145448 -H 12.98988210 -1.62602179 25.03306770 -O -6.61587484 6.91051284 16.80794839 -H -6.87670438 7.56029323 16.15709531 -H -5.70360422 7.24051577 16.96116848 -O 28.44654152 10.46643142 15.15012670 -H 27.89755972 10.57886512 14.35798755 -H 28.90014506 11.31095611 15.31348547 -O 14.94858806 16.71735240 11.85727633 -H 14.96253430 17.71240391 11.83189319 -H 14.01901105 16.56655810 11.88710414 -O 15.88544391 11.92555509 -0.39222541 -H 16.29048926 11.24240633 0.13157428 -H 16.51177320 12.66994451 -0.15112823 -O 8.31522528 19.52637161 11.69660723 -H 8.23597511 19.96329200 10.83055444 -H 8.70286444 20.21467649 12.23380518 -O 10.84247456 7.65508868 27.07641246 -H 10.40812947 8.35496868 27.53052526 -H 11.61606642 7.50994722 27.63128914 -O 18.01678191 13.17137000 18.00275004 -H 18.07030681 13.71113259 18.79134992 -H 17.38599959 12.45541615 18.10487312 -O 13.15063229 31.70267753 33.35654260 -H 12.27422550 32.13424500 33.48986026 -H 13.05518521 30.77289276 33.63072841 -O 18.37059520 21.18062507 14.11766637 -H 18.80579794 20.63372141 14.77189878 -H 18.27749933 22.07902169 14.56894137 -O 23.03108583 25.79722028 9.03478515 -H 22.30343043 26.41019931 8.85766535 -H 23.37732801 25.61420050 8.16958301 -O 34.26163915 1.53539449 25.22236243 -H 33.95124699 0.73511996 24.72398472 -H 35.03468353 1.80400755 24.76281177 -O 6.92485616 19.28782762 7.03423368 -H 6.07677548 18.98092375 6.80321386 -H 7.54084718 18.58506703 6.76926160 -O 17.60340438 34.65596006 25.42267594 -H 17.93230695 35.46083012 25.80155364 -H 18.17515430 34.63135903 24.61870164 -O 12.18048480 2.87379198 17.94954109 -H 12.36605624 2.06894365 17.47324429 -H 13.03481962 3.00280031 18.36516925 -O 0.40016638 14.56616253 10.07545637 -H 0.14667385 14.17932242 9.24824871 -H -0.28590793 14.46646652 10.70447843 -O 4.00919733 19.43690904 18.23784822 -H 3.64925146 20.30180956 18.24983572 -H 3.30189447 18.84421235 18.18044790 -O 13.07177037 4.31582356 15.41794757 -H 12.48691133 5.00120453 15.58953056 -H 12.80864132 3.63038291 16.04548696 -O 19.55962323 -3.36396501 11.39207336 -H 19.11751254 -3.44322391 12.27752847 -H 20.44480773 -3.76755246 11.24658218 -O 17.75773969 33.89092291 18.97256337 -H 17.96676426 33.64945254 18.08825585 -H 17.12043674 34.57076603 18.84367207 -O 6.98141614 0.60011294 17.48605934 -H 6.05739832 0.46434616 17.53851374 -H 7.09680914 1.45714456 17.05721984 -O 16.12293559 11.33340001 17.71477317 -H 15.80957799 11.04434874 16.86483894 -H 15.39125825 11.54817078 18.27434402 -O 9.89215123 32.95247695 17.69026114 -H 10.30592400 33.82043745 17.55213725 -H 10.62215703 32.27422512 17.61742230 -O 9.07212521 9.25778002 20.06486819 -H 9.47023546 8.87412893 19.24971548 -H 8.17791153 9.50362165 19.83686500 -O 16.78214383 14.84794948 11.50737347 -H 17.46634449 15.11756113 12.14211442 -H 16.03627064 15.50853128 11.59958950 -O 12.16960360 9.46525895 -10.34321752 -H 12.65271403 10.01163518 -10.95211690 -H 12.77221807 8.73452357 -10.24977187 -O 25.95896527 8.19232946 -1.71717092 -H 26.30584473 8.31628165 -0.85202176 -H 26.65755320 7.81047831 -2.22113896 -O 5.18137716 18.12485417 11.49053723 -H 4.65916389 17.82226033 12.26400116 -H 5.96757170 18.19644014 11.98244581 -O 17.39173485 15.10100613 8.78697835 -H 18.22035632 15.59357404 8.69382102 -H 17.43562838 14.82617785 9.70409836 -O 5.03924117 29.89627277 15.79330531 -H 5.08396685 30.19809216 14.92431180 -H 4.10572124 30.06660971 15.98326455 -O 17.23227735 6.00372723 12.17579658 -H 17.84155392 5.79003505 12.88809193 -H 17.52369597 5.41641202 11.46106235 -O 16.34244139 23.60234295 9.14932035 -H 16.05748223 23.91754840 9.98952323 -H 16.63623227 22.69449159 9.30874127 -O 11.81669837 3.34536901 13.30528056 -H 12.52054610 3.73899115 13.83559899 -H 12.01646809 2.42303672 13.35367993 -O 18.18088912 3.23308629 -7.02780623 -H 19.06139274 3.06147659 -7.23298554 -H 17.91750994 3.99184331 -7.51955013 -O 28.14677807 7.23266965 7.33279972 -H 28.91912207 7.17057648 7.86379543 -H 27.63660324 6.40009718 7.42773073 -O 19.62771918 19.44367644 16.03084953 -H 18.83613546 19.56295641 16.57374734 -H 20.33906868 19.67688516 16.62874015 -O 7.77050672 12.57440948 7.14202163 -H 8.42316672 13.21121444 6.98573502 -H 7.04479620 13.06065413 7.47718120 -O 12.50554405 8.81186763 6.27800761 -H 11.82150524 8.46339723 6.85555014 -H 12.50497104 8.27665761 5.48624903 -O 6.77791736 10.68663253 -5.79802511 -H 6.39429327 11.53507583 -5.56674031 -H 7.39764970 10.95781010 -6.48290860 -O 15.78302908 11.30749585 14.93412364 -H 15.13798564 12.00219379 14.79334643 -H 16.55569880 11.64263759 14.47559145 -O -1.23729546 6.92372378 22.52819773 -H -0.95637185 5.95618207 22.50174412 -H -0.48507452 7.42973563 22.93576811 -O 20.58857301 14.06900413 23.06615536 -H 19.72861992 14.41593893 23.43352146 -H 21.26935182 14.73832426 23.26837067 -O 7.13148578 4.53023913 4.21266885 -H 7.71568743 4.55802291 3.43434856 -H 7.35088274 5.33140667 4.77950031 -O 8.93828080 21.51227307 -0.01270266 -H 8.56023253 22.47643895 -0.08869531 -H 8.52112351 21.23077232 0.82278777 -O 31.59249801 16.46132370 -4.49850489 -H 32.23734953 17.08800979 -4.16415579 -H 30.78003366 16.52610906 -3.97554272 -O 22.35739979 -2.31375581 17.40199423 -H 21.68953869 -1.67393282 17.51763224 -H 22.61963476 -2.16493950 16.49523535 -O 23.47970186 -9.26795540 26.36995724 -H 23.25078358 -9.08541822 25.44953424 -H 23.03532869 -8.63155472 26.88232108 -O 10.59197415 6.67662966 32.13458849 -H 9.68358984 6.65970420 31.86172146 -H 10.87756734 5.82236721 31.83582318 -O 14.26703003 16.70843813 5.21459534 -H 14.17858516 17.52426869 4.70033472 -H 13.40268723 16.34086832 5.28562619 -O -2.81768224 15.98831302 12.47235055 -H -3.25412720 16.66412075 12.98497148 -H -1.90303263 15.95966629 12.80848499 -O 14.61564071 15.85589231 7.76365100 -H 14.89723220 15.78739811 6.85075347 -H 15.46997107 15.84704755 8.15057377 -O -1.02332713 9.61413172 17.31988865 -H -1.76013540 10.14366090 17.18918010 -H -0.72057334 9.57901983 18.24780701 -O 10.99538795 10.62888423 21.60714906 -H 10.38375990 10.28162078 20.97039195 -H 11.68500183 9.95060635 21.68064261 -O 14.12210941 4.57491311 4.32989482 -H 13.78384358 3.67104180 4.50801195 -H 15.09694221 4.70186941 4.49325709 -O 30.07302834 3.09020902 0.90501502 -H 30.21452624 3.37335195 1.77489180 -H 30.80000326 3.35472571 0.27898627 -O 9.75522227 16.62805417 -2.75758169 -H 9.92116650 16.04621742 -1.98716068 -H 9.26306227 17.44852998 -2.63676072 -O 10.12861213 22.06677670 19.54423546 -H 10.10159631 21.86979006 20.48289808 -H 10.85163623 21.51273046 19.28084188 -O 16.55928179 15.24680626 16.90540332 -H 15.70680573 15.34106718 17.39226821 -H 17.07338905 14.40294735 17.25189466 -O 0.68920871 13.10065863 14.04670463 -H -0.01919202 12.92986930 13.44819396 -H 0.47652959 12.92424017 14.94746708 -O 3.09256279 13.84166795 10.84301852 -H 2.15002389 13.94907067 10.54255792 -H 3.42977538 14.71248779 10.52115692 -O 4.44419930 7.65597601 13.44868424 -H 4.23855055 8.28880294 14.15140686 -H 5.38553139 7.89197246 13.41313620 -O 27.95000479 14.37384422 14.00300287 -H 28.52353581 13.60985697 13.77632546 -H 27.02117557 14.13267241 14.11713945 -O 28.17500931 4.41987074 22.29032350 -H 27.53554183 4.19558220 21.60806204 -H 27.76319409 4.75161063 23.07270178 -O 3.23081189 -6.17740365 15.04850269 -H 2.76783693 -6.15370317 15.87137328 -H 3.94535593 -5.56743914 15.07325414 -O -4.29575676 20.36270606 5.22060940 -H -4.23947261 19.40799930 5.01144355 -H -3.36906767 20.58412780 5.21452308 -O 9.82825603 38.36658149 9.94154847 -H 9.26574482 37.57131102 9.77177228 -H 10.24887910 38.82162461 9.14673633 -O 14.14266530 21.58020442 17.76689928 -H 13.27178894 21.24382708 18.07949755 -H 14.69547339 21.29980869 18.43549287 -O -11.46318301 14.00476614 9.58671598 -H -10.74220273 13.62606784 10.10376017 -H -11.02144146 14.66957647 9.05917884 -O 15.05993643 9.48618149 22.64589878 -H 15.04272615 9.75526511 23.55290869 -H 15.58945303 10.22418053 22.24821847 -O 14.88037919 31.11231500 23.64577066 -H 14.91639520 31.56455039 22.78249090 -H 15.31512706 30.18194568 23.56565952 -O 2.38032520 14.48447524 6.50493425 -H 2.21654392 14.05607881 5.58594208 -H 2.80805375 13.85771839 7.11145934 -O 6.19753461 28.80397531 10.88100367 -H 6.92244304 29.22969669 11.25641694 -H 6.41052493 27.89930498 11.07405643 -O 13.83695116 -2.37462956 13.70108405 -H 13.84079279 -3.04911983 14.35652565 -H 12.91357448 -2.27946488 13.35903588 -O 20.62307420 24.18592731 21.94399951 -H 20.04016937 23.62684648 21.40331365 -H 21.23944805 24.52028171 21.30520467 -O 7.59202935 28.14844645 -0.24331789 -H 8.27991997 27.49996456 0.06993422 -H 7.74969079 28.08585191 -1.22837848 -O 18.02218002 3.96382611 35.26400369 -H 17.58907151 3.51167981 34.54230342 -H 18.80275524 4.20265430 34.80868715 -O 26.28569770 4.78624179 -0.26782661 -H 25.67795967 4.72388890 0.47313847 -H 27.11895847 5.16263894 0.06760255 -O 16.01149151 19.41205667 6.32532577 -H 16.53946848 20.19640786 6.33204739 -H 15.50554173 19.37517380 7.11811322 -O -8.31885155 6.46405654 2.89327912 -H -8.27580289 7.16909395 3.55203362 -H -8.33615059 6.77499682 1.97636861 -O 15.27100393 17.87783210 19.58908299 -H 15.28220694 16.94327393 19.54396405 -H 14.58386728 18.14706472 19.03165087 -O 17.45611111 -3.77694615 9.47038191 -H 17.66521784 -3.93614740 8.56042763 -H 18.23605415 -3.56845328 10.04391159 -O 9.16626560 24.80350280 19.01837275 -H 8.34313310 25.05403385 18.60056580 -H 9.35235331 23.80915635 19.14644040 -O 22.41483568 6.34883805 18.15725488 -H 23.01265304 5.67417824 17.73602401 -H 22.10508702 5.87471822 18.91245095 -O 17.36245069 11.44872238 9.46111214 -H 16.83818075 10.71888391 9.12904562 -H 17.33801407 12.08558872 8.74991491 -O 12.70955748 -3.49265843 1.41927646 -H 12.45750300 -2.80213150 1.98755594 -H 13.67431176 -3.61394865 1.65644832 -O -1.30176486 -6.76827153 -8.33007525 -H -1.13105651 -6.37453444 -9.21771918 -H -1.99987119 -6.22950292 -7.94113383 -O 3.61184628 12.12964778 18.67769223 -H 2.93646894 12.46779253 19.24439525 -H 3.72533034 11.19293359 18.95657425 -O 24.43428036 12.15218556 16.44271175 -H 24.54163367 11.26257170 16.77435643 -H 24.55217197 12.83040971 17.07503024 -O -7.08033347 18.09768495 13.22095269 -H -7.30223440 18.02588406 12.27865375 -H -6.14107771 18.20921900 13.18667126 -O -4.06174025 27.50134908 17.51218996 -H -3.25917240 27.82397897 17.02201352 -H -3.90826232 26.54612852 17.61439459 -O 13.57046479 7.32541926 17.58730100 -H 13.92995754 7.46879531 16.75108594 -H 12.85345668 6.67490707 17.53165429 -O 19.60462101 6.78662781 2.23905359 -H 18.87107518 7.04502207 1.72737330 -H 19.34804522 6.66184251 3.17785137 -O 4.77707776 -0.46027157 23.17635561 -H 4.18322379 -1.16620807 23.15078711 -H 4.24464913 0.36097189 23.12586688 -O 16.14874564 -9.84575748 28.31203676 -H 15.68115118 -10.59883441 28.72064038 -H 15.96482150 -9.11323270 28.86390666 -O -10.50371550 1.77285958 29.81391244 -H -9.86825138 1.21322399 30.33470038 -H -11.31643674 2.00344686 30.36741210 -O 17.83518460 13.94760763 24.25922740 -H 17.96845386 14.24426311 25.15166975 -H 17.77855167 14.78931685 23.81028386 -O 15.50081563 10.85236219 28.06563888 -H 15.19634823 11.53803067 28.69914273 -H 15.86388644 10.05179372 28.53330729 -O 31.53456946 16.32983368 0.13465344 -H 31.12076165 16.59426467 0.96827853 -H 32.32634611 16.85431924 0.25511515 -O 5.11103327 14.42965486 3.50024675 -H 4.60533314 13.72097587 3.12369601 -H 6.00883722 14.15246980 3.56831006 -O 13.10273230 4.28666999 25.80546634 -H 13.84930443 4.90635407 25.90705049 -H 13.59957956 3.48418501 25.77430214 -O -1.42057867 20.63513061 -2.81388666 -H -1.79541206 20.09982960 -3.46747125 -H -0.71604081 20.03484120 -2.61789623 -O 10.21254986 22.58704237 22.59045516 -H 9.86417487 23.46461403 22.57700809 -H 9.68643311 21.96377329 23.08882203 -O 10.46875156 15.32461044 16.03727888 -H 9.55108956 15.20323041 16.07475740 -H 10.85623681 14.51917738 16.31723644 -O 7.27125680 8.55736588 13.64879631 -H 7.70271684 7.72289220 13.49393904 -H 7.81152823 9.33210201 13.48186678 -O 29.36932942 4.95937888 28.20983539 -H 30.24951541 4.64699029 28.56303120 -H 29.15401097 5.69393417 28.78227743 -O 25.92349456 15.86300318 16.17810930 -H 26.80504209 15.54068779 16.01143198 -H 25.49261199 15.21142822 16.74955792 +192 +Lattice="11.74456431055329 0.0 0.0 -5.29177210903e-07 11.74456431055329 0.0 -5.29177210903e-07 -5.29177210903e-07 11.74456431055329" Properties=species:S:1:pos:R:3:forces:R:3 cutoff=-1.0 nneightol=1.2 energy=-30010.461001933934 pbc="T T T" +O 5.73416426 3.02709473 1.80318722 -0.80332611 -1.21376692 0.20230786 +H 5.56943139 2.10076473 1.36991809 0.50217575 1.53231646 1.34795286 +H 5.56662675 2.96533975 2.79956970 0.54751666 -0.28190205 -1.62430029 +O 1.78772996 10.85151956 1.15475463 -2.83291472 2.12456520 -0.92718649 +H 1.27361313 11.62702876 0.64046847 1.81789416 -2.16291579 1.69135469 +H 2.16766332 10.15956744 0.55739294 -0.13023518 0.45973042 -0.26124271 +O 7.52468827 9.97186828 10.15051851 -1.51298176 3.37316030 2.50257924 +H 8.17832796 9.32362620 10.34398569 0.48150767 -0.47552780 0.31697757 +H 7.43679193 10.62175081 11.03466779 1.05936697 -2.82762853 -2.99742426 +O 7.91178140 4.58707211 0.75474958 1.34499609 1.23814613 -2.36786880 +H 8.06085062 4.79654691 1.63976672 0.38014497 0.68880399 2.57828797 +H 7.13320297 4.09945648 0.81464715 -2.16483898 -1.83566563 0.07202743 +O 8.92351531 5.17808368 9.14508181 2.09709552 -3.02514590 -0.30432053 +H 8.62775816 5.97546907 9.42279401 -2.76871939 4.09653535 0.85838888 +H 9.79237137 5.33770469 9.55709918 0.94460315 -1.16752304 -0.52726150 +O 11.39392620 4.75242940 10.31763267 -1.23014486 0.11996567 -0.73341779 +H 11.04689178 4.60206370 11.18738833 -0.18260446 -0.43417416 1.22912156 +H 0.40332564 5.30748867 10.49062070 1.23808957 1.01266029 -0.11816898 +O 0.06869249 6.49660278 7.03350598 -8.74972508 3.31707423 -1.29926643 +H 11.62972756 7.37731241 6.49459191 0.80802095 -2.94173414 0.93328515 +H 0.92074189 6.41346904 7.01763066 7.99459174 -0.50270591 0.52857277 +O 2.58803640 5.05946331 5.42406641 -2.78970988 -0.38920966 -3.53642028 +H 2.09149884 4.27517506 5.74982790 0.69823994 0.18291556 0.51624689 +H 2.05534545 5.27435689 4.54993445 1.81884547 -0.35324094 2.29502427 +O 3.93554913 4.81396213 0.78823062 -4.93885484 -11.15967257 12.97271248 +H 4.29762276 5.26709128 0.27274428 7.51580070 11.72099606 -13.81315506 +H 4.79081063 4.49826559 1.22479124 -1.65517925 -0.69692353 0.36172507 +O 4.09431817 7.33063898 3.19968059 -1.06004574 -1.11637349 -0.28933974 +H 3.38943825 6.58815044 3.16480781 1.14148290 1.68970918 -0.61438594 +H 4.19910055 7.70582563 2.28520416 0.06644145 -0.21912545 1.05279008 +O 4.01414782 0.34585435 10.69001467 0.27125870 -3.90565143 1.86140239 +H 3.97934383 11.01133108 10.83765511 -0.38882553 3.49365767 0.06856364 +H 3.76050260 0.40037812 9.77321516 -0.24997767 0.45197288 -1.37139619 +O 9.40067440 2.29813725 7.12410112 -2.25397402 -0.18400931 -3.24547412 +H 8.77407566 2.12047129 7.78176256 -1.42089509 -0.29561015 1.47685774 +H 10.18867218 2.35986048 7.56548783 3.33147756 0.45038600 1.81095218 +O 10.91142242 11.36201681 9.39247215 0.01736164 0.75490194 5.37813315 +H 10.21386102 0.09946732 9.94308104 1.27966947 -0.25601514 -1.75074206 +H 10.90565439 11.26390736 8.49001334 -1.04485051 0.02427020 -3.42446926 +O 9.59271281 7.85595320 8.22637725 1.68824880 -3.33631637 -2.48706005 +H 10.24471205 7.11245922 7.84028956 -2.08559754 2.31028120 1.60193682 +H 10.10252213 8.20510433 8.96706659 0.16744728 0.53774132 0.59653734 +O 8.17668751 11.46557679 0.59883281 -0.66836885 3.34592202 -5.23775086 +H 7.40086080 0.24360726 0.81692790 -0.70252854 0.12888586 -0.06194922 +H 8.35316811 11.04541009 1.33745836 1.62912882 -3.53077414 5.68080355 +O 0.94004098 10.15162978 3.54788449 -1.08457407 -1.07225848 -2.11326262 +H 0.69010529 9.19133189 3.77189578 0.19180130 1.74153750 -0.34616217 +H 0.93777081 10.30122818 2.50966526 1.29074064 -1.02193169 1.68592452 +O 2.27424490 5.50915811 2.47661814 3.42542057 -4.02492496 3.71742602 +H 2.87039478 5.20416153 1.76153568 0.28323491 -0.31793299 0.44400092 +H 1.75867813 6.03341397 2.01906506 -5.01572057 4.50292924 -3.15397366 +O 8.94351821 9.24398503 5.88873692 -1.92119599 -4.43389509 -2.57106317 +H 9.09221700 8.40449830 6.46427006 -0.54337204 2.43464552 -0.54531580 +H 8.36787924 8.80270415 5.00977887 2.04375025 1.37647669 3.10278297 +O 2.82171577 2.69312570 11.50923391 0.69614192 -0.37589905 1.50967018 +H 3.43897452 3.14968922 0.41529298 -1.06053939 -1.03034434 -1.56750974 +H 2.93838347 1.70842217 11.51627197 0.70775303 1.01310766 -0.29180954 +O 8.16112970 2.63468866 9.79782190 -1.27590023 2.29413467 1.11429604 +H 8.54928118 3.61930224 9.73373854 -1.52802272 -2.32642774 -0.06867111 +H 7.16627654 2.73929112 10.09193859 2.77315197 0.05309382 -1.14957673 +O 1.59972917 8.97754430 9.43268962 -4.27687261 0.84039630 2.26111141 +H 1.59251119 9.12142758 8.50784661 0.80233881 0.43452331 -2.11537093 +H 0.58284107 9.31288390 9.64240255 3.61139368 -1.36863482 0.04291019 +O 5.26826606 3.30655851 9.49391542 -0.84340449 0.50978314 1.64621124 +H 4.78704289 2.59503212 9.98054679 0.22770831 1.03334739 -0.67504858 +H 4.89323288 4.20901733 9.82787916 0.44176714 -1.60587061 -1.14998811 +O 7.36117251 0.04299829 7.68322976 -0.43534967 -0.03071647 3.23220208 +H 7.04043820 0.88966860 7.30592641 -0.03364444 -0.06154709 0.77135186 +H 7.21231496 0.07133097 8.74782847 0.53084562 -0.30424906 -4.25693627 +O 4.18004487 0.62351363 4.09110077 -1.56364280 2.67147508 0.69047006 +H 4.80862273 1.37200834 4.08969845 0.44022654 -0.29248317 0.30456530 +H 3.28940788 1.15635275 4.10035608 1.67807237 -2.07241806 -0.35558115 +O 2.70842422 6.37716749 7.53125007 2.06494643 5.11524802 -0.69604422 +H 2.64632527 5.94334801 6.65921894 0.39734926 -0.66881108 -0.10087985 +H 3.09797273 7.37493112 7.16849909 -1.55386232 -3.75355518 1.65329206 +O 6.41182859 2.43882960 7.01329141 -4.92870926 2.02800480 0.61801120 +H 5.72035273 2.64918283 6.21809682 2.70379386 -1.03493633 1.32465351 +H 5.74453613 2.77554505 7.76408804 2.33632649 -1.16785214 -1.14451680 +O 10.57301359 4.37816353 1.12879320 4.89504836 -1.30601815 2.06174798 +H 10.93983923 3.52935799 1.61142928 -2.07324081 1.97823337 -1.66711946 +H 9.71802197 4.32374295 0.82312457 -3.01427013 -1.27858446 -0.62062344 +O 4.08049606 10.52136590 2.32719437 0.42891316 2.23963240 1.86107843 +H 3.15932554 10.71626186 1.93731777 1.63434302 0.18014648 1.02641569 +H 4.27975774 11.25147169 3.16363304 -1.47402439 -2.26965261 -2.92434833 +O 1.84757461 2.91355447 6.97180392 -2.90159406 -1.25619014 -2.57119687 +H 1.40897666 2.99356607 7.80562845 -0.14525659 0.44582177 1.66832274 +H 0.95316987 2.61135724 6.50289999 2.62214073 0.34147968 0.65385239 +O 5.97425196 7.07160674 6.51708194 -1.32986257 4.64477707 0.74215954 +H 6.45172856 6.31562418 6.45929579 1.62818266 -4.29121937 -0.25735983 +H 5.04161946 6.94539798 6.38552849 -0.03046759 -0.33969019 -0.12541847 +O 3.26609762 9.55064322 11.51695990 -2.28802058 2.61571811 -1.59542165 +H 2.90240471 9.12894190 10.76187694 -0.52591939 -0.96484803 -1.23090590 +H 3.99413434 9.15122026 0.17271762 2.46309222 -2.04713382 1.18471344 +O 10.53697662 4.56069792 5.76512112 1.37467177 5.21414812 -0.75573497 +H 10.35298171 3.68800003 5.75575469 -0.26204901 -4.34917206 0.71721469 +H 11.27576093 4.91570703 6.31964592 -1.20071085 -0.75218685 -0.31628954 +O 4.63525899 10.81807556 6.19613596 6.71521024 -1.10373908 4.35700365 +H 4.35573171 11.34174933 5.54381921 -2.37777269 3.55238684 -4.56307766 +H 5.67410264 11.23263298 6.27461294 -3.69088709 -2.18111407 -0.04988097 +O 0.14165280 7.33720078 1.35500587 -5.25636565 -0.09894072 6.15964602 +H 0.43427986 7.46266870 0.56089609 3.84631548 0.76780374 -7.44962047 +H 10.92671564 7.65920512 1.13098929 2.25378890 -0.78840343 1.73881728 +O 10.27603934 2.10768108 2.86506067 1.27164762 -1.00033441 0.95626568 +H 11.01111940 2.17232008 3.54679438 -1.62994129 0.20511087 -0.66830200 +H 10.25354931 1.09798979 2.87938021 -0.22944278 0.78903592 -0.44897292 +O 5.69627517 0.40138197 0.90041090 2.59900079 0.43527099 4.94188874 +H 5.24481822 0.44575031 0.13631182 -2.71563637 0.20740533 -4.72132913 +H 5.15967360 11.54675258 1.48204016 -0.21494998 -0.23595898 -0.06999420 +O 6.15025630 7.53315510 9.28182120 3.37681641 -8.71825476 -0.73325838 +H 5.88831358 8.32623299 9.17037648 -3.12216395 9.38792459 -0.76454872 +H 6.54803881 7.35413445 8.40211700 -0.57476523 -0.20697287 0.55008777 +O 11.51516070 7.99909564 4.70859766 -1.85752516 -3.33904174 -2.28857594 +H 10.55803788 8.11683757 4.90491182 0.94879405 0.68445368 -0.18751835 +H 11.33058369 7.11780391 3.97989418 0.73715617 2.85156037 2.24620414 +O 4.32177970 9.39263090 8.51430257 10.95624679 -10.19283450 -11.15278201 +H 4.15839623 9.72273165 7.58681367 0.74426271 -1.00007216 1.44278033 +H 3.83315863 9.85920645 8.89837939 -11.80157447 10.92359377 9.90425375 +O 7.32079629 7.68735734 4.30241710 11.26303096 2.57085748 -17.99639319 +H 7.49129719 6.77442082 3.96804590 0.55662866 -0.25286348 0.13183903 +H 6.92412505 7.59215836 4.94862185 -11.68489776 -2.23415081 18.08807877 +O 10.60936807 5.82587067 3.33454140 -3.62983878 8.74340016 19.17817558 +H 10.85887512 5.24453775 3.99905568 0.76538690 -2.26595537 2.00967797 +H 10.70514914 5.60689714 2.61041531 3.34908448 -6.50093440 -20.65116124 +O 8.16710940 1.89280867 4.64662571 -2.78388890 -0.72861497 -4.24536116 +H 8.53457006 2.07518431 5.44433390 2.39779131 1.05826653 3.94904653 +H 8.71888248 2.16570536 3.89810984 0.79682122 0.07677472 0.24100195 +O 7.35476947 9.37220466 2.30818103 -1.57494023 0.21925041 2.66969073 +H 7.02816129 10.06029379 3.00869524 1.12488899 -1.41697158 -1.75353428 +H 7.24983362 8.55541964 2.92457723 0.16987646 1.65735955 -1.30613127 +O 7.59850849 4.79108580 6.60704207 -0.18279832 -1.17206875 0.89977338 +H 7.35064188 3.91050317 7.03265930 -0.45973248 0.75343126 -1.50952619 +H 8.26643596 4.99101424 7.26121093 0.89534594 0.76599882 -0.01246266 +O 10.40399439 11.10430751 6.79294202 2.81111175 -0.62073657 -1.02525355 +H 9.63001980 11.47674243 7.07319427 -3.06936890 2.63521222 1.66147846 +H 9.93990598 10.35631552 6.42130087 0.40481317 -1.41940385 -0.75827008 +O 3.49465984 8.56023515 5.57334730 4.08231201 1.30895435 -3.78476839 +H 4.21974904 9.43364214 5.51672534 -2.68191376 -2.97917456 0.99539275 +H 3.65141801 8.24495137 4.57004848 -0.61115664 0.20748555 2.30058300 +O 10.64836843 8.95923477 10.32953916 -2.39696341 0.22372670 2.32516276 +H 10.35155293 9.90349858 10.16999223 0.96258032 -1.01845041 -0.24083020 +H 10.06870771 8.69586327 11.18304908 2.34525851 0.93941467 -2.29535337 +O 11.45213569 2.78041878 8.81582775 0.13917079 0.55494715 -5.11691409 +H 11.40535643 3.52377517 9.35537683 -0.02186930 2.41838071 2.07431039 +H 11.49658658 2.03804136 9.30441706 0.27983642 -3.85064522 2.72189444 +O 5.72252236 2.78391664 4.58865435 2.00202122 0.11734314 -0.87511135 +H 5.58377209 3.78623649 4.59301477 0.76167423 -0.88388396 -0.15393664 +H 6.80527185 2.57167953 4.53785334 -2.41439550 0.27077174 0.34678438 +O 3.49103498 0.47779834 8.23103401 1.10622791 -0.34709034 -2.37964446 +H 4.13096898 -0.02426013 7.57813517 -2.14205385 1.52066936 1.47370043 +H 2.91503088 1.07665866 7.70577271 0.67948116 -0.68213454 0.43600941 +O 4.20392664 5.85068908 9.77697231 -3.57610785 -0.45028264 -2.74477212 +H 3.54920743 6.04214539 8.83884695 1.55419656 -1.34864705 2.76174141 +H 4.72216576 6.61011129 9.59234238 1.78331795 1.13481345 0.09583637 +O 1.45781442 6.56317328 10.70033363 2.20226397 0.63186945 -0.26552977 +H 2.44013666 6.43590616 10.96735645 -2.54561438 0.39446191 -1.41605113 +H 1.41492990 7.19966763 9.90556238 0.60172068 -0.81249982 1.68488579 +O 7.98681873 5.23825113 3.84425018 3.13433042 -1.45225227 2.74527092 +H 9.01755010 5.30341401 3.65056603 -2.77410842 0.24112279 0.40572437 +H 8.05524134 4.91626267 4.90003810 -0.71303407 1.02736700 -3.07754501 +O 10.04494765 1.29552636 11.26724117 1.73607648 6.18659119 -7.11522264 +H 9.25266353 1.89236946 10.78695994 2.14781312 -1.66582877 1.26821777 +H 9.64420175 0.85762163 0.14036796 -3.95195702 -4.15348017 5.70846863 +O 1.65347770 0.84323330 3.65143388 1.42823302 18.52259540 -1.58570801 +H 1.30082871 1.18126641 2.78746213 0.06763907 -0.72436750 0.47733529 +H 1.56093519 11.80917156 3.71966599 -1.83660666 -17.48993707 1.07095236 +O 9.54164721 8.40767336 0.89833123 11.90981796 -1.53191537 -0.18516168 +H 9.00596112 8.92785456 1.26700370 -5.91832217 7.89755826 6.08966056 +H 8.94113691 7.98808875 0.49614438 -7.23364771 -6.68636245 -5.64295689 +O 5.09521982 8.37512896 0.81392218 4.28942474 -0.28139245 -0.78329207 +H 5.86312474 9.13169362 1.08096087 -2.32849491 -3.31964533 -0.61849971 +H 5.54545966 7.65089703 0.19278931 -0.77571760 2.85232141 2.11019787 +O 7.30703768 11.10160871 4.63375612 -0.88771490 -3.55613037 3.03358941 +H 7.63533922 10.74907085 5.55297398 -0.86701751 0.61395914 -2.54795409 +H 7.79843164 0.12321944 4.54375366 1.37331423 2.81788919 -0.43847047 +O 10.24857504 11.03916580 3.08253663 2.08557697 -0.83679675 1.42397013 +H 11.34180224 10.69340141 3.15046182 -3.53841546 0.81605308 0.79711433 +H 9.89365589 10.83162249 3.99602350 0.78547751 0.29104335 -1.77379458 +O 11.39159782 1.59286574 5.25942351 10.18846363 14.10111874 -9.35825404 +H 11.14796463 0.93367498 5.59827155 -6.44107909 -15.49337173 8.38653088 +H 0.63682773 1.17983234 4.75863136 -3.26021169 1.80275036 1.16045250 +O 7.51865565 7.18246937 11.26967539 2.85097416 -4.61661833 5.64131139 +H 7.03461725 7.13050416 10.50220968 -1.92595253 0.25077060 -3.35841759 +H 7.61030914 6.12718417 11.64062861 -0.25806174 3.92457476 -1.28720280 +O 1.75378853 9.68542466 6.78468686 -3.15344401 -0.46783763 0.39065667 +H 2.25816320 9.04199808 6.22910370 -0.18277466 0.61772838 -0.22779213 +H 0.77725020 9.49312166 6.62916167 2.16249413 0.72466575 0.07833126 +O 0.79380286 1.53270887 1.01780886 -0.44967946 0.87239112 -0.65009858 +H -0.05250973 1.65674801 0.40803849 2.46039770 0.24974010 1.38686909 +H 1.63024682 2.14220989 0.87222163 -2.73532074 -0.92775214 -1.05769575 +O 5.12024461 5.20156327 4.72964303 16.37304935 -0.02624223 3.03762604 +H 5.10836987 5.84100514 4.17073135 0.04007426 6.65016130 -5.75084043 +H 4.40036251 4.91235205 4.83038250 -16.81327383 -5.96156814 2.63335074 diff --git a/tests_extensive/bulk_small_unit_cell.xyz b/tests/bulk_small_unit_cell.xyz similarity index 100% rename from tests_extensive/bulk_small_unit_cell.xyz rename to tests/bulk_small_unit_cell.xyz diff --git a/tests_extensive/test_cpp_extension.py b/tests/test_cpp_extension.py similarity index 100% rename from tests_extensive/test_cpp_extension.py rename to tests/test_cpp_extension.py diff --git a/tests_extensive/bulk.xyz b/tests_extensive/bulk.xyz deleted file mode 100644 index 6a7e03a..0000000 --- a/tests_extensive/bulk.xyz +++ /dev/null @@ -1,194 +0,0 @@ -192 -Lattice="11.74456431055329 0.0 0.0 -5.29177210903e-07 11.74456431055329 0.0 -5.29177210903e-07 -5.29177210903e-07 11.74456431055329" Properties=species:S:1:pos:R:3:forces:R:3 cutoff=-1.0 nneightol=1.2 energy=-30010.461001933934 pbc="T T T" -O 5.73416426 3.02709473 1.80318722 -0.80332611 -1.21376692 0.20230786 -H 5.56943139 2.10076473 1.36991809 0.50217575 1.53231646 1.34795286 -H 5.56662675 2.96533975 2.79956970 0.54751666 -0.28190205 -1.62430029 -O 1.78772996 10.85151956 1.15475463 -2.83291472 2.12456520 -0.92718649 -H 1.27361313 11.62702876 0.64046847 1.81789416 -2.16291579 1.69135469 -H 2.16766332 10.15956744 0.55739294 -0.13023518 0.45973042 -0.26124271 -O 7.52468827 9.97186828 10.15051851 -1.51298176 3.37316030 2.50257924 -H 8.17832796 9.32362620 10.34398569 0.48150767 -0.47552780 0.31697757 -H 7.43679193 10.62175081 11.03466779 1.05936697 -2.82762853 -2.99742426 -O 7.91178140 4.58707211 0.75474958 1.34499609 1.23814613 -2.36786880 -H 8.06085062 4.79654691 1.63976672 0.38014497 0.68880399 2.57828797 -H 7.13320297 4.09945648 0.81464715 -2.16483898 -1.83566563 0.07202743 -O 8.92351531 5.17808368 9.14508181 2.09709552 -3.02514590 -0.30432053 -H 8.62775816 5.97546907 9.42279401 -2.76871939 4.09653535 0.85838888 -H 9.79237137 5.33770469 9.55709918 0.94460315 -1.16752304 -0.52726150 -O 11.39392620 4.75242940 10.31763267 -1.23014486 0.11996567 -0.73341779 -H 11.04689178 4.60206370 11.18738833 -0.18260446 -0.43417416 1.22912156 -H 0.40332564 5.30748867 10.49062070 1.23808957 1.01266029 -0.11816898 -O 0.06869249 6.49660278 7.03350598 -8.74972508 3.31707423 -1.29926643 -H 11.62972756 7.37731241 6.49459191 0.80802095 -2.94173414 0.93328515 -H 0.92074189 6.41346904 7.01763066 7.99459174 -0.50270591 0.52857277 -O 2.58803640 5.05946331 5.42406641 -2.78970988 -0.38920966 -3.53642028 -H 2.09149884 4.27517506 5.74982790 0.69823994 0.18291556 0.51624689 -H 2.05534545 5.27435689 4.54993445 1.81884547 -0.35324094 2.29502427 -O 3.93554913 4.81396213 0.78823062 -4.93885484 -11.15967257 12.97271248 -H 4.29762276 5.26709128 0.27274428 7.51580070 11.72099606 -13.81315506 -H 4.79081063 4.49826559 1.22479124 -1.65517925 -0.69692353 0.36172507 -O 4.09431817 7.33063898 3.19968059 -1.06004574 -1.11637349 -0.28933974 -H 3.38943825 6.58815044 3.16480781 1.14148290 1.68970918 -0.61438594 -H 4.19910055 7.70582563 2.28520416 0.06644145 -0.21912545 1.05279008 -O 4.01414782 0.34585435 10.69001467 0.27125870 -3.90565143 1.86140239 -H 3.97934383 11.01133108 10.83765511 -0.38882553 3.49365767 0.06856364 -H 3.76050260 0.40037812 9.77321516 -0.24997767 0.45197288 -1.37139619 -O 9.40067440 2.29813725 7.12410112 -2.25397402 -0.18400931 -3.24547412 -H 8.77407566 2.12047129 7.78176256 -1.42089509 -0.29561015 1.47685774 -H 10.18867218 2.35986048 7.56548783 3.33147756 0.45038600 1.81095218 -O 10.91142242 11.36201681 9.39247215 0.01736164 0.75490194 5.37813315 -H 10.21386102 0.09946732 9.94308104 1.27966947 -0.25601514 -1.75074206 -H 10.90565439 11.26390736 8.49001334 -1.04485051 0.02427020 -3.42446926 -O 9.59271281 7.85595320 8.22637725 1.68824880 -3.33631637 -2.48706005 -H 10.24471205 7.11245922 7.84028956 -2.08559754 2.31028120 1.60193682 -H 10.10252213 8.20510433 8.96706659 0.16744728 0.53774132 0.59653734 -O 8.17668751 11.46557679 0.59883281 -0.66836885 3.34592202 -5.23775086 -H 7.40086080 0.24360726 0.81692790 -0.70252854 0.12888586 -0.06194922 -H 8.35316811 11.04541009 1.33745836 1.62912882 -3.53077414 5.68080355 -O 0.94004098 10.15162978 3.54788449 -1.08457407 -1.07225848 -2.11326262 -H 0.69010529 9.19133189 3.77189578 0.19180130 1.74153750 -0.34616217 -H 0.93777081 10.30122818 2.50966526 1.29074064 -1.02193169 1.68592452 -O 2.27424490 5.50915811 2.47661814 3.42542057 -4.02492496 3.71742602 -H 2.87039478 5.20416153 1.76153568 0.28323491 -0.31793299 0.44400092 -H 1.75867813 6.03341397 2.01906506 -5.01572057 4.50292924 -3.15397366 -O 8.94351821 9.24398503 5.88873692 -1.92119599 -4.43389509 -2.57106317 -H 9.09221700 8.40449830 6.46427006 -0.54337204 2.43464552 -0.54531580 -H 8.36787924 8.80270415 5.00977887 2.04375025 1.37647669 3.10278297 -O 2.82171577 2.69312570 11.50923391 0.69614192 -0.37589905 1.50967018 -H 3.43897452 3.14968922 0.41529298 -1.06053939 -1.03034434 -1.56750974 -H 2.93838347 1.70842217 11.51627197 0.70775303 1.01310766 -0.29180954 -O 8.16112970 2.63468866 9.79782190 -1.27590023 2.29413467 1.11429604 -H 8.54928118 3.61930224 9.73373854 -1.52802272 -2.32642774 -0.06867111 -H 7.16627654 2.73929112 10.09193859 2.77315197 0.05309382 -1.14957673 -O 1.59972917 8.97754430 9.43268962 -4.27687261 0.84039630 2.26111141 -H 1.59251119 9.12142758 8.50784661 0.80233881 0.43452331 -2.11537093 -H 0.58284107 9.31288390 9.64240255 3.61139368 -1.36863482 0.04291019 -O 5.26826606 3.30655851 9.49391542 -0.84340449 0.50978314 1.64621124 -H 4.78704289 2.59503212 9.98054679 0.22770831 1.03334739 -0.67504858 -H 4.89323288 4.20901733 9.82787916 0.44176714 -1.60587061 -1.14998811 -O 7.36117251 0.04299829 7.68322976 -0.43534967 -0.03071647 3.23220208 -H 7.04043820 0.88966860 7.30592641 -0.03364444 -0.06154709 0.77135186 -H 7.21231496 0.07133097 8.74782847 0.53084562 -0.30424906 -4.25693627 -O 4.18004487 0.62351363 4.09110077 -1.56364280 2.67147508 0.69047006 -H 4.80862273 1.37200834 4.08969845 0.44022654 -0.29248317 0.30456530 -H 3.28940788 1.15635275 4.10035608 1.67807237 -2.07241806 -0.35558115 -O 2.70842422 6.37716749 7.53125007 2.06494643 5.11524802 -0.69604422 -H 2.64632527 5.94334801 6.65921894 0.39734926 -0.66881108 -0.10087985 -H 3.09797273 7.37493112 7.16849909 -1.55386232 -3.75355518 1.65329206 -O 6.41182859 2.43882960 7.01329141 -4.92870926 2.02800480 0.61801120 -H 5.72035273 2.64918283 6.21809682 2.70379386 -1.03493633 1.32465351 -H 5.74453613 2.77554505 7.76408804 2.33632649 -1.16785214 -1.14451680 -O 10.57301359 4.37816353 1.12879320 4.89504836 -1.30601815 2.06174798 -H 10.93983923 3.52935799 1.61142928 -2.07324081 1.97823337 -1.66711946 -H 9.71802197 4.32374295 0.82312457 -3.01427013 -1.27858446 -0.62062344 -O 4.08049606 10.52136590 2.32719437 0.42891316 2.23963240 1.86107843 -H 3.15932554 10.71626186 1.93731777 1.63434302 0.18014648 1.02641569 -H 4.27975774 11.25147169 3.16363304 -1.47402439 -2.26965261 -2.92434833 -O 1.84757461 2.91355447 6.97180392 -2.90159406 -1.25619014 -2.57119687 -H 1.40897666 2.99356607 7.80562845 -0.14525659 0.44582177 1.66832274 -H 0.95316987 2.61135724 6.50289999 2.62214073 0.34147968 0.65385239 -O 5.97425196 7.07160674 6.51708194 -1.32986257 4.64477707 0.74215954 -H 6.45172856 6.31562418 6.45929579 1.62818266 -4.29121937 -0.25735983 -H 5.04161946 6.94539798 6.38552849 -0.03046759 -0.33969019 -0.12541847 -O 3.26609762 9.55064322 11.51695990 -2.28802058 2.61571811 -1.59542165 -H 2.90240471 9.12894190 10.76187694 -0.52591939 -0.96484803 -1.23090590 -H 3.99413434 9.15122026 0.17271762 2.46309222 -2.04713382 1.18471344 -O 10.53697662 4.56069792 5.76512112 1.37467177 5.21414812 -0.75573497 -H 10.35298171 3.68800003 5.75575469 -0.26204901 -4.34917206 0.71721469 -H 11.27576093 4.91570703 6.31964592 -1.20071085 -0.75218685 -0.31628954 -O 4.63525899 10.81807556 6.19613596 6.71521024 -1.10373908 4.35700365 -H 4.35573171 11.34174933 5.54381921 -2.37777269 3.55238684 -4.56307766 -H 5.67410264 11.23263298 6.27461294 -3.69088709 -2.18111407 -0.04988097 -O 0.14165280 7.33720078 1.35500587 -5.25636565 -0.09894072 6.15964602 -H 0.43427986 7.46266870 0.56089609 3.84631548 0.76780374 -7.44962047 -H 10.92671564 7.65920512 1.13098929 2.25378890 -0.78840343 1.73881728 -O 10.27603934 2.10768108 2.86506067 1.27164762 -1.00033441 0.95626568 -H 11.01111940 2.17232008 3.54679438 -1.62994129 0.20511087 -0.66830200 -H 10.25354931 1.09798979 2.87938021 -0.22944278 0.78903592 -0.44897292 -O 5.69627517 0.40138197 0.90041090 2.59900079 0.43527099 4.94188874 -H 5.24481822 0.44575031 0.13631182 -2.71563637 0.20740533 -4.72132913 -H 5.15967360 11.54675258 1.48204016 -0.21494998 -0.23595898 -0.06999420 -O 6.15025630 7.53315510 9.28182120 3.37681641 -8.71825476 -0.73325838 -H 5.88831358 8.32623299 9.17037648 -3.12216395 9.38792459 -0.76454872 -H 6.54803881 7.35413445 8.40211700 -0.57476523 -0.20697287 0.55008777 -O 11.51516070 7.99909564 4.70859766 -1.85752516 -3.33904174 -2.28857594 -H 10.55803788 8.11683757 4.90491182 0.94879405 0.68445368 -0.18751835 -H 11.33058369 7.11780391 3.97989418 0.73715617 2.85156037 2.24620414 -O 4.32177970 9.39263090 8.51430257 10.95624679 -10.19283450 -11.15278201 -H 4.15839623 9.72273165 7.58681367 0.74426271 -1.00007216 1.44278033 -H 3.83315863 9.85920645 8.89837939 -11.80157447 10.92359377 9.90425375 -O 7.32079629 7.68735734 4.30241710 11.26303096 2.57085748 -17.99639319 -H 7.49129719 6.77442082 3.96804590 0.55662866 -0.25286348 0.13183903 -H 6.92412505 7.59215836 4.94862185 -11.68489776 -2.23415081 18.08807877 -O 10.60936807 5.82587067 3.33454140 -3.62983878 8.74340016 19.17817558 -H 10.85887512 5.24453775 3.99905568 0.76538690 -2.26595537 2.00967797 -H 10.70514914 5.60689714 2.61041531 3.34908448 -6.50093440 -20.65116124 -O 8.16710940 1.89280867 4.64662571 -2.78388890 -0.72861497 -4.24536116 -H 8.53457006 2.07518431 5.44433390 2.39779131 1.05826653 3.94904653 -H 8.71888248 2.16570536 3.89810984 0.79682122 0.07677472 0.24100195 -O 7.35476947 9.37220466 2.30818103 -1.57494023 0.21925041 2.66969073 -H 7.02816129 10.06029379 3.00869524 1.12488899 -1.41697158 -1.75353428 -H 7.24983362 8.55541964 2.92457723 0.16987646 1.65735955 -1.30613127 -O 7.59850849 4.79108580 6.60704207 -0.18279832 -1.17206875 0.89977338 -H 7.35064188 3.91050317 7.03265930 -0.45973248 0.75343126 -1.50952619 -H 8.26643596 4.99101424 7.26121093 0.89534594 0.76599882 -0.01246266 -O 10.40399439 11.10430751 6.79294202 2.81111175 -0.62073657 -1.02525355 -H 9.63001980 11.47674243 7.07319427 -3.06936890 2.63521222 1.66147846 -H 9.93990598 10.35631552 6.42130087 0.40481317 -1.41940385 -0.75827008 -O 3.49465984 8.56023515 5.57334730 4.08231201 1.30895435 -3.78476839 -H 4.21974904 9.43364214 5.51672534 -2.68191376 -2.97917456 0.99539275 -H 3.65141801 8.24495137 4.57004848 -0.61115664 0.20748555 2.30058300 -O 10.64836843 8.95923477 10.32953916 -2.39696341 0.22372670 2.32516276 -H 10.35155293 9.90349858 10.16999223 0.96258032 -1.01845041 -0.24083020 -H 10.06870771 8.69586327 11.18304908 2.34525851 0.93941467 -2.29535337 -O 11.45213569 2.78041878 8.81582775 0.13917079 0.55494715 -5.11691409 -H 11.40535643 3.52377517 9.35537683 -0.02186930 2.41838071 2.07431039 -H 11.49658658 2.03804136 9.30441706 0.27983642 -3.85064522 2.72189444 -O 5.72252236 2.78391664 4.58865435 2.00202122 0.11734314 -0.87511135 -H 5.58377209 3.78623649 4.59301477 0.76167423 -0.88388396 -0.15393664 -H 6.80527185 2.57167953 4.53785334 -2.41439550 0.27077174 0.34678438 -O 3.49103498 0.47779834 8.23103401 1.10622791 -0.34709034 -2.37964446 -H 4.13096898 -0.02426013 7.57813517 -2.14205385 1.52066936 1.47370043 -H 2.91503088 1.07665866 7.70577271 0.67948116 -0.68213454 0.43600941 -O 4.20392664 5.85068908 9.77697231 -3.57610785 -0.45028264 -2.74477212 -H 3.54920743 6.04214539 8.83884695 1.55419656 -1.34864705 2.76174141 -H 4.72216576 6.61011129 9.59234238 1.78331795 1.13481345 0.09583637 -O 1.45781442 6.56317328 10.70033363 2.20226397 0.63186945 -0.26552977 -H 2.44013666 6.43590616 10.96735645 -2.54561438 0.39446191 -1.41605113 -H 1.41492990 7.19966763 9.90556238 0.60172068 -0.81249982 1.68488579 -O 7.98681873 5.23825113 3.84425018 3.13433042 -1.45225227 2.74527092 -H 9.01755010 5.30341401 3.65056603 -2.77410842 0.24112279 0.40572437 -H 8.05524134 4.91626267 4.90003810 -0.71303407 1.02736700 -3.07754501 -O 10.04494765 1.29552636 11.26724117 1.73607648 6.18659119 -7.11522264 -H 9.25266353 1.89236946 10.78695994 2.14781312 -1.66582877 1.26821777 -H 9.64420175 0.85762163 0.14036796 -3.95195702 -4.15348017 5.70846863 -O 1.65347770 0.84323330 3.65143388 1.42823302 18.52259540 -1.58570801 -H 1.30082871 1.18126641 2.78746213 0.06763907 -0.72436750 0.47733529 -H 1.56093519 11.80917156 3.71966599 -1.83660666 -17.48993707 1.07095236 -O 9.54164721 8.40767336 0.89833123 11.90981796 -1.53191537 -0.18516168 -H 9.00596112 8.92785456 1.26700370 -5.91832217 7.89755826 6.08966056 -H 8.94113691 7.98808875 0.49614438 -7.23364771 -6.68636245 -5.64295689 -O 5.09521982 8.37512896 0.81392218 4.28942474 -0.28139245 -0.78329207 -H 5.86312474 9.13169362 1.08096087 -2.32849491 -3.31964533 -0.61849971 -H 5.54545966 7.65089703 0.19278931 -0.77571760 2.85232141 2.11019787 -O 7.30703768 11.10160871 4.63375612 -0.88771490 -3.55613037 3.03358941 -H 7.63533922 10.74907085 5.55297398 -0.86701751 0.61395914 -2.54795409 -H 7.79843164 0.12321944 4.54375366 1.37331423 2.81788919 -0.43847047 -O 10.24857504 11.03916580 3.08253663 2.08557697 -0.83679675 1.42397013 -H 11.34180224 10.69340141 3.15046182 -3.53841546 0.81605308 0.79711433 -H 9.89365589 10.83162249 3.99602350 0.78547751 0.29104335 -1.77379458 -O 11.39159782 1.59286574 5.25942351 10.18846363 14.10111874 -9.35825404 -H 11.14796463 0.93367498 5.59827155 -6.44107909 -15.49337173 8.38653088 -H 0.63682773 1.17983234 4.75863136 -3.26021169 1.80275036 1.16045250 -O 7.51865565 7.18246937 11.26967539 2.85097416 -4.61661833 5.64131139 -H 7.03461725 7.13050416 10.50220968 -1.92595253 0.25077060 -3.35841759 -H 7.61030914 6.12718417 11.64062861 -0.25806174 3.92457476 -1.28720280 -O 1.75378853 9.68542466 6.78468686 -3.15344401 -0.46783763 0.39065667 -H 2.25816320 9.04199808 6.22910370 -0.18277466 0.61772838 -0.22779213 -H 0.77725020 9.49312166 6.62916167 2.16249413 0.72466575 0.07833126 -O 0.79380286 1.53270887 1.01780886 -0.44967946 0.87239112 -0.65009858 -H -0.05250973 1.65674801 0.40803849 2.46039770 0.24974010 1.38686909 -H 1.63024682 2.14220989 0.87222163 -2.73532074 -0.92775214 -1.05769575 -O 5.12024461 5.20156327 4.72964303 16.37304935 -0.02624223 3.03762604 -H 5.10836987 5.84100514 4.17073135 0.04007426 6.65016130 -5.75084043 -H 4.40036251 4.91235205 4.83038250 -16.81327383 -5.96156814 2.63335074 diff --git a/tests_extensive/readme.txt b/tests_extensive/readme.txt deleted file mode 100644 index ed4b2e6..0000000 --- a/tests_extensive/readme.txt +++ /dev/null @@ -1 +0,0 @@ -A bunch of tests that might be too heavy to be run on each commit to main \ No newline at end of file From 84588cda484531533540044f528dd0a78e2bc4ca Mon Sep 17 00:00:00 2001 From: spozdn Date: Fri, 31 May 2024 18:17:07 +0200 Subject: [PATCH 20/41] extract last model utility --- utilities/extract_last_model.py | 34 +++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 utilities/extract_last_model.py diff --git a/utilities/extract_last_model.py b/utilities/extract_last_model.py new file mode 100644 index 0000000..bda0aff --- /dev/null +++ b/utilities/extract_last_model.py @@ -0,0 +1,34 @@ +import torch +import argparse + +def extract_model_state_dict(input_checkpoint_path, output_model_state_dict_path): + """ + Extracts the model state dictionary from a given checkpoint and saves it to the specified output path. + + Parameters: + input_checkpoint_path (str): Path to the input checkpoint file. + output_model_state_dict_path (str): Path to save the extracted model state dictionary. + """ + # Load the checkpoint + checkpoint = torch.load(input_checkpoint_path) + + # Extract the model state dictionary + model_state_dict = checkpoint["model_state_dict"] + + # Save the model state dictionary + torch.save(model_state_dict, output_model_state_dict_path) + print(f"Model state dictionary has been saved to {output_model_state_dict_path}") + +def main(): + parser = argparse.ArgumentParser( + description='Extracting the state of the model at the end of fitting and exposing it as all the other model state dicts, such as "best_val_rmse_both_model_state_dict" or "best_val_mae_both_model_state_dict".' + ) + parser.add_argument('path_to_calc_folder', type=str, help='Path to the calc folder.') + + args = parser.parse_args() + input_checkpoint_path = args.path_to_calc_folder + "/checkpoint" + output_model_state_dict_path = args.path_to_calc_folder + "/last_model_state_dict" + extract_model_state_dict(input_checkpoint_path, output_model_state_dict_path) + +if __name__ == '__main__': + main() From d1a1fb9917ebf931446358b35cc8689efe5cdeb9 Mon Sep 17 00:00:00 2001 From: Marcel Langer Date: Mon, 3 Jun 2024 17:38:09 +0200 Subject: [PATCH 21/41] Make quadrature_order an argument to SingleStructCalculator.__init__ ... rather than a argument to .forward() This makes things more compatible with the i-pi driver, which is expecting to set everything up at init. --- src/single_struct_calculator.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/single_struct_calculator.py b/src/single_struct_calculator.py index f715f6a..196d978 100644 --- a/src/single_struct_calculator.py +++ b/src/single_struct_calculator.py @@ -10,7 +10,7 @@ class SingleStructCalculator: def __init__( - self, path_to_calc_folder, checkpoint="best_val_rmse_both_model", device="cpu" + self, path_to_calc_folder, checkpoint="best_val_rmse_both_model", device="cpu", quadrature_order=None ): hypers_path = path_to_calc_folder + "/hypers_used.yaml" path_to_model_state_dict = ( @@ -51,7 +51,12 @@ def __init__( self.all_species = all_species self.device = device - def forward(self, structure, quadrature_order = None): + if quadrature_order is not None: + self.quadrature_order = int(quadrature_order) + else: + self.quadrature_order = None + + def forward(self, structure): molecule = MoleculeCPP( structure, self.architectural_hypers.R_CUT, @@ -72,7 +77,7 @@ def forward(self, structure, quadrature_order = None): ) graph = graph.to(self.device) - if quadrature_order is None: + if self.quadrature_order is None: prediction_energy, prediction_forces = self.model( graph, augmentation=False, create_graph=False ) @@ -80,7 +85,7 @@ def forward(self, structure, quadrature_order = None): prediction_forces_final = prediction_forces.data.cpu().numpy() else: prediction_energy_final, prediction_forces_final = get_quadrature_predictions( - graph, self.model, quadrature_order, string2dtype(self.architectural_hypers.DTYPE) + graph, self.model, self.quadrature_order, string2dtype(self.architectural_hypers.DTYPE) ) compositional_features = get_compositional_features( From 2179889225ce6aad5df73c6b6d4ddd246e2223b7 Mon Sep 17 00:00:00 2001 From: Marcel Langer Date: Tue, 4 Jun 2024 14:58:59 +0200 Subject: [PATCH 22/41] Expand inference-time averaging Now we can also do inversions in addition to rotations. For the case of no rotations, we just take the unit matrix. This also fixes force predictions, which were previously not rotated back into the original direction, leading to immediate failures in dynamics. --- src/single_struct_calculator.py | 8 ++++--- src/utilities.py | 40 +++++++++++++++++++++++---------- 2 files changed, 33 insertions(+), 15 deletions(-) diff --git a/src/single_struct_calculator.py b/src/single_struct_calculator.py index 196d978..492eb3e 100644 --- a/src/single_struct_calculator.py +++ b/src/single_struct_calculator.py @@ -10,7 +10,7 @@ class SingleStructCalculator: def __init__( - self, path_to_calc_folder, checkpoint="best_val_rmse_both_model", device="cpu", quadrature_order=None + self, path_to_calc_folder, checkpoint="best_val_rmse_both_model", device="cpu", quadrature_order=None, inversions=False, ): hypers_path = path_to_calc_folder + "/hypers_used.yaml" path_to_model_state_dict = ( @@ -56,6 +56,8 @@ def __init__( else: self.quadrature_order = None + self.inversions = inversions + def forward(self, structure): molecule = MoleculeCPP( structure, @@ -77,7 +79,7 @@ def forward(self, structure): ) graph = graph.to(self.device) - if self.quadrature_order is None: + if self.quadrature_order is None and not self.inversions: prediction_energy, prediction_forces = self.model( graph, augmentation=False, create_graph=False ) @@ -85,7 +87,7 @@ def forward(self, structure): prediction_forces_final = prediction_forces.data.cpu().numpy() else: prediction_energy_final, prediction_forces_final = get_quadrature_predictions( - graph, self.model, self.quadrature_order, string2dtype(self.architectural_hypers.DTYPE) + graph, self.model, self.quadrature_order, self.inversions, string2dtype(self.architectural_hypers.DTYPE) ) compositional_features = get_compositional_features( diff --git a/src/utilities.py b/src/utilities.py index aab27b2..a2dfe4e 100644 --- a/src/utilities.py +++ b/src/utilities.py @@ -474,25 +474,41 @@ def string2dtype(string): raise ValueError("unknown dtype") -def get_quadrature_predictions(batch, model, quadrature_order, dtype): +def get_quadrature_predictions(batch, model, quadrature_order, inversions, dtype): x_initial = batch.x.clone() - all_energies, all_forces = [], [] - rotations, weights = get_quadrature(quadrature_order) - for rotation in rotations: + + if quadrature_order is not None: + rotations, weights = get_quadrature(quadrature_order) + else: + assert inversions + + rotations = [np.eye(3)] + weights = [1.0] + + inverse_rotations = [r.T for r in rotations] + + if inversions: + rotations += [-r for r in rotations] + inverse_rotations += [-r for r in inverse_rotations] + weights += weights + + energy_mean, forces_mean, total_weight = 0.0, 0.0, 0.0 + for rotation, inverse, weight in zip(rotations, inverse_rotations, weights): rotation = torch.tensor(rotation, device = batch.x.device, dtype = dtype) + inverse = torch.tensor(inverse, device = batch.x.device, dtype = dtype) + batch_rotations = rotation[None, :].repeat(batch.num_nodes, 1, 1) batch.x = torch.bmm(x_initial, batch_rotations) - prediction_energy, prediction_forces = model( + energy, forces = model( batch, augmentation=False, create_graph=False ) - all_energies.append(prediction_energy.data.cpu().numpy()) - all_forces.append(prediction_forces.data.cpu().numpy()) + # rotate forces back into original frame of reference + forces = torch.matmul(forces, inverse[None, :, :]) - energy_mean, forces_mean, total_weight = 0.0, 0.0, 0.0 - for energy, forces, weight in zip(all_energies, all_forces, weights): - energy_mean += energy * weight - forces_mean += forces * weight + energy_mean += energy.data.cpu().numpy() * weight + forces_mean += forces.data.cpu().numpy() * weight total_weight += weight + energy_mean /= total_weight forces_mean /= total_weight - return energy_mean, forces_mean \ No newline at end of file + return energy_mean, forces_mean From 0d0ed3d02334fef35f147bbc34df0468198b1a32 Mon Sep 17 00:00:00 2001 From: Michele Ceriotti Date: Thu, 6 Jun 2024 20:58:16 +0200 Subject: [PATCH 23/41] Disable compositional contributions to avoid massive mess --- src/single_struct_calculator.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/single_struct_calculator.py b/src/single_struct_calculator.py index 492eb3e..2a00a23 100644 --- a/src/single_struct_calculator.py +++ b/src/single_struct_calculator.py @@ -96,5 +96,8 @@ def forward(self, structure): self_contributions_energy = np.dot( compositional_features, self.self_contributions ) - energy_total = prediction_energy_final + self_contributions_energy + + # MC self_contributions_energy can be yuge and fuck up precision in well single precision + # taking it out for now, probably we should add an option + energy_total = prediction_energy_final # + self_contributions_energy return energy_total, prediction_forces_final From 12f71c1100d3b8d9cb58f188bbf71c6667ca3a49 Mon Sep 17 00:00:00 2001 From: Michele Ceriotti Date: Fri, 7 Jun 2024 21:37:14 +0200 Subject: [PATCH 24/41] Fixed Euler angles convention for the quadrature --- src/utilities.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utilities.py b/src/utilities.py index a2dfe4e..7ce198a 100644 --- a/src/utilities.py +++ b/src/utilities.py @@ -446,7 +446,7 @@ def get_quadrature(L): for v, weight in zip(all_v, weights_now): weights.append(weight) angles = [theta, v, w] - rotation = R.from_euler("xyz", angles, degrees=False) + rotation = R.from_euler("zyz", angles, degrees=False) rotation_matrix = rotation.as_matrix() matrices.append(rotation_matrix) From 9b9d1f2d92ebd6b66e1d0386fb0f19f2746e823b Mon Sep 17 00:00:00 2001 From: Michele Ceriotti Date: Fri, 7 Jun 2024 22:20:50 +0200 Subject: [PATCH 25/41] On a second thought, maybe it's ZXZ --- src/utilities.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utilities.py b/src/utilities.py index 7ce198a..2e82fe1 100644 --- a/src/utilities.py +++ b/src/utilities.py @@ -446,7 +446,7 @@ def get_quadrature(L): for v, weight in zip(all_v, weights_now): weights.append(weight) angles = [theta, v, w] - rotation = R.from_euler("zyz", angles, degrees=False) + rotation = R.from_euler("zxz", angles, degrees=False) rotation_matrix = rotation.as_matrix() matrices.append(rotation_matrix) From 089f55c5ca208565756b6b8a48c87d196ab677d5 Mon Sep 17 00:00:00 2001 From: Arslan Mazitov Date: Mon, 10 Jun 2024 16:07:22 +0200 Subject: [PATCH 26/41] Commented libtorch_python.so bindings --- src/neighbors_convert.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/neighbors_convert.cpp b/src/neighbors_convert.cpp index 3fa4fa7..2b54c3e 100644 --- a/src/neighbors_convert.cpp +++ b/src/neighbors_convert.cpp @@ -1,4 +1,4 @@ -#include +// #include #include #include // For std::fill #include // For c10::optional @@ -330,9 +330,9 @@ TORCH_LIBRARY(neighbors_convert, m) { ); } -PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) { - m.def("process_neighbors(Tensor i_list, Tensor j_list, Tensor S_list, Tensor D_list, int max_size, int n_atoms, Tensor species, Tensor all_species) -> Tensor[]", &process_neighbors_apply, "Process neighbors and return tensors, including count tensor, mask, and neighbor_species"); -} +// PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) { +// m.def("process_neighbors(Tensor i_list, Tensor j_list, Tensor S_list, Tensor D_list, int max_size, int n_atoms, Tensor species, Tensor all_species) -> Tensor[]", &process_neighbors_apply, "Process neighbors and return tensors, including count tensor, mask, and neighbor_species"); +// } /*static auto registry = torch::RegisterOperators() .op("neighbors_convert::process(Tensor i_list, Tensor j_list, Tensor S_list, Tensor D_list, int max_size, int n_atoms, Tensor species, Tensor all_species) -> Tensor[]", &process_neighbors_apply);*/ From 1c5cde04d42bed6b33b855c8e87632b15c71b4a7 Mon Sep 17 00:00:00 2001 From: Sergey Pozdnyakov Date: Thu, 13 Jun 2024 17:08:07 +0200 Subject: [PATCH 27/41] proper multi gpu handling in single struct calculator --- src/single_struct_calculator.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/single_struct_calculator.py b/src/single_struct_calculator.py index 196d978..abe2cf5 100644 --- a/src/single_struct_calculator.py +++ b/src/single_struct_calculator.py @@ -37,7 +37,7 @@ def __init__( model = PETMLIPWrapper( model, MLIP_SETTINGS.USE_ENERGIES, MLIP_SETTINGS.USE_FORCES ) - if FITTING_SCHEME.MULTI_GPU and torch.cuda.is_available(): + if torch.cuda.is_available() and (torch.cuda.device_count() > 1): model = DataParallel(model) model = model.to(torch.device("cuda:0")) @@ -76,11 +76,17 @@ def forward(self, structure): graph.num_nodes, dtype=torch.long, device=graph.x.device ) graph = graph.to(self.device) - + if self.quadrature_order is None: - prediction_energy, prediction_forces = self.model( - graph, augmentation=False, create_graph=False - ) + if torch.cuda.is_available() and (torch.cuda.device_count() > 1): + self.model.module.augmentation = False + self.model.module.create_graph = False + prediction_energy, prediction_forces = self.model([graph]) + else: + prediction_energy, prediction_forces = self.model( + graph, augmentation=False, create_graph=False + ) + prediction_energy_final = prediction_energy.data.cpu().numpy() prediction_forces_final = prediction_forces.data.cpu().numpy() else: From 69980a13275f2007f770a740b4f405f44606e69e Mon Sep 17 00:00:00 2001 From: serfg Date: Thu, 13 Jun 2024 19:01:53 +0200 Subject: [PATCH 28/41] augmentation option to single_struct_calculator --- src/single_struct_calculator.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/single_struct_calculator.py b/src/single_struct_calculator.py index abe2cf5..8a29d88 100644 --- a/src/single_struct_calculator.py +++ b/src/single_struct_calculator.py @@ -8,10 +8,16 @@ from .pet import PET, PETMLIPWrapper, PETUtilityWrapper from .utilities import string2dtype, get_quadrature_predictions + class SingleStructCalculator: def __init__( - self, path_to_calc_folder, checkpoint="best_val_rmse_both_model", device="cpu", quadrature_order=None + self, path_to_calc_folder, checkpoint="best_val_rmse_both_model", device="cpu", quadrature_order=None, + use_augmentation=False ): + if (quadrature_order is not None) and (use_augmentation): + raise NotImplementedError("Simultaneous use of a quadrature and augmentation is not yet implemented") + + self.use_augmentation = use_augmentation hypers_path = path_to_calc_folder + "/hypers_used.yaml" path_to_model_state_dict = ( path_to_calc_folder + "/" + checkpoint + "_state_dict" @@ -42,7 +48,8 @@ def __init__( model = model.to(torch.device("cuda:0")) model.load_state_dict( - torch.load(path_to_model_state_dict, map_location=torch.device(device)) + torch.load(path_to_model_state_dict, + map_location=torch.device(device)) ) model.eval() @@ -79,19 +86,20 @@ def forward(self, structure): if self.quadrature_order is None: if torch.cuda.is_available() and (torch.cuda.device_count() > 1): - self.model.module.augmentation = False + self.model.module.augmentation = self.use_augmentation self.model.module.create_graph = False prediction_energy, prediction_forces = self.model([graph]) else: prediction_energy, prediction_forces = self.model( - graph, augmentation=False, create_graph=False + graph, augmentation=self.use_augmentation, create_graph=False ) prediction_energy_final = prediction_energy.data.cpu().numpy() prediction_forces_final = prediction_forces.data.cpu().numpy() else: prediction_energy_final, prediction_forces_final = get_quadrature_predictions( - graph, self.model, self.quadrature_order, string2dtype(self.architectural_hypers.DTYPE) + graph, self.model, self.quadrature_order, string2dtype( + self.architectural_hypers.DTYPE) ) compositional_features = get_compositional_features( From 8061f88865912a6ac62737df7e45a0ef48077a08 Mon Sep 17 00:00:00 2001 From: serfg Date: Thu, 13 Jun 2024 19:33:08 +0200 Subject: [PATCH 29/41] fix --- utilities/extract_last_model.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utilities/extract_last_model.py b/utilities/extract_last_model.py index bda0aff..e70be0c 100644 --- a/utilities/extract_last_model.py +++ b/utilities/extract_last_model.py @@ -10,7 +10,7 @@ def extract_model_state_dict(input_checkpoint_path, output_model_state_dict_path output_model_state_dict_path (str): Path to save the extracted model state dictionary. """ # Load the checkpoint - checkpoint = torch.load(input_checkpoint_path) + checkpoint = torch.load(input_checkpoint_path, map_location=torch.device('cpu')) # Extract the model state dictionary model_state_dict = checkpoint["model_state_dict"] From 3d738fca353a589a6010a30dd829fb67080684c6 Mon Sep 17 00:00:00 2001 From: Arslan Mazitov Date: Wed, 10 Jul 2024 12:38:32 +0000 Subject: [PATCH 30/41] Added a workaround for a missing torch installation in the setup.py --- setup.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/setup.py b/setup.py index f78a8ed..f54f4ae 100644 --- a/setup.py +++ b/setup.py @@ -1,3 +1,16 @@ +import sys +import subprocess +import pkg_resources + +# Ensure torch is installed +def install_package(package): + subprocess.check_call([sys.executable, "-m", "pip", "install", package]) + +try: + pkg_resources.get_distribution('torch') +except pkg_resources.DistributionNotFound: + install_package('torch') + from setuptools import setup from torch.utils.cpp_extension import BuildExtension, CppExtension From a2b4a55e3b475709001ce5f08921c70ab99c4171 Mon Sep 17 00:00:00 2001 From: Arslan Mazitov Date: Wed, 10 Jul 2024 12:49:16 +0000 Subject: [PATCH 31/41] Reverting setup.py back --- setup.py | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/setup.py b/setup.py index f54f4ae..f78a8ed 100644 --- a/setup.py +++ b/setup.py @@ -1,16 +1,3 @@ -import sys -import subprocess -import pkg_resources - -# Ensure torch is installed -def install_package(package): - subprocess.check_call([sys.executable, "-m", "pip", "install", package]) - -try: - pkg_resources.get_distribution('torch') -except pkg_resources.DistributionNotFound: - install_package('torch') - from setuptools import setup from torch.utils.cpp_extension import BuildExtension, CppExtension From 32840c4e9a0c9f241a788acb247395ea680bf247 Mon Sep 17 00:00:00 2001 From: Arslan Mazitov Date: Wed, 10 Jul 2024 12:58:39 +0000 Subject: [PATCH 32/41] Added pyproject.toml to manage the missing torch installation --- pyproject.toml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 pyproject.toml diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..1c39f1e --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,6 @@ +[build-system] +requires = [ + "setuptools >= 68", + "wheel", + "torch", +] \ No newline at end of file From 695bb6ae8a31944c2b394980952dda3ab29bc7fd Mon Sep 17 00:00:00 2001 From: Arslan Mazitov Date: Fri, 12 Jul 2024 22:44:51 +0200 Subject: [PATCH 33/41] Added a CPU prefix for a torch build version --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 1c39f1e..d1ee779 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,5 +2,5 @@ requires = [ "setuptools >= 68", "wheel", - "torch", -] \ No newline at end of file + "torch==2.3.1+cpu", +] From aca532d5514db4358d7226e46e7f192204df6ccb Mon Sep 17 00:00:00 2001 From: Arslan Mazitov Date: Fri, 12 Jul 2024 22:56:14 +0200 Subject: [PATCH 34/41] Revert changes --- pyproject.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index d1ee779..052afcc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,5 +2,6 @@ requires = [ "setuptools >= 68", "wheel", - "torch==2.3.1+cpu", + "torch", ] +build-backend = "setuptools.build_meta" From e6c4a02566d05e829b45ad9cd43ee3f731facbc9 Mon Sep 17 00:00:00 2001 From: serfg Date: Sun, 14 Jul 2024 17:58:23 +0200 Subject: [PATCH 35/41] changing cpp extension location engine --- src/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/__init__.py b/src/__init__.py index aca95e8..3d95399 100644 --- a/src/__init__.py +++ b/src/__init__.py @@ -6,9 +6,9 @@ def load_neighbors_convert(): try: # Locate the shared object file in the package - lib_path = pkg_resources.path(__name__, 'neighbors_convert.so') - # Load the shared object file - torch.ops.load_library(str(lib_path)) + with pkg_resources.files(__name__).joinpath('neighbors_convert.so') as lib_path: + # Load the shared object file + torch.ops.load_library(str(lib_path)) except Exception as e: print(f"Failed to load neighbors_convert.so: {e}") From c31078074c8245e30b785395707568564cc65c77 Mon Sep 17 00:00:00 2001 From: serfg Date: Mon, 15 Jul 2024 16:41:57 +0200 Subject: [PATCH 36/41] disentangle neighbors_convert.so from libtorch --- setup.py | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/setup.py b/setup.py index f78a8ed..200c0c2 100644 --- a/setup.py +++ b/setup.py @@ -1,9 +1,22 @@ -from setuptools import setup -from torch.utils.cpp_extension import BuildExtension, CppExtension +from setuptools import setup, Extension +from torch.utils.cpp_extension import BuildExtension, include_paths, library_paths with open("requirements.txt") as f: requirements = f.read().splitlines() +# Collecting include and library paths +include_dirs = include_paths() +library_dirs = library_paths() + +# Defining the extension module without specifying the unwanted libraries +neighbors_convert_extension = Extension( + name="pet.neighbors_convert", + sources=["src/neighbors_convert.cpp"], + include_dirs=include_dirs, + library_dirs=library_dirs, + language='c++', +) + setup( name="pet", version="0.0.0", @@ -18,12 +31,7 @@ ], }, install_requires=requirements, - ext_modules=[ - CppExtension( - name="pet.neighbors_convert", # Ensure this matches the package structure - sources=["src/neighbors_convert.cpp"], - ), - ], + ext_modules=[neighbors_convert_extension], cmdclass={ "build_ext": BuildExtension.with_options(no_python_abi_suffix=True) }, From 2b2e563f749498454e0b59ef8ba1be8400a96329 Mon Sep 17 00:00:00 2001 From: serfg Date: Mon, 15 Jul 2024 17:11:02 +0200 Subject: [PATCH 37/41] fix --- setup.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/setup.py b/setup.py index 200c0c2..288af94 100644 --- a/setup.py +++ b/setup.py @@ -7,6 +7,8 @@ # Collecting include and library paths include_dirs = include_paths() library_dirs = library_paths() +library_dirs.append('c10') +library_dirs.append('torch') # Defining the extension module without specifying the unwanted libraries neighbors_convert_extension = Extension( From 1a470c453c86516b48600d7675a64a11e90116c9 Mon Sep 17 00:00:00 2001 From: serfg Date: Mon, 15 Jul 2024 17:18:03 +0200 Subject: [PATCH 38/41] fix --- setup.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 288af94..a6187d7 100644 --- a/setup.py +++ b/setup.py @@ -7,8 +7,13 @@ # Collecting include and library paths include_dirs = include_paths() library_dirs = library_paths() -library_dirs.append('c10') -library_dirs.append('torch') + +libraries = [] + +libraries.append('c10') +libraries.append('torch') +libraries.append('torch_cpu') + # Defining the extension module without specifying the unwanted libraries neighbors_convert_extension = Extension( @@ -16,6 +21,7 @@ sources=["src/neighbors_convert.cpp"], include_dirs=include_dirs, library_dirs=library_dirs, + libraries=libraries, language='c++', ) From dd25cf63fc495544b5fa71ac955f893bde95f21c Mon Sep 17 00:00:00 2001 From: Marcel Langer Date: Wed, 2 Oct 2024 14:56:15 +0200 Subject: [PATCH 39/41] Make addition of self_contributions optional --- src/single_struct_calculator.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/single_struct_calculator.py b/src/single_struct_calculator.py index 2a00a23..a112bf4 100644 --- a/src/single_struct_calculator.py +++ b/src/single_struct_calculator.py @@ -10,7 +10,7 @@ class SingleStructCalculator: def __init__( - self, path_to_calc_folder, checkpoint="best_val_rmse_both_model", device="cpu", quadrature_order=None, inversions=False, + self, path_to_calc_folder, checkpoint="best_val_rmse_both_model", device="cpu", quadrature_order=None, inversions=False, add_self_contributions=False, ): hypers_path = path_to_calc_folder + "/hypers_used.yaml" path_to_model_state_dict = ( @@ -57,6 +57,7 @@ def __init__( self.quadrature_order = None self.inversions = inversions + self.add_self_contributions = add_self_contributions def forward(self, structure): molecule = MoleculeCPP( @@ -93,11 +94,13 @@ def forward(self, structure): compositional_features = get_compositional_features( [structure], self.all_species )[0] - self_contributions_energy = np.dot( - compositional_features, self.self_contributions - ) - # MC self_contributions_energy can be yuge and fuck up precision in well single precision - # taking it out for now, probably we should add an option - energy_total = prediction_energy_final # + self_contributions_energy + energy_total = prediction_energy_final + if self.add_self_contributions: + self_contributions_energy = np.dot( + compositional_features, self.self_contributions + ) + # note: this may lead to numerical problems in less than double precision + energy_total = energy_total + self_contributions_energy + return energy_total, prediction_forces_final From 76a0b47eb680703c72772d8d272b6f0b96dc97d2 Mon Sep 17 00:00:00 2001 From: Marcel Langer Date: Wed, 2 Oct 2024 15:06:47 +0200 Subject: [PATCH 40/41] Add option to do random augmentation for single struct calculator --- src/single_struct_calculator.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/single_struct_calculator.py b/src/single_struct_calculator.py index a112bf4..781e4e1 100644 --- a/src/single_struct_calculator.py +++ b/src/single_struct_calculator.py @@ -10,7 +10,7 @@ class SingleStructCalculator: def __init__( - self, path_to_calc_folder, checkpoint="best_val_rmse_both_model", device="cpu", quadrature_order=None, inversions=False, add_self_contributions=False, + self, path_to_calc_folder, checkpoint="best_val_rmse_both_model", device="cpu", quadrature_order=None, inversions=False, use_augmentation=False, add_self_contributions=False, ): hypers_path = path_to_calc_folder + "/hypers_used.yaml" path_to_model_state_dict = ( @@ -51,12 +51,16 @@ def __init__( self.all_species = all_species self.device = device + if use_augmentation and (quadrature_order is not None or inversions): + raise NotImplementedError("Simultaneous use of a quadrature/inversions and augmentation is not yet implemented") + if quadrature_order is not None: self.quadrature_order = int(quadrature_order) else: self.quadrature_order = None self.inversions = inversions + self.use_augmentation = use_augmentation self.add_self_contributions = add_self_contributions def forward(self, structure): @@ -82,7 +86,7 @@ def forward(self, structure): if self.quadrature_order is None and not self.inversions: prediction_energy, prediction_forces = self.model( - graph, augmentation=False, create_graph=False + graph, augmentation=self.use_augmentation, create_graph=False ) prediction_energy_final = prediction_energy.data.cpu().numpy() prediction_forces_final = prediction_forces.data.cpu().numpy() @@ -91,12 +95,12 @@ def forward(self, structure): graph, self.model, self.quadrature_order, self.inversions, string2dtype(self.architectural_hypers.DTYPE) ) - compositional_features = get_compositional_features( - [structure], self.all_species - )[0] - energy_total = prediction_energy_final + if self.add_self_contributions: + compositional_features = get_compositional_features( + [structure], self.all_species + )[0] self_contributions_energy = np.dot( compositional_features, self.self_contributions ) From 8b2f3fb117373dcc2aaf82f55a376b36e7b1ca8f Mon Sep 17 00:00:00 2001 From: Marcel Langer Date: Thu, 7 Nov 2024 13:48:09 +0100 Subject: [PATCH 41/41] Fix case of DataParallel model being loaded Previously, this would cause problems because the forward code expects a plain model, not the DataParallel wrapped one. Since we are in single inference mode here, there is no need for parallelism and we just unwrap the model and move on. --- src/single_struct_calculator.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/single_struct_calculator.py b/src/single_struct_calculator.py index 781e4e1..37f6c53 100644 --- a/src/single_struct_calculator.py +++ b/src/single_struct_calculator.py @@ -44,6 +44,10 @@ def __init__( model.load_state_dict( torch.load(path_to_model_state_dict, map_location=torch.device(device)) ) + + if FITTING_SCHEME.MULTI_GPU and torch.cuda.is_available(): + model = model.module + model.eval() self.model = model @@ -83,7 +87,7 @@ def forward(self, structure): graph.num_nodes, dtype=torch.long, device=graph.x.device ) graph = graph.to(self.device) - + if self.quadrature_order is None and not self.inversions: prediction_energy, prediction_forces = self.model( graph, augmentation=self.use_augmentation, create_graph=False