# Set up the left minimal electrode with 2 Li atoms.
left_electrode_lattice = Hexagonal(3.111*Angstrom, 5.093*Angstrom)
left_electrode_elements = [Lithium, Lithium]
left_electrode_coordinates = [[ 0.333333333333,  0.666666666667,  0.25          ],
                              [ 0.666666666667,  0.333333333333,  0.75          ]]

left_electrode = BulkConfiguration(
    bravais_lattice=left_electrode_lattice,
    elements=left_electrode_elements,
    fractional_coordinates=left_electrode_coordinates,
    )

# Use the same electrode as the right electrode.
right_electrode = left_electrode

# Define transverse electrode repetitions; 2 repetitions
# in A and 3 in B for both electrodes.
transverse_electrode_repetitions = [[2, 3], [2, 3]]

# Create the repeated electrode and repeat it 4 times along
# C to create the central region. In this manner, the atoms in the electrode
# extensions will match the repeated electrodes.
repeated_left_electrode = left_electrode.repeat(
    transverse_electrode_repetitions[0][0],
    transverse_electrode_repetitions[0][1],
    1)
central_region = repeated_left_electrode.repeat(1, 1, 4)

# Change one of the atoms at the center of the central region to make a non-homogeneous device.
central_region_lattice = central_region.bravaisLattice()
central_region_elements = central_region.elements()
central_region_coordinates = central_region.fractionalCoordinates()

central_region_elements[24] = Hydrogen

central_region = BulkConfiguration(
    bravais_lattice=central_region_lattice,
    elements=central_region_elements,
    fractional_coordinates=central_region_coordinates,
    )

# Set up the device configuration with transverse repetitions.
device_configuration = DeviceConfiguration(
    central_region=central_region,
    electrodes=[left_electrode, right_electrode],
    transverse_electrode_repetitions=transverse_electrode_repetitions,
    )
