# -------------------------------------------------------------
# Bulk configuration
# -------------------------------------------------------------

# Set up lattice
vector_a = [3.61496, 0.0, 0.0]*Angstrom
vector_b = [0.0, 3.61496, 0.0]*Angstrom
vector_c = [0.0, 0.0, 3.61496]*Angstrom
lattice = UnitCell(vector_a, vector_b, vector_c)

# Define elements
elements = [Copper, Copper, Copper, Copper]

# Define coordinates
fractional_coordinates = [[ 0.0,  0.0,  0.0],
                          [ 0.5,  0.5,  0.0],
                          [ 0.5,  0.0,  0.5],
                          [ 0.0,  0.5,  0.5]]

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

# -------------------------------------------------------------
# Local structure
# -------------------------------------------------------------
local_structure = LocalStructure(bulk_configuration,
                                 cutoff_radius_structure=8.0*Angstrom,
                                 cutoff_radius_coordination=3.5*Angstrom,
                                 centrosymmetry_neighbors=12)

nlsave('ls_copper.nc', local_structure)
nlprint(local_structure)

# Extract the local structure index of the first atom
ls_atom1 = local_structure.evaluate(atom_index=0)

# Extract the centrosymmetry parameter of the first atom
cs_atom1 = local_structure.centrosymmetryParameters(atom_index=0)

# Extract the coordination number of the first atom
cn_atom1 = local_structure.coordinationNumbers(atom_index=0)
