hecss.cli¶
The command line interface for the HECSS sampler
__all__ = ['hecss_sampler', 'plot_stats', 'plot_bands', 'calculate_xscale', 'reshape_sample', 'dfset_writer', 'xsl_writer']
module-attribute
¶
HECSS
¶
Class encapsulating the sampling and weight generation for the HECSS algorithm.
Create the HECSS sampling object. It is intended to be a single object
per crystal cryst used to run samplers for one or more temperatures.
The object holds data common to all samplers (structure, calculator etc.).
The other parameters are set per sampler. The set of samplers, indexed
by temperature is hold inside the HECSS object in the samplers dictionary.
Arguments¶
- cryst : crystal structure (ASE
Atomsobject) - calc : ASE calculator or a callable returning a fresh one. A single calculator instance is reused; a callable is invoked once per sampler (i.e. once per temperature).
- width : eta, displacement scaling parameter, approx 1.0. If None, it is
estimated from forces on the first
sample()call. - maxburn : max. number of initial burn-in samples
- w_search : use width/eta searching algorithm (default True)
- disp_dist : use different distribution instead of
stats.normas the displacement distribution. - directory : basic calculation directory used by directory based calculators
- pbar : show progress bar during calculations
Source code in hecss/core.py
Ep0 = None
instance-attribute
¶
Q = _disp_dists[disp_dist]
instance-attribute
¶
calc = calc
instance-attribute
¶
cryst = cryst
instance-attribute
¶
directory = f'calc'
instance-attribute
¶
eta = width
instance-attribute
¶
maxburn = maxburn
instance-attribute
¶
pbar = None
instance-attribute
¶
samplers = {}
instance-attribute
¶
w_scale = 0.001
instance-attribute
¶
w_search = w_search
instance-attribute
¶
xscale_init = np.ones((len(self.cryst), 3))
instance-attribute
¶
__init__(cryst, calc, width=None, maxburn=20, w_search=True, disp_dist='normal', directory=None, pbar=False)
¶
Source code in hecss/core.py
print_xs(c, s)
¶
smpl_print()
¶
Source code in hecss/core.py
calculate_xscale(supercell, scale, output, skip)
¶
Calculate initial values for amplitude correction coefficients from the scale file data for the specified supercell.
Source code in hecss/cli.py
dfset_writer(s, sl, workdir='', dfset='', scale='', xsl=None)
¶
Write one sample to the DFSET file in workdir.
s is a sample tuple; sl is unused and exists only to match the
sentinel callback signature. If scale and xsl are both set, the
accumulated amplitude corrections are appended to the scale file and
xsl is cleared. Always
returns False, so it can be used as a sampler sentinel.
Source code in hecss/cli.py
hecss_sampler(fname, workdir, label, temp, width, ampl, scale, symprec, calc, setups, nodfset, dfset, nsamples, neta, command, nwork, pbar)
¶
Run HECSS sampler on the structure in the provided file (FNAME). Read the docs at: https://jochym.github.io/hecss/
FNAME - Supercell structure file. The containing directory must be readable by Vasp(restart). Usually this is a CONTCAR file for a supercell.
Source code in hecss/cli.py
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 | |
plot_bands(bands, output, x, sixel, width, height, label, nodecor)
¶
Plot the phonon dispersion from the file generated by ALAMODE. Optionally write out the plot to the output graphics file.
Source code in hecss/cli.py
plot_stats(dfset, t, output, x, sixel, sqrn, width, height)
¶
Plot the statistics of the samples from the DFSET file. Use T(K) as a reference target temperature. Optionally write out the plot to the output graphics file.
Source code in hecss/cli.py
reshape_sample(dfset, t, nmul, prob, w, check, b, output, d)
¶
Reshape the sample to the normal distribution centered around mean energy (temperature), or around provided temperature T (Kelvin). The reshaping is done by adjusting weighting of the samples by repeating the ones which should be up-weighted. The parameters are the variants of the weighting algorithm (see the docs).
The procedure reads and produces a file with in the DFSET format. For the 'check' function to work the parameter must point to the root directory of the calculated samples. The checked directories will be in the form: '{root}/nnnn'.
In check mode the raw file is not reshaped, just filtered.
Source code in hecss/cli.py
xsl_writer(s, sl, workdir='', dfset='', scale='', xsl=None)
¶
Append amplitude corrections to the scale file without writing DFSET data.
Used as the sampler sentinel when --nodfset is combined with
--scale. s, sl and dfset are unused; they match the sentinel
callback signature. Always returns False to keep sampling going.