ase_uhal.committee_calculators.BaseCommitteeCalculator#
- class ase_uhal.committee_calculators.BaseCommitteeCalculator(committee_size, descriptor_size, prior_weight, energy_weight=None, forces_weight=None, stress_weight=None, sqrt_prior=None, lowmem=False, random_seed=None, regularisation=0.0001, mpi_comm=None, **kwargs)[source]#
- __init__(committee_size, descriptor_size, prior_weight, energy_weight=None, forces_weight=None, stress_weight=None, sqrt_prior=None, lowmem=False, random_seed=None, regularisation=0.0001, mpi_comm=None, **kwargs)[source]#
- Parameters:
committee_size (int) – size of the committee used to approximate the posterior
descriptor_size (int) – length of the descriptor vector. Should be set by child classes, rather than the end user
prior_weight (float) – Weight given to the prior, relative to the likelihood, in forming the posterior
energy_weight (float or None, optional) – Weight given to energy observations in forming the likelihood. If None, energy observations will be ommitted
forces_weight (float or None, optional) – Weight given to force observations in forming the likelihood. If None, force observations will be ommitted
stress_weight (float or None, optional) – Weight given to stress observations in forming the likelihood. If None, stress observations will be ommitted
sqrt_prior (np.array of float, optional) – Square root of the prior matrix, used to form the posterior. If None, an identity matrix is used.
lowmem (bool, optional) – Whether to use the low memory variant of solving for the posterior. Cannot be changed after initialisation. Defaults to False
random_seed (int or np.random.RandomState object) – Seed or random state to use for all random processes.
regularisation (float, optional) – Regularisation strength used to ensure likelihood is positive definite in the low memory variant. Used in a cholesky decomposition cholesky(likelihood + regularisation * np.eye(self.n_desc)) to obtain a square root of the likelihood. Default is 1e-4
mpi_comm (mpi4py Comm or IntraComm object, or None) – MPI communicator. Defaults to COMM_WORLD if mpi4py detected, otherwise MPI is not used
**kwargs (Keyword Arguments) – Extra keyword arguments sent to ase.calculators.calculator.Calculator
- resample_committee(committee_size=None)[source]#
Resample the committee, based on the states of self.likelihood and self.sqrt_prior Populates self.committee_weights based on the newly sampled committee
- Parameters:
committee_size (int, optional) – New size of the committee, if supplied. By default, a committee of size self.n_comm is drawn
- get_descriptor_energy(atoms=None)[source]#
Get “descriptor energy”, which is the average of descriptor vectors in the structure
Returns an array of length self.n_desc
- get_descriptor_forces(atoms=None)[source]#
Get “descriptor forces”, which are the derivatives w.r.t atomic positions of the total descriptor energy
Returns an array of shape (self.n_desc, Nats, 3)
- get_descriptor_stress(atoms=None)[source]#
Get “descriptor stresses”, which are the stress analogues to the total descriptor energy
Returns an array of shape (self.n_desc, 3, 3)
- get_committee_energies(atoms=None)[source]#
Get energy predictions by each member of the committee
Returns an array of length self.n_comm
- get_committee_forces(atoms=None)[source]#
Get force predictions by each member of the committee
Returns an array of shape (self.n_comm, Nats, 3)
- get_committee_stresses(atoms=None)[source]#
Get stress predictions by each member of the committee
Returns an array of shape (self.n_comm, 3, 3)
Methods
__init__(committee_size, descriptor_size, ...)band_structure()Create band-structure object for plotting.
calculate([atoms, properties, system_changes])Do the calculation.
calculate_numerical_forces(atoms[, d])Calculate numerical forces using finite difference.
calculate_numerical_stress(atoms[, d, voigt])Calculate numerical stress using finite difference.
calculate_properties(atoms, properties)This method is experimental; currently for internal use.
calculation_required(atoms, properties)check_state(atoms[, tol])Check for any system changes since last calculation.
export_properties()get_atoms()get_bias_energy([atoms])get_bias_forces([atoms])get_bias_stress([atoms])get_charges([atoms])get_committee_energies([atoms])Get energy predictions by each member of the committee
get_committee_forces([atoms])Get force predictions by each member of the committee
get_committee_stresses([atoms])Get stress predictions by each member of the committee
get_default_parameters()get_descriptor_energy([atoms])Get "descriptor energy", which is the average of descriptor vectors in the structure
get_descriptor_forces([atoms])Get "descriptor forces", which are the derivatives w.r.t atomic positions of the total descriptor energy
get_descriptor_stress([atoms])Get "descriptor stresses", which are the stress analogues to the total descriptor energy
get_dipole_moment([atoms])get_forces([atoms])get_magnetic_moment([atoms])get_magnetic_moments([atoms])Calculate magnetic moments projected onto atoms.
get_potential_energies([atoms])get_potential_energy([atoms, force_consistent])get_property(name[, atoms, allow_calculation])Get the named property.
get_stress([atoms])get_stresses([atoms])the calculator should return intensive stresses, i.e., such that stresses.sum(axis=0) == stress
read(label)Read atoms, parameters and calculated properties from output file.
read_atoms(restart, **kwargs)resample_committee([committee_size])Resample the committee, based on the states of self.likelihood and self.sqrt_prior Populates self.committee_weights based on the newly sampled committee
reset()Clear all information from old calculation.
select_structure(atoms)set(**kwargs)Set parameters like set(key1=value1, key2=value2, ...).
set_label(label)Set label and convert label to directory and prefix.
sync()todict([skip_default])Obtain a dictionary of parameter information
Attributes
default_parametersDefault parameters
directorydiscard_results_on_any_changeWhether we purge the results following any change in the set() method.
energy_weightforces_weightignored_changesProperties of Atoms which we ignore for the purposes of cache
implemented_propertiesProperties calculator can handle (energy, forces, ...)
labelnamestress_weight