Ab initio study of the layered semiconductor cluster Bi6I18