I started with Qiskit
today and find it very exciting.
As a first question I want to understand how to measure an arbitrary state $|\Psi\rangle$ not in the basis of Z ($|1\rangle$, $|0\rangle$) but in the basis of Y ($|R\rangle$, $|L\rangle$).
Since measurements on qubits in Qiskit are carried out in the Z-basis (I would understand it in that way), I have to transform the state by a transformation
$|\Psi'\rangle = U |\Psi\rangle$
into a new state, on which the measurement is done in the Z-basis. U is to be determined. So I want a "mapping" from $|R\rangle \rightarrow |0\rangle$ and $|L\rangle \rightarrow |1\rangle$
The requirement on U is, therefore:
the amplitude of $|R\rangle$ in $|\Psi\rangle$ equals to the amplitude of $|0\rangle$ in $U|\Psi\rangle$
the amplitude of $|L\rangle$ in $|\Psi\rangle$ equals to the amplitude of $|1\rangle$ in $U|\Psi\rangle$
So I have
- $\langle 0|U|\Psi\rangle = \langle R|\Psi\rangle$
- $\langle 1|U|\Psi\rangle = \langle L|\Psi\rangle$
or
- $U^\dagger|0\rangle = |R\rangle$
- $U^\dagger|1\rangle = |L\rangle$
Therefore, the Z-base matrix-representation is
$U^\dagger = \begin{pmatrix}1 & 1& \\ i &-i\end{pmatrix} $
$U = \begin{pmatrix} 1 & -i& \\ 1 &i\end{pmatrix} $
This is a well known result: Actually, it can be written as
$U = H S^\dagger$
The circuit in Qiskit
is as follows
and works as expected:
I think that's all right so far, but I dislike the my clumsy way of bringing up U. Is there a better, more direct approach? It has nothing to with Qiskit, but the way in general.