qiskit/extensions/standard/cu3.py
def _define(self):
        """
        gate cu3(theta,phi,lambda) c, t
        { u1((lambda-phi)/2) t; cx c,t;
          u3(-theta/2,0,-(phi+lambda)/2) t; cx c,t;
          u3(theta/2,phi,0) t;
        }
        """
        definition = []
        q = QuantumRegister(2, "q")
        rule = [
            (U1Gate((self.params[2] - self.params[1]) / 2), [q[1]], []),
            (CnotGate(), [q[0], q[1]], []),
            (U3Gate(-self.params[0] / 2, 0, -(self.params[1] + self.params[2]) / 2), [q[1]], []),
            (CnotGate(), [q[0], q[1]], []),
            (U3Gate(self.params[0] / 2, self.params[1], 0), [q[1]], [])
        ]
        for inst in rule:
            definition.append(inst)
        self.definition = definition
def _define(self):
        """
        gate cu3(theta,phi,lambda) c, t
        { u1((lambda-phi)/2) t; cx c,t;
          u3(-theta/2,0,-(phi+lambda)/2) t; cx c,t;
          u3(theta/2,phi,0) t;
        }
        """
        definition = []
        q = QuantumRegister(2, "q")
        rule = [
            (U1Gate((self.params[2] - self.params[1]) / 2), [q[1]], []),
            (CnotGate(), [q[0], q[1]], []),
            (U3Gate(-self.params[0] / 2, 0, -(self.params[1] + self.params[2]) / 2), [q[1]], []),
            (CnotGate(), [q[0], q[1]], []),
            (U3Gate(self.params[0] / 2, self.params[1], 0), [q[1]], [])
        ]
        for inst in rule:
            definition.append(inst)
        self.definition = definition
def _define ( self ) : definition = [ ] q = QuantumRegister ( 2 , "q" ) rule = [ ( U1Gate ( ( self . params [ 2 ] - self . params [ 1 ] ) / 2 ) , [ q [ 1 ] ] , [ ] ) , ( CnotGate ( ) , [ q [ 0 ] , q [ 1 ] ] , [ ] ) , ( U3Gate ( - self . params [ 0 ] / 2 , 0 , - ( self . params [ 1 ] + self . params [ 2 ] ) / 2 ) , [ q [ 1 ] ] , [ ] ) , ( CnotGate ( ) , [ q [ 0 ] , q [ 1 ] ] , [ ] ) , ( U3Gate ( self . params [ 0 ] / 2 , self . params [ 1 ] , 0 ) , [ q [ 1 ] ] , [ ] ) ] for inst in rule : definition . append ( inst ) self . definition = definition
gate cu3(theta,phi,lambda) c, t
        { u1((lambda-phi)/2) t; cx c,t;
          u3(-theta/2,0,-(phi+lambda)/2) t; cx c,t;
          u3(theta/2,phi,0) t;
        }
gate cu3 ( theta phi lambda ) c t { u1 (( lambda - phi ) / 2 ) t ; cx c t ; u3 ( - theta / 2 0 - ( phi + lambda ) / 2 ) t ; cx c t ; u3 ( theta / 2 phi 0 ) t ; }