  By first principles calculations, we demonstrate that when decorated with
photochromic molecules, it is possible to use light to reversibly control the
magnetic properties of a nanoscale magnetic system. The combination of a
graphene-based magnetic system and a photochromic azobenzene molecule is chosen
as a model system. The {\it trans} and {\it cis} isomers of the azobenzene
molecule that can be converted between each other by means of photoexcitations
are found to have drastically different effects on the magnetic properties of
the system. The results may pave the way for the future design of light
controllable molecular-scale spintronic devices.
