I played around a bit with Quirk (
http://algassert.com/quirk), a simple quantum computer simulator. With some help from
this article, I think I finally get what's happening.
To simulate a double slit experiment / interference I did this:
So basically, there is first a Hadamard gate that's the "slit", i.e. it generates a superposition that has 50/50 chance of being one or zero (up or down, or whatever). Then I do a pi/8 phase shift, which puts the two states in different phase. And finally, another Hadamard gate that shows interference, simulating the waves in the double slit interfering with each other.
For clarity, I left out actual measurements and just used the simulator's own diagnostics to show the probability densities in the green boxes. Of course in reality it's impossible to peek a superposition like this, but for purposes of explaining just imagine that there is one measurement at the end and the other green boxes are just for show, and that we run the circuit enough times to see different probabilities. The three dots are just spacers so that the pictures align properly.
So, in the above case, there is interference. But if we add another entangled cubit (i.e. the prism in the quantum eraser experiment that creates another entangled photon) like this:
The interference pattern disappears. That black dot and the cross is a CNOT gate: if the bit in the line where the dot is is ON, then the value in the line with the cross is flipped. This is basically the picture with nothing but two screens in the double slit experiment. They both show just blotches and no interference pattern because we've extracted the "which-way" information from the double slit and even if we don't use it, that counts as an observation!
Next step:
Here we erase the information by unentangling (is there a better term?) the two cubits with another CNOT gate. Interference pattern re-appears. No time travel or faster than light communication, because we have to do the unentangling before any measurement. If we were to measure the top cubit then the entanglement would be lost.
But there is also another way to get the interference pattern: the delayed choice and using the measurement info from the other cubit/photon.
In this case we measure the cubits. The original pattern on the screen is a blotch, no interference pattern. But if we condition the measurement on the which-way info, then we can split it into two interference patterns. Pretty neat. In this case the cubits or photons could be lightyears apart, but we need to transmit the information of one measurement to the next to extract the pattern.
So, I hope I'm on the right track here. Next step is to try run this on an actual quantum computer (IBM cloud) but that'll have to wait until another day.