Open chriseclectic opened 7 months ago
I found coupling_map is not set if the target of AerBackend
is passed to passmanager_config here
We can avoid this by using _skip_target
option as following
pm = generate_preset_pass_manager(2, backend=AerSimulator(), coupling_map=CouplingMap([[0, 2], [1, 2]]), _skip_target=True)
But I think the issue in AerBackend is AerBackend.target.build_coupling_map()
should return coupling_map when setting coupling_map to AerSimulator as following
backend=AerSimulator(coupling_map=CouplingMap([[0, 2], [1, 2]]))
pm = generate_preset_pass_manager(2, backend=backend)
Informations
What is the current behavior?
Trying to use qiskit pass managers with a user provided coupling map leads to transpiler errors when using Aer 0.13.
Steps to reproduce the problem
Raises an exception:
What is the expected behavior?
The above code runs without error and returns the correct transpiled circuit when using AerSimulator from qiskit-aer 0.12
Suggested solutions
I'm not sure what is going on with Aer, but it seems like it is overriding the user provided coupling map somewhere in the passing of kwargs from the transpiler, and this is only happening in Qiskit Aer 0.13.
This might be related to the
target
attribute being added to AerSimulator in 0.13? @mtreinish