qiskit/unroll/_printerbackend.py
def define_gate(self, name, gatedata):
        """Define a new quantum gate.

        name is a string.
        gatedata is the AST node for the gate.
        """
        atomics = ["U", "CX", "measure", "reset", "barrier"]
        self.gates[name] = gatedata
        # Print out the gate definition if it is in self.basis
        if name in self.basis and name not in atomics:
            # Print the hierarchy of gates this gate calls
            if not self.gates[name]["opaque"]:
                calls = self.gates[name]["body"].calls()
                for call in calls:
                    if call not in self.printed_gates:
                        print(self._gate_string(call))
                        self.printed_gates.append(call)
            # Print the gate itself
            if name not in self.printed_gates:
                print(self._gate_string(name))
                self.printed_gates.append(name)
Define a new quantum gate.

        name is a string.
        gatedata is the AST node for the gate.
        
Define a new quantum gate.
name is a string.
gatedata is the AST node for the gate.
Define a new quantum gate . name is a string . gatedata is the AST node for the gate .
def define_gate(self, name, gatedata):
        atomics = ["U", "CX", "measure", "reset", "barrier"]
        self.gates[name] = gatedata
        if name in self.basis and name not in atomics:
            if not self.gates[name]["opaque"]:
                calls = self.gates[name]["body"].calls()
                for call in calls:
                    if call not in self.printed_gates:
                        print(self._gate_string(call))
                        self.printed_gates.append(call)
            if name not in self.printed_gates:
                print(self._gate_string(name))
                self.printed_gates.append(name)
def define_gate ( self , name , gatedata ) : atomics = [ "U" , "CX" , "measure" , "reset" , "barrier" ] self . gates [ name ] = gatedata if name in self . basis and name not in atomics : if not self . gates [ name ] [ "opaque" ] : calls = self . gates [ name ] [ "body" ] . calls ( ) for call in calls : if call not in self . printed_gates : print ( self . _gate_string ( call ) ) self . printed_gates . append ( call ) if name not in self . printed_gates : print ( self . _gate_string ( name ) ) self . printed_gates . append ( name )
Define a new quantum gate.
Define a new quantum gate .
"""Define a new quantum gate.

        name is a string.
        gatedata is the AST node for the gate.
        """ # Print out the gate definition if it is in self.basis # Print the hierarchy of gates this gate calls # Print the gate itself
self
name
gatedata