# Error with IBM's Quantum Composer Qiskit Histogram when Resets are involved?

I am having trouble understanding what IBM's histogram is doing.

I have independently verified, in agreement with the statevector given from IBM, that after all these steps the statevector should be in the state:

$$|\psi\rangle = \left(\frac{1}{\sqrt{6}}\> \frac{1}{\sqrt{6}}\>\frac{1}{\sqrt{6}}\>0\>\frac{1}{\sqrt{6}}\>\frac{1}{\sqrt{6}}\>\frac{1}{\sqrt{6}}\> 0 \> \ldots 0\right)^T$$

Where the dots stand in for 23 more 0's. When simulating measurement, I acquire the following Histogram:

Which matches up exactly with the absolute value of the squares amplitudes, which is what I believe the histogram should generate, especially after this answer confirmed as much.

However IBM does not generate this histogram, it generates the following histogram:

which is exactly the histogram I generate independently when I ignore the resets.

Does IBM have an error when dealing with Resets, or am I misunderstanding something?

The IBM histogram is correct. You seem to be under the impression that a reset is a postselection.

Applying a reset to a qubit cannot change the expected measurement statistics on other qubits. That would violate the no-communication theorem. So the distribution before the reset is equal to the distribution after. The same is not true for a postselection, because postselection implicitly involves broadcasting a "do we continue or do we restart?" bit.

• Maybe I simply don't understand resets/post selection well enough, but if we continue the circuit after the reset, surely the later probability differs compared to having never reset at all, no? How do I reconcile these two facts? Jan 11 at 21:25
• @Craig Why would they differ? The no communication theorem guarantees you can't change the observable statistics of one part of a system by operating a separate part. The two parts of the system have to touch after the operation for the operation to spread the difference. After you've finished the Toffoli gates, where are the qubits being reset touching the other qubits? Nowhere! Therefore nothing you do to them at that point can affect the statistics you get from observations of the other qubits. Jan 11 at 22:12
• I think I understand. Further (multi-qubit) gates would be this touching (interacting) after the reset, but if there are not further gates then the resetting can never have an effect on the rest of the system. Yes? Jan 11 at 23:25
• @Craig That's right. Jan 12 at 0:25
• Apologies for the barrage of clarifying questions: Is it possible to simulate this without having an ancillary qubit the whole time? All my probabilities work out when I introduce a $|0\rangle$ ancilla to swap and emulate a reset. However at some point I would like to dispose of the ancilla, unfortunately this would get rid of some probability. My Naive thought is to simply re-normalize after discarding but that probably violate the no-communication theorem. Any help/resources would be greatly appreciated Jan 12 at 2:49

The answer of Craig G., including the circuit on Quirk, is perfectly clear. It greatly shows the difference between reset and post-selection.

Unfortunately, IBM's Composer seems actually confusing, as Craig's initial question pointed out. Here are two pictures taken from the composer.

Circuit number #1 is an entangled superposition of four states : |000>, |011>, |100>, |111>

Reseting the middle bit gives a superposition of two states : |000> and |100>, which looks very much like a selection.

I was expecting four states : |000>, |001>, |100>, |101> (and indeed, measuring the bits actually provides these four states).

Thus, Craig's original question still holds : why is IBM's composer apparently inconsistent between state vector and measured probabilities?