-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Transpilation does not take place if an instruction with {None: None} properties is added to the target #8971
Labels
bug
Something isn't working
Comments
mtreinish
added a commit
to mtreinish/qiskit-core
that referenced
this issue
Oct 20, 2022
This commit fixes the handling of the `build_coupling_map()` method so that it correctly handles edge cases around a mix of ideal globally available gates and gates that have qubit/connectivity constraints. Previously, the method would incorrectly treat the presence of a globally defined ideal gate as meaning there were no connectivity constraints, even if that global gate was only on 1 qubit. While if the gate operates on two qubits this is correct behavior. Fixes Qiskit#8971
1ucian0
pushed a commit
that referenced
this issue
Oct 31, 2022
…8977) * Fix handling of global ideal gates for target build_coupling_map() This commit fixes the handling of the `build_coupling_map()` method so that it correctly handles edge cases around a mix of ideal globally available gates and gates that have qubit/connectivity constraints. Previously, the method would incorrectly treat the presence of a globally defined ideal gate as meaning there were no connectivity constraints, even if that global gate was only on 1 qubit. While if the gate operates on two qubits this is correct behavior. Fixes #8971 * Add test for single qarg non-ideal case
mergify bot
pushed a commit
that referenced
this issue
Oct 31, 2022
…8977) * Fix handling of global ideal gates for target build_coupling_map() This commit fixes the handling of the `build_coupling_map()` method so that it correctly handles edge cases around a mix of ideal globally available gates and gates that have qubit/connectivity constraints. Previously, the method would incorrectly treat the presence of a globally defined ideal gate as meaning there were no connectivity constraints, even if that global gate was only on 1 qubit. While if the gate operates on two qubits this is correct behavior. Fixes #8971 * Add test for single qarg non-ideal case (cherry picked from commit f6a343b)
mergify bot
added a commit
that referenced
this issue
Oct 31, 2022
…8977) (#9040) * Fix handling of global ideal gates for target build_coupling_map() This commit fixes the handling of the `build_coupling_map()` method so that it correctly handles edge cases around a mix of ideal globally available gates and gates that have qubit/connectivity constraints. Previously, the method would incorrectly treat the presence of a globally defined ideal gate as meaning there were no connectivity constraints, even if that global gate was only on 1 qubit. While if the gate operates on two qubits this is correct behavior. Fixes #8971 * Add test for single qarg non-ideal case (cherry picked from commit f6a343b) Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Environment
What is happening?
Tranpilation return a not-properly-routed circuit.
How can we reproduce the issue?
The documentation of
qiskit.transpiler.Target.add_instruction
saysIf there are no constraints on the instruction (as in a noisless/ideal simulation) this can be set to {None, None} which will indicate it runs on all qubits (or all available permutations of qubits for multi-qubit gates).
.So, let's create a target and add a single-qubit instruction to it by specifying
{None: None}
as its propertiesThis code prints the following circuit
which is clearly not routed against the target.
The root cause seems to be, that in this scenario the transpiler target fails to generate the coupling map. Note how the
assert
line in the above code snippet passes, meaning that the coupling map is None.What should happen?
Transpiler target should have a properly defined coupling map and transpilation should work correctly
Any suggestions?
No response
The text was updated successfully, but these errors were encountered: