# On the photonic implementation of Shor's code

The above picture comes from this paper.

I can see that the standard Shor's code has been re-designed.

I have two main doubts:

1. I can't figure out in figure (b) how the setting inputs the state $$\alpha|\texttt{0}\rangle + \beta|\texttt{1}\rangle$$
2. Related to point 1., I don't get how they gain the 10th qubit.
• I don't quite understand. Are you asking how to perform a local change of basis from the basis $\{|H\rangle,|V\rangle\}$ (which is just another way to write the computational basis in a photonic context usually) to the basis $\{|\pm i\rangle\}$? Can't you just apply local unitaries to do this?
– glS
Jun 15 at 8:38
• Maybe my own answer helps to understand what I mean. Jun 15 at 9:15
• @glS I tried to explain it better. What do you think? Anyway I believe I answered my own first question. But I am still confused about points 2. and 3. Jun 17 at 11:14
• so, regarding what's now the first question, I still feel that you should better clarify your current level of understanding. Do you know how to work out output state for these kinds of photonic "circuits"? By which I mean, know that you have to work in second quantisation, and how the various optical components affect input states? Without getting into the paper, judging only from the figures here, I'd say it's likely that the input state is chosen by suitably tuning one of the waveplates, which results in rotating the one photon's polarisation, which is what they're saying in fig.c I think
– glS
Jun 18 at 18:31
• @glS Not much actually. I think the main issues I'm facing come indeed from the principle of indistinguishability. In fact, this protocol seems to me to not be logically equivalent to the classical code, as I am struggling defining logical operators. Regarding the settings, I still don't understand how figure (c) is embedded in figure (b). Reading the paper is just more confusing to me. Jun 19 at 8:25

## Trigger photon and post-selection

To understand the role of the 10th trigger photon, and how it is used to effectively "choose" the input state for the rest of the circuit, remember that each photon source generates (in this type of encoding) a Bell pair.

Focus on EPR-2 in (b). This generates a Bell state, something like $$|00\rangle+|11\rangle$$. Each space corresponds here to the polarisation state of a photon. The first photon (i.e. the left space) then mingles with the rest of the circuit and does its thing. You can sum this up as the rest of the circuit amounting to some isometry $$V$$ acting on the first qubit, and giving 3 qubits as output: $$(V\otimes I)(|00\rangle+|11\rangle)$$. In other words, this $$V$$ encodes everything else that happens in the upper part of (b).

The bottom rail, i.e. the second photon generated by EPR-2, i.e. the second space in our formalism, is instead projected onto the state $$|\psi\rangle\equiv \bar\alpha|0\rangle+\bar\beta|1\rangle$$. Such projection amounts to obtaining the (normalised version of the) state $$(I\otimes \langle\psi|)(V\otimes I)(|00\rangle+|11\rangle) = V(\alpha|0\rangle+\beta|1\rangle).$$

You can thus see that performing the projection on the second system amounts to changing the input state entering $$V$$ in the first system. It's a bit like teleporting the state you want at the beginning of the circuit by suitably projecting at the end (except not really, because teleportation is built to have it work deterministically, which is not what happens here).

Practically speaking, doing this projection means that they use the waveplates to select a measurement basis, and then only keep the measurement results corresponding to one of the two associated outcomes. For example, if they want to project on $$|0\rangle+|1\rangle$$, they use a QWP (whose action amounts to performing an Hadamard operation on the qubit), and keep results corresponding to the first detector clicking. To see is, observe that the QWP maps $$c_1 a_H^\dagger+c_2 a^\dagger_V\to(c_1+c_2)a_H^\dagger+(c_1-c_2)a_V^\dagger$$, the PBS will send $$a_H^\dagger$$ on one rail (say, $$R$$ in the figure) and $$a_V^\dagger$$ in the other, and thus the $$R$$ detector will click with probability $$|c_1+c_2|^2$$.

