Optimal simulation of Deutsch gates and the Fredkin gate | Synapse