self_consistent_harmonic_model(atoms_ideal, calc, cs, T, alpha, n_iterations, n_structures, parameters_start=None)¶
Constructs a set of self-consistent second-order force constants that provides the closest match to the potential energy surface at a the specified temperature.
- atoms_ideal (ase.Atoms) – ideal structure
- calc (ASE calculator object) – calculator to be used as reference potential
- cs (ClusterSpace) – clusterspace onto which to project the reference potential
- T (float) – temperature in K
- alpha (float) – stepsize in optimization algorithm
- n_iterations (int) – number of iterations in poor mans
- n_structures (int) – number of structures to use when fitting
- parameters_start (numpy.ndarray) – parameters from which to start the optimization
sequence of parameter vectors generated while iterating to self-consistency
This module contains various support/utility functions.
Shell(types, distance, count=0)¶
Neighbor Shell class
- types (list or tuple) – atomic types for neighbor shell
- distance (float) – interatomic distance for neighbor shell
- count (int) – number of pairs in the neighbor shell
Computes the smallest possible displacements from positions and ideal positions given a cell metric.
- assumes pbc=[True, True, True].
get_neighbor_shells(atoms, cutoff, dist_tol=1e-05)¶
Gets list of neighbor shells.
Distances are grouped into shells via the following algorithm:
- Find smallest atomic distance d_min
- Find all pair distances in the range d_min + 1 * dist_tol
- Construct a shell from these and pop them from distance list
- Go to 1.
- atoms (ase.Atoms) – Atoms used for finding shells
- cutoff (float) – exclude neighbor shells which have a distance larger than cutoff
- dist_tol (float) – distance tolerance
Enforcing rotational sum rules¶
enforce_rotational_sum_rules(cs, parameters, sum_rules, **kwargs)
Enforces rotational sum rules by projecting parameters.
The interface to this function might change in future releases.
- cs (ClusterSpace) – the underlying cluster space
- parameters (numpy.ndarray) – parameters to be constrained
- sum_rules (list(str)) – type of sum rules to enforce; possible values: ‘Huang’, ‘Born-Huang’
- ridge_alpha (float) – hyperparameter to the ridge regression algorithm; keyword argument passed to the optimizer; larger values specify stronger regularization, i.e. less correction but higher stability [default: 1e-6]
- iterations (int) – number of iterations to run the projection since each step projects the solution down to each nullspace in serial; keyword argument passed to the optimizer [default: 10]
The rotational sum rules can be enforced to the parameters before constructing a force constant potential as illustrated by the following snippet:
cs = ClusterSpace(reference_structure, cutoffs) sc = StructureContainer(cs) # add structures to structure container opt = Optimizer(sc.get_fit_data()) opt.train() new_params = enforce_rotational_sum_rules(cs, opt.parameters, sum_rules=['Huang', 'Born-Huang']) fcp = ForceConstantPotential(cs, new_params)