def qasm(self):
string_temp = self.header + "<STR_LIT:\n>"<EOL>string_temp += self.extension_lib + "<STR_LIT:\n>"<EOL>for register in self.qregs:<EOL><INDENT>string_temp += register.qasm() + "<STR_LIT:\n>"<EOL><DEDENT>for register in self.cregs:<EOL><INDENT>string_temp += register.qasm() + "<STR_LIT:\n>"<EOL><DEDENT>for instruction, qargs, cargs in self.data:<EOL><INDENT>if instruction.name == '<STR_LIT>':<EOL><INDENT>qubit = qargs[<NUM_LIT:0>]<EOL>clbit = cargs[<NUM_LIT:0>]<EOL>string_temp += "<STR_LIT>" % (instruction.qasm(),<EOL>qubit[<NUM_LIT:0>].name, qubit[<NUM_LIT:1>],<EOL>clbit[<NUM_LIT:0>].name, clbit[<NUM_LIT:1>])<EOL><DEDENT>else:<EOL><INDENT>string_temp += "<STR_LIT>" % (instruction.qasm(),<EOL>"<STR_LIT:U+002C>".join(["<STR_LIT>" % (j[<NUM_LIT:0>].name, j[<NUM_LIT:1>])<EOL>for j in qargs + cargs]))<EOL><DEDENT><DEDENT>return string_temp<EOL>
Return OpenQASM string.