From 3fe45f36218e4ec7c5d9b2ec578ca4aeb9821aff Mon Sep 17 00:00:00 2001 From: Luciano Bello Date: Wed, 9 Sep 2020 20:09:37 -0400 Subject: [PATCH 1/3] exclude backend from _check_conflicting_argument --- qiskit/execute.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/qiskit/execute.py b/qiskit/execute.py index 897707cdb585..2afd16e6286d 100644 --- 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 From 4b0369b3b196750c41c00c37cf0b2a9aa314a3f5 Mon Sep 17 00:00:00 2001 From: Luciano Bello Date: Wed, 9 Sep 2020 20:10:20 -0400 Subject: [PATCH 2/3] test --- test/python/compiler/test_compiler.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/python/compiler/test_compiler.py b/test/python/compiler/test_compiler.py index 2722479a43df..fe86008ccc6b 100644 --- a/test/python/compiler/test_compiler.py +++ b/test/python/compiler/test_compiler.py @@ -169,6 +169,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 """ From 7a0dd0ba08ad1f72b68011a4997e1da413983fa9 Mon Sep 17 00:00:00 2001 From: Luciano Bello Date: Wed, 9 Sep 2020 21:12:17 -0400 Subject: [PATCH 3/3] reno --- releasenotes/notes/5037-e73ce50c4ae23445.yaml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 releasenotes/notes/5037-e73ce50c4ae23445.yaml diff --git a/releasenotes/notes/5037-e73ce50c4ae23445.yaml b/releasenotes/notes/5037-e73ce50c4ae23445.yaml new file mode 100644 index 000000000000..fa42d2040974 --- /dev/null +++ b/releasenotes/notes/5037-e73ce50c4ae23445.yaml @@ -0,0 +1,5 @@ +--- +fixes: + - | + The parameters `backend` and `passmanager` in :func:`qiskit.execute.execute` + are not conflicting and they are simultaneously allowed now.