4

The default Qiskit transpiler uses a stochastic swap (StochasticSwap) method to insert the swap gates needed to map the circuit to a given device topology. As the name suggests, this routine uses random numbers in the swap computation, leading to an output that varies. This is an heuristic that is used to get around the fact that computing the optimal ...


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


3

The online simulator is called the ibmq_qasm_simulator, all other devices with city names, e.g. ibmq_vigo, are real quantum devices.


3

There is a mistake in design of the first circuit. Both $X$ and $Z$ gate work when value 1 is in classical register. Gate $X$ should work in case qubit $q_2$ is in state $|1\rangle$. Similarly $Z$ acts when $q_1$ in state $|1\rangle$. Also you have to deal with state when both $X$ and $Z$ have to act. In your case you conditioned both $X$ and $Z$ on c==1. ...


2

I will provide some general comments concerning noise in quantum computers. Noise in quantum systems is normal phenomena as these systems are probabilistic by nature. Under current state of development, quantum computers unfortunately does not allow to build complex deep circuits. You can of course use additional qubits to introduce error correction which ...


2

Well actually when looking at the source code, the construct_circuit method: quantum register where the sequential QFT is performed self._up_qreg = QuantumRegister(2 * self._n, name='up') # quantum register where the multiplications are made self._down_qreg = QuantumRegister(self._n, name='down') # auxiliary quantum register used in ...


2

The Qiskit backends (quantum devices or simulators) work only when you explicitly invoke them, usually with execute. The code in your snippet does not call qiskit, and runs on a traditional machine.


1

This is the color scheme for the phase factors supplied by IBM Q. It seems that it is not just the Y gate but any phase larger than pi is incorrectly color coded.


1

Thanks to Martin Vesely! Now I modify method 1 by using the correct c values. I think I got the right answer. My goal is to see the 1st bit entangled with the 4th bit. As can be seen below, 1st and 4th bits always have the same values. So they are entangled.


1

What I have obtained by running 4 times the same code on "qasm_simulator": {'00': 4656, '01': 1613, '10': 185, '11': 1642} {'00': 4564, '01': 1735, '10': 179, '11': 1618} {'00': 4581, '01': 1646, '10': 184, '11': 1685} {'00': 4602, '01': 1684, '10': 181, '11': 1629} Here we don't have noise, but still, the results are different. So, one can expect some ...


1

I'm not sure what had caused the problem but I was able to solve it and most likely know what the problem was. Consider these two lines from my code above: job_exp = execute(qc, backend = backend, shots = 8192) exp_result = job_exp.result() Problem with the above lines is that we are not waiting for the actual quantum device to compute and send over the ...


1

EDIT: I believe this is solved in @IEIrodov's answer below. I'm not sure what's causing the issue, but based on similar issues on the qiskit slack channel, I don't think it's something you're doing. As a workaround, try running: exp_result = job_exp.result() exp_measurement_result = exp_result.get_counts() print(exp_measurement_result) plot_histogram(...


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


1

As Martin Vesley has mentioned in his answer, there are some error correction techniques that require additional qubits and gates resources, and how we know the resources of nowadays QCs are limited, and that's why those techniques are not so useful today. But in 2017 new error correction techniques were proposed that don't require additional gates/qubits. ...


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