Is a nucleic acid a carbohydrate?

No, a nucleic acid is a nucleic acid. Nucleic acids are a class of macromolecules of their own.