Cirq routing is hanging again for some circuits
See original GitHub issueHi guys,
I have a concern similar to the one from issue #2282. The problem was fixed later and when running from 6d81ddbb
commit everything works just fine. However, there were further changes in apply_next_swaps(…) function, in particular a new parameter max_num_empty_steps
was introduced.
In the last version of code when running routing via route_circuit_greedily(…) and with parameters max_search_radius=1
, max_num_empty_steps=1
everything also works well. However, when choosing different values for these two parameters (e.g. max_search_radius=2
, max_num_empty_steps=1
) routing hangs on some circuit instances.
Should there be any constraint on how to choose values for the parameters max_search_radius
and max_num_empty_steps
? Or maybe there is some bug in the routing code?
Thanks!
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:7 (5 by maintainers)
I think I managed to fix the issue by modifying function apply_next_swaps(…) in greedy router. In fact these changes were implemented earlier to fix such a problem and then for some reason were reverted.
See this screenshot:
After partially reverting these changes in apply_next_swaps(…) in Cirq. 0.8.2 the greedy router works fine! Should I create a pool request with the changes?
This is the modified version of apply_next_swaps(…) function:
These are the lines I added:
Submitted PR #3360