3

Currently IBM Q does not support IF statement on real quantum processor. The IF can be used on simulator only. However, there is a theorem stating that quantum gates controlled by classical register can be replaced by those controlled by qubits before measurement. So, you can simply replace the statement measure q[1] -> c[1]; if (c == 1) x q[2]; by cx ...


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


1

There's one more way: Create two identical qubits on the Bloch sphere (this is start with 0 and apply the same random rotational gate). Then, apply a CNOT gate followed by a Hadamard gate to the first qubit to perform a measurement in the Bell basis. You will measure 00, 01, 10 (which are equivalent to the 3 symmetric Bell states) with equal probability ...


1

What you're talking about is called a "projection". The projection onto basis state $|\psi\rangle$ is given by: $P_{\psi} = |\psi\rangle\langle\psi|$. Any measurement operator $M$, such as $Z$ can be written as the sum over projectors, weighted by their respective eigenvalues, such that $M = \sum_i \lambda_i P_i$ where $\lambda_i$ is the real-valued ...


1

I contacted @fran-cabrera from the IBMQ team and he could reproduce the bug! The problem is with the visualization of the transpiled circuit, not the execution (the result should be correct). The team is working on solving it and they expect to deploy a fix at the end of the week. I ran you example in Qiskit and it seems to work IBMQ.load_account() ...


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