TAO-DFT investigation of electronic properties of linear and cyclic carbon chains