Closed Spin1Half closed 7 months ago
I will add that for back of the hand calculations, a typical way I mitigate global phase is to multiply a matrix by a unit-normalized complex conjugate of its first non zero term (starting at the top left, going left to right).
We could similarly employ this strategy whenever a CONTROLLED gate is created, but this would likely come without its own set of issues.
I don’t feel that this is something to be fixed. The “controlled” construction doesn't descend to an operation from PU(2^n) to PU(2^(n+1)), and that situation just is what it is.
Or: you can’t ignore “global” phase if it isn’t actually global.
QISKit deals with this by adding an explicit phase slot to their circuits, so that if a compiler replaces the G in CONTROLLED G with a H1 … Hn, it remembers to add the correct RZ when building CONTROLLED H1 … CONTROLLED Hn. I find this distasteful, but it is an option.
My resolution is to add this caveat to the spec with a nice colored box.
Global phase is a typically benign side effect that may vary between two functionally identical quantum gates. Two states A B (or unitaries/gates) are said to be "equivalent up to a global phase" if A = cB where c is a number of the form e^(i*theta) for any real theta. Furthermore, the bloch sphere representation for the state of a single qubit is invariant to global phase, as a consequence, representing single qubit gates as "rotations about the bloch sphere" are also invariant to global phase.
For example: The S gate is defined as a 90 degree rotation about the Z axis of the bloch sphere:
The RZ gate can be defined by a pauli sum, but notice that the unitary for the RZ(pi/2) is only equivalent to the canonical S matrix up to a global phase (in this case, the phase is e^(i*pi/4) = (1 + i)/sqrt(2)):
Quil defines the CONTROLLED gate modifier in the following manner:
The key here is that a global phase mismatch for two unitaries (A, B) will result in a local phase mismatch if they are used in a "controlled" manner. More specifically
CONTROLLED S
andCONTROLLED RZ(pi/2)
have observably different properties (are not equivalent up to a global phase) despite the fact that T and RZ(pi/2) do not have observably different properties (only a global phase mismatch).There are some ideas floating around about how to deal with this, but there does not seem to be an obvious best solution.