Random#
Tools for generation of fully random occupancies.
- generate_random_ordered_occupancy(processor, composition=None, charge_neutral=False, tol=1e-06, encoded=True, rng=None, **kwargs)[source]#
Generate a random encoded occupancy according to a list of sublattices.
- Parameters:
processor (Processor) – A processor object that represents the supercell space.
composition (Sequence of Composition) – optional A sequence of pymatgen Compositions for each sublattice specifying the composition for the generated occupancy. Must be in the same order as the sublattices.
charge_neutral (bool) – optional If True, the generated occupancy will be charge neutral. Oxidation states must be present in sublattices, if a composition is given this option is ignored.
tol (float) – optional Tolerance for the composition check, only used if a composition is given.
encoded (bool) – optional If True then occupancy is given as integer array otherwise as a list of Species.
rng (optional) – {None, int, array_like[ints], SeedSequence, BitGenerator, Generator} A RNG, seed or otherwise to initialize defauly_rng
- Returns:
encoded occupancy
- Return type:
ndarray