First principles molecular dynamics and control of photochemical reactions