clease
Advanced tools
| Metadata-Version: 2.1 | ||
| Name: clease | ||
| Version: 1.0.5 | ||
| Version: 1.0.6 | ||
| Summary: CLuster Expansion in Atomistic Simulation Environment | ||
@@ -5,0 +5,0 @@ Home-page: https://gitlab.com/computationalmaterials/clease/ |
@@ -16,21 +16,21 @@ ase>=3.22 | ||
| [all] | ||
| pytest-mock | ||
| clang-format>=14.0.3 | ||
| ipython | ||
| sphinx_rtd_theme | ||
| cython | ||
| black>=22.1.0 | ||
| pre-commit | ||
| pytest | ||
| pytest-cov | ||
| twine | ||
| pytest-mock | ||
| mock | ||
| pyclean>=2.0.0 | ||
| pytest-benchmark[histogram]>=3.4.1 | ||
| tox>=4 | ||
| build | ||
| pip | ||
| sphinx | ||
| pyclean>=2.0.0 | ||
| black>=22.1.0 | ||
| build | ||
| clang-format>=14.0.3 | ||
| sphinx_rtd_theme | ||
| pytest-benchmark[histogram]>=3.4.1 | ||
| ipython | ||
| clease-gui | ||
| pylint | ||
| mock | ||
| cython | ||
| clease-gui | ||
| pip | ||
| twine | ||
| pytest-cov | ||
@@ -37,0 +37,0 @@ [dev] |
@@ -1,1 +0,1 @@ | ||
| 1.0.5 | ||
| 1.0.6 |
@@ -81,2 +81,5 @@ """Monte Carlo method for ase.""" | ||
| self.current_energy = self.evaluator.get_energy() | ||
| self.current_energy += sum( | ||
| bias.calculate_from_scratch(self.atoms) for bias in self.bias_potentials | ||
| ) | ||
| logger.debug("Updating current energy to %s", self.current_energy) | ||
@@ -83,0 +86,0 @@ self.evaluator.reset() |
@@ -6,2 +6,3 @@ """Collection of classess to perform regression.""" | ||
| from sklearn.linear_model import Lasso as skLasso | ||
| from scipy.linalg import lstsq | ||
| from clease.data_normalizer import DataNormalizer | ||
@@ -45,12 +46,4 @@ | ||
| self._ensure_weight_matrix_consistency(y) | ||
| return lstsq(X, y)[0] # Only fetch the solution | ||
| # We use SVD to carry out the fit | ||
| U, D, V_h = np.linalg.svd(X, full_matrices=False) | ||
| V = V_h.T | ||
| diag_item = np.zeros_like(D) | ||
| mask = np.abs(D) > self.tol | ||
| diag_item[mask] = 1.0 / D[mask] | ||
| coeff = V.dot(np.diag(diag_item)).dot(U.T).dot(y) | ||
| return coeff | ||
| def precision_matrix(self, X: np.ndarray) -> np.ndarray: | ||
@@ -57,0 +50,0 @@ D, V_h = np.linalg.svd(X, full_matrices=False)[1:] # U is unused |
@@ -38,3 +38,2 @@ #ifndef BASIS_FUNCTION_H | ||
| private: | ||
| const Symbols *symb_ptr{nullptr}; | ||
| std::vector<double> bfs; | ||
@@ -41,0 +40,0 @@ unsigned int num_bfs{0}; |
@@ -7,2 +7,3 @@ #ifndef CE_UPDATER_H | ||
| #include <map> | ||
| #include <memory> | ||
| #include <set> | ||
@@ -24,14 +25,5 @@ #include <string> | ||
| // Read values from name_list | ||
| // name_list[symm_group][cluster_size] = vector of string variables of all the cluster names | ||
| typedef std::vector<std::vector<std::vector<std::string>>> name_list; | ||
| // Read values form cluster_list | ||
| // cluster_list[symm_group][cluster_size][indx] = vector of indices belonging to the cluster #indx. | ||
| typedef std::vector<std::vector<std::vector<std::vector<std::vector<int>>>>> cluster_list; | ||
| typedef std::vector<std::map<std::string, double>> bf_list; | ||
| typedef std::array<SymbolChange, 2> swap_move; | ||
| typedef std::unordered_map<std::string, Cluster> cluster_dict; | ||
| // typedef std::unordered_map<std::string,double> cf; | ||
| typedef NamedArray cf; | ||
@@ -75,5 +67,2 @@ | ||
| /** New copy. NOTE: the pointer has to be deleted */ | ||
| CEUpdater *copy() const; | ||
| /** Initialize the object (cluster_info should contain duplication factors) */ | ||
@@ -198,5 +187,4 @@ void init(PyObject *py_atoms, PyObject *settings, PyObject *corrFunc, PyObject *eci, | ||
| // std::vector<std::string> symbols; | ||
| Symbols *symbols_with_id{nullptr}; | ||
| // std::vector<cluster_dict> clusters; | ||
| std::unique_ptr<Symbols> symbols_with_id{nullptr}; | ||
| ClusterList clusters; | ||
@@ -207,8 +195,7 @@ std::vector<int> trans_symm_group; | ||
| // bf_list basis_functions; | ||
| BasisFunction *basis_functions{nullptr}; | ||
| std::unique_ptr<BasisFunction> basis_functions{nullptr}; | ||
| Status_t status{Status_t::NOT_INITIALIZED}; | ||
| // Matrix<int> trans_matrix; | ||
| RowSparseStructMatrix trans_matrix; | ||
| std::map<std::string, int> ctype_lookup; | ||
@@ -220,3 +207,3 @@ NamedArray eci; | ||
| bool assume_no_self_interactions{false}; | ||
| CFHistoryTracker *history{nullptr}; | ||
| std::unique_ptr<CFHistoryTracker> history{nullptr}; | ||
| PyObject *atoms{nullptr}; | ||
@@ -223,0 +210,0 @@ std::vector<std::string> singlets; |
@@ -8,2 +8,3 @@ #ifndef SYMBOLS_H | ||
| typedef unsigned short int symb_id_t; | ||
| typedef std::vector<std::string> vec_str_t; | ||
@@ -19,3 +20,3 @@ typedef std::set<std::string> set_str_t; | ||
| /** Return the symbol ID of the atom at site indx */ | ||
| inline unsigned int id(unsigned int indx) const { | ||
| inline symb_id_t id(unsigned int indx) const { | ||
| return symb_ids[indx]; | ||
@@ -59,4 +60,3 @@ }; | ||
| private: | ||
| // unsigned int *symb_ids{nullptr}; | ||
| std::vector<unsigned int> symb_ids; | ||
| std::vector<symb_id_t> symb_ids; | ||
| vec_str_t symbols; | ||
@@ -63,0 +63,0 @@ dict_uint_t symb_id_translation; |
@@ -11,7 +11,7 @@ #include "basis_function.hpp" | ||
| BasisFunction::BasisFunction(const bf_raw_t &raw_bf_data, const Symbols &symb_with_num) | ||
| : symb_ptr(&symb_with_num) { | ||
| // We do not store the raw_bf_data, so we need to extract as much as we need now. | ||
| BasisFunction::BasisFunction(const bf_raw_t &raw_bf_data, const Symbols &symb_with_num) { | ||
| /* We do not store the raw_bf_data, so we need to extract as much as we need now. | ||
| Same with the symbols array */ | ||
| num_bfs = raw_bf_data.size(); | ||
| num_bf_values = symb_ptr->num_unique_symbols(); | ||
| num_bf_values = symb_with_num.num_unique_symbols(); | ||
@@ -24,3 +24,3 @@ this->bfs.clear(); | ||
| for (auto iter = raw_bf_data[dec_num].begin(); iter != raw_bf_data[dec_num].end(); ++iter) { | ||
| unsigned int indx = get_index(dec_num, symb_ptr->get_symbol_id(iter->first)); | ||
| unsigned int indx = get_index(dec_num, symb_with_num.get_symbol_id(iter->first)); | ||
| /* Assign with bounds check, since this isn't performance critical, | ||
@@ -45,3 +45,2 @@ as this construction is only done during initialization. */ | ||
| void BasisFunction::swap(const BasisFunction &other) { | ||
| this->symb_ptr = other.symb_ptr; | ||
| this->num_bfs = other.num_bfs; | ||
@@ -48,0 +47,0 @@ this->num_bf_values = other.num_bf_values; |
@@ -19,11 +19,4 @@ #include "ce_updater.hpp" | ||
| CEUpdater::CEUpdater(){}; | ||
| CEUpdater::~CEUpdater() { | ||
| delete history; | ||
| CEUpdater::~CEUpdater(){}; | ||
| delete symbols_with_id; | ||
| delete basis_functions; | ||
| symbols_with_id = nullptr; | ||
| basis_functions = nullptr; | ||
| } | ||
| void CEUpdater::init(PyObject *py_atoms, PyObject *settings, PyObject *corrFunc, PyObject *pyeci, | ||
@@ -62,3 +55,3 @@ PyObject *cluster_list) { | ||
| insert_in_set(symbols, unique_symbols); | ||
| symbols_with_id = new Symbols(symbols, unique_symbols); | ||
| symbols_with_id = std::make_unique<Symbols>(symbols, unique_symbols); | ||
@@ -169,3 +162,3 @@ // Build read the translational sites | ||
| this->basis_functions = new BasisFunction(basis_func_raw, *symbols_with_id); | ||
| this->basis_functions = std::make_unique<BasisFunction>(basis_func_raw, *symbols_with_id); | ||
@@ -197,3 +190,4 @@ #ifdef PRINT_DEBUG | ||
| flattened_cf_names(flattened_cnames); | ||
| history = new CFHistoryTracker(eci.get_names()); | ||
| history = std::make_unique<CFHistoryTracker>(eci.get_names()); | ||
| history->insert(corrFunc, nullptr); | ||
@@ -613,22 +607,2 @@ | ||
| CEUpdater *CEUpdater::copy() const { | ||
| CEUpdater *obj = new CEUpdater(); | ||
| obj->symbols_with_id = new Symbols(*symbols_with_id); | ||
| obj->clusters = clusters; | ||
| obj->trans_symm_group = trans_symm_group; | ||
| obj->trans_symm_group_count = trans_symm_group_count; | ||
| obj->normalisation_factor = normalisation_factor; | ||
| obj->basis_functions = new BasisFunction(*basis_functions); | ||
| obj->status = status; | ||
| obj->trans_matrix = trans_matrix; | ||
| obj->ctype_lookup = ctype_lookup; | ||
| obj->eci = eci; | ||
| obj->cname_with_dec = cname_with_dec; | ||
| obj->is_background_index = is_background_index; | ||
| obj->num_non_bkg_sites = num_non_bkg_sites; | ||
| obj->history = new CFHistoryTracker(*history); | ||
| obj->atoms = nullptr; // Left as nullptr by intention | ||
| return obj; | ||
| } | ||
| void CEUpdater::set_symbols(const vector<string> &new_symbs) { | ||
@@ -635,0 +609,0 @@ if (new_symbs.size() != symbols_with_id->size()) { |
@@ -7,2 +7,8 @@ .. _releasenotes: | ||
| 1.0.6 | ||
| ====== | ||
| * Now requires the ``c++14`` compiler flag. | ||
| * Fixed updating current energy for metadynamics. | ||
| See `!590 <https://gitlab.com/computationalmaterials/clease/-/merge_requests/590>`_. | ||
| 1.0.5 | ||
@@ -9,0 +15,0 @@ ====== |
+1
-1
| Metadata-Version: 2.1 | ||
| Name: clease | ||
| Version: 1.0.5 | ||
| Version: 1.0.6 | ||
| Summary: CLuster Expansion in Atomistic Simulation Environment | ||
@@ -5,0 +5,0 @@ Home-page: https://gitlab.com/computationalmaterials/clease/ |
+1
-1
@@ -66,3 +66,3 @@ import os | ||
| src_files = get_source_files() | ||
| extra_comp_args = ["-std=c++11"] | ||
| extra_comp_args = ["-std=c++14"] | ||
| extra_link_args = [] | ||
@@ -69,0 +69,0 @@ define_macros = [] |
Sorry, the diff of this file is too big to display
Alert delta unavailable
Currently unable to show alert delta for PyPI packages.
1622418
-0.09%17005
-0.02%