I'm trying to build a quantum walk circuit. I have the C0 matrix as follows

import numpy as np

C0 = np.array([[-1, 0], [0, -1]])

As we can see, it's the (-)Identity matrix. How to build the -I matrix using quantum gates?

include "qelib1.inc";
gate unitary139793144506800 p0 {
    u3(0,pi,pi) p0;
qreg q[2];
unitary139793144506800 q[0];
unitary139793144506800 q[1];

I obtained the above using qiskit unitary. Is there a way to decompose this into Pauli gates?


1 Answer 1


If you add $-I$ gate, a $I$ gate or nothing, it is not going to make any difference because it is just a global phase. However if you still insist to get one, here it's the decomposition of $-I$ using Pauli's anticommutativity ($XY-YX=iZ$): $$(XY)^2=XYXY=-I$$

  • 2
    $\begingroup$ Six gates XYZXYZ? Pah! Such waste! Use XZXZ to achieve this observationally indistinguishable goal in a mere 4 Pauli gates! ;) $\endgroup$ Mar 15, 2023 at 17:12
  • $\begingroup$ @CraigGidney good catch $\endgroup$
    – Mauricio
    Mar 15, 2023 at 17:13
  • $\begingroup$ @Mauricio corrected C0. thanks! $\endgroup$
    – Van Peer
    Mar 15, 2023 at 17:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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