Skip to content

Commit

Permalink
Merge pull request #5134 from prckent/nxbatchedsamples
Browse files Browse the repository at this point in the history
Nexus: enable samples tag with batched drivers
  • Loading branch information
ye-luo authored Aug 22, 2024
2 parents 89342b0 + 8a72585 commit 2933fce
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions nexus/lib/qmcpack_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -6542,19 +6542,19 @@ def generate_opts(opt_reqs,**kwargs):
cost = 'variance',
cycles = 12,
var_cycles = 0,
#var_samples = None,
var_samples = None,
init_cycles = 0,
#init_samples = None,
init_samples = None,
init_minwalkers = 1e-4,
)

shared_opt_batched_defaults = obj(
#samples = 204800,
nonlocalpp = True,
use_nonlocalpp_deriv = True,
samples = 204800,
#nonlocalpp = True,
#use_nonlocalpp_deriv = True,
warmupsteps = 300,
blocks = 100,
steps = 1,
#steps = 1,
substeps = 10,
timestep = 0.3,
usedrift = False,
Expand Down Expand Up @@ -7021,9 +7021,9 @@ def generate_batched_opt_calculations(
cost ,
cycles ,
var_cycles ,
#var_samples,
var_samples,
init_cycles,
#init_samples,
init_samples,
init_minwalkers,
loc = 'generate_opt_calculations',
**opt_inputs
Expand Down Expand Up @@ -7071,16 +7071,16 @@ def generate_batched_opt_calculations(
reweightedvariance = 0.0,
**opt_inputs
)
#if var_samples is not None:
# vmin_opt.samples = var_samples
##end if
if var_samples is not None:
vmin_opt.samples = var_samples
#end if
opt_calcs.append(loop(max=var_cycles,qmc=vmin_opt))
#end if
if init_cycles>0:
init_opt = opt(**opt_inputs)
#if init_samples is not None:
# init_opt.samples = init_samples
##end if
if init_samples is not None:
init_opt.samples = init_samples
#end if
init_opt.minwalkers = init_minwalkers
if not oneshift:
init_opt.energy = cost[0]
Expand Down Expand Up @@ -7710,7 +7710,7 @@ def generate_basic_input(**kwargs):
if isinstance(calc,loop):
calc = calc.qmc
#end if
if isinstance(calc,(linear,cslinear,linear_batch)) and 'nonlocalpp' not in calc:
if isinstance(calc,(linear,cslinear,linear_batch)) and 'nonlocalpp' not in calc and not batched:
calc.nonlocalpp = True
calc.use_nonlocalpp_deriv = True
#end if
Expand Down

0 comments on commit 2933fce

Please sign in to comment.