Generalization of the geometric phase to completely positive maps