The thermodynamic and optical properties of germanium, silicon, diamond and gallium arsenide