Objects of this class are used to select optimal structures to train cluster expansion models. Also, allows to evaluate the quality of training sets.
ConfigurationalDensityOfStates class
Objects of this class are use to store and access the configurational density of states (CDOS) that was generated from a Wang-Landau sampling.
Since the Wang-Landau algorithm is iterative, it contains the CDOS for each iteration of the outer loop.
Parameters:
scell
: SuperCell object (default: None)Super cell in which the Wang-Landau sampling is performed.
filename
: string (default: cdos.json)The trajectoy can be stored in a json file filename
.
read
: boolean (default: False)If True, the CDOS is read from the Json file filename
.
**kwargs
: keyword arguments
Keyword arguments can be used to store additional information about the parameters used for the WangLandau.wang_landau_sampling rountine. This will be saved in the Json file
filename
undersampling_info
, if the object is serialized.
Calculate the thermodynamic property with name prop_name
for the temperature list given
list temperatures
.
In disregard of the normalization used for the configurational density of states \(g(E)\), for numerical convenience this method internally normalizes \(g(E)\) according to
For the output quantities other normalizations can be easily obtained considering the following transformations:
Parameters:
temperatures
: list of floats Temperatures for which the thermodynamic property is calculated, in Kelvin.
prop_name
: string (default: U)Name of thermodynamic property.
If U, the internal energy is calculated.
If C_p, the isobaric specific heat at zero pressure is calculated.
If F, the free energy is calculated.
If S, the entropy is calculated.
modification_factor
: float (default: None)If None, the CDOS from the last iteration is used for calculuting teh thermodynamic property. If not None, the CDOS corresponding to the given modification factor is used.
Returns the energy_bins and configurational density of states (CDOS) as arrays, respectively.
Parameters:
ln
: boolean (default: False)Whether to return the natural logarithm of the CDOS.
normalization
: boolean (default: True)Whether to normalize the configurational density of states.
normalization_type
: integer (default: 0
)If normalization
is true, type of normalization applied. Possible values are:
0
: \(g(E_{min}) = 1\)
1
: \(\sum_E g(E) = \sum_{subl.} Binom(N_{sites}, n_{subs})\),i.e. the total weight of the histogram equals the total number of configurations.
2
: \(\sum_E g(E) = e^{F}\),where \(F\) is a custom normalization factor given by the argument
set_normalization_ln
, see below.
set_normalization_ln
: float (default: None)If not None, the normalization is set by the exponential of the given value.
See option 2
of normalization_type
.
discard_empty_bins
: boolean (default: True)Whether to keep the energy bins that are not visited during the sampling.
modification_factor
: float (default: None)If None, the CDOS from the last iteration is returned. If not None, the CDOS corresponding to the given modification factor is returned.
Read ConfigurationalDensityOfStates object from Json file with name filename
.
If filename
is not defined, it uses filename
defined in the initialization
of ConfigurationalDensityOfStates object.
Write ConfigurationalDensityOfStates object containing the configurational density of states to Json file
with name filename
. If filename
is not defined, it uses filename
defined in the initialization
of ConfigurationalDensityOfStates object.
Add entry of configurational of states that is obtained after a flat histgram reached (corresponding to a fixed modification factor \(f\)).