I recently came across these 2 videos on Coursera which show how to build a simple quantum computer that can implement the simplest case of the Deutsch-Jozsa algorithm (which uses only 2 qubits).



Since my only knowledge of quantum computing comes from this online textbook: https://qiskit.org/textbook/ch-states/introduction.html, which doesn't focus on the underlying physics), I was having trouble understanding the underlying physics used in those 2 videos.

I will try to explain the device's function in my own words. Please critique any incorrect statements I make.

enter image description here

2 qubits are encoded using a single photon.

Qubit 1's state is described by the path the photon is on and Qubit 2's state is described by the polarization of the photon.

Once the photon has passed from the laser past the 1st polarizing filter and beam splitter, it is equivalent to a Hadamard gate being applied to both Qubit 1 and Qubit 2.

After the photon passes through the waveplates, it is equivalent to the quantum oracle being applied to both Qubit 1 and Qubit 2.

Lastly, the photon passes through one final beam splitter, which is equivalent to a Hadamard gate being applied to both Qubit 1 and Qubit 2.

The difference in the interference pattern on the wall shows whether the quantum oracle was balanced or constant.

Am I interpreting this experiment correctly and can someone explain the physics underlying this system? I found the two videos to be very confusing, although very fascinating.

Thank you very much for your time and I apologize for the long question.

  • $\begingroup$ This has nothing to do with a quantum computer. $\endgroup$ Jul 8, 2020 at 20:28

2 Answers 2


You start with a polarisation filter. This does nothing to the path of your photon and, effectively, measures the polarisation of the photon, meaning that you prepare the "second" qubit in the fixed state determined by what polarisation the filter is detecting. So, at this point, you have $$ |0\rangle|-\rangle $$

Then, you input to a beamsplitter. I would expect that you are using non-polarising, 50:50 beam splitters? In which case, these have no effect on the polarisation of the photon, only on the path. However, the matrix that describes their action is not Hadamard. Instead, it is a beamsplitter, action, $$ B=\frac{1}{\sqrt{2}}\left(\begin{array}{cc} 1 & i \\ i & 1 \end{array}\right) $$ The difference is important because it means you will get the opposite outcome in your experiment from what you would have expected with the Hadamard!

Your state at this point is $$ \frac{1}{\sqrt{2}}(|0\rangle+i|1\rangle)|-\rangle $$

