Skip to content

Commit 34084e6

Browse files
Added Sobol Scatter index
1 parent c8b6d25 commit 34084e6

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

Modules/Ensemble.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1032,7 +1032,7 @@ def init_from_structures(self, structures):
10321032
self.force_computed = np.zeros(self.N, dtype = bool)
10331033

10341034

1035-
def generate(self, N, evenodd = True, project_on_modes = None, sobol = False, sobol_scramble = False):
1035+
def generate(self, N, evenodd = True, project_on_modes = None, sobol = False, sobol_scramble = False, sobol_scatter = 0.0):
10361036
"""
10371037
GENERATE THE ENSEMBLE
10381038
=====================
@@ -1068,7 +1068,7 @@ class is created.
10681068

10691069
structures = []
10701070
if evenodd:
1071-
structs = self.dyn_0.ExtractRandomStructures(N // 2, self.T0, project_on_vectors = project_on_modes, lock_low_w = self.ignore_small_w, sobol = sobol, sobol_scramble = sobol_scramble) # normal Sobol generator****Diegom_test****
1071+
structs = self.dyn_0.ExtractRandomStructures(N // 2, self.T0, project_on_vectors = project_on_modes, lock_low_w = self.ignore_small_w, sobol = sobol, sobol_scramble = sobol_scramble, sobol_scatter = sobol_scatter) # normal Sobol generator****Diegom_test****
10721072

10731073

10741074

@@ -1079,7 +1079,7 @@ class is created.
10791079
new_s.coords = super_struct.coords - new_s.get_displacement(super_struct)
10801080
structures.append(new_s)
10811081
else:
1082-
structures = self.dyn_0.ExtractRandomStructures(N, self.T0, project_on_vectors = project_on_modes, lock_low_w = self.ignore_small_w, sobol = sobol, sobol_scramble = sobol_scramble) # normal Sobol generator****Diegom_test****
1082+
structures = self.dyn_0.ExtractRandomStructures(N, self.T0, project_on_vectors = project_on_modes, lock_low_w = self.ignore_small_w, sobol = sobol, sobol_scramble = sobol_scramble, sobol_scatter = sobol_scatter) # normal Sobol generator****Diegom_test****
10831083

10841084

10851085
# Enforce all the processors to share the same structures

Modules/Relax.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ def setup_custom_functions(self, custom_function_pre = None,
257257

258258

259259
def relax(self, restart_from_ens = False, get_stress = False,
260-
ensemble_loc = None, start_pop = None, sobol = False, sobol_scramble = False):
260+
ensemble_loc = None, start_pop = None, sobol = False, sobol_scramble = False, sobol_scatter = 0.0):
261261
"""
262262
COSTANT VOLUME RELAX
263263
====================
@@ -328,7 +328,7 @@ def relax(self, restart_from_ens = False, get_stress = False,
328328
self.minim.ensemble.dyn_0 = self.minim.dyn.Copy()
329329

330330
if pop != start_pop or not restart_from_ens:
331-
self.minim.ensemble.generate(self.N_configs, sobol = sobol, sobol_scramble = sobol_scramble)
331+
self.minim.ensemble.generate(self.N_configs, sobol = sobol, sobol_scramble = sobol_scramble, sobol_scatter = sobol_scatter)
332332

333333
# Compute energies and forces
334334
self.minim.ensemble.compute_ensemble(self.calc, get_stress,
@@ -380,7 +380,7 @@ def relax(self, restart_from_ens = False, get_stress = False,
380380
def vc_relax(self, target_press = 0, static_bulk_modulus = 100,
381381
restart_from_ens = False,
382382
ensemble_loc = None, start_pop = None, stress_numerical = False,
383-
cell_relax_algorithm = "sd", fix_volume = False, sobol = False, sobol_scramble = False):
383+
cell_relax_algorithm = "sd", fix_volume = False, sobol = False, sobol_scramble = False, sobol_scatter = 0.0):
384384
"""
385385
VARIABLE CELL RELAX
386386
====================
@@ -543,7 +543,7 @@ def vc_relax(self, target_press = 0, static_bulk_modulus = 100,
543543
# Generate the ensemble
544544
self.minim.ensemble.dyn_0 = self.minim.dyn.Copy()
545545
if pop != start_pop or not restart_from_ens:
546-
self.minim.ensemble.generate(self.N_configs, sobol=sobol, sobol_scramble = sobol_scramble)
546+
self.minim.ensemble.generate(self.N_configs, sobol=sobol, sobol_scramble = sobol_scramble, sobol_scatter = sobol_scatter)
547547

548548
# Save also the generation
549549
#if ensemble_loc is not None and self.save_ensemble:

0 commit comments

Comments
 (0)