Open stylewarning opened 5 years ago
Yeah, you're late to the party: SWAP lies in the same local equivalence class as CNOT followed by ISWAP, and you can use that to solve for ISWAP, then expand SWAP into three CNOTs, then cancel one of those CNOTs with the one from the previous decomposition, and you'll end up with https://github.com/rigetti/quilc/blob/master/src/compilers/translators.lisp#L83 .
(optimal-2q.lisp
will also produce this decomposition without further prompting.)
@ecp-rigetti Does it (optimal 2q) understand the nature of the swaps?
No: given an ISWAP, it won't attempt to marry it to a SWAP in order to drive the depth down. This might be worth doing; IBM likes this idea enough to have given it a name ("mirror gates") in this paper: https://arxiv.org/pdf/1811.12926.pdf .
As @marcusps described to me in private correspondence, there is a
ISWAP
toCNOT+SWAP
translation described in this paper. We should add it (if @ecp-rigetti didn't already figure it out). See this paper: https://arxiv.org/pdf/quant-ph/0209035.pdf