Theory of quantum error mitigation for non-Clifford gates | Synapse