In 1993, Elitzur and Vaidman devised a thought experiment for testing potentially defective bombs without detonating them. The idea relies on the principle that photon self-interference is destroyed when which-path information is, even in principle, available. They called this principle Interaction-free measurement.

Imagine a batch of photosensitive bombs, some live and others defective (duds). These bombs are tested by sending a single photon through a Mach-Zehnder interferometer with two output detectors, labeled C and D. The bomb to be tested is placed in one of the paths after the first beam splitter.

Without a bomb or with a dud, the photon is always detected at C. With a live bomb, each photon has a 25% chance of detection at D (identifying a live bomb without detonation), a 50% chance of causing an explosion, and a 25% chance of detection at C (uncertain diagnosis). Check this paper for a detailed explanation about these statistics and the idea of interaction-free measurement.

Complete the following PennyLane circuit to model the behavior for a live-bomb test using mid-circuit measurements. Practice collecting statistics using counts and calculate the probability, prob_suc, of identifying a live bomb without detonation.

Hint.

The dashed pink line in the Figure simbolizes a mid-circuit measurement implemented by the live bomb.

n_shots = 10000
dev = qml.device("default.qubit", shots=n_shots)
np.random.seed(0)


@qml.qnode(dev)
def circuit():
"""
This quantum function implements the 'bomb tester' for a live bomb using mid-circuit measurements
and returns relevant statistics with qml.counts
"""

# 1st beam-splitter
m_bomb = # measure and postselect
# 2nd beam-splitter
m_det = # measure (detectors)
return # collect counts for m_bomb and m_det

results = circuit()
prob_suc = # favorable cases over total cases

print('the success probability is',prob_suc)

or to submit your code

To interact with codercises, please switch to a larger screen size.

Learning Objectives:

  • Perform mid-circuit measurements to shape the structure of a quantum circuit.
  • Collect information about the quantum state dynamically.