Electrical and optical characterization of molecular junctions