Repository: Qiskit/qiskit

Issue:
Removed compiled_circuit_qasm from QobjExperimentalHeader
<!-- ⚠️ If you do not respect this template, your issue will be closed -->
<!-- ⚠️ Make sure to browse the opened and closed issues to confirm this idea does not exist. -->

### What is the expected behavior?
After #1629 when all the backends are Qobj 1.0 compatible we need to remove compiled_circuit_qasm from the header. 




Discussion:
The ibmq_qasm_simulator, tenerife and melbourne work without this header. The only remaining one is Tokyo.
Also, both Aer and BasicAer do as well. 

Resolving patch:
diff --git a/qiskit/converters/circuits_to_qobj.py b/qiskit/converters/circuits_to_qobj.py
--- a/qiskit/converters/circuits_to_qobj.py
+++ b/qiskit/converters/circuits_to_qobj.py
@@ -94,15 +94,13 @@ def circuits_to_qobj(circuits, user_qobj_header=None, run_config=None,
 
         # TODO: why do we need creq_sizes and qreg_sizes in header
         # TODO: we need to rethink memory_slots as they are tied to classical bit
-        # TODO: when no more backends use the compiled_circuit_qasm lets delete it form header
         experimentheader = QobjExperimentHeader(qubit_labels=qubit_labels,
                                                 n_qubits=n_qubits,
                                                 qreg_sizes=qreg_sizes,
                                                 clbit_labels=clbit_labels,
                                                 memory_slots=memory_slots,
                                                 creg_sizes=creg_sizes,
-                                                name=circuit.name,
-                                                compiled_circuit_qasm=circuit.qasm())
+                                                name=circuit.name)
         # TODO: why do we need n_qubits and memory_slots in both the header and the config
         experimentconfig = QobjExperimentConfig(n_qubits=n_qubits, memory_slots=memory_slots)
 
diff --git a/qiskit/qobj/_converter.py b/qiskit/qobj/_converter.py
--- a/qiskit/qobj/_converter.py
+++ b/qiskit/qobj/_converter.py
@@ -94,8 +94,6 @@ def qobj_to_dict_previous_version(qobj):
                 'operations': [instruction.as_dict() for instruction in
                                experiment.instructions]
             },
-            'compiled_circuit_qasm': getattr(experiment.header,
-                                             'compiled_circuit_qasm', None)
         }
 
         converted['circuits'].append(circuit)


Test patch:
diff --git a/qiskit/test/mock.py b/qiskit/test/mock.py
--- a/qiskit/test/mock.py
+++ b/qiskit/test/mock.py
@@ -355,7 +355,7 @@ def new_fake_qobj():
             instructions=[
                 QobjInstruction(name='barrier', qubits=[1])
             ],
-            header=QobjExperimentHeader(compiled_circuit_qasm='fake-code'),
+            header=QobjExperimentHeader(),
             config=QobjItem(seed=123456)
         )]
     )
diff --git a/test/python/converters/test_qobj_to_circuits.py b/test/python/converters/test_qobj_to_circuits.py
--- a/test/python/converters/test_qobj_to_circuits.py
+++ b/test/python/converters/test_qobj_to_circuits.py
@@ -99,8 +99,6 @@ def test_qobj_to_circuits_single_no_qasm(self):
         """Check that qobj_to_circuits's result matches the qobj ini."""
         backend = BasicAer.get_backend('qasm_simulator')
         qobj_in = compile(self.circuit, backend, pass_manager=PassManager())
-        for i in qobj_in.experiments:
-            del i.header.compiled_circuit_qasm
         out_circuit = qobj_to_circuits(qobj_in)
         self.assertEqual(circuit_to_dag(out_circuit[0]), self.dag)
 
@@ -118,8 +116,6 @@ def test_qobj_to_circuits_multiple_no_qasm(self):
         circuit_b.measure(qreg2[0], creg2[1])
         qobj = compile([self.circuit, circuit_b], backend,
                        pass_manager=PassManager())
-        for i in qobj.experiments:
-            del i.header.compiled_circuit_qasm
 
         dag_list = [circuit_to_dag(x) for x in qobj_to_circuits(qobj)]
         self.assertEqual(dag_list, [self.dag, circuit_to_dag(circuit_b)])
diff --git a/test/python/qobj/test_qobj_identifiers.py b/test/python/qobj/test_qobj_identifiers.py
--- a/test/python/qobj/test_qobj_identifiers.py
+++ b/test/python/qobj/test_qobj_identifiers.py
@@ -33,31 +33,22 @@ def test_builtin_qasm_simulator_py(self):
         backend = BasicAer.get_backend('qasm_simulator')
         qobj = compile(self.circuits, backend=backend)
         exp = qobj.experiments[0]
-        c_qasm = exp.header.compiled_circuit_qasm
         self.assertIn(self.qr_name, map(lambda x: x[0], exp.header.qubit_labels))
-        self.assertIn(self.qr_name, c_qasm)
         self.assertIn(self.cr_name, map(lambda x: x[0], exp.header.clbit_labels))
-        self.assertIn(self.cr_name, c_qasm)
 
     def test_builtin_qasm_simulator(self):
         backend = BasicAer.get_backend('qasm_simulator')
         qobj = compile(self.circuits, backend=backend)
         exp = qobj.experiments[0]
-        c_qasm = exp.header.compiled_circuit_qasm
         self.assertIn(self.qr_name, map(lambda x: x[0], exp.header.qubit_labels))
-        self.assertIn(self.qr_name, c_qasm)
         self.assertIn(self.cr_name, map(lambda x: x[0], exp.header.clbit_labels))
-        self.assertIn(self.cr_name, c_qasm)
 
     def test_builtin_unitary_simulator_py(self):
         backend = BasicAer.get_backend('unitary_simulator')
         qobj = compile(self.circuits, backend=backend)
         exp = qobj.experiments[0]
-        c_qasm = exp.header.compiled_circuit_qasm
         self.assertIn(self.qr_name, map(lambda x: x[0], exp.header.qubit_labels))
-        self.assertIn(self.qr_name, c_qasm)
         self.assertIn(self.cr_name, map(lambda x: x[0], exp.header.clbit_labels))
-        self.assertIn(self.cr_name, c_qasm)
 
 
 if __name__ == '__main__':