RandomStructuresDataGenerator#

class autoplex.data.phonons.flows.RandomStructuresDataGenerator(name='RandomStruturesDataGeneratorForML', displacement_maker=<factory>, bulk_relax_maker=<factory>, code='vasp', uc=False, distort_type=0, n_structures=10, min_distance=1.5, angle_percentage_scale=10, angle_max_attempts=1000, rattle_type=0, rattle_std=0.01, rattle_seed=42, rattle_mc_n_iter=10, w_angle=None, supercell_settings=<factory>)[source]#

Bases: Maker

Maker to generate DFT labelled training data for ML potential fitting based on random atomic displacements.

This Maker performs the two following steps: 1. Generates supercells from the provided structure and randomly displaces the atomic positions using ase rattle. (randomized unit cells can be generated additionally). 2. Performs the static DFT (VASP) calculations on the randomized cells.

Parameters:
  • name (str) – Name of the flows produced by this maker.

  • displacement_maker (.BaseVaspMaker or None) – Maker used for a static calculation for a supercell.

  • code (str) – determines the dft code. currently only vasp is implemented. This keyword might enable the implementation of other codes in the future

  • n_structures (int.) – Total number of distorted structures to be generated. Must be provided if distorting volume without specifying a range, or if distorting angles. Default=10.

  • uc (bool.) – If True, will use the unit cells of initial randomly displaced structures and add phonon static computation jobs to the flow

  • distort_type (int.) – 0- volume distortion, 1- angle distortion, 2- volume and angle distortion. Default=0.

  • min_distance (float) – Minimum separation allowed between any two atoms. Default= 1.5A.

  • angle_percentage_scale (float) – Angle scaling factor. Default= 10 will randomly distort angles by +-10% of original value.

  • angle_max_attempts (int.) – Maximum number of attempts to distort structure before aborting. Default=1000.

  • w_angle (list[float]) – List of angle indices to be changed i.e. 0=alpha, 1=beta, 2=gamma. Default= [0, 1, 2].

  • rattle_type (int.) – 0- standard rattling, 1- Monte-Carlo rattling. Default=0.

  • rattle_std (float.) – Rattle amplitude (standard deviation in normal distribution). Default=0.01. Note that for MC rattling, displacements generated will roughly be rattle_mc_n_iter**0.5 * rattle_std for small values of n_iter.

  • rattle_seed (int.) – Seed for setting up NumPy random state from which random numbers are generated. Default=42.

  • rattle_mc_n_iter (int.) – Number of Monte Carlo iterations. Larger number of iterations will generate larger displacements. Default=10.

  • supercell_settings (dict) – settings for supercells

  • bulk_relax_maker (BaseVaspMaker) –

make(structure, mp_id, volume_custom_scale_factors=None, volume_scale_factor_range=None)[source]#

Make a flow to generate rattled structures reference DFT data.

Parameters:
  • structure (Structure) – Pymatgen structures drawn from the Materials Project.

  • mp_id (str) – Materials Project IDs

  • volume_scale_factor_range (list[float]) – [min, max] of volume scale factors. e.g. [0.90, 1.10] will distort volume +-10%.

  • volume_custom_scale_factors (list[float]) – Specify explicit scale factors (if range is not specified). If None, will default to [0.90, 0.95, 0.98, 0.99, 1.01, 1.02, 1.05, 1.10].