aim2dat.ml.cell_grid_search
¶
Methods to fit the cell parameters of crystalline materials.
Module Contents¶
Classes¶
Class to fit the cell parameters of an initial structure to a final structure using a |
-
class aim2dat.ml.cell_grid_search.CellGridSearch(length_scaling_factors=
[0.8, 1.0, 1.2]
, angle_scaling_factors=[0.9, 1.0, 1.1]
, symprec=0.005
, angle_tolerance=-1.0
, hall_number=0
, ffprint_r_max=10.0
, ffprint_delta_bin=0.005
, ffprint_sigma=0.05
, ffprint_use_weights=True
, ffprint_distinguish_kinds=False
, target_value=0.0
)[source]¶ Class to fit the cell parameters of an initial structure to a final structure using a brute-force grid search approach. The space group is maintained during the fitting process.
- Variables:¶
- length_scaling_factors : list¶
Scaling factors for the cell lengths.
- angle_scaling_factors : list¶
Scaling factors for the cell angles.
- symprec : float¶
Tolerance for spglib and length and angle comparison.
- angle_tolerance : float¶
Tolerance parameter for spglib.
- hall_number : int (optional)¶
The argument to constrain the space-group-type search only for the Hall symbol corresponding to it.
- ffprint_r_max : float¶
Cut-off value for the maximum distance between two atoms.
- ffprint_delta_bin : float (optional)¶
Bin size to descritize the function.
- ffprint_sigma : float (optional)¶
Smearing parameter for the Gaussian function.
- ffprint_use_weights : bool (optional)¶
Whether to use importance weights for the element pairs.
- ffprint_distinguish_kinds : bool (optional)¶
Whether different kinds should be distinguished e.g. Ni0 and Ni1 would be considered as different elements if
True
.- target_value : float (optional)¶
Target value used to calculate score if a model is set via the
set_model
function.
Overview
¶ fit
(search_space)Fit the initial to the final structure by varying the cell parameters.
Get optimized structure with the lowest score.
Return score of the initial structure.
Return list of parameter sets that are varied to fit the initial to the final structure.
set_initial_structure
(structure)Set initial crystal structure.
set_model
(model, function_name, single, transformer)Set scikit-learn model to predict the target value.
set_target_structure
(structure)Set target crystal structure.
-
fit(search_space=
None
)[source]¶ Fit the initial to the final structure by varying the cell parameters.
- get_optimized_structure()[source]¶
Get optimized structure with the lowest score.
- Returns:¶
aim2dat.strct.Structure – Optimized structure.
- return_initial_score()[source]¶
Return score of the initial structure.
- Returns:¶
float – Score of the initial structure.
- return_search_space()[source]¶
Return list of parameter sets that are varied to fit the initial to the final structure.
- Returns:¶
list – List of parameter sets that are varied.
- set_initial_structure(structure)[source]¶
Set initial crystal structure.
- Parameters:¶
structure (aim2dat.strct.Structure) – Initial structure.
-
set_model(model, function_name=
'predict'
, single=False
, transformer=None
)[source]¶ Set scikit-learn model to predict the target value.
- Parameters:¶
model – Object that takes structures or features as input to predicts a target value.
function_name (str (optional)) – Function name to retrieve the property prediction.
single (bool (optional)) – Whether a single structure/features or a list of structures/features is predicted at once.
transformer (aim2dat.ml.transformers (optional)) – Structure transformer.