qiskit/qasm/qasmparser.py
def verify_declared_bit(self, obj):
        """Verify a qubit id against the gate prototype."""
        # We are verifying gate args against the formal parameters of a
        # gate prototype.
        if obj.name not in self.current_symtab:
            raise QasmError("Cannot find symbol '" + obj.name
                            + "' in argument list for gate, line",
                            str(obj.line), 'file', obj.file)

        # This insures the thing is from the bitlist and not from the
        # argument list.
        sym = self.current_symtab[obj.name]
        if not (sym.type == 'id' and sym.is_bit):
            raise QasmError("Bit", obj.name,
                            'is not declared as a bit in the gate.')
def verify_declared_bit(self, obj):
        # We are verifying gate args against the formal parameters of a
        # gate prototype.
        if obj.name not in self.current_symtab:
            raise QasmError("Cannot find symbol '" + obj.name
                            + "' in argument list for gate, line",
                            str(obj.line), 'file', obj.file)

        # This insures the thing is from the bitlist and not from the
        # argument list.
        sym = self.current_symtab[obj.name]
        if not (sym.type == 'id' and sym.is_bit):
            raise QasmError("Bit", obj.name,
                            'is not declared as a bit in the gate.')
def verify_declared_bit ( self , obj ) : # We are verifying gate args against the formal parameters of a # gate prototype. if obj . name not in self . current_symtab : raise QasmError ( "Cannot find symbol '" + obj . name + "' in argument list for gate, line" , str ( obj . line ) , 'file' , obj . file ) # This insures the thing is from the bitlist and not from the # argument list. sym = self . current_symtab [ obj . name ] if not ( sym . type == 'id' and sym . is_bit ) : raise QasmError ( "Bit" , obj . name , 'is not declared as a bit in the gate.' )
Verify a qubit id against the gate prototype.
Verify a qubit id against the gate prototype .