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
Optimizations to reduce qubits based on non-entangled squares #210
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything looks great!
Thanks a lot Conrad! I tried to add back @pytest.mark.parametrize('board', BIG_CIRQ_BOARDS) in test_split_slide_merge_slide_coherence() but got the following DeviceMapping Error: Do you know why that happens? Thanks! |
It means the layout algorithm failed to find an acceptable mapping of the circuit onto the device graph. For some reason, in that case it just puts qubits that must be adjacent onto non-adjacent positions, so the error is surfaced a bit later. |
I was trying to test how this change affects the number of moves which can be laid out on a device and found a bug where sometimes |
Thanks a lot Conrad for detecting the bug and sharing the way to show the test coverage! Bugs are fixed and test cases have been added. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you squash the changes into 1 commit? I wanted to test, but didn't manage to - the branch is apparently old enough to not work with latest Cirq, and I couldn't rebase it onto the latest code due to all the merge commits. (I suggest using git rebase origin/master
instead of git merge origin/master
in the future to avoid this problem.)
@@ -509,6 +509,9 @@ def test_slide_with_two_path_qubits_coherence(): | |||
) | |||
|
|||
|
|||
# @pytest.mark.parametrize("board", BIG_CIRQ_BOARDS) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some detritus here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. It's removed.
Thanks a lot Conrad!``
Thanks Conrad. I tried to merge the past ~24 commits (which is relevant to the current effort) into one. I followed all steps in https://www.internalpointers.com/post/squash-commits-into-one-git, but it seems nothing has changed. |
I managed to run it and on a 50-game sample, the modified code can lay out 1505/2423 moves in a 50-game sample, while the existing code gets 1447/2423. LGTM |
Thanks a lot Conrad for testing it and sharing the results! I'm submitting this change now. |
Reduce number of qubits used in the following cases: