Characterizing and Mitigating Errors in Quantum Computers