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

# Set up configuration
bulk_configuration = BulkConfiguration(
    bravais_lattice=Hexagonal(2.4612*Angstrom, 6.709*Angstrom),
    elements=[Carbon, Carbon],
    fractional_coordinates=[[ 0.333333333333,  0.166666666667,  0.5 ],
                            [ 0.666666666667,  0.833333333333,  0.5 ]],
    )

# -------------------------------------------------------------
# Calculator
# -------------------------------------------------------------
calculator = LCAOCalculator()

bulk_configuration.setCalculator(calculator)
nlprint(bulk_configuration)
bulk_configuration.update()

# Fractional k-point, slighly displaced away from the Dirac point.
k = [1./3+0.001, 1./3+0.001, 0  ]

# Calculate the velocity of the band with band-index 3 (valence band) 
velocity = calculateVelocity(bulk_configuration, kpoint=k, spin=Spin.Up, band_indices=[3])
# Take the velocity component along the X cartesian direction.
velocity = velocity[0][0][0]

# Print the result.
print('Fermi velocity of graphene:')
print('v = %.2e m/s' %abs(velocity.inUnitsOf(Meter/Second)))