qiskit/unroll/_printerbackend.py
def start_gate(self, name, args, qubits, nested_scope=None, extra_fields=None):
        """Begin a custom gate.

        name is name string.
        args is list of Node expression objects.
        qubits is list of (regname, idx) tuples.
        nested_scope is a list of dictionaries mapping expression variables
        to Node expression objects in order of increasing nesting depth.
        """
        if self.listen and self.comments:
            print("// start %s, %s, %s" % (name,
                                           list(map(lambda x:
                                                    str(x.sym(nested_scope)),
                                                    args)),
                                           qubits))
        if self.listen and name not in self.basis \
           and self.gates[name]["opaque"]:
            raise BackendError("opaque gate %s not in basis" % name)
        if self.listen and name in self.basis:
            self.in_gate = name
            self.listen = False
            squbits = ["%s[%d]" % (x[0], x[1]) for x in qubits]
            if self.creg is not None:
                print("if(%s==%d) " % (self.creg, self.cval), end="")
            print(name, end="")
            if args:
                print("(%s)" % ",".join(map(lambda x:
                                            str(x.sym(nested_scope)),
                                            args)), end="")
            print(" %s;" % ",".join(squbits))
Begin a custom gate.

        name is name string.
        args is list of Node expression objects.
        qubits is list of (regname, idx) tuples.
        nested_scope is a list of dictionaries mapping expression variables
        to Node expression objects in order of increasing nesting depth.
        
Begin a custom gate.
name is name string.
args is list of Node expression objects.
qubits is list of (regname, idx) tuples.
nested_scope is a list of dictionaries mapping expression variables
to Node expression objects in order of increasing nesting depth.
Begin a custom gate . name is name string . args is list of Node expression objects . qubits is list of ( regname idx ) tuples . nested_scope is a list of dictionaries mapping expression variables to Node expression objects in order of increasing nesting depth .
def start_gate(self, name, args, qubits, nested_scope=None, extra_fields=None):
        if self.listen and self.comments:
            print("// start %s, %s, %s" % (name,
                                           list(map(lambda x:
                                                    str(x.sym(nested_scope)),
                                                    args)),
                                           qubits))
        if self.listen and name not in self.basis \
           and self.gates[name]["opaque"]:
            raise BackendError("opaque gate %s not in basis" % name)
        if self.listen and name in self.basis:
            self.in_gate = name
            self.listen = False
            squbits = ["%s[%d]" % (x[0], x[1]) for x in qubits]
            if self.creg is not None:
                print("if(%s==%d) " % (self.creg, self.cval), end="")
            print(name, end="")
            if args:
                print("(%s)" % ",".join(map(lambda x:
                                            str(x.sym(nested_scope)),
                                            args)), end="")
            print(" %s;" % ",".join(squbits))
def start_gate ( self , name , args , qubits , nested_scope = None , extra_fields = None ) : if self . listen and self . comments : print ( "// start %s, %s, %s" % ( name , list ( map ( lambda x : str ( x . sym ( nested_scope ) ) , args ) ) , qubits ) ) if self . listen and name not in self . basis and self . gates [ name ] [ "opaque" ] : raise BackendError ( "opaque gate %s not in basis" % name ) if self . listen and name in self . basis : self . in_gate = name self . listen = False squbits = [ "%s[%d]" % ( x [ 0 ] , x [ 1 ] ) for x in qubits ] if self . creg is not None : print ( "if(%s==%d) " % ( self . creg , self . cval ) , end = "" ) print ( name , end = "" ) if args : print ( "(%s)" % "," . join ( map ( lambda x : str ( x . sym ( nested_scope ) ) , args ) ) , end = "" ) print ( " %s;" % "," . join ( squbits ) )
Begin a custom gate.
Begin a custom gate .
"""Begin a custom gate.

        name is name string.
        args is list of Node expression objects.
        qubits is list of (regname, idx) tuples.
        nested_scope is a list of dictionaries mapping expression variables
        to Node expression objects in order of increasing nesting depth.
        """
self
name
args
qubits
nested_scope
extra_fields