Electronic and vibrational properties of diamondlike hydrocarbons