  It is vital to minimise the impact of errors for near-future quantum devices
that will lack the resources for full fault tolerance. Two quantum error
mitigation (QEM) techniques have been introduced recently, namely error
extrapolation [Li2017,Temme2017] and quasi-probability decomposition
[Temme2017]. To enable practical implementation of these ideas, here we account
for the inevitable imperfections in the experimentalist's knowledge of the
error model itself. We describe a protocol for systematically measuring the
effect of errors so as to design efficient QEM circuits. We find that the
effect of localised Markovian errors can be fully eliminated by inserting or
replacing some gates with certain single-qubit Clifford gates and measurements.
Finally, having introduced an exponential variant of the extrapolation method
we contrast the QEM techniques using exact numerical simulation of up to 19
qubits in the context of a `SWAP test' circuit. Our optimised methods
dramatically reduce the circuit's output error without increasing the qubit
count or time requirements.
