Z2 calculations with first principles code