Mathematical optimization approach for estimating the quantum yield distribution of a photochromic reaction in a polymer