Repository: Qiskit/qiskit

Issue:
Cannot use `execute` with a `PassManager`
<!-- ⚠️ 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**: 0.15.1
- **Python version**: 3.8.5
- **Operating system**: Ubuntu 18.04

### What is the current behavior?

Providing any `PassManager` to the `execute` method will throw an exception as it fails the `_check_conflicting_arguments` call - this method fails if a backend (a _required_ argument) is provided.

### Steps to reproduce the problem

```
from qiskit.transpiler import PassManager
from qiskit import QuantumCircuit, execute
from qiskit.providers.aer import Aer
qc = QuantumCircuit(2)
qc.h(0)
qc.measure_all()
b = Aer.get_backend('qasm_simulator')
job = execute(qc, b, pass_manager = PassManager())
```

```
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/will/miniconda3/envs/dev/lib/python3.8/site-packages/qiskit/execute.py", line 243, in execute
    _check_conflicting_argument(optimization_level=optimization_level,
  File "/home/will/miniconda3/envs/dev/lib/python3.8/site-packages/qiskit/execute.py", line 302, in _check_conflicting_argument
    raise QiskitError("The parameters pass_manager conflicts with the following "
qiskit.exceptions.QiskitError: 'The parameters pass_manager conflicts with the following parameter(s): backend.'
```

### What is the expected behavior?

This should not throw an exception since there are no conflicts here.

### Suggested solutions

Remove `backend` from the list of arguments checked for conflicts. Or, alternatively, deprecate the use of the `pass_manager` argument (it is currently unusable anyway) to encourage users to use `PassManager.run()` and `assemble` instead.


Discussion:
Can I help with this?
I think it is, indeed, a bug. I will remove `backend` as conflicting. 

> it is currently unusable anyway.

I'm curious. Why?

Resolving patch:
diff --git a/qiskit/execute.py b/qiskit/execute.py
--- a/qiskit/execute.py
+++ b/qiskit/execute.py
@@ -243,8 +243,7 @@ def execute(experiments, backend,
                                     coupling_map=coupling_map,
                                     seed_transpiler=seed_transpiler,
                                     backend_properties=backend_properties,
-                                    initial_layout=initial_layout,
-                                    backend=backend)
+                                    initial_layout=initial_layout)
         experiments = pass_manager.run(experiments)
     else:
         # transpiling the circuits using given transpile options


Test patch:
diff --git a/test/python/compiler/test_compiler.py b/test/python/compiler/test_compiler.py
--- a/test/python/compiler/test_compiler.py
+++ b/test/python/compiler/test_compiler.py
@@ -170,6 +170,18 @@ def test_parallel_compile(self):
         qobj = assemble(transpile(qlist, backend=backend))
         self.assertEqual(len(qobj.experiments), 10)
 
+    def test_no_conflict_backend_passmanager(self):
+        """execute(qc, backend=..., passmanager=...)
+        See: https://github.com/Qiskit/qiskit-terra/issues/5037
+        """
+        backend = BasicAer.get_backend('qasm_simulator')
+        qc = QuantumCircuit(2)
+        qc.u1(0, 0)
+        qc.measure_all()
+        job = execute(qc, backend=backend, pass_manager=PassManager())
+        result = job.result().get_counts()
+        self.assertEqual(result, {'00': 1024})
+
     def test_compile_single_qubit(self):
         """ Compile a single-qubit circuit in a non-trivial layout
         """