Skip to content
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

Adds unitary testing for routed circuits #5846

Merged
merged 8 commits into from
Sep 2, 2022

Conversation

ammareltigani
Copy link
Contributor

Adds utilitiy functions that tests whether two circuits define the same unitary up to permutation of qubits.

@ammareltigani ammareltigani requested review from a team, vtomole and cduck as code owners August 30, 2022 22:58
@CirqBot CirqBot added the size: M 50< lines changed <250 label Aug 30, 2022
Copy link
Collaborator

@tanujkhattar tanujkhattar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed offline, let's change the API of the testing method (and router implementation) to take an actual and expected circuit with the same set of qubits, along with a qubit_map that maps the initial qubits of actual to it's final qubit mapping. As a fallback, if the qubit_map is not specified, the method can potentially try to construct a qubit map by looking at the swaps operations in the actual circuit.

@ammareltigani
Copy link
Contributor Author

@tanujkhattar I've made the changes we discussed without the fallback strategy as a v1. I can follow up with that with another PR once we have a fully functioning basic routing implementation pushed to Cirq.

@ammareltigani ammareltigani requested review from tanujkhattar and removed request for MichaelBroughton August 31, 2022 21:54
cirq-core/cirq/testing/circuit_compare_test.py Outdated Show resolved Hide resolved
cirq-core/cirq/testing/circuit_compare.py Outdated Show resolved Hide resolved
cirq-core/cirq/testing/circuit_compare_test.py Outdated Show resolved Hide resolved
cirq-core/cirq/testing/circuit_compare.py Outdated Show resolved Hide resolved
cirq-core/cirq/testing/circuit_compare.py Outdated Show resolved Hide resolved
cirq-core/cirq/testing/circuit_compare.py Outdated Show resolved Hide resolved
cirq-core/cirq/testing/circuit_compare.py Outdated Show resolved Hide resolved
@tanujkhattar tanujkhattar added the automerge Tells CirqBot to sync and merge this PR. (If it's running.) label Sep 2, 2022
@CirqBot CirqBot added the front_of_queue_automerge CirqBot uses this label to indicate (and remember) what's being merged next. label Sep 2, 2022
@CirqBot CirqBot merged commit 8f9a0bc into quantumlib:master Sep 2, 2022
@CirqBot CirqBot removed automerge Tells CirqBot to sync and merge this PR. (If it's running.) front_of_queue_automerge CirqBot uses this label to indicate (and remember) what's being merged next. labels Sep 2, 2022
rht pushed a commit to rht/Cirq that referenced this pull request May 1, 2023
Adds utilitiy functions that tests whether two circuits define the same unitary up to permutation of qubits.
harry-phasecraft pushed a commit to PhaseCraft/Cirq that referenced this pull request Oct 31, 2024
Adds utilitiy functions that tests whether two circuits define the same unitary up to permutation of qubits.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: M 50< lines changed <250
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants