Density functional calculations of the structural, electronic and optical properties of semiconductor nanostructures