Please note that, physically speaking, this means that the experimenters cannot really decide what to input in the circuit. They cannot tune some plates to, say, always use as input $$|0\rangle+|1\rangle$$. Instead, what they do is choose the measurement basis on the last photon, collect all measurent results, and then only look at those where the last photon was found in the detector $$R$$ rather than $$T$$. The data on the rest of the circuit will then be identical to just entering the circuit with the state $$|0\rangle+|1\rangle$$.

## Blocks generating GHZ states

To understand the rest of the circuit, we can think of it as composed of four different blocks. Three nearly identical blocks, equal to Fig. (c), and the following block before those:

We can assume to consider this in the post-selected regime, that is, assuming the 10th photon was found in the correct detector, and thus the photon labeled $$e_2$$ is in the state $$\alpha |0\rangle+\beta |1\rangle$$. The EPR-1 source generates a pair of (polarisation-)entangled photons, and thus we can write the overall state entering the PBS as $$(a_{1H}^\dagger a_{2H}^\dagger + a_{1V}^\dagger a_{2V}^\dagger) (\alpha a_{3H}^\dagger + \beta a_{3V}^\dagger),$$ where I'm labeling the rails from top to bottom, and I'm using $$H$$ and $$V$$ in lieu of $$0$$ and $$1$$ because it's slightly more standard terminology in this context. Evolution through the PBS then gives the state $$(a_{1H}^\dagger a_{3H}^\dagger + a_{1V}^\dagger a_{2V}^\dagger) (\alpha a_{2H}^\dagger + \beta a_{3V}^\dagger) = \alpha a_{1H}^\dagger a_{2H}^\dagger a_{3H}^\dagger + \beta a_{1V}^\dagger a_{2V}^\dagger a_{3V}^\dagger + R,$$ where $$R$$ contains all the other terms obtained expanding the state. You can notice that all these terms contain more than one photon in some spatial mode. It follows that, post-selecting on events where all three output detectors click, we get the state $$\alpha a_{1H}^\dagger a_{2H}^\dagger a_{3H}^\dagger + \beta a_{1V}^\dagger a_{2V}^\dagger a_{3V}^\dagger,$$ which is what you'd write as $$\alpha |HHH\rangle+\beta |VVV\rangle$$ in bra-ket notation.

The other three blocks are actually essentially identical to this one, so the same reasoning works there. The overall result is that post-selecting on events where all detectors from 1 to 9 click, you get the state you want.

• Thank you. Your answer actually rises many more questions. But first I need to know whether such photonic settings admits logical operators. Jun 19 at 13:49
• We are facing an encoding, so, may I assume to apply some logical unitary before the measurements? I am starting to think that that's not possible. Jun 19 at 15:11
• If you are asking whether local unitary operations can be applied in the circuit before measurements, most likely, yes. It should just amount to putting polarisation waveplates towards the end. Like what you can also see in fig b where they mention bit flip and and phase flip. I'd focus on trying to understand precisely how each of the three blocks in fig. b works. It's going to be hard to figure this out if you don't know how to describe the evolution of photons in a linear optical circuit
– glS
Jun 20 at 6:36
• Thanks! I'm starting to get something. So, since my final goal is defining, with the standard circuit model, something which somehow is more syntactically equivalent to the photonic settings. So first of all, I don't see the post-selection as a real issue in my case. Or is it? Jun 20 at 10:03
• I edited the question. Point number 3. now propose a circuit which I wonder if is equivalent, but also deterministic. Jun 20 at 10:07

(Since you answered your self-question number 1 that the encoding is in the polarization of the photon) Regarding question number 2-

Notice that in the "Experimental Setup" chapter, the 10th qubit (also marked as $$o_2$$) is a qubit that is just used as a trigger. You should be aware of post-selection - not all outcomes are successful, the computer is choosing only those who succeeded, this is because CNOT is not determisticly possible in linear optics. Therefore qubit 10 helps the computer to know if the answer is correct. Anyway, here is the only explanation about this qubit in the article:

It is not a part of the 9 qubits code, and it is measured by a polarized encoded qubit - using 2 detectors - one for $$H$$ and one for $$V$$: