Band structures and optical properties of two transition-metal carbides—TiC and ZrC