# -*- coding: utf-8 -*-
# -------------------------------------------------------------
# Bulk Configuration
# -------------------------------------------------------------

# Set up lattice
lattice = FaceCenteredCubic(5.078081036912226*Angstrom)

# Define elements
elements = [Hafnium, Oxygen, Oxygen]

# Define coordinates
fractional_coordinates = [[ 0.  ,  0.  ,  0.  ],
                          [ 0.25,  0.25,  0.25],
                          [ 0.75,  0.75,  0.75]]

# Set up configuration
bulk_configuration = BulkConfiguration(
    bravais_lattice=lattice,
    elements=elements,
    fractional_coordinates=fractional_coordinates
    )

# create randomly displaced geometries of the loaded BulkConfiguration and store them in a trainingSet object

parameters = crystalTrainingRandomDisplacements(
    bulk_configuration,
    supercell_repetitions_list=[(2, 2, 2), (3, 3, 3)],
    sample_size_per_stage=7,
    max_atomic_rattling_amplitude=0.4*Angstrom,
    max_cell_rattling_amplitude=0.05,
    log_filename_prefix='random_displacements_crystal_',
)

nlsave('initial_training_sets.hdf5',parameters)
