Open tanujkhattar opened 8 months ago
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
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
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
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
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
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
Is your feature request related to a use case or problem? Please describe.
two_qubit_matrix_to_cz_operations
andthree_qubit_matrix_to_operations
are used from within the decompose method ofMatrixGate
but they currently ignore global phase; because of which we don't support decomposing controlled versions ofMatrixGate
.Describe the solution you'd like In general, it'd be nice to write a method which, given a target unitary
a
and actual unitaryb
returns acirq.GlobalPhaseGate()
which can be used to matchb
toa
s.t.a = global_phase_gate.coefficient * b
. This would require minor modification tomatch_global_phase
which already exists and can be used from within multiple anlaytical decompositions to "preserve" global phase by simply returning aGlobalPhaseGate()
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 https://github.com/quantumlib/Cirq/issues/6517