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