Physics of Photonic Devices