(self, **options)
return g1*g2*g1
Decompose the SWAP gate into CNOT gates.
Decompose the SWAP gate into CNOT gates.
Decompose the SWAP gate into CNOT gates .
def decompose(self, **options):
        """Decompose the SWAP gate into CNOT gates."""
        i, j = self.targets[0], self.targets[1]
        g1 = CNotGate(i, j)
        g2 = CNotGate(j, i)
        return g1*g2*g1
def decompose ( self , * * options ) : i , j = self . targets [ 0 ] , self . targets [ 1 ] g1 = CNotGate ( i , j ) g2 = CNotGate ( j , i ) return g1 * g2 * g1