From 73680a6c701614b3d11ac7ed678f0369491fbbe5 Mon Sep 17 00:00:00 2001 From: Peter Doak Date: Thu, 2 Jul 2026 19:44:44 +0000 Subject: [PATCH 1/3] More application testing energy density estimator --- src/Estimators/EnergyDensityInput.h | 4 +- tests/heg/heg_14_gamma/CMakeLists.txt | 56 +++++ ...eden_batch.s000.stat_ref_energydensity.dat | 10 + .../batch/short-heg-SJ-dmc-eden-batch.xml | 71 ++++++ .../batch/short-heg-SJ-eden-batch.xml | 71 ++++++ tests/scripts/check_stats.py | 95 +++++--- tests/solids/diamondC_1x1x1_pp/CMakeLists.txt | 43 +++- .../det_qmc_short_vmcbatch_edens_cell.in.xml | 20 +- .../qmc_edens_cell_dmc_short_batched.in.xml | 116 ++++++++++ .../qmc_edens_cell_short_batched.in.xml | 207 +++++++++--------- 10 files changed, 541 insertions(+), 152 deletions(-) create mode 100644 tests/heg/heg_14_gamma/batch/qmc-ref/short_heg_SJ_eden_batch.s000.stat_ref_energydensity.dat create mode 100644 tests/heg/heg_14_gamma/batch/short-heg-SJ-dmc-eden-batch.xml create mode 100644 tests/heg/heg_14_gamma/batch/short-heg-SJ-eden-batch.xml create mode 100644 tests/solids/diamondC_1x1x1_pp/qmc_edens_cell_dmc_short_batched.in.xml diff --git a/src/Estimators/EnergyDensityInput.h b/src/Estimators/EnergyDensityInput.h index d21ecf9716..24d92569d5 100644 --- a/src/Estimators/EnergyDensityInput.h +++ b/src/Estimators/EnergyDensityInput.h @@ -75,7 +75,9 @@ class EnergyDensityInput std::string name_{type_tag}; std::string type_{type_tag}; std::string dynamic_{"e"}; - std::string static_{"ion"}; + std::string static_{}; // There can't be a default for this since + // some systems, heg namely don't + // have static psets bool ion_points_{false}; EnergyDensityInputSection input_section_; ReferencePointsInput ref_points_input_; diff --git a/tests/heg/heg_14_gamma/CMakeLists.txt b/tests/heg/heg_14_gamma/CMakeLists.txt index ab0e4e83fe..3f6ae0aad3 100644 --- a/tests/heg/heg_14_gamma/CMakeLists.txt +++ b/tests/heg/heg_14_gamma/CMakeLists.txt @@ -114,6 +114,62 @@ qmc_run_and_check( HEG14GSSJ_NEW_SCALARS # VMC ) +# batch driver energy density +qmc_run_and_check( + short-heg_14_gamma-sj_eden_batch + "${qmcpack_SOURCE_DIR}/tests/heg/heg_14_gamma/batch" + short_heg_SJ_eden_batch + short-heg-SJ-eden-batch.xml + 4 + 4 + TRUE + 0 + HEG14GSSJ_NEW_SCALARS # VMC +) + +# batch driver energy density +qmc_run_and_check( + short-heg_14_gamma-sj-dmc_eden_batch + "${qmcpack_SOURCE_DIR}/tests/heg/heg_14_gamma/batch" + short_heg_SJ_dmc_eden_batch + short-heg-SJ-dmc-eden-batch.xml + 4 + 4 + TRUE + 0 + HEG14GSSJ_NEW_SCALARS # DMC +) + +function(add_heg_eden_stats_check test_name output_prefix) + set(full_name "${test_name}-r4-t4") + set(check_name "${full_name}-energydensity") + if(QMC_OMP AND HAVE_MPI AND NOT TEST_MAX_PROCS LESS 16) + add_test( + NAME ${check_name} + COMMAND + ${Python3_EXECUTABLE} + ${qmcpack_SOURCE_DIR}/tests/scripts/check_stats.py + -s + 0 + -q + energydensity,EDcell + -e + 2 + -c + 8 + -p + ${output_prefix} + -r + qmc-ref/short_heg_SJ_eden_batch.s000.stat_ref_energydensity.dat + WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${full_name}") + set_property(TEST ${check_name} APPEND PROPERTY DEPENDS ${full_name}) + set_property(TEST ${check_name} APPEND PROPERTY LABELS "QMCPACK-checking-results") + endif() +endfunction() + +add_heg_eden_stats_check(short-heg_14_gamma-sj_eden_batch short_heg_SJ_eden_batch) +add_heg_eden_stats_check(short-heg_14_gamma-sj-dmc_eden_batch short_heg_SJ_dmc_eden_batch) + # batch deterministic if(QMC_MIXED_PRECISION) list(APPEND DET_HEG14GSSJ_SCALARS "totenergy" "-1.24699382 0.00002") diff --git a/tests/heg/heg_14_gamma/batch/qmc-ref/short_heg_SJ_eden_batch.s000.stat_ref_energydensity.dat b/tests/heg/heg_14_gamma/batch/qmc-ref/short_heg_SJ_eden_batch.s000.stat_ref_energydensity.dat new file mode 100644 index 0000000000..6173fc7ef0 --- /dev/null +++ b/tests/heg/heg_14_gamma/batch/qmc-ref/short_heg_SJ_eden_batch.s000.stat_ref_energydensity.dat @@ -0,0 +1,10 @@ +# T T_err V V_err W W_err + 7.81275341e-01 5.00000000e-04 -1.85453971e+00 5.00000000e-04 1.40000000e+01 1.0e-16 + 9.76594176e-02 2.00000000e-04 -2.31817464e-01 3.50000000e-04 1.75000000e+00 2.50000000e-03 + 9.76594176e-02 2.00000000e-04 -2.31817464e-01 3.50000000e-04 1.75000000e+00 2.50000000e-03 + 9.76594176e-02 2.00000000e-04 -2.31817464e-01 3.50000000e-04 1.75000000e+00 2.50000000e-03 + 9.76594176e-02 2.00000000e-04 -2.31817464e-01 3.50000000e-04 1.75000000e+00 2.50000000e-03 + 9.76594176e-02 2.00000000e-04 -2.31817464e-01 3.50000000e-04 1.75000000e+00 2.50000000e-03 + 9.76594176e-02 2.00000000e-04 -2.31817464e-01 3.50000000e-04 1.75000000e+00 2.50000000e-03 + 9.76594176e-02 2.00000000e-04 -2.31817464e-01 3.50000000e-04 1.75000000e+00 2.50000000e-03 + 9.76594176e-02 2.00000000e-04 -2.31817464e-01 3.50000000e-04 1.75000000e+00 2.50000000e-03 diff --git a/tests/heg/heg_14_gamma/batch/short-heg-SJ-dmc-eden-batch.xml b/tests/heg/heg_14_gamma/batch/short-heg-SJ-dmc-eden-batch.xml new file mode 100644 index 0000000000..dd8a15fdb4 --- /dev/null +++ b/tests/heg/heg_14_gamma/batch/short-heg-SJ-dmc-eden-batch.xml @@ -0,0 +1,71 @@ + + + + batch + + + + + + p p p + + 6 + 5.0 + 14 + + + + -1 + 1.0 + + + -1 + 1.0 + + + + + + + + + + + + + + + + 1.082858193 0.6653279375 0.4358910287 0.2243616172 0.1102948764 + + + + + 1.696171854 1.047722154 0.6275148566 0.3175982878 0.1446706214 + + + + + + + + + + 200 + 102 + 100 + 5.0 + 64 + + + + + + + + + + + + + diff --git a/tests/heg/heg_14_gamma/batch/short-heg-SJ-eden-batch.xml b/tests/heg/heg_14_gamma/batch/short-heg-SJ-eden-batch.xml new file mode 100644 index 0000000000..771d8e032f --- /dev/null +++ b/tests/heg/heg_14_gamma/batch/short-heg-SJ-eden-batch.xml @@ -0,0 +1,71 @@ + + + + batch + + + + + + p p p + + 6 + 5.0 + 14 + + + + -1 + 1.0 + + + -1 + 1.0 + + + + + + + + + + + + + + + + 1.082858193 0.6653279375 0.4358910287 0.2243616172 0.1102948764 + + + + + 1.696171854 1.047722154 0.6275148566 0.3175982878 0.1446706214 + + + + + + + + + + 200 + 102 + 100 + 5.0 + 64 + + + + + + + + + + + + + diff --git a/tests/scripts/check_stats.py b/tests/scripts/check_stats.py index 10389c5b69..ae99ba72f5 100755 --- a/tests/scripts/check_stats.py +++ b/tests/scripts/check_stats.py @@ -33,6 +33,19 @@ class NexusError(Exception): #end class NexusError +class AliasDict(dict): + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + self.aliases = {} + + def alias(self, alias, key): + self.aliases[alias] = key + + def __getitem__(self, key): + if key in self.aliases: + return super().__getitem__(self.aliases[key]) + return super().__getitem__(key) + exit_call = sys.exit @@ -200,7 +213,7 @@ def __str__(self,nindent=1): return s #end def __str__ - def __eq__(self,other): + def __eq__(self,other): if not hasattr(other,'__dict__'): return False #end if @@ -450,9 +463,9 @@ def _keys(self,*args,**kwargs): return object_interface.keys(self,*args,**kwargs) def _values(self,*args,**kwargs): object_interface.values(self,*args,**kwargs) - def _items(self,*args,**kwargs): - return object_interface.items(self,*args,**kwargs) - def _copy(self,*args,**kwargs): + def _items(self,*args,**kwargs): + return object_interface.items(self,*args,**kwargs) + def _copy(self,*args,**kwargs): return object_interface.copy(self,*args,**kwargs) def _clear(self,*args,**kwargs): object_interface.clear(self,*args,**kwargs) @@ -590,7 +603,7 @@ def last(self): return self[max(self._keys())] #end def last - def select_random(self): + def select_random(self): return self[randint(0,len(self)-1)] #end def select_random @@ -733,7 +746,7 @@ def transfer_from(self,other,keys=None,copy=False,overwrite=True): if k not in self: self[k]=copier(other[k]) #end if - #end for + #end for #end if #end def transfer_from @@ -755,7 +768,7 @@ def transfer_to(self,other,keys=None,copy=False,overwrite=True): if k not in self: other[k]=copier(self[k]) #end if - #end for + #end for #end if #end def transfer_to @@ -1041,13 +1054,13 @@ def _set_parent(self,parent): def _add_dataset(self,name,dataset): self._datasets[name]=dataset - return + return #end def add_dataset def _add_group(self,name,group): group._name=name self._groups[name]=group - return + return #end def add_group def _contains_group(self,name): @@ -1145,9 +1158,9 @@ def get_keys(self): class HDFreader(DevBase): datasets = set(["","",""]) groups = set(["","",""]) - + def __init__(self,fpath,verbose=False,view=False): - + HDFglobals.view = view if verbose: @@ -1309,7 +1322,7 @@ class ColorWheel(DevBase): def __init__(self): colors = 'Black Maroon DarkOrange Green DarkBlue Purple Gray Firebrick Orange MediumSeaGreen DodgerBlue MediumOrchid'.split() lines = '- -- -. :'.split() - markers = '. v s o ^ d p'.split() + markers = '. v s o ^ d p'.split() ls = [] for line in lines: for color in colors: @@ -1416,7 +1429,7 @@ def erf(x): #end def erf -# standalone inverse error function +# standalone inverse error function # credit: https://stackoverflow.com/questions/42381244/pure-python-inverse-error-function import math def polevl(x, coefs, N): @@ -1586,7 +1599,7 @@ def exit_pass(msg=None): # Calculates the mean, variance, errorbar, and autocorrelation time # for a N-d array of statistical data values. -# If 'exclude' is provided, the first 'exclude' values will be +# If 'exclude' is provided, the first 'exclude' values will be # excluded from the analysis. def simstats(x,dim=None,exclude=None): if exclude!=None: @@ -1613,7 +1626,7 @@ def simstats(x,dim=None,exclude=None): shape = tuple(array(shape)[array(permutation)]) dim = ndim-1 #end if - if reshape: + if reshape: nvars = prod(shape[0:dim]) x=x.reshape(nvars,nblocks) rdim=dim @@ -1628,7 +1641,7 @@ def simstats(x,dim=None,exclude=None): N=nblocks if ndim==1: - i=0 + i=0 tempC=0.5 kappa=0.0 mtmp=mean @@ -1655,7 +1668,7 @@ def simstats(x,dim=None,exclude=None): error = zeros(mean.shape) kappa = zeros(mean.shape) for v in range(nvars): - i=0 + i=0 tempC=0.5 kap=0.0 vtmp = var[v] @@ -1679,7 +1692,7 @@ def simstats(x,dim=None,exclude=None): #end if kappa[v]=kap error[v]=sqrt(vtmp/Neff) - #end for + #end for #end if if reshape: @@ -1903,7 +1916,7 @@ def read_command_line(): elif options.quantity not in allowed_quantities: exit_fail('unrecognized quantity provided\nallowed quantities: {0}\nquantity provided: {1}'.format(allowed_quantities,options.quantity)) #end if - + if options.npartial_sums=='none': exit_fail('-c option is required') #end if @@ -1967,7 +1980,7 @@ def process_stat_file(options): vlog('processing stat.h5 file') values = obj() - + try: # find all output files matching prefix vlog('searching for qmcpack output files',n=1) @@ -2241,7 +2254,7 @@ def read_reference_file(filepath): # Checks computed values from stat.h5 files against specified reference values. passfail = {True:'pass',False:'fail'} def check_values(options,values): - # check_values is for statistical tests + # check_values is for statistical tests vlog('\nchecking against reference values') success = True @@ -2304,6 +2317,7 @@ def check_values(options,values): vlog('checking energy density terms per block',n=1) msg+='\n Energy density sums vs. scalar file per block tests:\n' scalars = load_scalar_file(options,'auto') + block_scalar = load_scalar_file(options, 'scalar') ed_success = True ftol = 1e-8 ed_values = obj( @@ -2322,19 +2336,45 @@ def check_values(options,values): else: exit_fail('unrecognized scalar file type: {0}'.format(scalars.file_type)) #end if + print ("Checking block sums of hdf5 and dat files", comparisons.values()) + sc_dmc_energies = dict() for k in sorted(comparisons.keys()): ed_vals = ed_values[k] sc_vals = scalars.data[comparisons[k]] if scalars.file_type=='dmc': - if len(sc_vals)%len(ed_vals)==0 and len(sc_vals)>len(ed_vals): + print("len(sc_vals)%len(ed_vals)", len(sc_vals)%len(ed_vals), len(sc_vals), " >= ", len(ed_vals)) + if len(sc_vals)%len(ed_vals)==0 and len(sc_vals)>=len(ed_vals): steps = len(sc_vals)//len(ed_vals) - sc_vals.shape = len(sc_vals)//steps,steps - sc_vals = sc_vals.mean(1) + if comparisons[k] == 'LocalEnergy': + sc_weights = scalars.data['Weight'] + sc_vals = array([val * weight for val, weight in zip(sc_vals, sc_weights)]) + sc_vals = sc_vals.reshape(len(sc_vals)//steps,steps) + sc_vals = sc_vals.sum(1) + sc_weights = sc_weights.reshape(len(sc_weights)//steps,steps) + sc_weights = sc_weights.sum(1) + sc_vals = sc_vals / sc_weights + elif comparisons[k] == 'Weight': + sc_vals = sc_vals.reshape(len(sc_vals)//steps,steps) + sc_vals = sc_vals.sum(1) + else: + sc_vals = sc_vals.mean(1) + #end if + sc_dmc_energies[comparisons[k]] = sc_vals #end if #end if + if len(ed_vals)!=len(sc_vals): exit_fail('energy density per block test cannot be completed\nnumber of energy density and scalar blocks do not match\nenergy density blocks: {0}\nscalar file blocks: {1}'.format(len(ed_vals),len(sc_vals))) #end if + + if scalars.file_type=='dmc': + ftol = 1e-7 + else: + ftol = 1e-7 + # This test is actually relative error assuming the + # the scv is the true value. since conventionally the + # divisor is the true value. + print("checking estimator", comparisons[k], "versus scalar agreement") for i,(edv,scv) in enumerate(zip(ed_vals,sc_vals)): if abs((edv-scv)/scv)>ftol: ed_success = False @@ -2343,7 +2383,7 @@ def check_values(options,values): #end for #end for if ed_success: - fmsg = 'all per block sums match the scalar file' + fmsg = f'all per block sums match sums of {scalars.file_type}.dat' else: fmsg = 'some per block sums do not match the scalar file' #end if @@ -2353,7 +2393,6 @@ def check_values(options,values): success &= ed_success #end if - # function used immediately below to test a mean value vs reference def check_mean(label,mean_comp,error_comp,mean_ref,error_ref,nsigma): msg='\n Testing quantity: {0}\n'.format(label) @@ -2440,11 +2479,11 @@ def check_values_abs_err(options,values): success = True msg = '' - + try: msg += '\nTests for series {0} quantity "{1}"\n'.format(options.series,options.quantity) N = options.npartial_sums - + # read in the reference file ref_values,dnames = read_reference_file(options) diff --git a/tests/solids/diamondC_1x1x1_pp/CMakeLists.txt b/tests/solids/diamondC_1x1x1_pp/CMakeLists.txt index 5619f4e116..13ef4ee37b 100644 --- a/tests/solids/diamondC_1x1x1_pp/CMakeLists.txt +++ b/tests/solids/diamondC_1x1x1_pp/CMakeLists.txt @@ -798,7 +798,7 @@ if(add_estimator_tests) -s 0 -q - 'energydensity,EDcellBatched' + 'energydensity,EDcell' -e 20 -c @@ -807,7 +807,7 @@ if(add_estimator_tests) qmc_edens_cell_short_batched -r qmc-ref/qmc_edens_cell_short.s000.stat_ref_energydensity.dat) - + simple_run_and_check( short-diamondC_1x1x1_pp-vmc-estimator-energydensity-voronoi "${qmcpack_SOURCE_DIR}/tests/solids/diamondC_1x1x1_pp" @@ -848,6 +848,26 @@ if(add_estimator_tests) -r qmc-ref/qmc_edens_cell_dmc_short.s001.stat_ref_energydensity.dat) + simple_run_and_check( + short-diamondC_1x1x1_pp-dmc-estimator-energydensity-cell-batched + "${qmcpack_SOURCE_DIR}/tests/solids/diamondC_1x1x1_pp" + qmc_edens_cell_dmc_short_batched${IFEXT}.in.xml + ${NMPI} + ${NOMP} + check_stats.py + -s + 1 + -q + 'energydensity,EDcell' + -e + 2 + -c + 8 + -p + qmc_edens_cell_dmc_short_batched + -r + qmc-ref/qmc_edens_cell_dmc_short.s001.stat_ref_energydensity.dat) + simple_run_and_check( long-diamondC_1x1x1_pp-vmc-estimator-energydensity-cell "${qmcpack_SOURCE_DIR}/tests/solids/diamondC_1x1x1_pp" @@ -1059,12 +1079,11 @@ if(add_estimator_tests AND NOT QMC_MIXED_PRECISION) qmc-ref/det_qmc_spindens_short_mw.s000.stat_ref_spindensity_4_4.dat) # SIMPLE_RUN_AND_CHECK( - # deterministic-diamondC_1x1x1_pp-vmcbatch-estimator-spindensity - # "${qmcpack_SOURCE_DIR}/tests/solids/diamondC_1x1x1_pp" - # det_qmc_spindens_short_vmcbatched.in.xml - # 1 1 - # check_stats.py -s 0 -q spindensity -e 0 -c 8 -p det_qmc_spindens_short -r qmc-ref/det_qmc_vmcbatch_spindens_short.s000.stat_ref_spindensity_1_1.dat - # ) + # deterministic-diamondC_1x1x1_pp-vmcbatch-estimator-spindensity + # "${qmcpack_SOURCE_DIR}/tests/solids/diamondC_1x1x1_pp" + # det_qmc_spindens_short_vmcbatched.in.xml 1 1 check_stats.py -s 0 -q + # spindensity -e 0 -c 8 -p det_qmc_spindens_short -r + # qmc-ref/det_qmc_vmcbatch_spindens_short.s000.stat_ref_spindensity_1_1.dat ) simple_run_and_check( deterministic-diamondC_1x1x1_pp-dmc-estimator-spindensity @@ -1898,7 +1917,7 @@ if(add_traces_tests) check_traces.py -p qmc_trace_scalars - -n + -n 4 -s '0,1' @@ -1953,7 +1972,7 @@ if(add_traces_tests) -m vmc --dmc_steps_exclude=1) - + simple_run_and_check( deterministic-diamondC_1x1x1_pp-vmc-walkerlog_scalars "${qmcpack_SOURCE_DIR}/tests/solids/diamondC_1x1x1_pp" @@ -2002,7 +2021,7 @@ if(add_traces_tests) -m vmc --dmc_steps_exclude=1) - + simple_run_and_check( deterministic-diamondC_1x1x1_pp-vmcbatch-walkerlog_scalars "${qmcpack_SOURCE_DIR}/tests/solids/diamondC_1x1x1_pp" @@ -2068,7 +2087,7 @@ if(add_traces_tests) check_traces.py -p qmc_trace_scalars_selective - -n + -n 4 -s '0,1' diff --git a/tests/solids/diamondC_1x1x1_pp/det_qmc_short_vmcbatch_edens_cell.in.xml b/tests/solids/diamondC_1x1x1_pp/det_qmc_short_vmcbatch_edens_cell.in.xml index bbe6dc1d7b..5d99490dfc 100644 --- a/tests/solids/diamondC_1x1x1_pp/det_qmc_short_vmcbatch_edens_cell.in.xml +++ b/tests/solids/diamondC_1x1x1_pp/det_qmc_short_vmcbatch_edens_cell.in.xml @@ -1,6 +1,6 @@ - + batched @@ -46,27 +46,27 @@ - + - + - --0.2032153051 -0.1625595974 -0.143124599 -0.1216434956 -0.09919771951 -0.07111729038 + +-0.2032153051 -0.1625595974 -0.143124599 -0.1216434956 -0.09919771951 -0.07111729038 -0.04445345869 -0.02135082917 - -0.2797730287 0.2172604155 0.1656172964 0.1216984261 0.083995349 0.05302065936 + +0.2797730287 0.2172604155 0.1656172964 0.1216984261 0.083995349 0.05302065936 0.02915953995 0.0122402581 - -0.4631099906 0.356399124 0.2587895287 0.1829298509 0.1233653291 0.07714708174 + +0.4631099906 0.356399124 0.2587895287 0.1829298509 0.1233653291 0.07714708174 0.04145899033 0.01690645936 @@ -78,7 +78,7 @@ - + diff --git a/tests/solids/diamondC_1x1x1_pp/qmc_edens_cell_dmc_short_batched.in.xml b/tests/solids/diamondC_1x1x1_pp/qmc_edens_cell_dmc_short_batched.in.xml new file mode 100644 index 0000000000..03c5acf19a --- /dev/null +++ b/tests/solids/diamondC_1x1x1_pp/qmc_edens_cell_dmc_short_batched.in.xml @@ -0,0 +1,116 @@ + + + + + batched + + + + + 3.37316115 3.37316115 0.00000000 + 0.00000000 3.37316115 3.37316115 + 3.37316115 0.00000000 3.37316115 + + + p p p + + 15 + + + + -1 + 1.0 + + + -1 + 1.0 + + + + + 4 + 4 + 6 + 21894.7135906 + + 0.00000000 0.00000000 0.00000000 + 1.68658058 1.68658058 1.68658058 + + + + + + + + + + + + + + + + +-0.2032153051 -0.1625595974 -0.143124599 -0.1216434956 -0.09919771951 -0.07111729038 +-0.04445345869 -0.02135082917 + + + + + + + 0.2797730287 0.2172604155 0.1656172964 0.1216984261 0.083995349 0.05302065936 +0.02915953995 0.0122402581 + + + + + 0.4631099906 0.356399124 0.2587895287 0.1829298509 0.1233653291 0.07714708174 + 0.04145899033 0.01690645936 + + + + + + + + + + + + + + + + + + 64 + no + 100 + 0.01 + 1 + 1 + no + + + + + + + + + + + + + + + 256 + no + 100 + 0.01 + 100 + 100 + no + + diff --git a/tests/solids/diamondC_1x1x1_pp/qmc_edens_cell_short_batched.in.xml b/tests/solids/diamondC_1x1x1_pp/qmc_edens_cell_short_batched.in.xml index bdda65c53e..c51ae31a8d 100644 --- a/tests/solids/diamondC_1x1x1_pp/qmc_edens_cell_short_batched.in.xml +++ b/tests/solids/diamondC_1x1x1_pp/qmc_edens_cell_short_batched.in.xml @@ -1,104 +1,109 @@ - - - batched - - - - - 3.37316115 3.37316115 0.00000000 - 0.00000000 3.37316115 3.37316115 - 3.37316115 0.00000000 3.37316115 - - - p p p - - 15 - - - - -1 - 1.0 - - - -1 - 1.0 - - - - - 4 - 4 - 6 - 21894.7135906 - - 0.00000000 0.00000000 0.00000000 - 1.68658058 1.68658058 1.68658058 - - - - - - - - - - - - - - - - --0.2032153051 -0.1625595974 -0.143124599 -0.1216434956 -0.09919771951 -0.07111729038 --0.04445345869 -0.02135082917 - - - - - - -0.2797730287 0.2172604155 0.1656172964 0.1216984261 0.083995349 0.05302065936 -0.02915953995 0.0122402581 - - - - -0.4631099906 0.356399124 0.2587895287 0.1829298509 0.1233653291 0.07714708174 -0.04145899033 0.01690645936 - - - - - - - - - - - - - - - - - - - - - - - - - - - - 16 - 1000 - 8 - 2 - 0.3 - 100 - + + + batched + + + + + 3.37316115 3.37316115 0.00000000 + 0.00000000 3.37316115 3.37316115 + 3.37316115 0.00000000 3.37316115 + + + p p p + + 15 + + + + -1 + 1.0 + + + -1 + 1.0 + + + + + 4 + 4 + 6 + 21894.7135906 + + 0.00000000 0.00000000 0.00000000 + 1.68658058 1.68658058 1.68658058 + + + + + + + + + + + + + + + + + -0.2032153051 -0.1625595974 -0.143124599 -0.1216434956 + -0.09919771951 -0.07111729038 + -0.04445345869 -0.02135082917 + + + + + + + 0.2797730287 0.2172604155 0.1656172964 0.1216984261 0.083995349 + 0.05302065936 + 0.02915953995 0.0122402581 + + + + + 0.4631099906 0.356399124 0.2587895287 0.1829298509 0.1233653291 + 0.07714708174 + 0.04145899033 0.01690645936 + + + + + + + + + + + + + + + + + + + + + + + + + + 16 + 200 + 100 + 2 + 0.3 + 100 + From a6db7e4d4cfab9fa0e50801b5c8c2c736c0c9635 Mon Sep 17 00:00:00 2001 From: Peter Doak Date: Thu, 2 Jul 2026 21:08:13 +0000 Subject: [PATCH 2/3] expanding SJ dmc testing --- tests/heg/heg_14_gamma/CMakeLists.txt | 35 +++++++--- .../batch/short-heg-SJ-dmc-batch.xml | 65 +++++++++++++++++++ .../batch/short-heg-SJ-dmc-eden-batch.xml | 14 +++- .../qmc_edens_cell_dmc_short_batched.in.xml | 4 +- 4 files changed, 106 insertions(+), 12 deletions(-) create mode 100644 tests/heg/heg_14_gamma/batch/short-heg-SJ-dmc-batch.xml diff --git a/tests/heg/heg_14_gamma/CMakeLists.txt b/tests/heg/heg_14_gamma/CMakeLists.txt index 3f6ae0aad3..2c5174739c 100644 --- a/tests/heg/heg_14_gamma/CMakeLists.txt +++ b/tests/heg/heg_14_gamma/CMakeLists.txt @@ -114,6 +114,22 @@ qmc_run_and_check( HEG14GSSJ_NEW_SCALARS # VMC ) +list(APPEND HEG14GSSJ_DMC_SCALARS "totenergy" "-1.110199 0.000322") # total energy +list(APPEND HEG14GSSJ_DMC_SCALARS "variance" " 0.022894 0.000060") # energy variance + +qmc_run_and_check( + short-heg_14_gamma-sj-dmc_batch + "${qmcpack_SOURCE_DIR}/tests/heg/heg_14_gamma/batch" + short_heg_SJ_dmc_batch + short-heg-SJ-dmc-batch.xml + 1 + 16 + TRUE + 1 + HEG14GSSJ_DMC_SCALARS # DMC +) + + # batch driver energy density qmc_run_and_check( short-heg_14_gamma-sj_eden_batch @@ -129,28 +145,29 @@ qmc_run_and_check( # batch driver energy density qmc_run_and_check( - short-heg_14_gamma-sj-dmc_eden_batch + short-heg_14_gamma-sj_dmc_eden_batch "${qmcpack_SOURCE_DIR}/tests/heg/heg_14_gamma/batch" short_heg_SJ_dmc_eden_batch short-heg-SJ-dmc-eden-batch.xml 4 4 TRUE - 0 - HEG14GSSJ_NEW_SCALARS # DMC + 1 + HEG14GSSJ_DMC_SCALARS # DMC ) -function(add_heg_eden_stats_check test_name output_prefix) +function(add_heg_eden_stats_check test_name output_prefix series) set(full_name "${test_name}-r4-t4") set(check_name "${full_name}-energydensity") if(QMC_OMP AND HAVE_MPI AND NOT TEST_MAX_PROCS LESS 16) + set(reference_filename "qmc-ref/short_heg_SJ_eden_batch.s000.stat_ref_energydensity.dat") add_test( NAME ${check_name} COMMAND ${Python3_EXECUTABLE} ${qmcpack_SOURCE_DIR}/tests/scripts/check_stats.py -s - 0 + ${series} -q energydensity,EDcell -e @@ -160,15 +177,17 @@ function(add_heg_eden_stats_check test_name output_prefix) -p ${output_prefix} -r - qmc-ref/short_heg_SJ_eden_batch.s000.stat_ref_energydensity.dat + ${reference_filename} WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${full_name}") set_property(TEST ${check_name} APPEND PROPERTY DEPENDS ${full_name}) set_property(TEST ${check_name} APPEND PROPERTY LABELS "QMCPACK-checking-results") endif() endfunction() -add_heg_eden_stats_check(short-heg_14_gamma-sj_eden_batch short_heg_SJ_eden_batch) -add_heg_eden_stats_check(short-heg_14_gamma-sj-dmc_eden_batch short_heg_SJ_dmc_eden_batch) +add_heg_eden_stats_check(short-heg_14_gamma-sj_eden_batch +short_heg_SJ_eden_batch 0) +add_heg_eden_stats_check(short-heg_14_gamma-sj-dmc_eden_batch +short_heg_SJ_dmc_eden_batch 1) # batch deterministic if(QMC_MIXED_PRECISION) diff --git a/tests/heg/heg_14_gamma/batch/short-heg-SJ-dmc-batch.xml b/tests/heg/heg_14_gamma/batch/short-heg-SJ-dmc-batch.xml new file mode 100644 index 0000000000..5352ac2a21 --- /dev/null +++ b/tests/heg/heg_14_gamma/batch/short-heg-SJ-dmc-batch.xml @@ -0,0 +1,65 @@ + + + + batch + + + + + p p p + + 6 + 5.0 + 14 + + + + -1 + 1.0 + + + -1 + 1.0 + + + + + + + + + + + + + + + + 1.082858193 0.6653279375 0.4358910287 0.2243616172 0.1102948764 + + + + + 1.696171854 1.047722154 0.6275148566 0.3175982878 0.1446706214 + + + + + + + + + + 200 + 80 + 10 + 5.0 + + + 200 + 800 + 40 + 0.125 + + + diff --git a/tests/heg/heg_14_gamma/batch/short-heg-SJ-dmc-eden-batch.xml b/tests/heg/heg_14_gamma/batch/short-heg-SJ-dmc-eden-batch.xml index dd8a15fdb4..89d3de4a6a 100644 --- a/tests/heg/heg_14_gamma/batch/short-heg-SJ-dmc-eden-batch.xml +++ b/tests/heg/heg_14_gamma/batch/short-heg-SJ-dmc-eden-batch.xml @@ -52,11 +52,21 @@ 200 - 102 - 100 + 80 + 40 5.0 64 + + + + + 200 + 800 + 100 + 0.06 + 64 + diff --git a/tests/solids/diamondC_1x1x1_pp/qmc_edens_cell_dmc_short_batched.in.xml b/tests/solids/diamondC_1x1x1_pp/qmc_edens_cell_dmc_short_batched.in.xml index 03c5acf19a..231a98243b 100644 --- a/tests/solids/diamondC_1x1x1_pp/qmc_edens_cell_dmc_short_batched.in.xml +++ b/tests/solids/diamondC_1x1x1_pp/qmc_edens_cell_dmc_short_batched.in.xml @@ -88,8 +88,8 @@ no 100 0.01 - 1 - 1 + 10 + 10 no From 2e8e9d9cc6aaf1a76e2b83465f26caf536513a27 Mon Sep 17 00:00:00 2001 From: Peter Doak Date: Thu, 2 Jul 2026 22:28:56 +0000 Subject: [PATCH 3/3] heg eden reference files gend from longer runs --- tests/heg/heg_14_gamma/CMakeLists.txt | 17 ++++++++++------ ...eden_batch.s001.stat_ref_energydensity.dat | 10 ++++++++++ ...eden_batch.s000.stat_ref_energydensity.dat | 20 +++++++++---------- 3 files changed, 31 insertions(+), 16 deletions(-) create mode 100644 tests/heg/heg_14_gamma/batch/qmc-ref/short_heg_SJ_dmc_eden_batch.s001.stat_ref_energydensity.dat diff --git a/tests/heg/heg_14_gamma/CMakeLists.txt b/tests/heg/heg_14_gamma/CMakeLists.txt index 2c5174739c..04c70f7bcf 100644 --- a/tests/heg/heg_14_gamma/CMakeLists.txt +++ b/tests/heg/heg_14_gamma/CMakeLists.txt @@ -156,11 +156,10 @@ qmc_run_and_check( HEG14GSSJ_DMC_SCALARS # DMC ) -function(add_heg_eden_stats_check test_name output_prefix series) +function(add_heg_eden_stats_check test_name output_prefix series reference_filename) set(full_name "${test_name}-r4-t4") set(check_name "${full_name}-energydensity") if(QMC_OMP AND HAVE_MPI AND NOT TEST_MAX_PROCS LESS 16) - set(reference_filename "qmc-ref/short_heg_SJ_eden_batch.s000.stat_ref_energydensity.dat") add_test( NAME ${check_name} COMMAND @@ -184,10 +183,16 @@ function(add_heg_eden_stats_check test_name output_prefix series) endif() endfunction() -add_heg_eden_stats_check(short-heg_14_gamma-sj_eden_batch -short_heg_SJ_eden_batch 0) -add_heg_eden_stats_check(short-heg_14_gamma-sj-dmc_eden_batch -short_heg_SJ_dmc_eden_batch 1) +add_heg_eden_stats_check( + short-heg_14_gamma-sj_eden_batch + short_heg_SJ_eden_batch + 0 + qmc-ref/short_heg_SJ_eden_batch.s000.stat_ref_energydensity.dat) +add_heg_eden_stats_check( + short-heg_14_gamma-sj_dmc_eden_batch + short_heg_SJ_dmc_eden_batch + 1 + qmc-ref/short_heg_SJ_dmc_eden_batch.s001.stat_ref_energydensity.dat) # batch deterministic if(QMC_MIXED_PRECISION) diff --git a/tests/heg/heg_14_gamma/batch/qmc-ref/short_heg_SJ_dmc_eden_batch.s001.stat_ref_energydensity.dat b/tests/heg/heg_14_gamma/batch/qmc-ref/short_heg_SJ_dmc_eden_batch.s001.stat_ref_energydensity.dat new file mode 100644 index 0000000000..f0f5bc8a52 --- /dev/null +++ b/tests/heg/heg_14_gamma/batch/qmc-ref/short_heg_SJ_dmc_eden_batch.s001.stat_ref_energydensity.dat @@ -0,0 +1,10 @@ +# T T_err V V_err W W_err + 7.701687642616e-01 9.297670538182e-04 -1.880044146318e+00 9.435026343402e-04 1.400000000000e+01 9.156511964133e-17 + 9.626624475126e-02 3.490256604697e-04 -2.349321616666e-01 6.738082877798e-04 1.748674849950e+00 5.352045929504e-03 + 9.620137943728e-02 3.635563237728e-04 -2.348742918046e-01 6.931328365557e-04 1.749547812982e+00 5.588141222878e-03 + 9.630051621241e-02 3.782699432931e-04 -2.350908049413e-01 7.226825329440e-04 1.750521544532e+00 5.678370578703e-03 + 9.625569492348e-02 3.424985456192e-04 -2.350334669800e-01 6.455106703608e-04 1.750723780890e+00 5.179137061123e-03 + 9.619907762775e-02 3.607270693319e-04 -2.348151395562e-01 6.832492527105e-04 1.749000883020e+00 5.512199273707e-03 + 9.633886561148e-02 3.734801771907e-04 -2.351243586495e-01 6.957544754619e-04 1.751527937848e+00 5.349658297788e-03 + 9.621113052193e-02 3.553986065916e-04 -2.349236007679e-01 6.849711248010e-04 1.749278657949e+00 5.586085203157e-03 + 9.639585517599e-02 3.620350686496e-04 -2.352503219517e-01 6.756000545315e-04 1.750724532829e+00 5.411274265383e-03 diff --git a/tests/heg/heg_14_gamma/batch/qmc-ref/short_heg_SJ_eden_batch.s000.stat_ref_energydensity.dat b/tests/heg/heg_14_gamma/batch/qmc-ref/short_heg_SJ_eden_batch.s000.stat_ref_energydensity.dat index 6173fc7ef0..3ad60c19bf 100644 --- a/tests/heg/heg_14_gamma/batch/qmc-ref/short_heg_SJ_eden_batch.s000.stat_ref_energydensity.dat +++ b/tests/heg/heg_14_gamma/batch/qmc-ref/short_heg_SJ_eden_batch.s000.stat_ref_energydensity.dat @@ -1,10 +1,10 @@ -# T T_err V V_err W W_err - 7.81275341e-01 5.00000000e-04 -1.85453971e+00 5.00000000e-04 1.40000000e+01 1.0e-16 - 9.76594176e-02 2.00000000e-04 -2.31817464e-01 3.50000000e-04 1.75000000e+00 2.50000000e-03 - 9.76594176e-02 2.00000000e-04 -2.31817464e-01 3.50000000e-04 1.75000000e+00 2.50000000e-03 - 9.76594176e-02 2.00000000e-04 -2.31817464e-01 3.50000000e-04 1.75000000e+00 2.50000000e-03 - 9.76594176e-02 2.00000000e-04 -2.31817464e-01 3.50000000e-04 1.75000000e+00 2.50000000e-03 - 9.76594176e-02 2.00000000e-04 -2.31817464e-01 3.50000000e-04 1.75000000e+00 2.50000000e-03 - 9.76594176e-02 2.00000000e-04 -2.31817464e-01 3.50000000e-04 1.75000000e+00 2.50000000e-03 - 9.76594176e-02 2.00000000e-04 -2.31817464e-01 3.50000000e-04 1.75000000e+00 2.50000000e-03 - 9.76594176e-02 2.00000000e-04 -2.31817464e-01 3.50000000e-04 1.75000000e+00 2.50000000e-03 +# T T_err V V_err W W_err + 7.809944030678e-01 4.153666455982e-04 -1.854328037659e+00 3.837780085340e-04 1.400000000000e+01 3.004092001875e-17 + 9.761073878546e-02 1.543618291424e-04 -2.317162923937e-01 2.711924991568e-04 1.749600156250e+00 2.261529435217e-03 + 9.764586177813e-02 1.568374692326e-04 -2.317813077152e-01 2.900115900183e-04 1.749741562500e+00 2.108868505832e-03 + 9.767484527822e-02 1.674053514573e-04 -2.318416493742e-01 3.036195256048e-04 1.749991875000e+00 2.093010225280e-03 + 9.771935945445e-02 1.594176210134e-04 -2.319188713472e-01 2.663525541139e-04 1.750682343750e+00 2.365496347591e-03 + 9.750145732212e-02 1.540929643724e-04 -2.316427070495e-01 2.644606325834e-04 1.749095312500e+00 2.122103097207e-03 + 9.759441952282e-02 1.587821918948e-04 -2.317554760108e-01 2.781628691873e-04 1.750215000000e+00 2.144835018695e-03 + 9.765097017927e-02 1.589500289087e-04 -2.318786696601e-01 2.688542348687e-04 1.750779687500e+00 2.056197525570e-03 + 9.759675074728e-02 1.762249114623e-04 -2.317930641082e-01 2.888268307360e-04 1.749894062500e+00 2.181759409640e-03