Abstract-An efficient quantum mechanical approach is formulated to model electron-photon interactions in nanoscale devices. Based on nonequilibrium Green's function formalism, electron-photon interactions and open boundaries in the nanoscale systems are taken into account in terms of selfenergies. By separating different components in the electron-photon interactions, optical absorption and emission processes in the devices can be analyzed, and the method allows studies of different optoelectronic devices. In conjunction with density-functional tight-binding method, photo-induced current and other optical properties of nanoscale devices can be simulated without relying on empirical parameters. To demonstrate our approach, numerical studies of gallium nitride nanowire solar cells of realistic sizes are presented.