I've been experimenting with quantum circuits and can't quite fathom how the difference between states comes together.
Speaking in terms of simulations using qiskit
, the following code yelds the same results:
circuit = QuantumCircuit(1)
circuit.h(0)
state = Statevector.from_instruction(circuit)
display(plot_bloch_multivector(state, title="H", reverse_bits=False))
circuit = QuantumCircuit(1)
circuit.ry(0.5*np.pi,0)
state = Statevector.from_instruction(circuit)
display(plot_bloch_multivector(state, title="Y", reverse_bits=False))
According to this page, the H-Gate is equivalent to the following circuit:
The state vector remains the same, which makes sense as it's only rotating around the x-axis.
Even negating the initial qubit state and make it a $|1\rangle$ does not bring any difference to the table.
So, I went deeper and looked at the maths behind it. Applying the H gate to $|0\rangle$ results in:
$$ H|0\rangle =\ \begin{pmatrix} \frac{1}{\sqrt{2}} & \frac{1}{\sqrt{2}}\\ \frac{1}{\sqrt{2}} & -\frac{1}{\sqrt{2}} \end{pmatrix} \begin{pmatrix} 1 \\ 0 \end{pmatrix} =\ \begin{pmatrix}\frac{1}{\sqrt{2}} \\ \frac{1}{\sqrt{2}}\end{pmatrix} =\ \frac{|0\rangle + |1\rangle}{\sqrt{2}} =\ |+\rangle $$
Now, using the RY-Gate, we can construct a matrix using $\frac{\pi}{2}$. This is where my understanding of the mathematical application stops tho, and I can't quite figure out how to do the rest of the calculation. This is as far as I've come, but I can't quite "translate" the result into a comparable qubit state:
$$ \begin{pmatrix} \cos(\frac{\pi}{4}) & -\sin(\frac{\pi}{4})\\ \sin(\frac{\pi}{4}) & \cos(\frac{\pi}{4}) \end{pmatrix}|0\rangle =\ \begin{pmatrix} 0.707 & -0.707\\ 0.707 & 0.707\end{pmatrix} \begin{pmatrix} 1 \\ 0 \end{pmatrix} =\ \begin{pmatrix} 0.707 \\ 0.707 \end{pmatrix} $$
Reason for this question is that I am trying different circuits to classify IRIS for comparison, and I am seeing much better accuracy when using my basic Y-Rotation based circuit in comparison to qiskits ZZFeature
and RealAmplitudes
circuit.