Skip to content

Commit 2d7ae25

Browse files
Added sobol scramble flag.
1 parent 2668ed9 commit 2d7ae25

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
@@ -1022,7 +1022,7 @@ def init_from_structures(self, structures):
10221022
self.force_computed = np.zeros(self.N, dtype = bool)
10231023

10241024

1025-
def generate(self, N, evenodd = True, project_on_modes = None, sobol = False):
1025+
def generate(self, N, evenodd = True, project_on_modes = None, sobol = False, sobol_scramble = False):
10261026
"""
10271027
GENERATE THE ENSEMBLE
10281028
=====================
@@ -1055,7 +1055,7 @@ class is created.
10551055

10561056
structures = []
10571057
if evenodd:
1058-
structs = self.dyn_0.ExtractRandomStructures(N // 2, self.T0, project_on_vectors = project_on_modes, lock_low_w = self.ignore_small_w, sobol = sobol) # normal Sobol generator****Diegom_test****
1058+
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****
10591059

10601060

10611061

@@ -1066,7 +1066,7 @@ class is created.
10661066
new_s.coords = super_struct.coords - new_s.get_displacement(super_struct)
10671067
structures.append(new_s)
10681068
else:
1069-
structures = self.dyn_0.ExtractRandomStructures(N, self.T0, project_on_vectors = project_on_modes, lock_low_w = self.ignore_small_w, sobol = sobol) # normal Sobol generator****Diegom_test****
1069+
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****
10701070

10711071

10721072
# 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):
260+
ensemble_loc = None, start_pop = None, sobol = False, sobol_scramble = False):
261261
"""
262262
COSTANT VOLUME RELAX
263263
====================
@@ -326,7 +326,7 @@ def relax(self, restart_from_ens = False, get_stress = False,
326326
self.minim.ensemble.dyn_0 = self.minim.dyn.Copy()
327327

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

331331
# Compute energies and forces
332332
self.minim.ensemble.compute_ensemble(self.calc, get_stress,
@@ -377,7 +377,7 @@ def relax(self, restart_from_ens = False, get_stress = False,
377377
def vc_relax(self, target_press = 0, static_bulk_modulus = 100,
378378
restart_from_ens = False,
379379
ensemble_loc = None, start_pop = None, stress_numerical = False,
380-
cell_relax_algorithm = "sd", fix_volume = False, sobol = False):
380+
cell_relax_algorithm = "sd", fix_volume = False, sobol = False, sobol_scramble = False):
381381
"""
382382
VARIABLE CELL RELAX
383383
====================
@@ -538,7 +538,7 @@ def vc_relax(self, target_press = 0, static_bulk_modulus = 100,
538538
# Generate the ensemble
539539
self.minim.ensemble.dyn_0 = self.minim.dyn.Copy()
540540
if pop != start_pop or not restart_from_ens:
541-
self.minim.ensemble.generate(self.N_configs, sobol=sobol)
541+
self.minim.ensemble.generate(self.N_configs, sobol=sobol, sobol_scramble = sobol_scramble)
542542

543543
# Save also the generation
544544
#if ensemble_loc is not None and self.save_ensemble:

0 commit comments

Comments
 (0)