How do I use quantum gates offered on IBM quantum to construct either eigenvector of the Hadamard gate?

enter image description here


1 Answer 1


Notice that the vectors you're trying to create are real. A great way of creating a real vector is to apply a $Y$ rotation, $$ R_Y(\theta)|0\rangle=\cos\frac{\theta}{2}|0\rangle+\sin\frac{\theta}{2}|1\rangle. $$ So, take the state you want to create and normalize it. For example, $$ |\psi\rangle=\frac{1}{\sqrt{4+2\sqrt{2}}}((1+\sqrt{2})|0\rangle+|1\rangle). $$ Now solve for $\theta$, i.e. $$ \cos\frac{\theta}{2}=\frac{1+\sqrt{2}}{\sqrt{4+2\sqrt{2}}}. $$ Thus, $\theta=\pi/4$. (If that's not so obvious, use the double angle formula, $$ \cos\theta=\cos^2\frac{\theta}{2}-\sin^2\frac{\theta}{2}=\frac{(1+\sqrt{2})^2-1}{4+2\sqrt{2}}=\frac{1}{\sqrt{2}}.) $$

Hence, the circuit you want to run is simply $R_Y(\pi/4)|0\rangle$. I'm assuming you can convert this into qiskit commands.


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.