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

Preserve global phase in analytical decompositions #6523

Open
tanujkhattar opened this issue Mar 23, 2024 · 2 comments
Open

Preserve global phase in analytical decompositions #6523

tanujkhattar opened this issue Mar 23, 2024 · 2 comments
Assignees
Labels
kind/feature-request Describes new functionality

Comments

@tanujkhattar
Copy link
Collaborator

Is your feature request related to a use case or problem? Please describe.
two_qubit_matrix_to_cz_operations and three_qubit_matrix_to_operations are used from within the decompose method of MatrixGate but they currently ignore global phase; because of which we don't support decomposing controlled versions of MatrixGate.

Describe the solution you'd like
In general, it'd be nice to write a method which, given a target unitary a and actual unitary b returns a cirq.GlobalPhaseGate() which can be used to match b to a s.t. a = global_phase_gate.coefficient * b. This would require minor modification to match_global_phasewhich already exists and can be used from within multiple anlaytical decompositions to "preserve" global phase by simply returning a GlobalPhaseGate() with the right phase.

We should also try to update as many anlaytical_decomposition as possible to preserve global phase.

This can be used to solve issues like #6517

@tanujkhattar tanujkhattar added the kind/feature-request Describes new functionality label Mar 23, 2024
Copy link

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days

Copy link

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature-request Describes new functionality
Projects
None yet
Development

No branches or pull requests

2 participants