Optimizing atom interferometry on atom chips