qiskit/extensions/standard/cswap.py
def _define(self):
        """
        gate cswap a,b,c
        { cx c,b;
          ccx a,b,c;
          cx c,b;
        }
        """
        definition = []
        q = QuantumRegister(3, "q")
        rule = [
            (CnotGate(), [q[2], q[1]], []),
            (ToffoliGate(), [q[0], q[1], q[2]], []),
            (CnotGate(), [q[2], q[1]], [])
        ]
        for inst in rule:
            definition.append(inst)
        self.definition = definition
def _define(self):
        """
        gate cswap a,b,c
        { cx c,b;
          ccx a,b,c;
          cx c,b;
        }
        """
        definition = []
        q = QuantumRegister(3, "q")
        rule = [
            (CnotGate(), [q[2], q[1]], []),
            (ToffoliGate(), [q[0], q[1], q[2]], []),
            (CnotGate(), [q[2], q[1]], [])
        ]
        for inst in rule:
            definition.append(inst)
        self.definition = definition
def _define ( self ) : definition = [ ] q = QuantumRegister ( 3 , "q" ) rule = [ ( CnotGate ( ) , [ q [ 2 ] , q [ 1 ] ] , [ ] ) , ( ToffoliGate ( ) , [ q [ 0 ] , q [ 1 ] , q [ 2 ] ] , [ ] ) , ( CnotGate ( ) , [ q [ 2 ] , q [ 1 ] ] , [ ] ) ] for inst in rule : definition . append ( inst ) self . definition = definition
gate cswap a,b,c
        { cx c,b;
          ccx a,b,c;
          cx c,b;
        }
gate cswap a b c { cx c b ; ccx a b c ; cx c b ; }