2
$\begingroup$

I am implementing a quantum circuit in Qiskit. I create the equal superposition state $$ -|00\rangle + |01\rangle + |10\rangle +|11\rangle $$ but I want to obtain the quantum state $$ |00\rangle - |01\rangle - |10\rangle -|11\rangle . $$

In general, when I have $n$ qubits, I want to put a -1 coefficient in front of every state except $|0\rangle^{\otimes n}$. This transformation corresponds to $-I$ matrix. Which gate(s) should I apply to my circuit to have this transformation?

$\endgroup$
4
$\begingroup$

Your states differ in global phase only, hence they are indistinguishable (or in other words they are equivalent). Therefore you do not need to apply gate $-I$.

Note that the global phase is $\pi$ as $-1 = \mathrm{e}^{i\pi}$


However, in case the state is produced by controlled gate, global phase cannot be neglected. In that case you can implement controlled $-I$ as $Z \otimes I$, i.e. $Z$ gate is applied on controlling qubit and identity gates on controlled qubits.

Just to show that $Z \otimes I$ is controlled global phase $\pi$ (or in other words controlled gate $-I$):

$$ C(-I) = \begin{pmatrix} I & O \\ O & -I \end{pmatrix} = \begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & -1 & 0 \\ 0 & 0 & 0 & -1 \\ \end{pmatrix}= \begin{pmatrix}1 & 0 \\ 0 & -1\end{pmatrix} \otimes \begin{pmatrix}1 & 0 \\ 0 & 1\end{pmatrix}= Z \otimes I $$

| improve this answer | |
$\endgroup$

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.