# In what state is this 3-qubit state?

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...

• It is in a state related to a quantum Fourier transform. Nov 25, 2022 at 12:52
• 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. Nov 25, 2022 at 22:08
• 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?
– glS
Nov 28, 2022 at 6:22

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.

• 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
– Bob
Nov 25, 2022 at 21:32
• Did you try (the inverse of) a circuit like this one? physics.stackexchange.com/a/311898 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.prepare_state(state1)
qc.append(get_gate(), [0, 1, 2])
display(Statevector(qc))

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