2

I would just like to share a code for testing a phase measurement on IBM Q: OPENQASM 2.0; include "qelib1.inc"; qreg q[1]; creg c[1]; //measuring theta in //(|0> + |1>*exp(i*theta)) h q[0]; //(|0> + |1>) t q[0]; //(|0> + |1>*exp(i*pi/4)) //s q[0]; //(|0> + |1>*exp(i*pi/2)) //u1 (pi/8) q[0]; //(|0> + |1>*exp(i*pi/8)) h q[0]; ...


2

Answer to the second question: Here is the circuit for measuring in $M{{({{\theta }_{k}})}_{\pm }}=\left\{ 1/\sqrt{2}\left( |0\rangle \pm {{e}^{-i{{\theta }_{k}}}}|1\rangle \right) \right\}$ basis. I assume here that $\theta_k$ is given: circuit.u1(theta_k, q[0]) # q[0] is one of the qubits circuit.h(q[0]) circuit.measure(q[0], c[0]) #c[0] is a ...


Only top voted, non community-wiki answers of a minimum length are eligible