qlat_utils.g_mk_jk¶
- qlat_utils.g_mk_jk(data_list, jk_idx_list, *, avg=None, jk_type, all_jk_idx, get_all_jk_idx, n_rand_sample, rng_state, jk_blocking_func, is_normalizing_rand_sample, is_apply_rand_sample_jk_idx_blocking_shift, is_use_old_rand_alg, is_hash_jk_idx, jk_idx_hash_size, eps, is_sync_node=False, **_kwargs)[source]¶
Create a (randomized) Super-Jackknife data set from un-jackknifed data.
jk_arr[0]is the average of the data andjk_arr[1:]are the resampled values, from which the error is estimated withg_jk_avg_err. The data set hasg_jk_size()samples, i.e.1 + n_rand_sampleforjk_type == "rjk"and1 + len(all_jk_idx)forjk_type == "super", and its dtype is the dtype of the data.- Parameters:
data_list – the un-jackknifed data, a list or
np.ndarrayof values (each value being afloat, acomplexor annp.ndarray);Noneentries are ignored. For the collective MPI variants below the data must have a dtype supported by MPI.jk_idx_list – the indices that name the entries of
data_list, withlen(jk_idx_list) == len(data_list), usuallyjk_idx_list = [(job_tag, traj,) for traj in traj_list]. The indices are mapped to the jackknife blocks byjk_blocking_func(seejk_blocking_func_default,block_sizeandblock_size_dict).avg – the average of the data; when
None(the default) it is computed fromdata_list. Pass a precomputed value to reuse it (it must be the average of the whole data set).is_sync_node – when
True, the operation is performed byg_mk_jk_sync_node, i.e. as a collective MPI operation in which every node holds the whole data set, every node must call this function with the same parameters, and every node obtains the completejk_arr. Useg_mk_jk_distributedinstead when the data set itself is split between the nodes. Bothjk_typevalues are supported; the result agrees with theis_sync_node=Falseresult up to the floating-point roundoff.
- Returns:
the (randomized) Super-Jackknife data set
jk_arr.
The other keyword parameters are the entries of
default_g_jk_kwargs, which supplies their defaults; set them there, pass them explicitly or use theq.JkKwargs(...)context manager. The most commonly used are:jk_type:"rjk"(the default) or"super".eps(default1): the overall scale of the fluctuations; when the data is already jackknifed, multiply it bylen(data_list).n_rand_sample(default1024): the number of random samples of"rjk".is_normalizing_rand_sample,is_apply_rand_sample_jk_idx_blocking_shiftandis_use_old_rand_alg: options of the random numbers of"rjk".is_hash_jk_idx,jk_idx_hash_size,all_jk_idxandget_all_jk_idx: the samples of"super".block_size,block_size_dictandjk_blocking_func: the jackknife blocks.rng_state: the random numbers of"rjk".
See
rjackknifeandsjackknifefor the formulas, anddocs/qlat-utils/qlat_data.mdfor the full documentation.- Example::
jk_arr = q.g_mk_jk(data_list, jk_idx_list) avg, err = q.g_jk_avg_err(jk_arr)