Bounds for the adiabatic approximation with applications to quantum computation