Cosmologists use photonics to search Andromeda for signs of alien life