It is possible to understand the physics of why it looks like this if you know a little bit of electromagnetism. Strictly, this is all derived from Maxwell's equations, but I won't go back that far (also, I'm a little rusty myself, so this may not be perfect). Imagine you have a beamsplitter at position $x=0$. You have an incident photon (travelling along $y=0$) that you might describe by $Ie^{i(kx-\omega t)}$. This will give you a transmitted component $Te^{i(kx-\omega t)}$ and a reflected one $Re^{i(ky+\omega t)}$ (note the different sin on the $\omega t$ component). By assumption, the beamsplitter is 50:50 meaning $|R|^2=|T|^2=|I|^2/2$. We require continuity on the first derivative of the wavefunction at the boundary ($x=y=0$). This gives $$ |I|^2=|T-R|^2. $$ Since we don't care about global phase, we can assume $T=I/\sqrt{2}$ is real. From this, you derive that $R=iI/\sqrt{2}$. The $T$ coefficient is top-left (and bottom-right) of the $B$ matrix, while $R$ is the two off-diagonal elements.

Now you go through the function evaluation. You talk about waveplates. Usually, to me, a waveplate means a think that adds a phase (or not) if the photon is travelling along a particular path. So, for example, if you had a waveplate on the "1" path but not the "0" path, this would be like applying the gate $$ \left(\begin{array}{cc} 1 & 0 \\ 0 & -1 \end{array}\right) $$ on the first qubit. Because it's not using polarisation, it's not doing anything to the second qubit. This will eventually create the net result that you want, but it's not doing Deutsch's algorithm. What you actually want is an optical element that flips the polarisiation $|H\rangle\leftrightarrow |V\rangle$ (or not). The net effect on the calculation is the same, but there is a slight conceptual difference.

At this point (however you've made them), if the two waveplates are the same, you're in the state $$ \frac{1}{\sqrt{2}}(|0\rangle+i|1\rangle)|-\rangle $$ whereas if they're different, you've got $$ \frac{1}{\sqrt{2}}(|0\rangle-i|1\rangle)|-\rangle $$

Finally, you use the second beamsplitter. The two results are $|1\rangle|-\rangle$ or $|0\rangle|-\rangle$.

  • $\begingroup$ Doesn't the waveplate affect the polarization qubit? Not the path qubit. $\endgroup$ Jul 4, 2020 at 23:24
  • $\begingroup$ As I said, it depends what you’ve actually used as the wave plate. The conventional meaning of the term waveplate is something that affects the path qubit. $\endgroup$
    – DaftWullie
    Jul 5, 2020 at 5:46
  • $\begingroup$ I am having trouble visualizing how the path qubit can be affected by a wave plate. It makes sense for the polarization of a photon to be flipped (the electric field vector becomes flipped upside down). However, doesn't the path qubit just tell you the probability amplitude of the photon being in one path or the other? I just need help visualizing the path qubit. $\endgroup$ Jul 5, 2020 at 6:22
  • $\begingroup$ I believe it is also called spatial encoding, according to books.google.com/… $\endgroup$ Jul 5, 2020 at 6:46
  • $\begingroup$ Well, you need to visualise what's happening to, e.g. the electric field, so in a sense you're talking about polarisation. But the point is that what will happen is independent of what polarisation the state is in. So, think about the light like a wave. Mathematically, we'd use $e^{i(kx-\omega t)}$ but it's easier to visualise the real part of this, $\cos(kx-\omega t)$. So, this describes a wave moving through space. What a waveplate does is slows down the wave over a small region of space. $\endgroup$
    – DaftWullie
    Jul 5, 2020 at 8:40

Not exactly.

You are correct, there is a single photon; qubit 1 is its path, qubit 2 is its polarization.

The waveplates implement an oracle (one from 4 possible).

You are wrong about the beam splitters; beam splitters do not affect polarization, so they act on the qubit 1 only as Hadamard gates.

The $|-\rangle$ state of qubit 2 is created by the polarization filter. We actually don't know which was the state of qubit 2 before the polarization filter, but there is nothing wrong in thinking that it was the state $|1\rangle$ and the polarization filter acted as Hadamard gate.

  • $\begingroup$ Thank you very much. What is the interference pattern supposed to look like on the wall? Will the photon only appear on one wall or both? Also, is there any difference in using one photon as compared to many photons from a laser? $\endgroup$ Jun 29, 2020 at 0:37
  • 1
    $\begingroup$ In an ideal thought experiment a photon always appears on one wall only, depending on the oracle type; in a real Mach–Zehnder interferometer this is impossible, and a photon may appear on any wall; many photons form inteference picture which is sensitive to the type of the oracle. $\endgroup$
    – kludg
    Jun 29, 2020 at 0:48
  • $\begingroup$ Thank you again. One last question I have (because of my lack of physics knowledge), why do the initial polarizer and beam splitter create the states |plus> and |minus> for qubit 1 and qubit 2. Why does it not create the states |plus> and |plus> or alternatively |minus> and |minus>. If this explanation is too complex, could you provide me with some resources that explain this simply? $\endgroup$ Jun 29, 2020 at 1:04
  • $\begingroup$ Just to be specific, I am asking for an explanation of the physics. I am not asking why the Deutsch-Jozsa algorithm did not instead use some different mechanism. $\endgroup$ Jun 29, 2020 at 1:15
  • $\begingroup$ The polarizer creates $|-\rangle$ state because it is rotated so. I believe the beam splitters act as Hadamard gates because they were manufactured so; the beam splitters can be manufactured differently, but I am not ready to go into details. $\endgroup$
    – kludg
    Jun 29, 2020 at 1:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.