GOFEE¶
Below an overview of the inputs to GOFEE is shown. Many of the inputs
can be safely kept at default settings. However calc
, defining the
calculator, as well as either startgenerator
or structures
,
defining the system, must always be set.
In addition it is recomended to also set the candidate_generatior
.
-
class
gofee.
GOFEE
(structures=None, calc=None, gpr=None, startgenerator=None, candidate_generator=None, kappa=2, max_steps=200, Ninit=10, max_relax_dist=4, Ncandidates=30, population_size=10, dualpoint=True, min_certainty=0.7, position_constraint=None, trajectory='structures.traj', logfile='search.log', restart='restart.pickl')¶ GOFEE global structure search method.
Parameters:
- structures: Atoms-object, list of Atoms-objects or None
In initial structures from which to start the sesarch. If None, the startgenerator must be supplied. If less than Ninit structures is supplied, the remaining ones are generated using the startgenerator or by rattling the supplied structures, depending on wether the startgenerator is supplied.
- calc: ASE calculator
Specifies the energy-expression with respect to which the atomic coordinates are globally optimized.
- gpr: GPR object
The Gaussian Process Regression model used as the surrogate model for the Potential energy surface.
- startgenerator: Startgenerator object
Used to generate initial random structures. Must be supplied if structures if structues=None. (This is the recommended way to initialize the search.)
- candidate_generator: OperationSelector object
Object used to generate new candidates.
- trajectory: str
Name of trajectory to which all structures, evaluated during the search, is saved.
- logfile: file object or str
If logfile is a string, a file with that name will be opened. Use ‘-‘ for stdout.
- kappa: float
How much to weigh predicted uncertainty in the acquisition function.
- max_steps: int
Number of search steps.
- Ninit: int
Number of initial structures. If len(structures) < Ninit, the remaining structures are generated using the startgenerator (if supplied) or by rattling the supplied ‘structures’.
- max_relax_dist: float
Max distance (in Angstrom) that an atom is allowed to move during surrogate relaxation.
- Ncandidates: int
Number of new cancidate structures generated and surrogate-relaxed in each search iteration.
- population_size: int
Maximum number of structures in the population.
- dualpoint: boolean
Whether to use dualpoint evaluation or not.
- min_certainty: float
Max predicted uncertainty allowed for structures to be considdered for evaluation. (in units of the maximum possible uncertainty.)
- position_constraint: OperationConstraint object
Enforces constraints on the positions of the “free” atoms in the search. The constraint is enforces both during mutation/crossover operations and during surrogate-relaxation.
- restart: str
Filename for restart file.
-
run
()¶ Method to run the search.
StartGenerator¶
The StartGenerator
is used to generate initial structures for
the search. In addition it can be used to generate new candidates during
the search, if it is included as an operation in the
CandidateGenerator
.
-
class
gofee.candidates.
StartGenerator
(slab, stoichiometry, box_to_place_in, cluster=False, description='StartGenerator', *args, **kwargs)¶ Class used to generate random initial candidates.
Generates new candidates by iteratively adding one atom at a time within a user-defined box.
Parameters:
- slab: Atoms object
The atoms object describing the super cell to optimize within. Can be an empty cell or a cell containing the atoms of a slab.
- stoichiometry: list
A list of atomic numbers for the atoms that are placed on top of the slab (if one is present).
- box_to_place_in: list
The box within which atoms are placed. The box should be on the form [p0, vspan] where ‘p0’ is the position of the box corner and ‘vspan’ is a matrix containing the three spanning vectors.
- blmin: float
The minimum allowed distance between atoms in units of the covalent distance between atoms, where d_cov=r_cov_i+r_cov_j.
- blmax: float
The maximum allowed distance, in units of the covalent distance, from a single isolated atom to the closest atom. If blmax=None, no constraint is enforced on isolated atoms.
- cluster: bool
If True atoms are required to be placed within blmin*d_cov of one of the other atoms to be placed. If False the atoms in the slab are also included.
CandidateGenerator¶
The CandidateGenerator
is used in each iteration in the GOFEE search
to generate new candidates based on a list on operations to use. Possible
operation can be found below under the “Mutations” section.
-
class
gofee.candidates.
CandidateGenerator
(probabilities, operations)¶ Class to produce new candidates by applying one of the candidate generation operations which is supplied in the ‘operations’-list. The operations are drawn randomly according to the ‘probabilities’-list.
- operationslist or list of lists
Defines the operations to generate new candidates in GOFEE. of mutations/crossovers. Either a list of mutations, e.g. the RattleMutation, or alternatively a list of lists of such mutations, in which case consecutive operations, one drawn from each list, are performed.
- probabilitieslist or list of lists
probability for each of the mutations/crossovers in operations. Must have the same dimensions as operations.
-
get_new_candidate
(parents)¶ Generate new candidate by applying a randomly drawn operation on the structures. This is done successively for each list of operations, if multiple are present.
Mutations¶
The mutations to chose from are listed below.
RattleMutation¶
-
class
gofee.candidates.
RattleMutation
(n_top, Nrattle=3, rattle_range=3, description='RattleMutation', *args, **kwargs)¶ Class to perform rattle mutations on structures.
Rattles a number of randomly selected atoms within a sphere of radius ‘rattle_range’ of their original positions.
Parameters:
- n_top: int
The number of atoms to optimize. Specifically the atoms with indices [-n_top:] are optimized.
- Nrattle: float
The average number of atoms to rattle.
- rattle_range: float
The maximum distance within witch to rattle the atoms. Atoms are rattled uniformly within a sphere of this radius.
- blmin: float
The minimum allowed distance between atoms in units of the covalent distance between atoms, where d_cov=r_cov_i+r_cov_j.
- blmax: float
The maximum allowed distance, in units of the covalent distance, from a single isolated atom to the closest atom. If blmax=None, no constraint is enforced on isolated atoms.
- description: str
Name of the operation, which will be saved in info-dict of structures, on which the operation is applied.
RattleMutation2¶
-
class
gofee.candidates.
RattleMutation2
(n_top, Nrattle=3, description='RattleMutation', *args, **kwargs)¶ Class to perform rattle mutations on structures.
Rattles a number of randomly selected atom to the visinity of other candomly selected atoms random atom.
Parameters:
- n_top: int
The number of atoms to optimize. Specifically the atoms with indices [-n_top:] are optimized.
- Nrattle: float
The average number of atoms to rattle.
- blmin: float
The minimum allowed distance between atoms in units of the covalent distance between atoms, where d_cov=r_cov_i+r_cov_j.
- blmax: float
The maximum allowed distance, in units of the covalent distance, from a single isolated atom to the closest atom. If blmax=None, no constraint is enforced on isolated atoms.
- description: str
Name of the operation, which will be saved in info-dict of structures, on which the operation is applied.
PermutationMutation¶
-
class
gofee.candidates.
PermutationMutation
(n_top, Npermute=3, description='PermutationMutation', *args, **kwargs)¶ Class to perform permutation mutations on structures.
Swaps the positions of a number of pairs of unlike atoms.
Parameters:
- n_top: int
The number of atoms to optimize. Specifically the atoms with indices [-n_top:] are optimized.
- Npermute: float
The average number of permutations to perform.
- blmin: float
The minimum allowed distance between atoms in units of the covalent distance between atoms, where d_cov=r_cov_i+r_cov_j.
- blmax: float
The maximum allowed distance, in units of the covalent distance, from a single isolated atom to the closest atom. If blmax=None, no constraint is enforced on isolated atoms.
- description: str
Name of the operation, which will be saved in info-dict of structures, on which the operation is applied.