  Reducing errors in quantum gates is critical to the development of quantum
computers. To do so, any distortions in the control signals should be
identified, however, conventional tools are not always applicable when part of
the system is under high vacuum, cryogenic, or microscopic. Here, we
demonstrate a method to detect and compensate for amplitude-dependent phase
changes, using the qubit itself as a probe. The technique is implemented using
a microwave-driven trapped ion qubit, where correcting phase distortions leads
to a three-fold improvement in single-qubit gate error, to attain
state-of-the-art performance benchmarked at $1.6(4)\times 10^{-6}$ error per
Clifford gate.
