-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Fix subgraph handling of non-contiguous nodelist argument #6738
Conversation
This commit fixes the subgraph() method on the coupling map class when the node list had a non-contiguous list that didn't start at 0. Previously, the subgraph method would inject nodes for the holes in the node list so that all the indices specified in the nodelist argument were present in the output subgraph. But this was neglecting the nodes get reindexed and wasn't valid. This commit fixes this by just removing that step and relying on retworkx's subgraph() method to do the underlying work. Fixes Qiskit#6736
f59005a
to
e7a57c8
Compare
I just noticed there's a |
I'm not sure there is a functional difference between them. I didn't even know there was a |
I suspect reduce, or something equivalent, will come in handy in the future to run independent experiments on a single chip simultaneously. |
This commit fixes the subgraph() method on the coupling map class when the node list had a non-contiguous list that didn't start at 0. Previously, the subgraph method would inject nodes for the holes in the node list so that all the indices specified in the nodelist argument were present in the output subgraph. But this was neglecting the nodes get reindexed and wasn't valid. This commit fixes this by just removing that step and relying on retworkx's subgraph() method to do the underlying work. Fixes #6736 Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: Kevin Krsulich <kevin.krsulich@ibm.com> (cherry picked from commit 0c6890d)
) This commit fixes the subgraph() method on the coupling map class when the node list had a non-contiguous list that didn't start at 0. Previously, the subgraph method would inject nodes for the holes in the node list so that all the indices specified in the nodelist argument were present in the output subgraph. But this was neglecting the nodes get reindexed and wasn't valid. This commit fixes this by just removing that step and relying on retworkx's subgraph() method to do the underlying work. Fixes #6736 Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: Kevin Krsulich <kevin.krsulich@ibm.com> (cherry picked from commit 0c6890d) Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
Summary
This commit fixes the subgraph() method on the coupling map class when
the node list had a non-contiguous list that didn't start at 0.
Previously, the subgraph method would inject nodes for the holes in the
node list so that all the indices specified in the nodelist argument
were present in the output subgraph. But this was neglecting the nodes
get reindexed and wasn't valid. This commit fixes this by just removing
that step and relying on retworkx's subgraph() method to do the
underlying work.
Details and comments
Fixes #6736