I need to use the following matrix gate in a quantum circuit:

$$\text{Sign Flip}=\left[\begin{matrix}0 & -1 \\ -1 & 0\end{matrix}\right]$$

$\text{Sign Flip}$ can be decomposed as (in terms of Pauli-$X$,$Y$,$Z$):

$$\begin{bmatrix} 0 & -1\\ -1 & 0\end{bmatrix} = \begin{bmatrix} 0 & 1\\ 1 & 0\end{bmatrix} \begin{bmatrix} 0 & -i\\ i & 0\end{bmatrix} \begin{bmatrix} 1 & 0\\ 0 & -1\end{bmatrix} \begin{bmatrix} 0 & -i\\ i & 0\end{bmatrix} \begin{bmatrix} 1 & 0\\ 0 & -1\end{bmatrix}$$

Is there any standard shorthand notation for the $\text{Sign Flip}$ gate? I don't really want to replace one simple custom gate by $5$ quantum gates in my circuit.

  • 1
    $\begingroup$ Is it physically different from Pauli-X gate? $\endgroup$ – kludg Jul 28 '18 at 9:34
  • $\begingroup$ Looks to me like -X but I must be seeing it totally wrong, what am I missing? $\endgroup$ – user1271772 Jul 28 '18 at 18:32
  • 2
    $\begingroup$ @user1271772 Norbert and Blue discussed this in comments that have since been deleted. The conclusion was that this gate is physically equivalent to Pauli X. $\endgroup$ – James Wootton Jul 30 '18 at 12:37

A unitary $U$ and $e^{i\phi}U$, which differs from it by a phase, act exact identically on any quantum state. Thus, they should really be considered the "same" unitary in terms of their action.

You can therefore use $X$ instead of your unitary, which is $-X$. This will have exactly the identical action in any circuit.

(Why is this? There are different ways to see this: Either since $|\psi\rangle$ and $e^{i\phi}|\psi\rangle$ describe the same quantum state, or by working with density operators on which $U$ acts as $\rho\mapsto U\rho U^\dagger$, such that phases cancel. Also, note that this is not true for controlled-unitaries -- but this is an entirely different question.)


With the IBM Q Experience you can implement that transformation with what they call the U3 gate, which takes three input arguments and looks like this:

$$ U3(\theta,\phi,\lambda) = \begin{bmatrix} \cos(\theta/2) & -e^{i\lambda}\sin(\theta/2) \\ e^{i\phi}\sin(\theta/2) & e^{i\lambda+i\phi}\cos(\theta/2) \end{bmatrix}. $$ So in this case you could just write $U3(\pi,\pi,0)$.

  • $\begingroup$ Note that U3 does not allow to get all unitaries, but only all unitaries up to a phase. This can be seen by parameter counting (3 Euler angles!) or by noting that the first entry is real. Thus, it is basically conicidence that you get -X (or that you can get any phase in front of the X). $\endgroup$ – Norbert Schuch Jul 28 '18 at 13:26
  • $\begingroup$ @NorbertSchuch of course it does not allow to get all unitaries. When actually implementing an algorithm in one of those quantum computers one of the problems is to decompose your unitary gate into available operations. I was just answering the question with an existing gate - regardless of that one can generally ignore global phase. $\endgroup$ – user96233 Jul 30 '18 at 8:51
  • $\begingroup$ Well, it does allow to get all unitaries -- up to a phase. Since phases are irrelevant, these are actually all gates. However, the fact that you get -X exactly is a mere coincidence due to the phase convention chosen. Thus, I would argue that the answer misses the point. (You might argue that the question also misses the point, but even then a good answer should point out what is relevant.) $\endgroup$ – Norbert Schuch Jul 30 '18 at 11:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.