Decomposition of inorganic and organometallic compounds