def assemble(self):
instruction = QasmQobjInstruction(name=self.name)<EOL>if self.params:<EOL><INDENT>params = [<EOL>x.evalf() if hasattr(x, '<STR_LIT>') else x for x in self.params<EOL>]<EOL>params = [<EOL>sympy.matrix2numpy(x, dtype=complex) if isinstance(<EOL>x, sympy.Matrix) else x for x in params<EOL>]<EOL>instruction.params = params<EOL><DEDENT>if self.num_qubits:<EOL><INDENT>instruction.qubits = list(range(self.num_qubits))<EOL><DEDENT>if self.num_clbits:<EOL><INDENT>instruction.memory = list(range(self.num_clbits))<EOL><DEDENT>if self.control:<EOL><INDENT>instruction._control = self.control<EOL><DEDENT>return instruction<EOL>
Assemble a QasmQobjInstruction