Repository: Qiskit/qiskit

Issue:
circuits_to_qobj does not work
<!-- ⚠️ If you do not respect this template, your issue will be closed -->
<!-- ⚠️ Make sure to browse the opened and closed issues -->

### Information

- **Qiskit Terra version**:
- **Python version**:
- **Operating system**:

### What is the current behavior?
```
q = QuantumRegister(2,'q')
c = ClassicalRegister(2,'c')
qc = QuantumCircuit(q,c)
qc.h(q[0])
qc.cx(q[0], q[1])
qc.measure(q[0],c[0])
qc.measure(q[1],c[1])
qobj = circuits_to_qobj(qc)
```
```
ModelValidationError: {'header': ["Value 'RunConfig()' is not the expected type <class 'qiskit.qobj.models.QobjHeader'>"]}
```


### Steps to reproduce the problem



### What is the expected behavior?



### Suggested solutions





Discussion:
I was just playing around with this locally and it looks like this can be fixed if we just remove the initialization of an empty RunConfig() when the run_config kwarg is None, in other words remove https://github.com/Qiskit/qiskit-terra/blob/master/qiskit/converters/circuits_to_qobj.py#L46. The `assemble_circuits()` function knows how to handle not having a RunConfig() passed in.

Running the above example code with this change and printing the qobj yields:

`{'config': {'memory_slots': 2, 'n_qubits': 2}, 'qobj_id': '97977d9b-c27f-46ac-a94e-9e6a53bd10ac', 'schema_version': '1.1.0', 'header': {}, 'type': 'QASM', 'experiments': [{'config': {'memory_slots': 2, 'n_qubits': 2}, 'header': {'name': 'circuit0', 'creg_sizes': [['c', 2]], 'qreg_sizes': [['q', 2]], 'qubit_labels': [['q', 0], ['q', 1]], 'memory_slots': 2, 'n_qubits': 2, 'clbit_labels': [['c', 0], ['c', 1]]}, 'instructions': [{'name': 'h', 'qubits': [0]}, {'name': 'cx', 'qubits': [0, 1]}, {'name': 'measure', 'memory': [0], 'qubits': [0]}, {'name': 'measure', 'memory': [1], 'qubits': [1]}]}]}`

which looks correct to me.

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
@@ -9,7 +9,6 @@
 import warnings
 
 from qiskit.qobj import QobjHeader
-from qiskit.compiler.run_config import RunConfig
 from qiskit.compiler import assemble_circuits
 
 
@@ -43,7 +42,6 @@ def circuits_to_qobj(circuits, qobj_header=None, run_config=None,
                   DeprecationWarning)
 
     qobj_header = qobj_header or QobjHeader()
-    run_config = run_config or RunConfig()
 
     if backend_name:
         warnings.warn('backend_name is not required anymore', DeprecationWarning)


Test patch:
diff --git a/test/python/converters/test_circuits_to_qobj.py b/test/python/converters/test_circuits_to_qobj.py
new file mode 100644
--- /dev/null
+++ b/test/python/converters/test_circuits_to_qobj.py
@@ -0,0 +1,34 @@
+# -*- coding: utf-8 -*-
+
+# Copyright 2019, IBM.
+#
+# This source code is licensed under the Apache License, Version 2.0 found in
+# the LICENSE.txt file in the root directory of this source tree.
+
+"""Test Circuits to Qobj."""
+
+from qiskit.test import QiskitTestCase
+
+from qiskit.converters import circuits_to_qobj
+from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit
+
+
+class TestCircuitsToQobj(QiskitTestCase):
+    """Test Circuits to Qobj."""
+
+    def test_no_run_config(self):
+        """Test circuits_to_qobj_without_run_config_set."""
+        qr = QuantumRegister(2, 'q')
+        cr = ClassicalRegister(2, 'c')
+        qc = QuantumCircuit(qr, cr)
+        qc.h(qr[0])
+        qc.cx(qr[0], qr[1])
+        qc.measure(qr[0], cr[0])
+        qc.measure(qr[1], cr[1])
+        qobj = circuits_to_qobj(qc)
+        expected = [{'name': 'h', 'qubits': [0]},
+                    {'name': 'cx', 'qubits': [0, 1]},
+                    {'name': 'measure', 'memory': [0], 'qubits': [0]},
+                    {'name': 'measure', 'memory': [1], 'qubits': [1]}]
+        self.assertEqual(qobj.to_dict()['experiments'][0]['instructions'],
+                         expected)