So, I have a state of three qubits that is in one of the states below, with $\omega=e^{i\frac{2\pi}{3}}$:

$$|\psi_0\rangle=\frac{1}{\sqrt 3}(|100\rangle+\omega^2|010\rangle+\omega|001\rangle),$$ $$|\psi_1\rangle=\frac{1}{\sqrt 3}(|100\rangle+\omega|010\rangle+\omega^2|001\rangle).$$

I tried to measure the qubits but the amplitudes are $1/3$ for each, so...

  • $\begingroup$ It is in a state related to a quantum Fourier transform. $\endgroup$
    – Mauricio
    Nov 25, 2022 at 12:52
  • $\begingroup$ Note that after the measurement in computational basis you lose information about the phase. So, 1/3 probability for all three basis states in the superposition is correct. Just to add that amplitudes are $1/\sqrt{3}$. The $1/3$ is probability of measurement the state. $\endgroup$ Nov 25, 2022 at 22:08
  • $\begingroup$ I don't understand the question. The state is what you wrote. The outcome probabilities in the computational basis are all equal to $1/3$, yes... so what's the question? $\endgroup$
    – glS
    Nov 28, 2022 at 6:22

2 Answers 2


Try looking up some of the answers on this site about how to create a W state. This is a state of the form $$ \frac{1}{\sqrt{3}}(|001\rangle+|010\rangle+|100\rangle. $$ Let me call the unitary that acts on the state $|000\rangle$ and produces the W state $U$.

So, if you can convert one of your two states in to the W state and apply $U^\dagger$, that state would definitely be in the state $|000\rangle$, while your other state would definitely be in something else. That way, a standard measurement would definitely distinguish them.

The only step you need to add now is to introduce a gate $$ P=\left(\begin{array}{cc} 1 & 0 \\ 0 & \omega \end{array}\right). $$ If you apply the gate $I\otimes P\otimes P^2$, one of your states will be correctly converted to W.

  • $\begingroup$ Thanks! I correctly converted one of the two states to W, but I can't figure out who is U (and U†), I tried several options but I didn't get the state |000> with any $\endgroup$
    – Bob
    Nov 25, 2022 at 21:32
  • $\begingroup$ Did you try (the inverse of) a circuit like this one? physics.stackexchange.com/a/311898 $\endgroup$
    – DaftWullie
    Nov 29, 2022 at 10:58

Are you trying to write code to distinguish these two states? Your two states $|\psi_0\rangle$ and $|\psi_1\rangle$ are orthogonal.

It's not the prettiest answer, but you can use Qiskit to convert $|\psi_0\rangle$ to $|000\rangle$. That means that if you measure those three qubits and get $|000\rangle$, you must have $|\psi_0\rangle$ and any other value means $|\psi_1\rangle$

from qiskit.quantum_info import Statevector, Operator
from qiskit.circuit.library.data_preparation import StatePreparation
from qiskit import *

w = math.cos(2 * math.pi / 3) + 1j * math.sin(2 * math.pi / 3)
state1 = np.array([1, w, 0, 0, w * w, 0, 0, 0]) / math.sqrt(3)
state2 = np.array([1, w ** 2, 0, 0, w, 0, 0, 0]) / math.sqrt(3)

def get_gate():
    return StatePreparation(state1).inverse()

// See that the Circuit returns |000> when you start in state1
qc = QuantumCircuit(3)
qc.append(get_gate(), [0, 1, 2])

// See that the circuit can't return |000> when you start in state2
qc = QuantumCircuit(3)
qc.append(get_gate(), [0, 1, 2])

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.