We present and study novel optimal control problems motivated by the search for photovoltaic materials with high power-conversion efficiency. The material must perform the first step: convert light (photons) into electronic excitations. We formulate various desirable properties of the excitations as mathematical control goals at the Kohn-Sham-DFT level of theory, with the control being given by the nuclear charge distribution. We prove that nuclear distributions exist which give rise to optimal HOMO-LUMO excitations, and present illustrative numerical simulations for 1D finite nanocrystals. We observe pronounced goal-dependent features such as large electron-hole separation, and a hierarchy of length scales: internal HOMO and LUMO wavelengths $<$ atomic spacings $<$ (irregular) fluctuations of the doping profiles $<$ system size.