The Queen and Prince Philip will pay a visit to Cambridge a week on Wednesday to open new science labs and celebrate the 500th birthday of St. John’s.