From 471cbc41d4154dfde81bc2ffcfb1d156cda2a276 Mon Sep 17 00:00:00 2001 From: Shusuke KASAMATSU Date: Tue, 3 Oct 2023 19:54:56 +0900 Subject: [PATCH] initial random configuration with constraints --- abics/applications/latgas_abinitio_interface/model_setup.py | 2 +- abics/scripts/activelearn.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/abics/applications/latgas_abinitio_interface/model_setup.py b/abics/applications/latgas_abinitio_interface/model_setup.py index 4f72eaec..a57eb7be 100644 --- a/abics/applications/latgas_abinitio_interface/model_setup.py +++ b/abics/applications/latgas_abinitio_interface/model_setup.py @@ -1482,7 +1482,7 @@ def dummy_structure_from_sublattice(self, defect_sublattice): return dummy_structure def shuffle(self): - max_trial = 1000 + max_trial = 10000 num_trial = 0 while num_trial < max_trial: for defect_sublattice in self.defect_sublattices: diff --git a/abics/scripts/activelearn.py b/abics/scripts/activelearn.py index 021aecba..d7e96871 100644 --- a/abics/scripts/activelearn.py +++ b/abics/scripts/activelearn.py @@ -215,7 +215,8 @@ def main_impl(params_root: MutableMapping): solver_input = solver.input solver_input.from_directory(alparams.base_input_dir[0]) for i in range(ndata): - config.shuffle() # randomize config + constraint_fullfilled, msg = config.shuffle() # randomize config + print(msg) config.structure.sort(key=lambda site: site.species_string) structure0 = config.structure.copy() perturb_structure(config.structure, perturb)