Skip to content

Create a unitary to pauli string transformer #6100

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

Merged

Conversation

NoureldinYosri
Copy link
Collaborator

@NoureldinYosri NoureldinYosri commented May 19, 2023

@NoureldinYosri NoureldinYosri requested review from a team, vtomole and cduck as code owners May 19, 2023 17:15
@NoureldinYosri NoureldinYosri requested a review from dabacon May 19, 2023 17:15
@CirqBot CirqBot added the size: M 50< lines changed <250 label May 23, 2023
@tanujkhattar tanujkhattar self-assigned this May 30, 2023
got = unitary_to_pauli_string(protocols.unitary(want))
assert got is not None
assert np.all(want.pauli_mask == got.pauli_mask)
assert np.isclose(cast(np.complex128, want.coefficient), cast(np.complex128, got.coefficient))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we add a test for eps != 0 as well?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

the default value is eps=1e-15 not zero.

@NoureldinYosri
Copy link
Collaborator Author

@dstrain115 PTAL

@NoureldinYosri
Copy link
Collaborator Author

@dstrain115 ping

@NoureldinYosri NoureldinYosri merged commit 508677a into quantumlib:master Jul 5, 2023
harry-phasecraft pushed a commit to PhaseCraft/Cirq that referenced this pull request Oct 31, 2024
- This is the first step to implementing the algorithm in quantumlib#5906 (comment)
- Based on https://quantumcomputing.stackexchange.com/questions/13157/how-do-i-check-if-a-gate-represented-by-unitary-u-is-a-clifford-gate#comment17495_13158
- The complexity of this algorithm is $\mathcal{O}(n 4^n)$ where $n$ is the number of qubits it acts on or alternatively $\mathcal{O}(S \log_4{S})$ where $S$ is the size of the unitary.
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.

4 participants