generateInitialPopulation

generateInitialPopulation(elements, population_size, calculator, volume=None, max_forces=PhysicalQuantity(0.01, eV / Ang), max_stress=PhysicalQuantity(0.1, GPa), max_steps=1000, max_step_length=PhysicalQuantity(0.2, Ang), external_pressure=None, rng=None, log_filename_prefix='initial_population_', max_iterations=100)

Generates an initial population to be used with CrystalStructurePrediction. Each structure is generated by placing the atoms in a random unit cell and performing a local geometry optimization (OptimizeGeometry) at the specified pressure. The initial volume of the unit cell (the volume before optimization) is either given explicitly or roughly estimated from the covalent radii of the atoms.

Parameters:
  • elements (list) – A list of elements. Each entry in this list corresponds to one atom.

  • population_size (int) – The number of configurations to generate.

  • calculator (Calculator) – The calculator used to perform the geometry optimization calculations.

  • volume (PhysicalQuantity of type volume) – An initial guess for the volume of the unit cell. If None, an initial guess will be made based on the covalent radii of the atoms.

  • max_forces (PhysicalQuantity of type force) – The geometry optimization uses this parameter to determine when the optimization has converged. The max_forces parameter represents the maximum force on an atom.
    Default: 0.01*eV/Ang

  • max_stress (PhysicalQuantity of type pressure) – The geometry optimization uses this parameter to determine when the optimization has converged. The max_stress represents the maximum deviation from the target stress.
    Default: 0.1*GPa

  • max_steps (int) – The maximum number of optimization steps.
    Default: 200

  • external_pressure (PhysicalQuantity of type pressure) – The target external pressure of the system.
    Default: 0*GPa

  • rng (numpy.random.RandomState) – The random number generator used to generate the random number stream.
    Default: A new random number generator (seeded from OS entropy pool)

  • log_filename_prefix (str | None) – The filename prefix to use when running in parallel. If None is specified then all logging will be done to stdout.
    Default: initial_population_

  • max_iterations (int) – The maximum number of iterations used to generate a random configuration that meets the hard constraints.
    Default: 100

Returns:

A Population object which contains a list of BulkConfiguration objects.

Return type:

Population