Linear optics describe the evolution of photons passing through a linear interferometer. Given a circuit with
to represent a state with
Equivalently, a Fock state can be written as the result of creation operators
such that
When the photons pass through a linear interferometer, the evolution is modeled as applying unitary linear transformations to the creation operators. In other words, there exists a unitary operator U that applies the transformations
and the output state is given by
Developing the product gives a linear superposition of Fock states:
For more details about the formalism see [1].
Perceval information
Given
- the Naive backend which gives you one specific coefficient for a chosen
$\ket{t}$ , - the SLOS backend which gives you all coefficients.
The unitary operator applied can be itself described as a linear optical circuit made of constant beam splitters and parameterized phase shifters arranged in a fixed architecture also called a chip. A beam splitter (BS) applies the 2-mode unitary transformation
and a phase shifter (PS) parameterized by an angle
An example of circuit is given in Fig.1 with the corresponding unitary applied.
Similarly to quantum circuits, the sequential composition is equivalent to matrix/matrix products. Where it differs is in the spatial composition where the direct sum is used. Theoretical results guarantee that some chips are universal in the sense there always exists a set of angles of the beam splitters and phase shifters to implement any desired operator U [2,3].
Perceval information
Perceval can generate such universal chips for you and choose the angles to implement the unitary of your choice. You can also easily iterate through the angles of the circuits to choose yourself the unitary to apply. Then you can call Perceval's backends to perform some simulations .
For near-term applications, photonic hardware essentially relies on using a chip with an encoding to mimic the quantum circuit approach. For instance, in the dual rail encoding, one qubit is encoded as a photon that can be in two different spatial modes (thus encoding the
If one-qubit gates can be easily implemented by doing some local 2-mode operations (see Fig.2), unfortunately it is known that entangling 2-qubit gates cannot be implemented with the use of linear optics only. We need auxiliary modes and photons and some postselection schemes on the auxiliary modes to implement entangling gates [4]. Roughly, with auxiliary photons and modes, the output state is now a sum of a desired state (on which the correct 2-qubit gate has been applied) and a garbage state
and we need to measure the register
For instance, in the dual rail encoding, one can check that implementing a CZ gate between two qubits is equivalent to implementing a CZ gate between two modes, the modes encoding the state
with Fock state notations. The constraints
So far, the best known scheme to do a CZ gate is Knill's version given in Fig.3 that has a probability of success of 2/27 [5]. It requires two extra photons, two extra modes and the gate is implemented if one photon is detected in each auxiliary mode.
The matrix of the circuit is
One can check that for any input
and postselecting on the two auxiliary modes ensures we get the correct result.
The goal of this challenge is to better understand the link between the linear optical circuit as a unitary on the modes and the resulting unitary operator on the Fock space and how we can design the search of more complex linear optical gates. To assess the quality of your work, we propose a
and one can check that with a dual rail encoding this is equivalent, at the mode level, to the gate
where the modes
Using standard circuit decomposition, the CCZ gate can be implemented as in Fig.4 with 6 CNOT gates but it is costly in terms of extra resources and success probability. You can still use it to check your code.
In [6], they investigate the numerical search of a Toffoli gate, with promising results. However they do not provide a linear optical to check their result. You can start by trying to reproduce their results before improving on their work.
Insights
Both analytical and numerical work are promising leads. Feel free to choose the ones you prefer/feel is the more promising! Keep in mind that analytical work, if they do not end up with a practical result, will be harder to judge than numerical results.
Suggested guideline
- Start by reproducing the results from [5]. Do not necessary follow the exact same method. The goal is to have a code that can recover a CZ gate with success probability 2/27.
- Then reproduce the results from [6], either by applying your method from Question 1 or by designing a new method.
- More exploratory work is to find better implementations for both the Toffoli and the CCZ gate in hybrid encoding.
- Any theoretical result is welcomed! Proofs that the current implementations are optimal with respect to any metrics (success probability, number of photons, etc.) are of particular interest.
Your mentors for this challenge will be Pierre-Emmanuel Emeriau and Samuel Horsch (on site) and Alexia Salavrakos and Timothé Goubalt (on Slack).
Perceval is Quandela's quantum simulation framework which must be used to solve any of these challenges
Perceval provides tools for composing circuits from linear optical components, defining single-photon sources, manipulating Fock states, running simulations, reproducing published experimental papers and experimenting with a new generation of quantum algorithms.
You can find documentation regarding Perceval here: https://perceval.quandela.net/docs/
And the source code repository is here: https://github.com/Quandela/Perceval
You have all the installation explanation on the github repository, we advise you to work on the version 0.10.3.
A lot of notebooks are available our github (in docs/source/notebooks) or in our documentation to inspire you.
If you have any issue, please contact either Marion Fabre (on site) or Eric Bertasi or Melvin Mathe (on Slack).
Create a GitHub repository, either add us (our usernames are in your github challenge repo) or send us the link (if it's public), and commit your code in this repository so we can keep track of your contribution. Only the code in the main branch will be reviewed and will be part of your evaluation.
The result of your work has to be a locally simulated Processor. The Processor class is a composition of a Perceval circuit with input states, ports and heralding function.
We strongly advise that you checkout the Perceval code and go read how we design our own gates in Perceval in perceval/components/core_catalog (or at least visit this github online directory )
As your work will be autograded, the main branch of your git repository is required to follow this file architecture:
.
├── main.py
├── requirements.txt
├── README.md
- main.py should contain a method called "get_CCZ" with no argument that return a perceval Processor
- requirements.txt should contain all your scripts' python module dependencies, and follow the requirements format
- README.md explains how to use your script and how you came up with this result(s)
Other files can be included in you git repository (like other python files, jupyter notebook, ...) but they will not be use by our autograder, nevertheless those files could be use to give you bonus point if you are selected as finalist.
Our autograder will rate 4 parameters, from the most to the less important:
- Fidelity
- Performance
- Number of Photon (ancillaries included)
- Number of Modes (heralds and ancillaries included)
The file auto_grader.py can show you the exact cost function that will be used to grade your processor. You can see at the bottom of this file how the criteria are defined. You can actually execute auto_grader.py to see our postprocessed ccz grade. This can be useful to define your loss function.
Our Fidelity is the distance between your gate and the theoretical perfect one. It's calculating with the distance between probabilities.
This is a ratio of how many measurement we keep and how many measurement we throw away.
For instance, for Knill's CZ gate, the performance as stated above is 2/27.
To get Fidelity and Performance, you can use the Analyzer.
This object has been presented in the remote Perceval workshop with the notebook "Getting started with Perceval".
Since the Analyzer can only inspect logical space, you can change your CZ or CCZ gate to CNOT or CCNOT (Toffoli) by adding Hadamard gates around the data qubit:
import perceval as pcvl
processor = pcvl.Processor("SLOS", 4)
processor.add(2, pcvl.BS.H())
processor.add(0, pcvl.catalog["heralded cz"].build_processor())
processor.add(2, pcvl.BS.H())
states = {
pcvl.BasicState([1, 0, 1, 0]): "00",
pcvl.BasicState([1, 0, 0, 1]): "01",
pcvl.BasicState([0, 1, 1, 0]): "10",
pcvl.BasicState([0, 1, 0, 1]): "11"
}
ca = pcvl.algorithm.Analyzer(processor, states)
truth_table = {"00": "00", "01": "01", "10": "11", "11": "10"}
ca.compute(expected=truth_table)
pcvl.pdisplay(ca)
print(
f"performance = {ca.performance}, fidelity = {ca.fidelity.real}")
Output:
00 01 10 11
00 1 0 0 0
01 0 1 0 0
10 0 0 0 1
11 0 0 1 0
performance = 0.074066, fidelity = 0.9999999915267557
If you think you have successfully answered the challenge above but that sleeping is cheating, we have an extra challenging question for you. It's a bit more tricky than the first one so you shouldn't address this if you have not completed the first challenge.
This challenge is about a special CZ gate in an hybrid qubit encoding. We slightly deviate from the dual rail encoding. Two qubits are encoded in one photon and 4 modes and a third qubit is encoded as one photon with 2 modes. We want to apply a CZ gate between one of the first two qubits and the third qubit. Without loss of generality, let's assume we want to do CNOT(2,3). At the Fock state level, given the modes that encode the states
This operation can be rewritten as
which is equivalent to applying two CZ gates. Can we do better with a direct implementation?
Fig.5 and Fig.6 gives a recap of the two gates we are looking for in a Fock state formalism.
Note that the behavior of the gates is not defined for larger number of photons. We do not care as these cases will never happen if we stay in the chosen encoding.
Good luck!
[1] Aaronson, S., & Arkhipov, A. (2011, June). The computational complexity of linear optics. In Proceedings of the forty-third annual ACM symposium on Theory of computing (pp. 333-342).
[2] Reck, M., Zeilinger, A., Bernstein, H. J., & Bertani, P. (1994). Experimental realization of any discrete unitary operator. Physical review letters, 73(1), 58.
[3] Clements, W. R., Humphreys, P. C., Metcalf, B. J., Kolthammer, W. S., & Walmsley, I. A. (2016). Optimal design for universal multiport interferometers. Optica, 3(12), 1460-1465.
[4] Knill, E., Laflamme, R., & Milburn, G. J. (2001). A scheme for efficient quantum computation with linear optics. nature, 409(6816), 46-52.
[5] Knill, E. (2002). Quantum gates using linear optics and postselection. Physical Review A, 66(5), 052306.
[6] Uskov, D. B., Kaplan, L., Smith, A. M., Huver, S. D., & Dowling, J. P. (2009). Maximal success probabilities of linear-optical quantum gates. Physical Review A, 79(4), 042326.